glib-web 3.27.1 → 4.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (111) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/concerns/glib/auth/response.rb +0 -22
  3. data/app/controllers/concerns/glib/json/libs.rb +33 -10
  4. data/app/controllers/concerns/glib/json/new_dynamic_text.rb +0 -0
  5. data/app/helpers/glib/app_feature_support_helper.rb +0 -0
  6. data/app/helpers/glib/dynamic_texts_helper.rb +0 -0
  7. data/app/helpers/glib/json_ui/abstract_builder.rb +0 -8
  8. data/app/helpers/glib/json_ui/action_builder/components.rb +0 -5
  9. data/app/helpers/glib/json_ui/action_builder/dialogs.rb +4 -23
  10. data/app/helpers/glib/json_ui/action_builder/logics.rb +11 -0
  11. data/app/helpers/glib/json_ui/action_builder/popovers.rb +0 -9
  12. data/app/helpers/glib/json_ui/action_builder/sheets.rb +0 -0
  13. data/app/helpers/glib/json_ui/action_builder/windows.rb +4 -3
  14. data/app/helpers/glib/json_ui/action_builder.rb +0 -24
  15. data/app/helpers/glib/json_ui/analytics_helper.rb +0 -0
  16. data/app/helpers/glib/json_ui/builder/mouse_events.rb +0 -7
  17. data/app/helpers/glib/json_ui/default.rb +4 -4
  18. data/app/helpers/glib/json_ui/generic_builders.rb +0 -0
  19. data/app/helpers/glib/json_ui/list_builders.rb +0 -3
  20. data/app/helpers/glib/json_ui/page_helper.rb +9 -1
  21. data/app/helpers/glib/json_ui/view_builder/fields.rb +23 -38
  22. data/app/helpers/glib/json_ui/view_builder/panels.rb +1 -0
  23. data/app/helpers/glib/json_ui/view_builder.rb +5 -14
  24. data/app/models/glib/active_storage/attachment.rb +0 -0
  25. data/app/models/glib/active_storage/blob.rb +0 -0
  26. data/app/models/glib/dynamic_text_record.rb +0 -0
  27. data/app/models/glib/text.rb +0 -0
  28. data/app/policies/glib/application_policy.rb +0 -6
  29. data/app/validators/email_typo_validator.rb +0 -0
  30. data/app/validators/email_validator.rb +0 -0
  31. data/app/validators/url_validator.rb +0 -0
  32. data/app/views/json_ui/garage/actions/_components.json.jbuilder +2 -6
  33. data/app/views/json_ui/garage/actions/_dialogs.json.jbuilder +19 -14
  34. data/app/views/json_ui/garage/actions/_reload.json.jbuilder +1 -1
  35. data/app/views/json_ui/garage/actions/_windows.json.jbuilder +5 -0
  36. data/app/views/json_ui/garage/actions/dialogs_oauth_post.json.jbuilder +0 -0
  37. data/app/views/json_ui/garage/actions/partial_update.json.jbuilder +1 -1
  38. data/app/views/json_ui/garage/forms/_alert_post_data.json.jbuilder +1 -3
  39. data/app/views/json_ui/garage/forms/_partial_update_execute.json.jbuilder +1 -1
  40. data/app/views/json_ui/garage/forms/_read_more_text.json.jbuilder +27 -20
  41. data/app/views/json_ui/garage/forms/conditional_value.json.jbuilder +49 -68
  42. data/app/views/json_ui/garage/forms/dirty_prompt.json.jbuilder +0 -28
  43. data/app/views/json_ui/garage/forms/dynamic_select_data.json.jbuilder +0 -0
  44. data/app/views/json_ui/garage/forms/file_upload.json.jbuilder +14 -3
  45. data/app/views/json_ui/garage/forms/generic_post.json.jbuilder +0 -0
  46. data/app/views/json_ui/garage/forms/otp_field.json.jbuilder +11 -9
  47. data/app/views/json_ui/garage/forms/rich_text_preview.json.jbuilder +0 -1
  48. data/app/views/json_ui/garage/forms/selects.json.jbuilder +17 -24
  49. data/app/views/json_ui/garage/forms/show_hide.json.jbuilder +317 -271
  50. data/app/views/json_ui/garage/forms/submission_flow.json.jbuilder +0 -0
  51. data/app/views/json_ui/garage/forms/submission_flow_post.json.jbuilder +0 -0
  52. data/app/views/json_ui/garage/forms/submission_indicator.json.jbuilder +0 -0
  53. data/app/views/json_ui/garage/forms/submission_indicator_post.json.jbuilder +0 -0
  54. data/app/views/json_ui/garage/forms/timers.json.jbuilder +0 -90
  55. data/app/views/json_ui/garage/home/blank.json.jbuilder +0 -0
  56. data/app/views/json_ui/garage/home/slow.json.jbuilder +0 -0
  57. data/app/views/json_ui/garage/lists/autoload_all.json.jbuilder +0 -0
  58. data/app/views/json_ui/garage/lists/autoload_as_needed.json.jbuilder +0 -0
  59. data/app/views/json_ui/garage/lists/chat_ui.json.jbuilder +0 -0
  60. data/app/views/json_ui/garage/lists/fab.json.jbuilder +0 -0
  61. data/app/views/json_ui/garage/notifications/action_cable.json.jbuilder +3 -3
  62. data/app/views/json_ui/garage/notifications/web_socket.json.jbuilder +0 -0
  63. data/app/views/json_ui/garage/pages/custom_style_class.json.jbuilder +0 -0
  64. data/app/views/json_ui/garage/pages/full_width.json.jbuilder +0 -0
  65. data/app/views/json_ui/garage/pages/full_width_height.json.jbuilder +0 -0
  66. data/app/views/json_ui/garage/pages/layout.json.jbuilder +0 -0
  67. data/app/views/json_ui/garage/pages/lifecycle_hooks.json.jbuilder +4 -0
  68. data/app/views/json_ui/garage/pages/loading_indicator.json.jbuilder +0 -0
  69. data/app/views/json_ui/garage/pages/nested_scroll.json.jbuilder +0 -0
  70. data/app/views/json_ui/garage/pages/redirect_onload.json.jbuilder +0 -0
  71. data/app/views/json_ui/garage/panels/_styled.json.jbuilder +0 -0
  72. data/app/views/json_ui/garage/panels/card.json.jbuilder +0 -0
  73. data/app/views/json_ui/garage/panels/custom.json.jbuilder +0 -0
  74. data/app/views/json_ui/garage/panels/outlined.json.jbuilder +0 -0
  75. data/app/views/json_ui/garage/services/dynamic_text.json.jbuilder +0 -0
  76. data/app/views/json_ui/garage/services/image.json.jbuilder +0 -0
  77. data/app/views/json_ui/garage/services/index.json.jbuilder +0 -0
  78. data/app/views/json_ui/garage/tables/_autoload_section.json.jbuilder +0 -0
  79. data/app/views/json_ui/garage/tables/autoload_all.json.jbuilder +0 -0
  80. data/app/views/json_ui/garage/tables/autoload_as_needed.json.jbuilder +0 -0
  81. data/app/views/json_ui/garage/tables/export_import.json.jbuilder +0 -0
  82. data/app/views/json_ui/garage/tables/index.json.jbuilder +0 -0
  83. data/app/views/json_ui/garage/views/calendar_data.json.jbuilder +0 -0
  84. data/app/views/json_ui/garage/views/{components_update.json.jbuilder → components_replace.json.jbuilder} +6 -6
  85. data/app/views/json_ui/garage/views/controls.json.jbuilder +0 -32
  86. data/app/views/json_ui/garage/views/links.json.jbuilder +0 -0
  87. data/app/views/json_ui/garage/views/map_data.json.jbuilder +0 -0
  88. data/app/views/json_ui/garage/views/multimedia.json.jbuilder +0 -0
  89. data/app/views/layouts/json_ui/no_custom.html.erb +0 -0
  90. data/lib/generators/glib/install_generator.rb +0 -0
  91. data/lib/generators/templates/20191017062519_create_texts.rb +0 -0
  92. data/lib/generators/templates/20191024063257_add_scope_to_texts.rb +0 -0
  93. data/lib/generators/templates/20191112095018_add_lang_to_texts.rb +0 -0
  94. data/lib/generators/templates/20191126071051_create_active_storage_tables.active_storage.rb +0 -0
  95. data/lib/generators/templates/database.yml +0 -0
  96. data/lib/generators/templates/dynamic_text.rb +0 -0
  97. data/lib/glib/blob.rb +15 -0
  98. data/lib/glib/direct_uploads_controller.rb +15 -7
  99. data/lib/glib/dynamic_text/config.rb +0 -0
  100. data/lib/glib/dynamic_text.rb +0 -0
  101. data/lib/glib/engine.rb +1 -0
  102. data/lib/glib/json_crawler/action_crawler.rb +0 -0
  103. data/lib/glib/json_crawler/action_crawlers/action_http.rb +0 -0
  104. data/lib/glib/json_crawler/action_crawlers/dialogs_alert.rb +0 -0
  105. data/lib/glib/json_crawler/action_crawlers/menu.rb +0 -0
  106. data/lib/glib/json_crawler/action_crawlers/run_multiple.rb +0 -0
  107. data/lib/glib/json_crawler/action_crawlers/windows_open.rb +0 -0
  108. data/lib/glib/json_crawler/coverage.rb +0 -0
  109. data/lib/glib/value.rb +0 -0
  110. data/lib/glib/version.rb +0 -0
  111. metadata +5 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5d3975f40436740c9cebdcb654cd5292e9d3f772f442f3078b79bdb328657fe0
4
- data.tar.gz: f95e4819e89b6f1b04d17cd375c1b904137bb6c1df2f7f48cab7f549ff608e51
3
+ metadata.gz: 559c94d3c5c18214daed6e708f570879f069e39aabba1f08d248f2d0e2d62bf2
4
+ data.tar.gz: 6d3cc151c5226a7741a5508d27a77463ea64e09e5db08601ff3927d8a5c9191c
5
5
  SHA512:
6
- metadata.gz: 6bde54f472baee8e766265a748e09fb07afdaf86878e054f35ce49ead3fd75fd54491fc6d568fbccdde5b8fc750832bf21d376784c9a6750dff521121566d545
7
- data.tar.gz: 1aefdd5d62f0958ecf2df76e5737cab190dff943b7415116e3c1a088d6304346230373bdfcf0e66b396f60f9b2bf4ef778b406b24029810daec9b9acb8a55cdc
6
+ metadata.gz: bacdb36e88f43a3ce8ce1ff7be69b14414024dfa34ac41c51d8dacc72f23122f09dcfe4400c138134245b4fa785d6e5075c3f6573bc6d3d46820b4fc80ab2ec5
7
+ data.tar.gz: 255300aeb08012f9fdb26eda37c8f288728cbfa8cca9ca0400287d8ad1bc3fff416946c3044716d486fb0194d68993127aebe59ddd69809658b8087bb68f42a2
@@ -11,28 +11,6 @@ module Glib::Auth
11
11
  params[:_dialog].present? # E.g. _dialog=v1
12
12
  end
13
13
 
14
- def __glib_error_dialog(title, message, bottom_views = [])
15
- {
16
- action: 'dialogs/show',
17
- # Don't show another dialog, just use the current one since it's a new dialog anyway, which means
18
- # that it wouldn't contain existing user data.
19
- updateExisting: glib_json_dialog_mode?,
20
- title: title,
21
- body: {
22
- childViews: [
23
- {
24
- view: 'label',
25
- text: message
26
- },
27
- ].concat(bottom_views),
28
- padding: {
29
- x: 20,
30
- y: 22,
31
- },
32
- }
33
- }
34
- end
35
-
36
14
  def json_ui_401_response(sign_in_url)
37
15
  {
38
16
  # Handle dialogs_open and windows_open
@@ -178,7 +178,7 @@ module Glib::Json::Libs
178
178
  # end
179
179
  # end
180
180
 
181
- def __glib_error_dialog(title, message)
181
+ def __glib_error_dialog(title, message, bottom_views = [])
182
182
  {
183
183
  action: 'dialogs/show',
184
184
  # Don't show another dialog, just use the current one since it's a new dialog anyway, which means
@@ -188,14 +188,21 @@ module Glib::Json::Libs
188
188
  body: {
189
189
  childViews: [
190
190
  {
191
- "view": "label",
192
- "text": message
193
- },
194
- ],
195
- "padding": {
196
- "x": 20,
197
- "y": 22,
198
- },
191
+ view: 'panels/vertical',
192
+ styleClasses: ['glib-error-dialog'],
193
+ childViews: [
194
+ {
195
+ view: 'label',
196
+ text: message
197
+ },
198
+ ].concat(bottom_views),
199
+ }
200
+ ]
201
+ # Set this in the project's custom CSS.
202
+ # padding: {
203
+ # x: 20,
204
+ # y: 22,
205
+ # },
199
206
  }
200
207
  }
201
208
  end
@@ -310,7 +317,23 @@ module Glib::Json::Libs
310
317
  format.json do
311
318
  render json: {
312
319
  glib_json_dialog_mode? ? :onLoad : :onResponse => __glib_error_dialog(
313
- 'Your session has expired', 'Please refresh the page and retry.')
320
+ 'Your session has expired', 'Please refresh the page and retry.', [
321
+ {
322
+ view: 'button',
323
+ text: 'Refresh',
324
+ onClick: {
325
+ action: 'dialogs/close',
326
+ onClose: {
327
+ action: 'windows/reload',
328
+ onReload: {
329
+ action: 'snackbars/alert',
330
+ message: 'Refreshed. You can try again now.'
331
+ }
332
+ }
333
+ }
334
+ },
335
+ ]
336
+ )
314
337
  }
315
338
  end
316
339
  end
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
@@ -70,6 +47,10 @@ class Glib::JsonUi::ActionBuilder
70
47
  action :onClose
71
48
  end
72
49
 
50
+ class CloseAll < Action
51
+ action :onClose
52
+ end
53
+
73
54
  class Oauth < Action
74
55
  hash :provider
75
56
  action :onSuccess
@@ -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
 
@@ -37,9 +38,9 @@ class Glib::JsonUi::ActionBuilder
37
38
  required :url
38
39
  end
39
40
 
40
- # Any component can listen to the refresh_state event and react appropriately.
41
- # E.g. Stripe credit card component can refresh its token to make sure it is not stale.
42
- class RefreshState < Action
41
+ class CloseAllWithOpen < Action
42
+ string :url
43
+ action :onOpen
43
44
  end
44
45
 
45
46
  class Print < Action
@@ -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
 
@@ -107,6 +107,8 @@ module Glib
107
107
  json.url options[:url]
108
108
  json.inputName options[:inputName]
109
109
  json.strategy options[:strategy]
110
+ json.storagePrefix options[:storagePrefix]
111
+ json.metadata options[:metadata]
110
112
  end
111
113
  end
112
114
 
@@ -235,7 +237,7 @@ module Glib
235
237
  def form(options = {})
236
238
  form = Glib::JsonUi::ViewBuilder::Panels::Form.new(json, self)
237
239
  form.childViews(->(view_builder) { })
238
- panel_options = options.slice!(:url, :method, :local, :onSubmit, :paramNameForFormData, :model)
240
+ panel_options = options.slice!(:url, :method, :local, :onSubmit, :paramNameForFormData, :model, :onChange, :onChangeAndLoad)
239
241
 
240
242
  json.fullPageForm do
241
243
  json.view 'panels/fullPageForm'
@@ -281,6 +283,12 @@ module Glib
281
283
  end
282
284
  end
283
285
 
286
+ if (on_unload = options[:unload])
287
+ json.onUnload do
288
+ on_unload.call @action_builder
289
+ end
290
+ end
291
+
284
292
  if (on_refocus = options[:refocus])
285
293
  json.onRefocus do
286
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,9 +267,10 @@ 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
272
+ string :storagePrefix
273
+ hash :metadata
292
274
 
293
275
  def buttonLabels(obj)
294
276
  @buttonLabels = ActiveSupport::HashWithIndifferentAccess.new(obj)
@@ -296,9 +278,9 @@ class Glib::JsonUi::ViewBuilder
296
278
 
297
279
  def created
298
280
  @buttonLabels ||= ActiveSupport::HashWithIndifferentAccess.new
299
- @buttonLabels['change'] ||= I18n.t('common.change') if I18n.exists?('common.change')
300
- @buttonLabels['upload'] ||= I18n.t('common.upload') if I18n.exists?('common.upload')
301
- @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')
302
284
 
303
285
  json.set! :buttonLabels, @buttonLabels
304
286
 
@@ -329,22 +311,15 @@ class Glib::JsonUi::ViewBuilder
329
311
  array :files
330
312
  string :directUploadUrl
331
313
  string :uploadTitle
332
- string :uploadFailedText # deprecated
333
314
  action :onFinishUpload
334
315
  string :strategy # can be "delegate" or "dropUpload"
335
316
  string :url # http post end point if you don't want to use onFinishUpload
336
317
 
337
- required :accepts, :directUploadUrl
318
+ string :storagePrefix
319
+ hash :metadata
338
320
 
339
- # deprecated
340
- def title(value)
341
- @placeholder = value
342
- end
321
+ required :accepts, :directUploadUrl
343
322
 
344
- # deprecated
345
- def subtitle(value)
346
- @hint = value
347
- end
348
323
 
349
324
  def accepts(value)
350
325
  @accepts = value
@@ -361,11 +336,11 @@ class Glib::JsonUi::ViewBuilder
361
336
  def created
362
337
  super
363
338
 
364
- @placeholder ||= I18n.t('common.multi_upload.placeholder', default: nil)
365
- @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)
366
341
 
367
342
  ['200', '403', '401', 'else'].each do |status|
368
- key = "common.multi_upload.responseMessages.#{status}"
343
+ key = "glib.multi_upload.responseMessages.#{status}"
369
344
  @responseMessages[status] = I18n.t(key) if I18n.exists?(key)
370
345
  end
371
346
  json.responseMessages (@responseMessages || {}).reverse_merge({
@@ -391,6 +366,17 @@ class Glib::JsonUi::ViewBuilder
391
366
  end
392
367
  end
393
368
 
369
+ class Sign < AbstractField
370
+ string :directUploadUrl
371
+
372
+ required :directUploadUrl
373
+
374
+ # Override
375
+ # Signature field doesn't have default value
376
+ def value(value)
377
+ end
378
+ end
379
+
394
380
  # TODO
395
381
  # class MultiImage < Text
396
382
  # # file_rules = { fileType: 'image/*', maxFileSize: 5000 }
@@ -453,7 +439,6 @@ class Glib::JsonUi::ViewBuilder
453
439
  class Otp < AbstractField
454
440
  int :length
455
441
  string :type
456
- string :align # deprecated
457
442
  end
458
443
 
459
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
@@ -334,6 +323,8 @@ module Glib
334
323
  hash :items
335
324
  hash :dropData
336
325
  string :strategy
326
+ string :storagePrefix
327
+ hash :metadata
337
328
  end
338
329
  end
339
330
  end
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
@@ -66,6 +52,15 @@ section.rows builder: ->(template) do
66
52
  action.dialogs_open fullscreen: 'mobile', url: json_ui_garage_url(path: 'forms/basic', mode: 'dialog')
67
53
  end
68
54
 
55
+ template.thumbnail title: 'dialogs/reload (without url)', onClick: ->(action) do
56
+ action.runMultiple childActions: ->(saction) do
57
+ saction.dialogs_open url: json_ui_garage_url(path: 'forms/dialogs_form')
58
+ saction.timeouts_set interval: 1000, onTimeout: ->(ssaction) do
59
+ ssaction.dialogs_reload
60
+ end
61
+ end
62
+ end
63
+
69
64
  if !Rails.env.test? # Prevent test failure
70
65
  template.thumbnail title: 'dialogs/open (page with error)', onClick: ->(action) do
71
66
  action.dialogs_open url: json_ui_garage_url(path: 'forms/non_existent', mode: 'dialog')
@@ -96,6 +91,16 @@ section.rows builder: ->(template) do
96
91
  action.dialogs_open url: json_ui_garage_url(path: 'forms/dialogs_form')
97
92
  end
98
93
 
94
+ template.thumbnail title: 'dialogs/closeAll', onClick: ->(action) do
95
+ action.runMultiple childActions: ->(saction) do
96
+ saction.dialogs_open url: json_ui_garage_url(path: 'forms/dialogs_form')
97
+ saction.dialogs_open url: json_ui_garage_url(path: 'forms/dialogs_form')
98
+ saction.timeouts_set interval: 1000, onTimeout: ->(ssaction) do
99
+ ssaction.dialogs_closeAll
100
+ end
101
+ end
102
+ end
103
+
99
104
  template.thumbnail title: 'dialogs/oauth', onClick: ->(action) do
100
105
  if respond_to?(:user_facebook_omniauth_authorize_url)
101
106
  provider = {