glib-web 3.20.0 → 3.20.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (87) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/concerns/glib/auth/policy.rb +1 -1
  3. data/app/controllers/concerns/glib/json/libs.rb +5 -0
  4. data/app/controllers/concerns/glib/json/new_dynamic_text.rb +0 -0
  5. data/app/controllers/concerns/glib/json/ui.rb +4 -0
  6. data/app/helpers/glib/app_feature_support_helper.rb +0 -0
  7. data/app/helpers/glib/dynamic_texts_helper.rb +0 -0
  8. data/app/helpers/glib/json_ui/action_builder/sheets.rb +0 -0
  9. data/app/helpers/glib/json_ui/analytics_helper.rb +0 -0
  10. data/app/helpers/glib/json_ui/generic_builders.rb +0 -0
  11. data/app/helpers/glib/json_ui/view_builder/fields.rb +9 -2
  12. data/app/helpers/glib/json_ui/view_builder.rb +3 -0
  13. data/app/models/glib/active_storage/attachment.rb +0 -0
  14. data/app/models/glib/active_storage/blob.rb +0 -0
  15. data/app/models/glib/application_record.rb +3 -0
  16. data/app/models/glib/dynamic_text_record.rb +0 -0
  17. data/app/models/glib/text.rb +0 -0
  18. data/app/validators/email_typo_validator.rb +0 -0
  19. data/app/validators/email_validator.rb +0 -0
  20. data/app/validators/url_validator.rb +0 -0
  21. data/app/views/json_ui/garage/actions/_sheets.json.jbuilder +0 -0
  22. data/app/views/json_ui/garage/actions/dialogs_oauth_post.json.jbuilder +0 -0
  23. data/app/views/json_ui/garage/forms/dynamic_select_data.json.jbuilder +0 -0
  24. data/app/views/json_ui/garage/forms/generic_post.json.jbuilder +0 -0
  25. data/app/views/json_ui/garage/forms/submission_flow.json.jbuilder +0 -0
  26. data/app/views/json_ui/garage/forms/submission_flow_post.json.jbuilder +0 -0
  27. data/app/views/json_ui/garage/forms/submission_indicator.json.jbuilder +0 -0
  28. data/app/views/json_ui/garage/forms/submission_indicator_post.json.jbuilder +0 -0
  29. data/app/views/json_ui/garage/home/blank.json.jbuilder +0 -0
  30. data/app/views/json_ui/garage/home/slow.json.jbuilder +0 -0
  31. data/app/views/json_ui/garage/lists/autoload_all.json.jbuilder +0 -0
  32. data/app/views/json_ui/garage/lists/autoload_as_needed.json.jbuilder +0 -0
  33. data/app/views/json_ui/garage/lists/chat_ui.json.jbuilder +0 -0
  34. data/app/views/json_ui/garage/lists/fab.json.jbuilder +0 -0
  35. data/app/views/json_ui/garage/notifications/web_socket.json.jbuilder +0 -0
  36. data/app/views/json_ui/garage/pages/custom_style_class.json.jbuilder +0 -0
  37. data/app/views/json_ui/garage/pages/full_width.json.jbuilder +0 -0
  38. data/app/views/json_ui/garage/pages/full_width_height.json.jbuilder +0 -0
  39. data/app/views/json_ui/garage/pages/index.json.jbuilder +0 -0
  40. data/app/views/json_ui/garage/pages/layout.json.jbuilder +0 -0
  41. data/app/views/json_ui/garage/pages/lifecycle_hooks.json.jbuilder +0 -0
  42. data/app/views/json_ui/garage/pages/loading_indicator.json.jbuilder +0 -0
  43. data/app/views/json_ui/garage/pages/nested_scroll.json.jbuilder +0 -0
  44. data/app/views/json_ui/garage/pages/redirect_onload.json.jbuilder +0 -0
  45. data/app/views/json_ui/garage/panels/_styled.json.jbuilder +0 -0
  46. data/app/views/json_ui/garage/panels/card.json.jbuilder +0 -0
  47. data/app/views/json_ui/garage/panels/custom.json.jbuilder +0 -0
  48. data/app/views/json_ui/garage/panels/index.json.jbuilder +1 -1
  49. data/app/views/json_ui/garage/panels/outlined.json.jbuilder +0 -0
  50. data/app/views/json_ui/garage/services/dynamic_text.json.jbuilder +0 -0
  51. data/app/views/json_ui/garage/services/image.json.jbuilder +0 -0
  52. data/app/views/json_ui/garage/services/index.json.jbuilder +0 -0
  53. data/app/views/json_ui/garage/tables/_autoload_section.json.jbuilder +0 -0
  54. data/app/views/json_ui/garage/tables/autoload_all.json.jbuilder +0 -0
  55. data/app/views/json_ui/garage/tables/autoload_as_needed.json.jbuilder +0 -0
  56. data/app/views/json_ui/garage/tables/export_import.json.jbuilder +0 -0
  57. data/app/views/json_ui/garage/tables/index.json.jbuilder +0 -0
  58. data/app/views/json_ui/garage/views/calendar_data.json.jbuilder +0 -0
  59. data/app/views/json_ui/garage/views/links.json.jbuilder +0 -0
  60. data/app/views/json_ui/garage/views/map_data.json.jbuilder +0 -0
  61. data/app/views/json_ui/garage/views/multimedia.json.jbuilder +0 -0
  62. data/app/views/layouts/json_ui/no_custom.html.erb +0 -0
  63. data/lib/generators/glib/install_generator.rb +0 -0
  64. data/lib/generators/templates/20191017062519_create_texts.rb +0 -0
  65. data/lib/generators/templates/20191024063257_add_scope_to_texts.rb +0 -0
  66. data/lib/generators/templates/20191112095018_add_lang_to_texts.rb +0 -0
  67. data/lib/generators/templates/20191126071051_create_active_storage_tables.active_storage.rb +0 -0
  68. data/lib/generators/templates/database.yml +0 -0
  69. data/lib/generators/templates/dynamic_text.rb +0 -0
  70. data/lib/glib/crypt/utils.rb +0 -0
  71. data/lib/glib/crypt.rb +0 -0
  72. data/lib/glib/dynamic_text/config.rb +0 -0
  73. data/lib/glib/dynamic_text.rb +0 -0
  74. data/lib/glib/json_crawler/action_crawler.rb +0 -0
  75. data/lib/glib/json_crawler/action_crawlers/action_http.rb +0 -0
  76. data/lib/glib/json_crawler/action_crawlers/dialogs_alert.rb +0 -0
  77. data/lib/glib/json_crawler/action_crawlers/menu.rb +0 -0
  78. data/lib/glib/json_crawler/action_crawlers/run_multiple.rb +0 -0
  79. data/lib/glib/json_crawler/action_crawlers/windows_open.rb +0 -0
  80. data/lib/glib/json_crawler/coverage.rb +0 -0
  81. data/lib/glib/mailer_tester.rb +3 -1
  82. data/lib/glib/time_freezable_mailer.rb +37 -0
  83. data/lib/glib/time_returning_mailer.rb +15 -0
  84. data/lib/glib/value.rb +0 -0
  85. data/lib/glib/version.rb +0 -0
  86. data/lib/glib-web.rb +3 -0
  87. metadata +5 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f7d54630cdd25d883da692e88f98d775f50718d1b0f9edb5ce1bef914044883a
4
- data.tar.gz: a1c732849861960b1822ba8ae7ff72d237e0206c7e90780b3f3e36a9ca0cdae0
3
+ metadata.gz: 50cd95cb3043e936a17b46b0b3e3a102cbe3faa2894e3b67e53228ac115e2a83
4
+ data.tar.gz: c6a7069e1c997a5e0731039dabeb56c926fd452668a41ff75cc4f06ab0379a27
5
5
  SHA512:
6
- metadata.gz: 88f51b200e02d93754093488d74ccaae5a21cc2deb8ad80801bb21db2a3353301b209de2163a50200a0568867650ca5e24a2c467d4e127464ba504f9dcbbab7c
7
- data.tar.gz: b5dbf27b9c38e17d22d359f5845704fc5ac6a11ab612fd2feebee2d9271ef38d241824dcf21c8776039cfc3070b8ab8816825f1bdf781bfe9d001b28ac0ca9c8
6
+ metadata.gz: 3b9134e80a27875fc0971a9dc05dc2d7e1daea7c9bb156e14a3f5fad294db2f1a831f8ecc48d8e42dd7ff02d3a5d7772bca18cc9bb37f176eebb540dfc86ec6f
7
+ data.tar.gz: 844365e90f4a43e1ec06a54a380ac56df052ded036dddfb6fd40b5e747dc5e579cbae07e308cc5a7088c1071ea3ad342687df2c9abe19c923ea70e5c5ae863dc
@@ -51,7 +51,7 @@ module Glib::Auth
51
51
 
52
52
  # Expose protected method
53
53
  public # Override
54
- def policy_scope(*args)
54
+ def policy_scope(*args, **opts)
55
55
  super
56
56
  end
57
57
 
@@ -116,6 +116,11 @@ module Glib::Json::Libs
116
116
  redirect_to user_default_url
117
117
  end
118
118
  format.json do
119
+ if __json_ui_rendering?
120
+ redirect_to user_default_url
121
+ return
122
+ end
123
+
119
124
  render json: if glib_json_dialog_mode?
120
125
  { onLoad: __glib_error_dialog('Access denied', "Make sure you're logged in with the correct account.") }
121
126
  else
@@ -32,6 +32,10 @@ module Glib::Json::Ui
32
32
  @__json_ui_activated
33
33
  end
34
34
 
35
+ def __json_ui_rendering?
36
+ @__json_ui_rendering != nil
37
+ end
38
+
35
39
  def json_ui_page_lifecycle_prop(name)
36
40
  if (hash = json_transformation_start).is_a?(Hash) && hash['body'] # A valid page
37
41
  hash[name] ||= { 'action' => 'runMultiple', 'childActions' => [] }
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -295,7 +295,12 @@ class Glib::JsonUi::ViewBuilder
295
295
  json.set! :buttonLabels, @buttonLabels
296
296
 
297
297
  if @prop && context
298
- json.fileTitle context.field_value(@prop).blob&.filename
298
+ # json.fileTitle context.field_value(@prop).blob&.filename
299
+
300
+ if (value = context.field_value(@prop)).attached?
301
+ json.fileTitle value.blob.filename
302
+ json.fileUrl url_for(value)
303
+ end
299
304
  end
300
305
 
301
306
  super
@@ -303,7 +308,9 @@ class Glib::JsonUi::ViewBuilder
303
308
 
304
309
  @Override
305
310
  def determine_value(context, prop)
306
- context.field_value(prop)&.signed_id || ''
311
+ if (value = context.field_value(prop)).attached?
312
+ value.signed_id || ''
313
+ end
307
314
  end
308
315
  end
309
316
 
@@ -272,6 +272,9 @@ module Glib
272
272
  string :imageUrl
273
273
  action :onCLick
274
274
  bool :showTitle
275
+ bool :aboveLeftDrawer
276
+ bool :collapseButtonsOnMobile
277
+ int :elevation
275
278
 
276
279
  # def leftButtons(block)
277
280
  # json.leftButtons do
File without changes
File without changes
@@ -7,6 +7,9 @@ module Glib
7
7
  scope :created_asc, -> { order(created_at: :asc) }
8
8
  scope :created_desc, -> { order(created_at: :desc) }
9
9
 
10
+ scope :updated_asc, -> { order(updated_at: :asc) }
11
+ scope :updated_desc, -> { order(updated_at: :desc) }
12
+
10
13
  def self.glib_has_one_attached(field_name)
11
14
  has_one_attached field_name
12
15
 
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
@@ -127,7 +127,7 @@ json_ui_page json do |page|
127
127
  end
128
128
 
129
129
  section.rows builder: ->(template) do
130
- template.thumbnail title: 'Grid', subtitle: 'Arrage child component in grid like', onClick: ->(action) do
130
+ template.thumbnail title: 'Grid', subtitle: 'Arrange child component in grid like', onClick: ->(action) do
131
131
  action.windows_open url: json_ui_garage_url(path: 'panels/grid')
132
132
  end
133
133
 
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
@@ -15,7 +15,9 @@ module Glib
15
15
  preview_class.instance_methods(false).each do |mailer_method|
16
16
  test "mailer for #{preview_class}##{mailer_method}" do
17
17
  preview.send(mailer_method).deliver_now
18
- Timecop.return # Allows mailer preview to use Timecop.freeze()
18
+
19
+ # See TimeFreezableMailer
20
+ preview.try(:return_time_if_frozen)
19
21
 
20
22
  logfile = File.join(log_dir, "#{preview_class.name.underscore}##{mailer_method}.txt")
21
23
 
@@ -0,0 +1,37 @@
1
+ module Glib
2
+ module TimeFreezableMailer
3
+ @@__mailer_freeze_time = false
4
+
5
+ def allow_time_freeze?
6
+ Rails.env.development? || Rails.env.test?
7
+ end
8
+
9
+ def return_time_if_frozen
10
+ return unless allow_time_freeze?
11
+ return unless @@__mailer_freeze_time
12
+
13
+ @@__mailer_freeze_time = false
14
+
15
+ Timecop.return # Allows mailer preview to use Timecop.freeze()
16
+ end
17
+
18
+ def freeze_time(year, month, day)
19
+ return unless allow_time_freeze?
20
+
21
+ if @@__mailer_freeze_time
22
+ example_code = %{
23
+ Rails.application.config.to_prepare do
24
+ class ::Rails::MailersController
25
+ prepend Glib::TimeReturningMailer
26
+ end
27
+ end
28
+ }
29
+
30
+ raise "Please create `config/initializers/mailer_preview_setup.rb` and add the following: #{example_code}"
31
+ end
32
+
33
+ @@__mailer_freeze_time = true
34
+ Timecop.freeze(DateTime.new(year, month, day))
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,15 @@
1
+ module Glib
2
+ module TimeReturningMailer
3
+ extend ActiveSupport::Concern
4
+
5
+ prepended do
6
+ include Glib::TimeFreezableMailer
7
+ end
8
+
9
+ # Override Rails::MailersController's preview
10
+ def preview
11
+ super
12
+ return_time_if_frozen
13
+ end
14
+ end
15
+ end
data/lib/glib/value.rb CHANGED
File without changes
data/lib/glib/version.rb CHANGED
File without changes
data/lib/glib-web.rb CHANGED
@@ -6,4 +6,7 @@ require 'glib/json_crawler'
6
6
  require 'glib/dynamic_text'
7
7
  require 'glib/crypt'
8
8
  require 'glib/test_helpers'
9
+
10
+ require 'glib/time_freezable_mailer'
11
+ require 'glib/time_returning_mailer'
9
12
  require 'glib/mailer_tester'
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.20.0
4
+ version: 3.20.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - ''
@@ -310,6 +310,8 @@ files:
310
310
  - lib/glib/json_crawler/router.rb
311
311
  - lib/glib/mailer_tester.rb
312
312
  - lib/glib/test_helpers.rb
313
+ - lib/glib/time_freezable_mailer.rb
314
+ - lib/glib/time_returning_mailer.rb
313
315
  - lib/glib/value.rb
314
316
  - lib/glib/version.rb
315
317
  - lib/tasks/db.rake
@@ -331,7 +333,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
331
333
  - !ruby/object:Gem::Version
332
334
  version: '0'
333
335
  requirements: []
334
- rubygems_version: 3.4.6
336
+ rubyforge_project:
337
+ rubygems_version: 2.7.6
335
338
  signing_key:
336
339
  specification_version: 4
337
340
  summary: ''