glib-web 3.8.1 → 3.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (96) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/concerns/glib/auth/policy.rb +7 -5
  3. data/app/controllers/concerns/glib/json/libs.rb +11 -0
  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/forms_helper.rb +0 -0
  8. data/app/helpers/glib/json_ui/action_builder/sheets.rb +0 -0
  9. data/app/helpers/glib/json_ui/action_builder.rb +4 -1
  10. data/app/helpers/glib/json_ui/analytics_helper.rb +0 -0
  11. data/app/helpers/glib/json_ui/generic_builders.rb +0 -0
  12. data/app/helpers/glib/json_ui/list_builders.rb +3 -0
  13. data/app/helpers/glib/json_ui/table_builders.rb +0 -0
  14. data/app/helpers/glib/urls_helper.rb +19 -1
  15. data/app/models/concerns/glib/enum_humanization.rb +26 -0
  16. data/app/models/glib/active_storage/attachment.rb +0 -0
  17. data/app/models/glib/active_storage/blob.rb +0 -0
  18. data/app/models/glib/application_record.rb +10 -8
  19. data/app/models/glib/dynamic_text_record.rb +0 -0
  20. data/app/models/glib/text.rb +0 -0
  21. data/app/validators/email_typo_validator.rb +0 -0
  22. data/app/validators/email_validator.rb +0 -0
  23. data/app/validators/url_validator.rb +0 -0
  24. data/app/views/json_ui/garage/actions/_reload.json.jbuilder +0 -0
  25. data/app/views/json_ui/garage/actions/_sheets.json.jbuilder +0 -0
  26. data/app/views/json_ui/garage/actions/dialogs_oauth_post.json.jbuilder +0 -0
  27. data/app/views/json_ui/garage/forms/dynamic_group.json.jbuilder +0 -0
  28. data/app/views/json_ui/garage/forms/dynamic_select_data.json.jbuilder +0 -0
  29. data/app/views/json_ui/garage/forms/generic_post.json.jbuilder +0 -0
  30. data/app/views/json_ui/garage/forms/show_hide.json.jbuilder +3 -1
  31. data/app/views/json_ui/garage/forms/submission_flow.json.jbuilder +0 -0
  32. data/app/views/json_ui/garage/forms/submission_flow_post.json.jbuilder +0 -0
  33. data/app/views/json_ui/garage/forms/submission_indicator.json.jbuilder +0 -0
  34. data/app/views/json_ui/garage/forms/submission_indicator_post.json.jbuilder +0 -0
  35. data/app/views/json_ui/garage/home/blank.json.jbuilder +0 -0
  36. data/app/views/json_ui/garage/home/slow.json.jbuilder +0 -0
  37. data/app/views/json_ui/garage/lists/autoload_all.json.jbuilder +0 -0
  38. data/app/views/json_ui/garage/lists/autoload_as_needed.json.jbuilder +0 -0
  39. data/app/views/json_ui/garage/lists/chat_ui.json.jbuilder +0 -0
  40. data/app/views/json_ui/garage/lists/edit_mode.json.jbuilder +1 -1
  41. data/app/views/json_ui/garage/lists/fab.json.jbuilder +0 -0
  42. data/app/views/json_ui/garage/notifications/web_socket.json.jbuilder +0 -0
  43. data/app/views/json_ui/garage/pages/custom_style_class.json.jbuilder +0 -0
  44. data/app/views/json_ui/garage/pages/full_width.json.jbuilder +0 -0
  45. data/app/views/json_ui/garage/pages/full_width_height.json.jbuilder +0 -0
  46. data/app/views/json_ui/garage/pages/index.json.jbuilder +0 -0
  47. data/app/views/json_ui/garage/pages/layout.json.jbuilder +0 -0
  48. data/app/views/json_ui/garage/pages/lifecycle_hooks.json.jbuilder +0 -0
  49. data/app/views/json_ui/garage/pages/loading_indicator.json.jbuilder +0 -0
  50. data/app/views/json_ui/garage/pages/nested_scroll.json.jbuilder +0 -0
  51. data/app/views/json_ui/garage/pages/redirect_onload.json.jbuilder +0 -0
  52. data/app/views/json_ui/garage/panels/_styled.json.jbuilder +0 -0
  53. data/app/views/json_ui/garage/panels/card.json.jbuilder +0 -0
  54. data/app/views/json_ui/garage/panels/custom.json.jbuilder +0 -0
  55. data/app/views/json_ui/garage/panels/outlined.json.jbuilder +0 -0
  56. data/app/views/json_ui/garage/services/dynamic_text.json.jbuilder +0 -0
  57. data/app/views/json_ui/garage/services/image.json.jbuilder +0 -0
  58. data/app/views/json_ui/garage/services/index.json.jbuilder +0 -0
  59. data/app/views/json_ui/garage/tables/_autoload_section.json.jbuilder +0 -0
  60. data/app/views/json_ui/garage/tables/autoload_all.json.jbuilder +0 -0
  61. data/app/views/json_ui/garage/tables/autoload_as_needed.json.jbuilder +0 -0
  62. data/app/views/json_ui/garage/tables/export_import.json.jbuilder +0 -0
  63. data/app/views/json_ui/garage/tables/index.json.jbuilder +0 -0
  64. data/app/views/json_ui/garage/views/calendar_data.json.jbuilder +0 -0
  65. data/app/views/json_ui/garage/views/images.json.jbuilder +5 -0
  66. data/app/views/json_ui/garage/views/links.json.jbuilder +0 -0
  67. data/app/views/json_ui/garage/views/map_data.json.jbuilder +0 -0
  68. data/app/views/json_ui/garage/views/multimedia.json.jbuilder +0 -0
  69. data/config/routes.rb +0 -0
  70. data/lib/generators/glib/install_generator.rb +0 -0
  71. data/lib/generators/templates/20191017062519_create_texts.rb +0 -0
  72. data/lib/generators/templates/20191024063257_add_scope_to_texts.rb +0 -0
  73. data/lib/generators/templates/20191112095018_add_lang_to_texts.rb +0 -0
  74. data/lib/generators/templates/20191126071051_create_active_storage_tables.active_storage.rb +0 -0
  75. data/lib/generators/templates/database.yml +0 -0
  76. data/lib/generators/templates/dynamic_text.rb +0 -0
  77. data/lib/glib/crypt/utils.rb +0 -0
  78. data/lib/glib/crypt.rb +0 -0
  79. data/lib/glib/dynamic_text/config.rb +0 -0
  80. data/lib/glib/dynamic_text.rb +0 -0
  81. data/lib/glib/engine.rb +0 -0
  82. data/lib/glib/json_crawler/action_crawler.rb +0 -0
  83. data/lib/glib/json_crawler/action_crawlers/action_http.rb +0 -0
  84. data/lib/glib/json_crawler/action_crawlers/dialogs_alert.rb +0 -0
  85. data/lib/glib/json_crawler/action_crawlers/forms_submit.rb +0 -0
  86. data/lib/glib/json_crawler/action_crawlers/menu.rb +0 -0
  87. data/lib/glib/json_crawler/action_crawlers/run_multiple.rb +0 -0
  88. data/lib/glib/json_crawler/action_crawlers/windows_open.rb +0 -0
  89. data/lib/glib/json_crawler/coverage.rb +0 -0
  90. data/lib/glib/json_crawler.rb +0 -0
  91. data/lib/glib/mailer_tester.rb +0 -0
  92. data/lib/glib/value.rb +0 -0
  93. data/lib/glib/version.rb +0 -0
  94. data/lib/glib-web.rb +0 -0
  95. data/lib/tasks/db.rake +2 -0
  96. metadata +4 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b72f7c02474a721398c60f153fbdd616ed2c2ab88d22fa9da4ef09fc314d632e
4
- data.tar.gz: 972c69195d11c87ec3778c5d911ac788ba0c0236bc6d4830cf361cbc84914b44
3
+ metadata.gz: d1d627b99feb7c052188e21ff35b225428e2c5affb1ea7f8111582681ba92a88
4
+ data.tar.gz: 216d55f78c01ef928f54d1c4971b9c0fe4e632a4add7da00f9dc218c658cb201
5
5
  SHA512:
6
- metadata.gz: 359795ce00de01bbf2fd732235eded82fa3220137aa3707b720f02204f9268f7ec0a66f71f3cdf3dcfbb2e54babd9138191c88e5b4f5f1c6d4a6d235ff095c9b
7
- data.tar.gz: 3138fc48fc4f6563bf30cc4c3d41a0223eb12d0a07ef63a3e844246931b87f3d34d62cf147d0b577620a44e8c85eefd8cc5e5c48112a9087779e91a246c50ba6
6
+ metadata.gz: 62d0d1bfd6619de0f66d3332abad1eb7971952c98000982d4ef1fa7dfa5c2258978b1ee3f78907fd0e0e8a8b1a9a1117f843410bac26a045aee29f2a9513f6fe
7
+ data.tar.gz: 88f948b5cb7c56269d68b8afbf56ffee729813c60061eb7fc10369e945d813d93d037efd2e5ad1ac482f446b5c28bab981c60dee59832c0ddff3f63d7ea12396
@@ -29,11 +29,13 @@ module Glib::Auth
29
29
  return @__pundit_policies[policy_name]
30
30
  end
31
31
 
32
- if policy_name.is_a?(Symbol) && policy_name.to_s.ends_with?('_admin')
33
- policy_class = CommonAdminPolicy
34
- else
35
- policy_class = Pundit::PolicyFinder.new(policy_name).policy
36
- end
32
+ # if policy_name.is_a?(Symbol) && policy_name.to_s.ends_with?('_admin')
33
+ # policy_class = CommonAdminPolicy
34
+ # else
35
+ # policy_class = Pundit::PolicyFinder.new(policy_name).policy
36
+ # end
37
+
38
+ policy_class = Pundit::PolicyFinder.new(policy_name).policy
37
39
 
38
40
  raise "Policy not found for #{policy_name.is_a?(Symbol) || policy_name.is_a?(Class) ? policy_name : policy_name.class}" unless policy_class
39
41
 
@@ -58,6 +58,17 @@ module Glib::Json::Libs
58
58
  JSON.parse(render_to_string(template, locals: args))
59
59
  end
60
60
 
61
+ def glib_ui_redirect_to(url)
62
+ respond_to do |format|
63
+ format.html do
64
+ redirect_to url
65
+ end
66
+ format.json do
67
+ glib_json_redirect_to url
68
+ end
69
+ end
70
+ end
71
+
61
72
  def glib_force_json_ui
62
73
  if params[:_render] != 'v1'
63
74
  redirect_to url_for(params.to_unsafe_h.merge(_render: 'v1'))
File without changes
File without changes
File without changes
File without changes
@@ -57,8 +57,11 @@ module Glib
57
57
 
58
58
  module Forms
59
59
  class Submit < Action
60
- # Change the URL to submit and bypass all frontend validations.
60
+ # Change the URL to submit and bypass all frontend validations. This is useful for
61
+ # previewing and showing/hiding certain components based on user's selection prior
62
+ # to submitting the final data.
61
63
  string :overrideUrl
64
+ string :overrideMethod
62
65
  end
63
66
  end
64
67
 
File without changes
File without changes
@@ -59,6 +59,9 @@ module Glib
59
59
  panels_builder :content, :header, :footer, :right
60
60
  end
61
61
 
62
+ class Editable < Standard
63
+ end
64
+
62
65
  class CommentOutgoing < Standard
63
66
  end
64
67
 
File without changes
@@ -1,6 +1,6 @@
1
1
  module Glib
2
2
  module UrlsHelper
3
- def glib_url_current(new_params)
3
+ def glib_url_current(new_params = {})
4
4
  url_for(params.to_unsafe_h.merge(new_params.merge(only_path: false)))
5
5
  end
6
6
 
@@ -8,5 +8,23 @@ module Glib
8
8
  route = Rails.application.routes.recognize_path(url)
9
9
  route[:controller] == controller_name && route[:action] == action_name
10
10
  end
11
+
12
+ def glib_url_build(protocol, host, port, path, params = {})
13
+ case (protocol = protocol.chomp('://'))
14
+ when 'http'
15
+ request_builder = URI::HTTP
16
+ when 'https'
17
+ request_builder = URI::HTTPS
18
+ else
19
+ Rollbar.warn("Unsupported protocol: #{protocol}")
20
+ end
21
+
22
+ request_builder.build(
23
+ host: host,
24
+ port: port,
25
+ path: path,
26
+ query: params.to_query
27
+ )
28
+ end
11
29
  end
12
30
  end
@@ -0,0 +1,26 @@
1
+ # To use this, simply:
2
+ # - Include the module
3
+ # - Add this migration: `add_column :model, :deleted_at, :datetime, null: true`
4
+ #
5
+ # After that, any call to `destroy` will automatically be a soft-deletion.
6
+ module Glib
7
+ module EnumHumanization
8
+ extend ActiveSupport::Concern
9
+
10
+ included do
11
+ extend ClassMethods
12
+ end
13
+
14
+ def glib_enum_humanize(enum_name, default_value = nil)
15
+ self.class.glib_enum_humanize(enum_name, send(enum_name), default_value)
16
+ end
17
+ end
18
+
19
+ module ClassMethods
20
+ def glib_enum_humanize(enum_name, enum_value, default_value = nil)
21
+ if enum_value
22
+ I18n.t("activerecord.attributes.#{model_name.i18n_key}.#{enum_name.to_s.pluralize}.#{enum_value}", default: default_value)
23
+ end
24
+ end
25
+ end
26
+ end
File without changes
File without changes
@@ -1,18 +1,20 @@
1
1
  module Glib
2
2
  class ApplicationRecord < ActiveRecord::Base
3
+ include EnumHumanization
4
+
3
5
  self.abstract_class = true
4
6
 
5
7
  scope :created_asc, -> { order(created_at: :asc) }
6
8
  scope :created_desc, -> { order(created_at: :desc) }
7
9
 
8
- def glib_enum_humanize(enum_name, default_value = nil)
9
- self.class.glib_enum_humanize(enum_name, send(enum_name), default_value)
10
- end
10
+ # def glib_enum_humanize(enum_name, default_value = nil)
11
+ # self.class.glib_enum_humanize(enum_name, send(enum_name), default_value)
12
+ # end
11
13
 
12
- def self.glib_enum_humanize(enum_name, enum_value, default_value = nil)
13
- if enum_value
14
- I18n.t("activerecord.attributes.#{model_name.i18n_key}.#{enum_name.to_s.pluralize}.#{enum_value}", default: default_value)
15
- end
16
- end
14
+ # def self.glib_enum_humanize(enum_name, enum_value, default_value = nil)
15
+ # if enum_value
16
+ # I18n.t("activerecord.attributes.#{model_name.i18n_key}.#{enum_name.to_s.pluralize}.#{enum_value}", default: default_value)
17
+ # end
18
+ # end
17
19
  end
18
20
  end
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -262,7 +262,9 @@ page.form url: json_ui_garage_url(path: 'forms/generic_post'), method: 'post', p
262
262
 
263
263
  form.spacer height: 8
264
264
 
265
- form.button text: 'Reload component', onClick: ->(action) { action.windows_reload url: json_ui_garage_current_url({ key: SecureRandom.hex(3) }) }
265
+ if !Rails.env.test?
266
+ form.button text: 'Reload component', onClick: ->(action) { action.windows_reload url: json_ui_garage_current_url({ key: SecureRandom.hex(3) }) }
267
+ end
266
268
 
267
269
  if !params[:key]
268
270
  form.fields_check name: 'user[loadif4]', label: 'Show reload component 1', checkValue: 'true', uncheckValue: 'false', value: 'false'
File without changes
File without changes
File without changes
@@ -51,7 +51,7 @@ page.form \
51
51
  batch_count = 20
52
52
  batch_count.times do |index|
53
53
  id = (batch_count * tab_index) + index
54
- row.thumbnail title: "Item #{id}", recordId: "PK_#{id}"
54
+ row.editable title: "Item #{id}", recordId: "PK_#{id}"
55
55
  end
56
56
  end
57
57
  end
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -7,6 +7,11 @@ render "#{@path_prefix}/nav_menu", json: json, page: page
7
7
  small_image_url = 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSGQpSWjtELISLBlmugOZ6wzl1JamYXQvbFeYywpfg3E8b8DrO0Kg&s'
8
8
 
9
9
  page.scroll padding: glib_json_padding_body, childViews: ->(scroll) do
10
+ scroll.panels_column lg: { cols: 3 }, md: { cols: 1 }, sm: { cols: 1 }, xs: { cols: 1 }
11
+ scroll.panels_column backgroundColor: '#333333', height: 'matchParent', lg: { cols: 3 }, xs: { cols: 4 }, childViews: ->(column) do
12
+ column.image width: 'matchParent', url: glib_json_image_standard_url
13
+ end
14
+
10
15
  scroll.h2 text: 'Avatar'
11
16
  scroll.spacer height: 6
12
17
  scroll.avatar \
File without changes
data/config/routes.rb CHANGED
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
data/lib/glib/engine.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
data/lib/glib-web.rb CHANGED
File without changes
data/lib/tasks/db.rake CHANGED
@@ -54,6 +54,8 @@ namespace :db do
54
54
  model.unscoped.all
55
55
  end
56
56
 
57
+ next if entries.length <= 0
58
+
57
59
  puts "Dumping model: #{m} (#{entries.length} entries)"
58
60
 
59
61
  model_file = File.join(Rails.root, dump_dir, model.table_name + '.yml')
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.8.1
4
+ version: 3.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ''
@@ -121,6 +121,7 @@ files:
121
121
  - app/helpers/glib/json_ui/view_builder/multimedia.rb
122
122
  - app/helpers/glib/json_ui/view_builder/panels.rb
123
123
  - app/helpers/glib/urls_helper.rb
124
+ - app/models/concerns/glib/enum_humanization.rb
124
125
  - app/models/concerns/glib/soft_deletable.rb
125
126
  - app/models/glib/active_storage/attachment.rb
126
127
  - app/models/glib/active_storage/blob.rb
@@ -318,7 +319,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
318
319
  - !ruby/object:Gem::Version
319
320
  version: '0'
320
321
  requirements: []
321
- rubygems_version: 3.1.4
322
+ rubyforge_project:
323
+ rubygems_version: 2.7.6
322
324
  signing_key:
323
325
  specification_version: 4
324
326
  summary: ''