glib-web 3.28.0 → 4.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (105) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/concerns/glib/json/new_dynamic_text.rb +0 -0
  3. data/app/helpers/glib/app_feature_support_helper.rb +0 -0
  4. data/app/helpers/glib/dynamic_texts_helper.rb +0 -0
  5. data/app/helpers/glib/json_ui/abstract_builder.rb +0 -8
  6. data/app/helpers/glib/json_ui/action_builder/components.rb +0 -5
  7. data/app/helpers/glib/json_ui/action_builder/dialogs.rb +0 -23
  8. data/app/helpers/glib/json_ui/action_builder/logics.rb +11 -0
  9. data/app/helpers/glib/json_ui/action_builder/popovers.rb +0 -9
  10. data/app/helpers/glib/json_ui/action_builder/sheets.rb +0 -0
  11. data/app/helpers/glib/json_ui/action_builder/windows.rb +1 -5
  12. data/app/helpers/glib/json_ui/action_builder.rb +0 -24
  13. data/app/helpers/glib/json_ui/analytics_helper.rb +0 -0
  14. data/app/helpers/glib/json_ui/builder/mouse_events.rb +0 -7
  15. data/app/helpers/glib/json_ui/default.rb +4 -4
  16. data/app/helpers/glib/json_ui/generic_builders.rb +0 -0
  17. data/app/helpers/glib/json_ui/list_builders.rb +0 -3
  18. data/app/helpers/glib/json_ui/page_helper.rb +7 -1
  19. data/app/helpers/glib/json_ui/view_builder/fields.rb +7 -38
  20. data/app/helpers/glib/json_ui/view_builder/panels.rb +1 -0
  21. data/app/helpers/glib/json_ui/view_builder.rb +3 -14
  22. data/app/models/glib/active_storage/attachment.rb +0 -0
  23. data/app/models/glib/active_storage/blob.rb +0 -0
  24. data/app/models/glib/dynamic_text_record.rb +0 -0
  25. data/app/models/glib/text.rb +0 -0
  26. data/app/policies/glib/application_policy.rb +0 -6
  27. data/app/validators/email_typo_validator.rb +0 -0
  28. data/app/validators/email_validator.rb +0 -0
  29. data/app/validators/url_validator.rb +0 -0
  30. data/app/views/json_ui/garage/actions/_components.json.jbuilder +2 -6
  31. data/app/views/json_ui/garage/actions/_dialogs.json.jbuilder +0 -14
  32. data/app/views/json_ui/garage/actions/_reload.json.jbuilder +1 -1
  33. data/app/views/json_ui/garage/actions/dialogs_oauth_post.json.jbuilder +0 -0
  34. data/app/views/json_ui/garage/actions/partial_update.json.jbuilder +1 -1
  35. data/app/views/json_ui/garage/forms/_alert_post_data.json.jbuilder +1 -3
  36. data/app/views/json_ui/garage/forms/_partial_update_execute.json.jbuilder +1 -1
  37. data/app/views/json_ui/garage/forms/_read_more_text.json.jbuilder +27 -20
  38. data/app/views/json_ui/garage/forms/conditional_value.json.jbuilder +49 -68
  39. data/app/views/json_ui/garage/forms/dirty_prompt.json.jbuilder +0 -28
  40. data/app/views/json_ui/garage/forms/dynamic_select_data.json.jbuilder +0 -0
  41. data/app/views/json_ui/garage/forms/file_upload.json.jbuilder +1 -3
  42. data/app/views/json_ui/garage/forms/generic_post.json.jbuilder +0 -0
  43. data/app/views/json_ui/garage/forms/otp_field.json.jbuilder +11 -9
  44. data/app/views/json_ui/garage/forms/rich_text_preview.json.jbuilder +0 -1
  45. data/app/views/json_ui/garage/forms/selects.json.jbuilder +17 -24
  46. data/app/views/json_ui/garage/forms/show_hide.json.jbuilder +317 -271
  47. data/app/views/json_ui/garage/forms/submission_flow.json.jbuilder +0 -0
  48. data/app/views/json_ui/garage/forms/submission_flow_post.json.jbuilder +0 -0
  49. data/app/views/json_ui/garage/forms/submission_indicator.json.jbuilder +0 -0
  50. data/app/views/json_ui/garage/forms/submission_indicator_post.json.jbuilder +0 -0
  51. data/app/views/json_ui/garage/forms/timers.json.jbuilder +0 -90
  52. data/app/views/json_ui/garage/home/blank.json.jbuilder +0 -0
  53. data/app/views/json_ui/garage/home/slow.json.jbuilder +0 -0
  54. data/app/views/json_ui/garage/lists/autoload_all.json.jbuilder +0 -0
  55. data/app/views/json_ui/garage/lists/autoload_as_needed.json.jbuilder +0 -0
  56. data/app/views/json_ui/garage/lists/chat_ui.json.jbuilder +0 -0
  57. data/app/views/json_ui/garage/lists/fab.json.jbuilder +0 -0
  58. data/app/views/json_ui/garage/notifications/action_cable.json.jbuilder +3 -3
  59. data/app/views/json_ui/garage/notifications/web_socket.json.jbuilder +0 -0
  60. data/app/views/json_ui/garage/pages/custom_style_class.json.jbuilder +0 -0
  61. data/app/views/json_ui/garage/pages/full_width.json.jbuilder +0 -0
  62. data/app/views/json_ui/garage/pages/full_width_height.json.jbuilder +0 -0
  63. data/app/views/json_ui/garage/pages/layout.json.jbuilder +0 -0
  64. data/app/views/json_ui/garage/pages/lifecycle_hooks.json.jbuilder +4 -0
  65. data/app/views/json_ui/garage/pages/loading_indicator.json.jbuilder +0 -0
  66. data/app/views/json_ui/garage/pages/nested_scroll.json.jbuilder +0 -0
  67. data/app/views/json_ui/garage/pages/redirect_onload.json.jbuilder +0 -0
  68. data/app/views/json_ui/garage/panels/_styled.json.jbuilder +0 -0
  69. data/app/views/json_ui/garage/panels/card.json.jbuilder +0 -0
  70. data/app/views/json_ui/garage/panels/custom.json.jbuilder +0 -0
  71. data/app/views/json_ui/garage/panels/outlined.json.jbuilder +0 -0
  72. data/app/views/json_ui/garage/services/dynamic_text.json.jbuilder +0 -0
  73. data/app/views/json_ui/garage/services/image.json.jbuilder +0 -0
  74. data/app/views/json_ui/garage/services/index.json.jbuilder +0 -0
  75. data/app/views/json_ui/garage/tables/_autoload_section.json.jbuilder +0 -0
  76. data/app/views/json_ui/garage/tables/autoload_all.json.jbuilder +0 -0
  77. data/app/views/json_ui/garage/tables/autoload_as_needed.json.jbuilder +0 -0
  78. data/app/views/json_ui/garage/tables/export_import.json.jbuilder +0 -0
  79. data/app/views/json_ui/garage/tables/index.json.jbuilder +0 -0
  80. data/app/views/json_ui/garage/views/calendar_data.json.jbuilder +0 -0
  81. data/app/views/json_ui/garage/views/{components_update.json.jbuilder → components_replace.json.jbuilder} +6 -6
  82. data/app/views/json_ui/garage/views/controls.json.jbuilder +0 -32
  83. data/app/views/json_ui/garage/views/links.json.jbuilder +0 -0
  84. data/app/views/json_ui/garage/views/map_data.json.jbuilder +0 -0
  85. data/app/views/json_ui/garage/views/multimedia.json.jbuilder +0 -0
  86. data/app/views/layouts/json_ui/no_custom.html.erb +0 -0
  87. data/lib/generators/glib/install_generator.rb +0 -0
  88. data/lib/generators/templates/20191017062519_create_texts.rb +0 -0
  89. data/lib/generators/templates/20191024063257_add_scope_to_texts.rb +0 -0
  90. data/lib/generators/templates/20191112095018_add_lang_to_texts.rb +0 -0
  91. data/lib/generators/templates/20191126071051_create_active_storage_tables.active_storage.rb +0 -0
  92. data/lib/generators/templates/database.yml +0 -0
  93. data/lib/generators/templates/dynamic_text.rb +0 -0
  94. data/lib/glib/dynamic_text/config.rb +0 -0
  95. data/lib/glib/dynamic_text.rb +0 -0
  96. data/lib/glib/json_crawler/action_crawler.rb +0 -0
  97. data/lib/glib/json_crawler/action_crawlers/action_http.rb +0 -0
  98. data/lib/glib/json_crawler/action_crawlers/dialogs_alert.rb +0 -0
  99. data/lib/glib/json_crawler/action_crawlers/menu.rb +0 -0
  100. data/lib/glib/json_crawler/action_crawlers/run_multiple.rb +0 -0
  101. data/lib/glib/json_crawler/action_crawlers/windows_open.rb +0 -0
  102. data/lib/glib/json_crawler/coverage.rb +0 -0
  103. data/lib/glib/value.rb +0 -0
  104. data/lib/glib/version.rb +0 -0
  105. metadata +4 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 575e99be2d5c58f1f7c9422f254b6a4b5b24180c82b38496e84c8dec22c41bcc
4
- data.tar.gz: 76e6c254672deb1e9cd34a9452978ef4c9c32fc276fb8ac3e1e6eec1cbe8df85
3
+ metadata.gz: 559c94d3c5c18214daed6e708f570879f069e39aabba1f08d248f2d0e2d62bf2
4
+ data.tar.gz: 6d3cc151c5226a7741a5508d27a77463ea64e09e5db08601ff3927d8a5c9191c
5
5
  SHA512:
6
- metadata.gz: a32237713616d6611d7cc6e57f57d81e7ff02823a68ed1d633e5de7276d4894ce67f30ff1766bda40df3bde0d53a9d69db2c677b740b266ae040e98f91c72a0b
7
- data.tar.gz: 5fb068a0f809fc0ab4245fcbf1116758c253b04629a378fe8bd262486dc18d55490ac1cd854e0b4c1494a98cc4414abb108eb7f60baf1a84752565f66b7049ff
6
+ metadata.gz: bacdb36e88f43a3ce8ce1ff7be69b14414024dfa34ac41c51d8dacc72f23122f09dcfe4400c138134245b4fa785d6e5075c3f6573bc6d3d46820b4fc80ab2ec5
7
+ data.tar.gz: 255300aeb08012f9fdb26eda37c8f288728cbfa8cca9ca0400287d8ad1bc3fff416946c3044716d486fb0194d68993127aebe59ddd69809658b8087bb68f42a2
File without changes
File without changes
@@ -202,14 +202,6 @@ module Glib
202
202
  else
203
203
  data = {}
204
204
  name = value
205
- # data = { material: { name: value } }
206
-
207
- # name = value
208
-
209
- # TODO: deprecated
210
- # json.set!(propName) do
211
- # json.name name
212
- # end
213
205
  end
214
206
 
215
207
  json.set!(propName) do
@@ -10,11 +10,6 @@ class Glib::JsonUi::ActionBuilder
10
10
  action :onFind
11
11
  end
12
12
 
13
- class Update < Action
14
- string :targetId
15
- views :views
16
- end
17
-
18
13
  # Experimental
19
14
  class ReplaceChildren < Action
20
15
  string :targetId
@@ -7,26 +7,9 @@ class Glib::JsonUi::ActionBuilder
7
7
  action :onClose
8
8
  end
9
9
 
10
- # class Show < Action
11
- # string :body
12
- # action :onLoad
13
- # action :onClose
14
- # end
15
-
16
- # Deprecated in favour of `sheets/select`
17
- class Options < Action
18
- string :message
19
-
20
- def buttons(block)
21
- json.buttons do
22
- block.call page.menu_builder
23
- end
24
- end
25
- end
26
10
 
27
11
  class Show < Action
28
12
  panels_builder :content, :body
29
- bool :showClose # deprecated
30
13
  bool :disableCloseButton
31
14
  string :fullscreen # mobile, always
32
15
  length :width
@@ -45,7 +28,6 @@ class Glib::JsonUi::ActionBuilder
45
28
 
46
29
  class Open < Action
47
30
  string :url, cache: true
48
- bool :showClose # deprecated
49
31
  bool :disableCloseButton
50
32
  string :fullscreen
51
33
  length :width
@@ -54,13 +36,8 @@ class Glib::JsonUi::ActionBuilder
54
36
  bool :updateExisting
55
37
  end
56
38
 
57
- # Deprecation canceled. This is still useful for a scenario where the previous dialog
58
- # was unknown, so we simply want to reload its content.
59
39
  class Reload < Action
60
- # Deprecated. Should just use dialogs_show or dialogs_open if
61
- # these attributes are needed.
62
40
  string :url, cache: true
63
- bool :showClose # deprecated
64
41
  bool :disableCloseButton
65
42
  string :fullscreen # mobile, always
66
43
  length :width
@@ -0,0 +1,11 @@
1
+ class Glib::JsonUi::ActionBuilder
2
+ module Logics
3
+ class Set < Action
4
+ string :targetId
5
+ hash :conditionalData
6
+ hash :data
7
+ hash :variables
8
+ action :onSet
9
+ end
10
+ end
11
+ end
@@ -1,14 +1,5 @@
1
1
  class Glib::JsonUi::ActionBuilder
2
2
  module Popovers
3
- # Deprecated. Use popovers_show instead.
4
- class Open < Action
5
- string :key
6
- views :childViews
7
- string :placement
8
- int :offset
9
- int :width
10
- singleton_array :styleClass, :styleClasses
11
- end
12
3
 
13
4
  class Show < Action
14
5
  panels_builder :content, :body
File without changes
@@ -20,6 +20,7 @@ class Glib::JsonUi::ActionBuilder
20
20
 
21
21
  class Reload < Action
22
22
  string :url, cache: true
23
+ bool :disableDirtyCheck
23
24
  action :onReload
24
25
  end
25
26
 
@@ -42,11 +43,6 @@ class Glib::JsonUi::ActionBuilder
42
43
  action :onOpen
43
44
  end
44
45
 
45
- # Any component can listen to the refresh_state event and react appropriately.
46
- # E.g. Stripe credit card component can refresh its token to make sure it is not stale.
47
- class RefreshState < Action
48
- end
49
-
50
46
  class Print < Action
51
47
  end
52
48
  end
@@ -110,30 +110,6 @@ module Glib
110
110
  end
111
111
  end
112
112
 
113
- module Logics
114
- # Future: Replace showIf and loadIf
115
- # Example:
116
- # `submitWhenNotDisplayed` is false by default
117
- # fields_text id: 'my_text', displayed: false, submitWhenNotDisplayed: true
118
- #
119
- # logics_if condition: { '==', BLAH1, BLAH2 }, true: ->(action) do
120
- # action.components_set targetId: 'my_text', displayed: true
121
- # end
122
- #
123
- # class If < Action
124
- # hash :condition
125
- # action :true
126
- # action :false
127
- # end
128
-
129
- class Set < Action
130
- string :targetId
131
- hash :conditionalData
132
- hash :variables
133
- action :onSet
134
- end
135
- end
136
-
137
113
  module Timeouts
138
114
  class Set < Action
139
115
  string :timerId
File without changes
@@ -17,13 +17,6 @@ module Glib
17
17
  key = 'tooltip_test'
18
18
  end
19
19
  onMouseEnter ->(action) do
20
- # action.popovers_open(
21
- # key: key,
22
- # placement: options[:placement] || 'top',
23
- # childViews: ->(view) {
24
- # view.p styleClass: 'tooltip', text: options[:text]
25
- # }
26
- # )
27
20
 
28
21
  action.popovers_show(
29
22
  key: key,
@@ -3,12 +3,12 @@ module Glib
3
3
  module Default
4
4
  def default_accepts(value)
5
5
  default_max_size_error = {
6
- body: I18n.t('common.accepts.max_file_size_error.body', default: '') || 'Files exceed the maximum size',
7
- button: I18n.t('common.accepts.max_file_size_error.button', default: '') || 'Dismiss'
6
+ body: I18n.t('glib.accepts.max_file_size_error.body', default: nil) || 'Files exceed the maximum size',
7
+ button: I18n.t('glib.accepts.max_file_size_error.button', default: nil) || 'Dismiss'
8
8
  }
9
9
  default_max_length_error = {
10
- body: I18n.t('common.accepts.max_file_length_error.body', default: '') || 'Files exceed the maximum limit per upload',
11
- button: I18n.t('common.accepts.max_file_length_error.button', default: '') || 'Dismiss'
10
+ body: I18n.t('glib.accepts.max_file_length_error.body', default: nil) || 'Files exceed the maximum limit per upload',
11
+ button: I18n.t('glib.accepts.max_file_length_error.button', default: nil) || 'Dismiss'
12
12
  }
13
13
 
14
14
  {
File without changes
@@ -43,9 +43,6 @@ module Glib
43
43
  string :paramNameForNewSectionIndex
44
44
  string :paramNameForNewSectionedRowIndex
45
45
 
46
- string :id # Deprecated
47
- string :paramNameForNewIndex # Deprecated
48
-
49
46
  panels_builder :accessory, :header, :body, :footer
50
47
  end
51
48
 
@@ -237,7 +237,7 @@ module Glib
237
237
  def form(options = {})
238
238
  form = Glib::JsonUi::ViewBuilder::Panels::Form.new(json, self)
239
239
  form.childViews(->(view_builder) { })
240
- panel_options = options.slice!(:url, :method, :local, :onSubmit, :paramNameForFormData, :model, :onChange)
240
+ panel_options = options.slice!(:url, :method, :local, :onSubmit, :paramNameForFormData, :model, :onChange, :onChangeAndLoad)
241
241
 
242
242
  json.fullPageForm do
243
243
  json.view 'panels/fullPageForm'
@@ -283,6 +283,12 @@ module Glib
283
283
  end
284
284
  end
285
285
 
286
+ if (on_unload = options[:unload])
287
+ json.onUnload do
288
+ on_unload.call @action_builder
289
+ end
290
+ end
291
+
286
292
  if (on_refocus = options[:refocus])
287
293
  json.onRefocus do
288
294
  on_refocus.call @action_builder
@@ -9,6 +9,7 @@ class Glib::JsonUi::ViewBuilder
9
9
  hash :validation
10
10
  bool :disableDirtyCheck
11
11
  action :onChange
12
+ action :onChangeAndLoad
12
13
  string :paramNameForFormData
13
14
  string :paramNameForFieldName
14
15
 
@@ -155,9 +156,6 @@ class Glib::JsonUi::ViewBuilder
155
156
  def value(value)
156
157
  @value = value if value != Glib::Value::DEFAULT
157
158
  end
158
-
159
- # TODO: Remove (deprecated). Where possible, use value instead of this
160
- bool :checked
161
159
  end
162
160
 
163
161
  # This doesn't use camel case because some terms have become single words (e.g. snackbar)
@@ -173,15 +171,6 @@ class Glib::JsonUi::ViewBuilder
173
171
  string :cacheKey
174
172
  end
175
173
 
176
- # Deprecated
177
- # Just use fields_select with options provided by the backend. This allows greater flexibility,
178
- # which is important because different systems might want to use different values for
179
- # countries as well as for regions, e.g. alpha2 vs alpha3
180
- # See app/views/json_ui/garage/forms/pickers.json.jbuilder for an example
181
- class Country < AbstractField
182
- hash :region
183
- end
184
-
185
174
  class Select < AbstractField
186
175
  array :options
187
176
  # bool :readOnly
@@ -209,14 +198,6 @@ class Glib::JsonUi::ViewBuilder
209
198
  end
210
199
  end
211
200
 
212
- # TODO: Remove (deprecated)
213
- class Autocomplete < AbstractField
214
- array :options
215
- # bool :readOnly
216
- bool :multiple, cache: true
217
- # bool :manualEntry
218
- hash :append
219
- end
220
201
 
221
202
  class DynamicSelect < AbstractField
222
203
  array :selectedOptions
@@ -286,7 +267,6 @@ class Glib::JsonUi::ViewBuilder
286
267
  string :fileUrl
287
268
  string :fileTitle
288
269
  string :uploadText
289
- string :uploadIcon # deprecated
290
270
  hash :placeholderView
291
271
  hash :infoSpec
292
272
  string :storagePrefix
@@ -298,9 +278,9 @@ class Glib::JsonUi::ViewBuilder
298
278
 
299
279
  def created
300
280
  @buttonLabels ||= ActiveSupport::HashWithIndifferentAccess.new
301
- @buttonLabels['change'] ||= I18n.t('common.change') if I18n.exists?('common.change')
302
- @buttonLabels['upload'] ||= I18n.t('common.upload') if I18n.exists?('common.upload')
303
- @buttonLabels['delete'] ||= I18n.t('common.delete') if I18n.exists?('common.delete')
281
+ @buttonLabels['change'] ||= I18n.t('glib.change') if I18n.exists?('glib.change')
282
+ @buttonLabels['upload'] ||= I18n.t('glib.upload') if I18n.exists?('glib.upload')
283
+ @buttonLabels['delete'] ||= I18n.t('glib.delete') if I18n.exists?('glib.delete')
304
284
 
305
285
  json.set! :buttonLabels, @buttonLabels
306
286
 
@@ -331,7 +311,6 @@ class Glib::JsonUi::ViewBuilder
331
311
  array :files
332
312
  string :directUploadUrl
333
313
  string :uploadTitle
334
- string :uploadFailedText # deprecated
335
314
  action :onFinishUpload
336
315
  string :strategy # can be "delegate" or "dropUpload"
337
316
  string :url # http post end point if you don't want to use onFinishUpload
@@ -341,15 +320,6 @@ class Glib::JsonUi::ViewBuilder
341
320
 
342
321
  required :accepts, :directUploadUrl
343
322
 
344
- # deprecated
345
- def title(value)
346
- @placeholder = value
347
- end
348
-
349
- # deprecated
350
- def subtitle(value)
351
- @hint = value
352
- end
353
323
 
354
324
  def accepts(value)
355
325
  @accepts = value
@@ -366,11 +336,11 @@ class Glib::JsonUi::ViewBuilder
366
336
  def created
367
337
  super
368
338
 
369
- @placeholder ||= I18n.t('common.multi_upload.placeholder', default: nil)
370
- @hint ||= I18n.t('common.multi_upload.hint', default: nil)
339
+ @placeholder ||= I18n.t('glib.multi_upload.placeholder', default: nil)
340
+ @hint ||= I18n.t('glib.multi_upload.hint', default: nil)
371
341
 
372
342
  ['200', '403', '401', 'else'].each do |status|
373
- key = "common.multi_upload.responseMessages.#{status}"
343
+ key = "glib.multi_upload.responseMessages.#{status}"
374
344
  @responseMessages[status] = I18n.t(key) if I18n.exists?(key)
375
345
  end
376
346
  json.responseMessages (@responseMessages || {}).reverse_merge({
@@ -469,7 +439,6 @@ class Glib::JsonUi::ViewBuilder
469
439
  class Otp < AbstractField
470
440
  int :length
471
441
  string :type
472
- string :align # deprecated
473
442
  end
474
443
 
475
444
  class Rating < AbstractField
@@ -6,6 +6,7 @@ class Glib::JsonUi::ViewBuilder
6
6
 
7
7
  action :onSubmit
8
8
  action :onChange
9
+ action :onChangeAndLoad
9
10
  string :paramNameForFormData
10
11
  bool :local
11
12
 
@@ -41,16 +41,15 @@ module Glib
41
41
  hash :padding
42
42
  singleton_array :styleClass, :styleClasses
43
43
 
44
- hash :valueIf
45
-
46
44
  hash :showIf
47
45
  hash :loadIf
48
46
  action :onIfTrue
49
47
  action :onIfFalse
50
48
 
49
+ bool :displayed
50
+ bool :submitWhenNotDisplayed
51
+
51
52
  hash :analytics
52
- # hash :tooltip
53
- array :extensions # deprecated
54
53
  hash :dragData
55
54
 
56
55
  def self.component_name
@@ -166,9 +165,6 @@ module Glib
166
165
  class Icon < View
167
166
  badgeable
168
167
 
169
- # TODO: Remove later. Deprecated.
170
- icon :spec
171
-
172
168
  action :onClick
173
169
  color :color
174
170
 
@@ -204,13 +200,6 @@ module Glib
204
200
  action :onClick
205
201
  color :color
206
202
  bool :disabled
207
-
208
- # TODO: This should be deprecated in favour of `popovers/open`
209
- def childButtons(block)
210
- json.childButtons do
211
- block.call page.menu_builder
212
- end
213
- end
214
203
  end
215
204
 
216
205
  class Fab < View
File without changes
File without changes
File without changes
File without changes
@@ -125,12 +125,6 @@ module Glib
125
125
  controller.helpers
126
126
  end
127
127
 
128
- # TODO: Remove. Deprecated
129
- # private # Used by child
130
- # def public?
131
- # true
132
- # end
133
-
134
128
  class Scope
135
129
  attr_reader :user, :scope
136
130
 
File without changes
File without changes
File without changes
@@ -4,14 +4,10 @@ section.header padding: glib_json_padding_list, childViews: ->(header) do
4
4
  end
5
5
 
6
6
  section.rows builder: ->(template) do
7
- template.thumbnail title: 'components/update (Deprecated)', onClick: ->(action) do
8
- action.windows_open url: json_ui_garage_url(path: 'views/components_update')
7
+ template.thumbnail title: 'components/replace', onClick: ->(action) do
8
+ action.windows_open url: json_ui_garage_url(path: 'views/components_replace')
9
9
  end
10
10
 
11
- # template.thumbnail title: 'components/replace', onClick: ->(action) do
12
- # action.windows_open url: json_ui_garage_url(path: 'views/components')
13
- # end
14
-
15
11
  template.thumbnail title: 'components/set', onClick: ->(action) do
16
12
  action.windows_open url: json_ui_garage_url(path: 'views/components_set')
17
13
  end
@@ -40,20 +40,6 @@ section.rows builder: ->(template) do
40
40
  # end
41
41
  # end
42
42
 
43
- # TODO: Deprecate
44
- template.thumbnail title: 'dialogs/option (Deprecated)', onClick: ->(action) do
45
- # TODO: Rename to `dialogs/menu`
46
- action.dialogs_options message: 'Select one', buttons: ->(menu) do
47
- menu.button text: 'Option1', onClick: ->(action) do
48
- action.dialogs_alert message: 'Option 1'
49
- end
50
- menu.button text: 'Option2', onClick: ->(action) do
51
- action.dialogs_alert message: 'Option 2'
52
- end
53
- menu.button text: 'Cancel'
54
- end
55
- end
56
-
57
43
  template.thumbnail title: 'dialogs/show', onClick: ->(action) do
58
44
  render 'json_ui/garage/actions/dialogs_show', json: json, action: action, dialog_mode: :show
59
45
  end
@@ -16,7 +16,7 @@ section.rows builder: ->(template) do
16
16
  action.windows_reload url: json_ui_garage_url(path: 'actions/index', reload_counter: reload_counter + 1)
17
17
  end
18
18
 
19
- template.thumbnail title: "components/update (counter: #{reload_counter})", onClick: ->(action) do
19
+ template.thumbnail title: "components/replace (counter: #{reload_counter})", onClick: ->(action) do
20
20
  action.http_get url: json_ui_garage_url(path: 'actions/partial_update', reload_counter: reload_counter + 1)
21
21
  end
22
22
  end
@@ -1,5 +1,5 @@
1
1
  json_ui_response_with_view json do |action|
2
- action.components_update targetId: 'action_list', views: ->(update) do
2
+ action.components_replace targetId: 'action_list', views: ->(update) do
3
3
  render "#{@path_prefix}/actions/list", panel: update
4
4
  end
5
5
  end
@@ -7,6 +7,4 @@ info = "Method: #{request.method}\nForm Data:\n"
7
7
 
8
8
  info += JSON.pretty_generate(params.require(:user).to_unsafe_h)
9
9
 
10
- action.dialogs_alert message: info, onClose: ->(action) do
11
- action.windows_refreshState
12
- end
10
+ action.dialogs_alert message: info
@@ -1,5 +1,5 @@
1
1
  name = params[:name]
2
- action.components_update targetId: 'greeting', views: ->(update) do
2
+ action.components_replace targetId: 'greeting', views: ->(update) do
3
3
  update.panels_vertical childViews: ->(vertical) do
4
4
  name = params[:name]
5
5
  vertical.fields_hidden name: 'name', value: name
@@ -6,26 +6,9 @@ if text.length > min_chars
6
6
  form.markdown \
7
7
  text: text.truncate(min_chars),
8
8
  styleClasses: ['line-clamp', "line-clamp-#{max_lines}"],
9
- showIf: {
10
- "!=": [
11
- {
12
- "var": toggle_name
13
- },
14
- 'true'
15
- ]
16
- }
17
- form.markdown \
18
- text: text,
19
- showIf: {
20
- "==": [
21
- {
22
- "var": toggle_name
23
- },
24
- 'true'
25
- ]
26
- }
9
+ id: "#{id}-off"
10
+ form.markdown id: "#{id}-on", text: text
27
11
 
28
- # NOTE: Don't put a valueIf here in an attempt to implement accordions. It won't work due to circular updates, presumably between valueIf and the on/off icons and labels.
29
12
  form.fields_check \
30
13
  width: 'matchParent',
31
14
  offIcon: 'expand_more',
@@ -35,7 +18,31 @@ if text.length > min_chars
35
18
  checkValue: 'true',
36
19
  uncheckValue: nil,
37
20
  name: toggle_name,
38
- disableDirtyCheck: true
21
+ disableDirtyCheck: true,
22
+ onChangeAndLoad: ->(action) do
23
+ action.runMultiple childActions: ->(saction) do
24
+ saction.logics_set targetId: "#{id}-on", conditionalData: {
25
+ displayed: {
26
+ "==": [
27
+ {
28
+ "var": toggle_name
29
+ },
30
+ 'true'
31
+ ]
32
+ }
33
+ }
34
+ saction.logics_set targetId: "#{id}-off", conditionalData: {
35
+ displayed: {
36
+ "!=": [
37
+ {
38
+ "var": toggle_name
39
+ },
40
+ 'true'
41
+ ]
42
+ }
43
+ }
44
+ end
45
+ end
39
46
 
40
47
  @__read_more_index += 1
41
48
  end