glib-web 3.23.0 → 3.23.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (77) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/concerns/glib/json/libs.rb +28 -9
  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/json_ui/action_builder/sheets.rb +0 -0
  7. data/app/helpers/glib/json_ui/analytics_helper.rb +0 -0
  8. data/app/helpers/glib/json_ui/generic_builders.rb +0 -0
  9. data/app/helpers/glib/urls_helper.rb +2 -2
  10. data/app/models/glib/active_storage/attachment.rb +0 -0
  11. data/app/models/glib/active_storage/blob.rb +0 -0
  12. data/app/models/glib/dynamic_text_record.rb +0 -0
  13. data/app/models/glib/text.rb +0 -0
  14. data/app/validators/email_typo_validator.rb +0 -0
  15. data/app/validators/email_validator.rb +0 -0
  16. data/app/validators/url_validator.rb +0 -0
  17. data/app/views/json_ui/garage/actions/_sheets.json.jbuilder +0 -0
  18. data/app/views/json_ui/garage/actions/dialogs_oauth_post.json.jbuilder +0 -0
  19. data/app/views/json_ui/garage/forms/dynamic_select_data.json.jbuilder +0 -0
  20. data/app/views/json_ui/garage/forms/generic_post.json.jbuilder +0 -0
  21. data/app/views/json_ui/garage/forms/submission_flow.json.jbuilder +0 -0
  22. data/app/views/json_ui/garage/forms/submission_flow_post.json.jbuilder +0 -0
  23. data/app/views/json_ui/garage/forms/submission_indicator.json.jbuilder +0 -0
  24. data/app/views/json_ui/garage/forms/submission_indicator_post.json.jbuilder +0 -0
  25. data/app/views/json_ui/garage/home/blank.json.jbuilder +0 -0
  26. data/app/views/json_ui/garage/home/slow.json.jbuilder +0 -0
  27. data/app/views/json_ui/garage/lists/autoload_all.json.jbuilder +0 -0
  28. data/app/views/json_ui/garage/lists/autoload_as_needed.json.jbuilder +0 -0
  29. data/app/views/json_ui/garage/lists/chat_ui.json.jbuilder +0 -0
  30. data/app/views/json_ui/garage/lists/fab.json.jbuilder +0 -0
  31. data/app/views/json_ui/garage/notifications/web_socket.json.jbuilder +0 -0
  32. data/app/views/json_ui/garage/pages/custom_style_class.json.jbuilder +0 -0
  33. data/app/views/json_ui/garage/pages/full_width.json.jbuilder +0 -0
  34. data/app/views/json_ui/garage/pages/full_width_height.json.jbuilder +0 -0
  35. data/app/views/json_ui/garage/pages/layout.json.jbuilder +0 -0
  36. data/app/views/json_ui/garage/pages/lifecycle_hooks.json.jbuilder +0 -0
  37. data/app/views/json_ui/garage/pages/loading_indicator.json.jbuilder +0 -0
  38. data/app/views/json_ui/garage/pages/nested_scroll.json.jbuilder +0 -0
  39. data/app/views/json_ui/garage/pages/redirect_onload.json.jbuilder +0 -0
  40. data/app/views/json_ui/garage/panels/_styled.json.jbuilder +0 -0
  41. data/app/views/json_ui/garage/panels/card.json.jbuilder +0 -0
  42. data/app/views/json_ui/garage/panels/custom.json.jbuilder +0 -0
  43. data/app/views/json_ui/garage/panels/outlined.json.jbuilder +0 -0
  44. data/app/views/json_ui/garage/services/dynamic_text.json.jbuilder +0 -0
  45. data/app/views/json_ui/garage/services/image.json.jbuilder +0 -0
  46. data/app/views/json_ui/garage/services/index.json.jbuilder +0 -0
  47. data/app/views/json_ui/garage/tables/_autoload_section.json.jbuilder +0 -0
  48. data/app/views/json_ui/garage/tables/autoload_all.json.jbuilder +0 -0
  49. data/app/views/json_ui/garage/tables/autoload_as_needed.json.jbuilder +0 -0
  50. data/app/views/json_ui/garage/tables/export_import.json.jbuilder +0 -0
  51. data/app/views/json_ui/garage/tables/index.json.jbuilder +0 -0
  52. data/app/views/json_ui/garage/views/calendar_data.json.jbuilder +0 -0
  53. data/app/views/json_ui/garage/views/links.json.jbuilder +0 -0
  54. data/app/views/json_ui/garage/views/map_data.json.jbuilder +0 -0
  55. data/app/views/json_ui/garage/views/multimedia.json.jbuilder +0 -0
  56. data/app/views/layouts/json_ui/no_custom.html.erb +0 -0
  57. data/lib/generators/glib/install_generator.rb +0 -0
  58. data/lib/generators/templates/20191017062519_create_texts.rb +0 -0
  59. data/lib/generators/templates/20191024063257_add_scope_to_texts.rb +0 -0
  60. data/lib/generators/templates/20191112095018_add_lang_to_texts.rb +0 -0
  61. data/lib/generators/templates/20191126071051_create_active_storage_tables.active_storage.rb +0 -0
  62. data/lib/generators/templates/database.yml +0 -0
  63. data/lib/generators/templates/dynamic_text.rb +0 -0
  64. data/lib/glib/crypt/utils.rb +2 -1
  65. data/lib/glib/crypt.rb +27 -0
  66. data/lib/glib/dynamic_text/config.rb +0 -0
  67. data/lib/glib/dynamic_text.rb +0 -0
  68. data/lib/glib/json_crawler/action_crawler.rb +0 -0
  69. data/lib/glib/json_crawler/action_crawlers/action_http.rb +0 -0
  70. data/lib/glib/json_crawler/action_crawlers/dialogs_alert.rb +0 -0
  71. data/lib/glib/json_crawler/action_crawlers/menu.rb +0 -0
  72. data/lib/glib/json_crawler/action_crawlers/run_multiple.rb +0 -0
  73. data/lib/glib/json_crawler/action_crawlers/windows_open.rb +0 -0
  74. data/lib/glib/json_crawler/coverage.rb +0 -0
  75. data/lib/glib/value.rb +0 -0
  76. data/lib/glib/version.rb +0 -0
  77. metadata +3 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 45dc3048668b5ebaea724341b5f6ee89cd90a467f7859d03923c1824ffdbb729
4
- data.tar.gz: 69d8c59495ac1d84d17ee027a851b0761f1ae7981852a516ac449d36671f3d72
3
+ metadata.gz: a811ee1cb0c122afb173bc3518ec0259c734ccd5b137195fd6e2a1acfd7f4324
4
+ data.tar.gz: 826e0af4bbe74e0d804242d2cd6e79531ad56ebe7188061fa7d40d34a77c7f71
5
5
  SHA512:
6
- metadata.gz: 9d31cca0cb02fb134b52c2eb166bd76fa4040ad64a88b4f3a7cd5d3080bf85a390c568e07805fc0fa91c0eab6529247b4d209f28a8c68385be82f31227ba9a4c
7
- data.tar.gz: 0bc9b7c6b5d1e13fc1a4e6735f33f2819c5799c32ce6ee0001783c62eb9d6d9ed33d2771c80d695276d768e602e90ec591ebfa17b60b2234d696116312a5f49c
6
+ metadata.gz: e6bf10f5745554bc5ff670aa5acc12fbf544666b069a2d91c5f48ba56093317ac3ee839906e724f2ed3d4a9b6814575855f2a25a04e98449b2bdcf8a424218c0
7
+ data.tar.gz: 6d68d0b78429a9d25d8d04c1c23c32e0d742a8c7ebfb3eadb8ab0db0e35fcca7af432df0eebb3606005a54a79339f34c445ee24097735b88ff63bae7cb499d14
@@ -62,14 +62,27 @@ module Glib::Json::Libs
62
62
  JSON.parse(render_to_string(template, locals: args))
63
63
  end
64
64
 
65
- def glib_redirect_to(url)
65
+ def glib_html_url(url)
66
+ url = url.include?('?') ? url.sub(/.json\?/, '?') : url.sub(/.json$/, '')
67
+
68
+ # As much as possible, try retaining the front fragment by matching the back, because
69
+ # the front could be either a `?` or `&`
70
+ url = url.sub(/format=json\&/, '');
71
+
72
+ # If no match, then we replace the front fragment
73
+ url.sub(/[\&\?]format=json/, '');
74
+ end
75
+
76
+ def glib_redirect_to(url, return_to_previous: false)
77
+ url = __delete_redirect_back_url(url) if return_to_previous
78
+
66
79
  respond_to do |format|
67
80
  format.html do
68
81
  redirect_to url
69
82
  end
70
83
  format.json do
71
84
  if __json_ui_rendering?
72
- redirect_to url
85
+ redirect_to glib_html_url(url)
73
86
  return
74
87
  end
75
88
 
@@ -147,10 +160,10 @@ module Glib::Json::Libs
147
160
  session.delete(REDIRECT_BACK_KEY) || url
148
161
  end
149
162
 
150
- def html_ui_redirect_back_or_to(default_url)
151
- redirect_url = __delete_redirect_back_url(default_url)
152
- redirect_to redirect_url
153
- end
163
+ # def html_ui_redirect_back_or_to(default_url)
164
+ # redirect_url = __delete_redirect_back_url(default_url)
165
+ # redirect_to redirect_url
166
+ # end
154
167
 
155
168
  def json_ui_redirect_back_or_to(default_url, json_action)
156
169
  redirect_url = __delete_redirect_back_url(default_url)
@@ -210,9 +223,15 @@ module Glib::Json::Libs
210
223
  end
211
224
 
212
225
  def json_ui_redirect_to(url)
213
- render json: {
214
- onResponse: { action: 'dialogs/close', onClose: { action: 'windows/open', url: url } }
215
- }
226
+ # `onLoad` also executes in `onResponse` situation, e.g. form submit.
227
+ on_load = { action: 'windows/open', url: url }
228
+
229
+ if glib_json_dialog_mode?
230
+ # Only do this in dialog mode because this seems to add to the rendering time
231
+ # (i.e. longer flicker time), presumably due to the use of things like `nextTick()`.
232
+ on_load = { action: 'dialogs/close', onClose: on_load }
233
+ end
234
+ render json: { onLoad: on_load }
216
235
  end
217
236
 
218
237
  module ClassMethods
File without changes
File without changes
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(new_params = {})
4
- url_for(params.to_unsafe_h.merge(new_params.merge(only_path: false)))
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)))
5
5
  end
6
6
 
7
7
  def glib_url_equals_current?(url)
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
@@ -1,5 +1,6 @@
1
+ # Deprecated. Use Glib::Crypt instead.
1
2
  module Glib
2
- module Crypt
3
+ class Crypt
3
4
  class Utils
4
5
  def self.encrypt(original_message, encryption_secret, encryption_salt)
5
6
  encryptor = message_encryptor(encryption_secret, encryption_salt)
data/lib/glib/crypt.rb CHANGED
@@ -1 +1,28 @@
1
1
  require_relative './crypt/utils'
2
+
3
+ # A replacement of Glib::Crypt::Utils
4
+ module Glib
5
+ class Crypt
6
+ # Recommended digest: 'SHA256'
7
+ def self.encrypt(original_message, encryption_secret, encryption_salt, digest)
8
+ encryptor = message_encryptor(encryption_secret, encryption_salt, digest)
9
+ CGI.escape(encryptor.encrypt_and_sign(original_message))
10
+ end
11
+
12
+ def self.decrypt(encrypted_message, encryption_secret, encryption_salt, digest)
13
+ encryptor = message_encryptor(encryption_secret, encryption_salt, digest)
14
+ begin
15
+ encryptor.decrypt_and_verify(CGI.unescape(encrypted_message))
16
+ rescue ActiveSupport::MessageEncryptor::InvalidMessage
17
+ nil
18
+ end
19
+ end
20
+
21
+ private
22
+ def self.message_encryptor(encryption_secret, encryption_salt, digest)
23
+ key_generator = ActiveSupport::KeyGenerator.new(encryption_secret, iterations: 1000)
24
+ key_secret = key_generator.generate_key(encryption_salt, 32)
25
+ ActiveSupport::MessageEncryptor.new(key_secret, digest: digest, serializer: JSON)
26
+ end
27
+ end
28
+ end
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.23.0
4
+ version: 3.23.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: ''