glib-web 3.24.0 → 3.24.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (79) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/concerns/glib/json/libs.rb +20 -12
  3. data/app/controllers/concerns/glib/json/new_dynamic_text.rb +0 -0
  4. data/app/helpers/glib/app_feature_support_helper.rb +0 -0
  5. data/app/helpers/glib/dynamic_texts_helper.rb +0 -0
  6. data/app/helpers/glib/enum_helper.rb +7 -3
  7. data/app/helpers/glib/json_ui/action_builder/sheets.rb +0 -0
  8. data/app/helpers/glib/json_ui/analytics_helper.rb +0 -0
  9. data/app/helpers/glib/json_ui/generic_builders.rb +0 -0
  10. data/app/helpers/glib/urls_helper.rb +2 -2
  11. data/app/models/concerns/glib/enum_humanization.rb +15 -8
  12. data/app/models/glib/active_storage/attachment.rb +0 -0
  13. data/app/models/glib/active_storage/blob.rb +0 -0
  14. data/app/models/glib/dynamic_text_record.rb +0 -0
  15. data/app/models/glib/text.rb +0 -0
  16. data/app/validators/email_typo_validator.rb +0 -0
  17. data/app/validators/email_validator.rb +0 -0
  18. data/app/validators/url_validator.rb +0 -0
  19. data/app/views/json_ui/garage/actions/_sheets.json.jbuilder +0 -0
  20. data/app/views/json_ui/garage/actions/dialogs_oauth_post.json.jbuilder +0 -0
  21. data/app/views/json_ui/garage/forms/dynamic_select_data.json.jbuilder +0 -0
  22. data/app/views/json_ui/garage/forms/generic_post.json.jbuilder +0 -0
  23. data/app/views/json_ui/garage/forms/submission_flow.json.jbuilder +0 -0
  24. data/app/views/json_ui/garage/forms/submission_flow_post.json.jbuilder +0 -0
  25. data/app/views/json_ui/garage/forms/submission_indicator.json.jbuilder +0 -0
  26. data/app/views/json_ui/garage/forms/submission_indicator_post.json.jbuilder +0 -0
  27. data/app/views/json_ui/garage/home/blank.json.jbuilder +0 -0
  28. data/app/views/json_ui/garage/home/slow.json.jbuilder +0 -0
  29. data/app/views/json_ui/garage/lists/autoload_all.json.jbuilder +0 -0
  30. data/app/views/json_ui/garage/lists/autoload_as_needed.json.jbuilder +0 -0
  31. data/app/views/json_ui/garage/lists/chat_ui.json.jbuilder +0 -0
  32. data/app/views/json_ui/garage/lists/fab.json.jbuilder +0 -0
  33. data/app/views/json_ui/garage/notifications/web_socket.json.jbuilder +0 -0
  34. data/app/views/json_ui/garage/pages/custom_style_class.json.jbuilder +0 -0
  35. data/app/views/json_ui/garage/pages/full_width.json.jbuilder +0 -0
  36. data/app/views/json_ui/garage/pages/full_width_height.json.jbuilder +0 -0
  37. data/app/views/json_ui/garage/pages/layout.json.jbuilder +0 -0
  38. data/app/views/json_ui/garage/pages/lifecycle_hooks.json.jbuilder +0 -0
  39. data/app/views/json_ui/garage/pages/loading_indicator.json.jbuilder +0 -0
  40. data/app/views/json_ui/garage/pages/nested_scroll.json.jbuilder +0 -0
  41. data/app/views/json_ui/garage/pages/redirect_onload.json.jbuilder +0 -0
  42. data/app/views/json_ui/garage/panels/_styled.json.jbuilder +0 -0
  43. data/app/views/json_ui/garage/panels/card.json.jbuilder +0 -0
  44. data/app/views/json_ui/garage/panels/custom.json.jbuilder +0 -0
  45. data/app/views/json_ui/garage/panels/outlined.json.jbuilder +0 -0
  46. data/app/views/json_ui/garage/services/dynamic_text.json.jbuilder +0 -0
  47. data/app/views/json_ui/garage/services/image.json.jbuilder +0 -0
  48. data/app/views/json_ui/garage/services/index.json.jbuilder +0 -0
  49. data/app/views/json_ui/garage/tables/_autoload_section.json.jbuilder +0 -0
  50. data/app/views/json_ui/garage/tables/autoload_all.json.jbuilder +0 -0
  51. data/app/views/json_ui/garage/tables/autoload_as_needed.json.jbuilder +0 -0
  52. data/app/views/json_ui/garage/tables/export_import.json.jbuilder +0 -0
  53. data/app/views/json_ui/garage/tables/index.json.jbuilder +0 -0
  54. data/app/views/json_ui/garage/views/calendar_data.json.jbuilder +0 -0
  55. data/app/views/json_ui/garage/views/links.json.jbuilder +0 -0
  56. data/app/views/json_ui/garage/views/map_data.json.jbuilder +0 -0
  57. data/app/views/json_ui/garage/views/multimedia.json.jbuilder +0 -0
  58. data/app/views/layouts/json_ui/no_custom.html.erb +0 -0
  59. data/lib/generators/glib/install_generator.rb +0 -0
  60. data/lib/generators/templates/20191017062519_create_texts.rb +0 -0
  61. data/lib/generators/templates/20191024063257_add_scope_to_texts.rb +0 -0
  62. data/lib/generators/templates/20191112095018_add_lang_to_texts.rb +0 -0
  63. data/lib/generators/templates/20191126071051_create_active_storage_tables.active_storage.rb +0 -0
  64. data/lib/generators/templates/database.yml +0 -0
  65. data/lib/generators/templates/dynamic_text.rb +0 -0
  66. data/lib/glib/crypt/utils.rb +0 -0
  67. data/lib/glib/crypt.rb +0 -0
  68. data/lib/glib/dynamic_text/config.rb +0 -0
  69. data/lib/glib/dynamic_text.rb +0 -0
  70. data/lib/glib/json_crawler/action_crawler.rb +0 -0
  71. data/lib/glib/json_crawler/action_crawlers/action_http.rb +0 -0
  72. data/lib/glib/json_crawler/action_crawlers/dialogs_alert.rb +0 -0
  73. data/lib/glib/json_crawler/action_crawlers/menu.rb +0 -0
  74. data/lib/glib/json_crawler/action_crawlers/run_multiple.rb +0 -0
  75. data/lib/glib/json_crawler/action_crawlers/windows_open.rb +0 -0
  76. data/lib/glib/json_crawler/coverage.rb +0 -0
  77. data/lib/glib/value.rb +0 -0
  78. data/lib/glib/version.rb +0 -0
  79. metadata +3 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: acd39c10550b9bef746a929eef30b91bf4c71c38339d13c2afd874f3e5ac7858
4
- data.tar.gz: bf8b5698b2a60b122f8ced2c312c73782daacf1b1c465e9655c64b658dd4d907
3
+ metadata.gz: efea09ac466f54d5eb3b868b7ab7f1f042d8f7185969f9fb6f8201c23de313c1
4
+ data.tar.gz: c09fe47288f977d7e8d61835294f66d10be6c4a8974845ca054123f94c0e5ad2
5
5
  SHA512:
6
- metadata.gz: fdd1ac28d0d3615a38145752d95f7a1bef47261c849936f498abeefcc49787ca79d488077fed7ef524e2994ae98e1d9aa45780a9ac05265939d7b15dc6cf7b9c
7
- data.tar.gz: 88595a13ae7e0cd3fecc9b07f8087382980973cb98ea13ede1aa313c328f63473283a7861b8d16c7f73fa7330c372b20478e92aa8703696754f025046572e2ea
6
+ metadata.gz: 803e0cd9bb622b0810e622a996c2d3e9ed26903d773280eae32e3c78877b04e1bed20f261ebcadd1b5124e21a08fb4ac8598b51ef203aa8c052bd9eddf424337
7
+ data.tar.gz: 31c43c485528da181ac17a78301f919d1c743d358adf0a72ec96908680cf5325fa6621ac4239b052f313e0b76fb0dc0a7e007201c1acf32294fa250c75bdefce
@@ -6,7 +6,8 @@ module Glib::Json::Libs
6
6
 
7
7
  helper_method :json_ui_app_bundle_id, :json_ui_app_build_version, :json_ui_app_device_os
8
8
  helper_method :json_ui_app_is_android?, :json_ui_app_is_ios?, :json_ui_app_is_web?
9
- helper_method :json_ui_redirect_back_or_to
9
+ # helper_method :json_ui_redirect_back_or_to
10
+ helper_method :delete_redirect_back_url
10
11
 
11
12
  include Glib::Auth::Response
12
13
  helper_method :glib_json_dialog_mode?
@@ -115,7 +116,7 @@ module Glib::Json::Libs
115
116
 
116
117
  def glib_handle_401(sign_in_url)
117
118
  if !glib_json_dialog_mode? && request.get?
118
- session[REDIRECT_BACK_KEY] = url_for(params.to_unsafe_h.merge(format: nil))
119
+ json_ui_save_return_url
119
120
  end
120
121
 
121
122
  respond_to do |format|
@@ -160,17 +161,22 @@ module Glib::Json::Libs
160
161
  session.delete(REDIRECT_BACK_KEY) || url
161
162
  end
162
163
 
164
+ def delete_redirect_back_url(url)
165
+ __delete_redirect_back_url(url)
166
+ end
167
+
163
168
  # def html_ui_redirect_back_or_to(default_url)
164
169
  # redirect_url = __delete_redirect_back_url(default_url)
165
170
  # redirect_to redirect_url
166
171
  # end
167
172
 
168
- def json_ui_redirect_back_or_to(default_url, json_action)
169
- redirect_url = __delete_redirect_back_url(default_url)
170
- json_action.windows_closeAll onClose: ->(subaction) do
171
- subaction.windows_open url: redirect_url
172
- end
173
- end
173
+ # def json_ui_redirect_back_or_to(default_url, json_action)
174
+ # redirect_url = __delete_redirect_back_url(default_url)
175
+ # json_action.windows_closeAll onClose: ->(subaction) do
176
+ # puts "***** R2: #{redirect_url}"
177
+ # subaction.windows_open url: redirect_url
178
+ # end
179
+ # end
174
180
 
175
181
  def __glib_error_dialog(title, message)
176
182
  {
@@ -223,15 +229,17 @@ module Glib::Json::Libs
223
229
  end
224
230
 
225
231
  def json_ui_redirect_to(url)
226
- # `onLoad` also executes in `onResponse` situation, e.g. form submit.
227
- on_load = { action: 'windows/open', url: url }
232
+ on_response = { action: 'windows/open', url: url }
228
233
 
229
234
  if glib_json_dialog_mode?
230
235
  # Only do this in dialog mode because this seems to add to the rendering time
231
236
  # (i.e. longer flicker time), presumably due to the use of things like `nextTick()`.
232
- on_load = { action: 'dialogs/close', onClose: on_load }
237
+ on_response = { action: 'dialogs/close', onClose: on_load }
233
238
  end
234
- render json: { onLoad: on_load }
239
+
240
+ # Use onResponse because it is harder to guarantee that `onLoad` executes in Vuejs because it relies
241
+ # on app.vue's reactivity.
242
+ render json: { onResponse: on_response }
235
243
  end
236
244
 
237
245
  module ClassMethods
File without changes
File without changes
@@ -1,11 +1,15 @@
1
1
  module Glib
2
2
  module EnumHelper
3
- def glib_enum_options(clazz, enum_field, keys: nil, include_hints: false)
3
+ def glib_enum_options(clazz, enum_field, keys: nil, hint_suffix: false, hint_subtitle: false)
4
4
  enum_name = enum_field.to_s
5
5
  keys ||= clazz.defined_enums[enum_name].keys
6
6
  keys.map do |i|
7
- text = clazz.glib_enum_humanize(enum_field, i, include_hints: include_hints)
8
- { text: text, value: i }
7
+ text = clazz.glib_enum_humanize(enum_field, i, hint_suffix: hint_suffix)
8
+ option = { text: text, value: i }
9
+ if hint_subtitle && (hint = clazz.glib_enum_hint(enum_field, i))
10
+ option[:subtitle] = hint
11
+ end
12
+ option
9
13
  end
10
14
  end
11
15
 
File without changes
File without changes
File without changes
@@ -1,7 +1,7 @@
1
1
  module Glib
2
2
  module UrlsHelper
3
- def glib_url_current(override_params: params.to_unsafe_h, extra_params: {})
4
- url_for(override_params.merge(extra_params.merge(only_path: false)))
3
+ def glib_url_current(replacement_params: params.to_unsafe_h, extra_params: {})
4
+ url_for(replacement_params.merge(extra_params.merge(only_path: false)))
5
5
  end
6
6
 
7
7
  def glib_url_equals_current?(url)
@@ -11,13 +11,13 @@ module Glib
11
11
  extend ClassMethods
12
12
  end
13
13
 
14
- def glib_enum_humanize(enum_name, default_enum_value = nil, include_hints: false)
15
- self.class.glib_enum_humanize(enum_name, send(enum_name) || default_enum_value, include_hints: include_hints)
14
+ def glib_enum_humanize(enum_name, default_enum_value = nil, hint_suffix: false)
15
+ self.class.glib_enum_humanize(enum_name, send(enum_name) || default_enum_value, hint_suffix: hint_suffix)
16
16
  end
17
17
  end
18
18
 
19
19
  module ClassMethods
20
- def glib_enum_humanize(enum_name, enum_value, default_translation = nil, include_hints: false)
20
+ def glib_enum_humanize(enum_name, enum_value, default_translation = nil, hint_suffix: false)
21
21
  if enum_value
22
22
  translation_key = "activerecord.attributes.#{model_name.i18n_key}.#{enum_name.to_s.pluralize}.#{enum_value}"
23
23
 
@@ -27,15 +27,22 @@ module Glib
27
27
  text = I18n.t(translation_key, default: default_translation)
28
28
  end
29
29
 
30
- if include_hints
31
- i18n_key = self.model_name.i18n_key
32
- if (hint = I18n.t("dt_models.#{i18n_key}.#{enum_name.to_s.pluralize}.#{enum_value}.hint")).present?
33
- text += " #{hint}"
34
- end
30
+ if hint_suffix && (hint = glib_enum_hint(enum_name, enum_value))
31
+ text += " #{hint}"
35
32
  end
36
33
 
37
34
  text
38
35
  end
39
36
  end
37
+
38
+ def glib_enum_hint(enum_name, enum_value)
39
+ i18n_key = self.model_name.i18n_key
40
+ if (hint = I18n.t("dt_models.#{i18n_key}.#{enum_name.to_s.pluralize}.#{enum_value}.hint")).present?
41
+ # text += " #{hint}"
42
+ return hint
43
+ end
44
+
45
+ nil
46
+ end
40
47
  end
41
48
  end
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
data/lib/glib/crypt.rb CHANGED
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
data/lib/glib/value.rb CHANGED
File without changes
data/lib/glib/version.rb CHANGED
File without changes
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: glib-web
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.24.0
4
+ version: 3.24.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - ''
@@ -336,7 +336,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
336
336
  - !ruby/object:Gem::Version
337
337
  version: '0'
338
338
  requirements: []
339
- rubygems_version: 3.4.6
339
+ rubyforge_project:
340
+ rubygems_version: 2.7.6
340
341
  signing_key:
341
342
  specification_version: 4
342
343
  summary: ''