glib-web 3.16.1 → 3.16.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (85) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/concerns/glib/json/new_dynamic_text.rb +0 -0
  3. data/app/helpers/glib/app_feature_support_helper.rb +0 -0
  4. data/app/helpers/glib/dynamic_texts_helper.rb +0 -0
  5. data/app/helpers/glib/json_ui/action_builder/sheets.rb +0 -0
  6. data/app/helpers/glib/json_ui/analytics_helper.rb +0 -0
  7. data/app/helpers/glib/json_ui/generic_builders.rb +0 -0
  8. data/app/helpers/glib/json_ui/table_builders.rb +0 -0
  9. data/app/helpers/glib/json_ui/view_builder/fields.rb +27 -7
  10. data/app/helpers/glib/json_ui/view_builder/panels.rb +6 -8
  11. data/app/models/glib/active_storage/attachment.rb +0 -0
  12. data/app/models/glib/active_storage/blob.rb +0 -0
  13. data/app/models/glib/dynamic_text_record.rb +0 -0
  14. data/app/models/glib/text.rb +0 -0
  15. data/app/validators/email_typo_validator.rb +0 -0
  16. data/app/validators/email_validator.rb +0 -0
  17. data/app/validators/url_validator.rb +0 -0
  18. data/app/views/json_ui/garage/actions/_sheets.json.jbuilder +0 -0
  19. data/app/views/json_ui/garage/actions/dialogs_oauth_post.json.jbuilder +0 -0
  20. data/app/views/json_ui/garage/forms/dynamic_select_data.json.jbuilder +0 -0
  21. data/app/views/json_ui/garage/forms/file_upload.json.jbuilder +1 -1
  22. data/app/views/json_ui/garage/forms/generic_post.json.jbuilder +0 -0
  23. data/app/views/json_ui/garage/forms/selects.json.jbuilder +23 -2
  24. data/app/views/json_ui/garage/forms/submission_flow.json.jbuilder +0 -0
  25. data/app/views/json_ui/garage/forms/submission_flow_post.json.jbuilder +0 -0
  26. data/app/views/json_ui/garage/forms/submission_indicator.json.jbuilder +0 -0
  27. data/app/views/json_ui/garage/forms/submission_indicator_post.json.jbuilder +0 -0
  28. data/app/views/json_ui/garage/home/blank.json.jbuilder +0 -0
  29. data/app/views/json_ui/garage/home/slow.json.jbuilder +0 -0
  30. data/app/views/json_ui/garage/lists/autoload_all.json.jbuilder +0 -0
  31. data/app/views/json_ui/garage/lists/autoload_as_needed.json.jbuilder +0 -0
  32. data/app/views/json_ui/garage/lists/chat_ui.json.jbuilder +0 -0
  33. data/app/views/json_ui/garage/lists/fab.json.jbuilder +0 -0
  34. data/app/views/json_ui/garage/notifications/web_socket.json.jbuilder +0 -0
  35. data/app/views/json_ui/garage/pages/custom_style_class.json.jbuilder +0 -0
  36. data/app/views/json_ui/garage/pages/full_width.json.jbuilder +0 -0
  37. data/app/views/json_ui/garage/pages/full_width_height.json.jbuilder +0 -0
  38. data/app/views/json_ui/garage/pages/index.json.jbuilder +0 -0
  39. data/app/views/json_ui/garage/pages/layout.json.jbuilder +0 -0
  40. data/app/views/json_ui/garage/pages/lifecycle_hooks.json.jbuilder +0 -0
  41. data/app/views/json_ui/garage/pages/loading_indicator.json.jbuilder +0 -0
  42. data/app/views/json_ui/garage/pages/nested_scroll.json.jbuilder +0 -0
  43. data/app/views/json_ui/garage/pages/redirect_onload.json.jbuilder +0 -0
  44. data/app/views/json_ui/garage/panels/_styled.json.jbuilder +0 -0
  45. data/app/views/json_ui/garage/panels/card.json.jbuilder +0 -0
  46. data/app/views/json_ui/garage/panels/custom.json.jbuilder +0 -0
  47. data/app/views/json_ui/garage/panels/outlined.json.jbuilder +0 -0
  48. data/app/views/json_ui/garage/services/dynamic_text.json.jbuilder +0 -0
  49. data/app/views/json_ui/garage/services/image.json.jbuilder +0 -0
  50. data/app/views/json_ui/garage/services/index.json.jbuilder +0 -0
  51. data/app/views/json_ui/garage/tables/_autoload_section.json.jbuilder +0 -0
  52. data/app/views/json_ui/garage/tables/autoload_all.json.jbuilder +0 -0
  53. data/app/views/json_ui/garage/tables/autoload_as_needed.json.jbuilder +0 -0
  54. data/app/views/json_ui/garage/tables/export_import.json.jbuilder +0 -0
  55. data/app/views/json_ui/garage/tables/index.json.jbuilder +0 -0
  56. data/app/views/json_ui/garage/views/calendar_data.json.jbuilder +0 -0
  57. data/app/views/json_ui/garage/views/links.json.jbuilder +0 -0
  58. data/app/views/json_ui/garage/views/map_data.json.jbuilder +0 -0
  59. data/app/views/json_ui/garage/views/multimedia.json.jbuilder +0 -0
  60. data/app/views/layouts/json_ui/no_custom.html.erb +0 -0
  61. data/lib/generators/glib/install_generator.rb +0 -0
  62. data/lib/generators/templates/20191017062519_create_texts.rb +0 -0
  63. data/lib/generators/templates/20191024063257_add_scope_to_texts.rb +0 -0
  64. data/lib/generators/templates/20191112095018_add_lang_to_texts.rb +0 -0
  65. data/lib/generators/templates/20191126071051_create_active_storage_tables.active_storage.rb +0 -0
  66. data/lib/generators/templates/database.yml +0 -0
  67. data/lib/generators/templates/dynamic_text.rb +0 -0
  68. data/lib/glib/crypt/utils.rb +0 -0
  69. data/lib/glib/crypt.rb +0 -0
  70. data/lib/glib/dynamic_text/config.rb +0 -0
  71. data/lib/glib/dynamic_text.rb +0 -0
  72. data/lib/glib/engine.rb +0 -0
  73. data/lib/glib/json_crawler/action_crawler.rb +0 -0
  74. data/lib/glib/json_crawler/action_crawlers/action_http.rb +0 -0
  75. data/lib/glib/json_crawler/action_crawlers/dialogs_alert.rb +0 -0
  76. data/lib/glib/json_crawler/action_crawlers/menu.rb +0 -0
  77. data/lib/glib/json_crawler/action_crawlers/run_multiple.rb +0 -0
  78. data/lib/glib/json_crawler/action_crawlers/windows_open.rb +0 -0
  79. data/lib/glib/json_crawler/coverage.rb +0 -0
  80. data/lib/glib/json_crawler.rb +0 -0
  81. data/lib/glib/mailer_tester.rb +0 -0
  82. data/lib/glib/value.rb +0 -0
  83. data/lib/glib/version.rb +0 -0
  84. data/lib/glib-web.rb +0 -0
  85. metadata +3 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a6506d01810212bd6a00ece4f282642215269a2f959748bc89c6f6f030c1b89c
4
- data.tar.gz: 8d882c41d4155f53e3d6a41b2de5b96c98fbd03fb9d6419fc23c0ec67e9155d8
3
+ metadata.gz: 26d2c5c409ff911326efa81f445217d859f62b5350630c28185ca4e8a0ef85ad
4
+ data.tar.gz: edb315e653b13110b2cdfb896bdbc20e980adc593155ecb8527951a8cfaf232f
5
5
  SHA512:
6
- metadata.gz: a1edf3c7be0d464dbe4969b14e5355c623703ea3b6824891cb055cf186e1c019b9057fb125d85d9c4e223679ca145f9a1bb37dec0c4a8f775b67360d761813a9
7
- data.tar.gz: 9a460d9990353da55df488ec6675178be435296ce2e846da4284e9fc0a758b46b2b51a698450e1eca5ee3ffeddca4b3e265e63ec3fa845a4e5ebf2574e67f64b
6
+ metadata.gz: '05778a76d110933cd70d86343d645d680b19c48df67027affcfdd59a89cbfa7d74489826d116f450c881a9bb67059fbc83f04b22dd80edf228649e9515da0f89'
7
+ data.tar.gz: eb2db140e67e307c7cdd5a52ea48887bb5414b4949e6fa154a490822ea64863cfbe85369fc1695036976e49db0009015adb7593f600d53768ef856cbea820441
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -48,9 +48,6 @@ class Glib::JsonUi::ViewBuilder
48
48
  # Override
49
49
  def created
50
50
  if @prop && (form = page.current_form)
51
- association = form.nested_associations.last
52
- context = association || form
53
-
54
51
  context.field_assert_respond_to(@prop)
55
52
 
56
53
  @name ||= context.field_name(@prop, @multiple || false)
@@ -61,7 +58,7 @@ class Glib::JsonUi::ViewBuilder
61
58
 
62
59
  if form.current_dynamic_group.nil?
63
60
  # This is not relevant inside a dynamic group
64
- @value ||= context.field_value(@prop)
61
+ @value ||= determine_value(context, @prop)
65
62
  end
66
63
  end
67
64
  json.name @name
@@ -78,6 +75,16 @@ class Glib::JsonUi::ViewBuilder
78
75
  # json.validation @validation if @validation
79
76
  end
80
77
 
78
+ # To be overridden
79
+ def determine_value(context, prop)
80
+ context.field_value(prop)
81
+ end
82
+
83
+ def context
84
+ form = page.current_form
85
+ association = form.nested_associations.last
86
+ @context ||= association || form
87
+ end
81
88
  end
82
89
 
83
90
  class Text < AbstractField
@@ -168,6 +175,8 @@ class Glib::JsonUi::ViewBuilder
168
175
  bool :multiple, cache: true
169
176
  # bool :manualEntry
170
177
  hash :append
178
+
179
+ panels_builder :accessory, :header, :footer
171
180
  end
172
181
 
173
182
  class TimeZone < AbstractField
@@ -274,8 +283,17 @@ class Glib::JsonUi::ViewBuilder
274
283
 
275
284
  json.set! :buttonLabels, @buttonLabels
276
285
 
286
+ if @prop && context
287
+ json.fileTitle context.field_value(@prop).blob&.filename
288
+ end
289
+
277
290
  super
278
291
  end
292
+
293
+ @Override
294
+ def determine_value(context, prop)
295
+ context.field_value(prop)&.signed_id || ''
296
+ end
279
297
  end
280
298
 
281
299
  class MultiUpload < AbstractField
@@ -310,9 +328,11 @@ class Glib::JsonUi::ViewBuilder
310
328
  json.placeholder @placeholder if @placeholder
311
329
  json.hint @hint if @hint
312
330
 
313
- if @prop && (form = page.current_form)
314
- model = form.instance_variable_get(:@model)
315
- @files ||= model.send(@prop).to_a.map { |file| { name: file.blob&.filename, signed_id: file.signed_id } }
331
+ if @prop && context
332
+ # association = form.nested_associations.last
333
+ # context = association || form
334
+
335
+ @files ||= context.field_value(@prop, collect_ids: false).to_a.map { |file| { name: file.blob&.filename, signed_id: file.signed_id } }
316
336
  end
317
337
 
318
338
  json.files @files if @files.present?
@@ -34,8 +34,6 @@ class Glib::JsonUi::ViewBuilder
34
34
 
35
35
  def field_assert_respond_to(prop)
36
36
  self.class.field_assert_respond_to(@model, prop)
37
- # # Identify a prop being used on a nil model or incorrect model.
38
- # raise "Invalid property `#{prop}` on '#{@model.class}'" unless @model.respond_to?(prop)
39
37
  end
40
38
 
41
39
  def self.field_assert_respond_to(model, prop)
@@ -74,12 +72,12 @@ class Glib::JsonUi::ViewBuilder
74
72
  "#{name}[#{prop}]#{suffix}"
75
73
  end
76
74
 
77
- def field_value(prop)
78
- self.class.field_value(@model, prop)
75
+ def field_value(prop, collect_ids: true)
76
+ self.class.field_value(@model, prop, collect_ids: collect_ids)
79
77
  end
80
78
 
81
- def self.field_value(model, prop)
82
- if is_array_association?(model, prop)
79
+ def self.field_value(model, prop, collect_ids:)
80
+ if is_array_association?(model, prop) && collect_ids
83
81
  model.send(prop)&.map { |record| record.id }
84
82
  else
85
83
  model.send(prop)
@@ -384,8 +382,8 @@ class Glib::JsonUi::ViewBuilder
384
382
  @delegate_class.field_name(@model, prop, multiple, page)
385
383
  end
386
384
 
387
- def field_value(prop)
388
- @delegate_class.field_value(@model, prop)
385
+ def field_value(prop, collect_ids: true)
386
+ @delegate_class.field_value(@model, prop, collect_ids: collect_ids)
389
387
  end
390
388
 
391
389
  def field_label(prop, args)
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -41,7 +41,7 @@ page.form options.merge(childViews: ->(form) do
41
41
  name: 'user[multi][]',
42
42
  accepts: { fileType: 'image', maxFileSize: 5000 },
43
43
  directUploadUrl: rails_direct_uploads_url,
44
- uploadTitle: 'File added:',
44
+ uploadTitle: 'Files uploaded:',
45
45
  uploadFailedText: '(UPLOAD FAILED)',
46
46
  files: [
47
47
  { name: 'File (Example)', signed_id: ActiveStorage::Attachment.last&.signed_id }
@@ -60,8 +60,29 @@ page.form url: json_ui_garage_url(path: 'forms/generic_post'), method: 'post', p
60
60
  options << { type: 'divider' }
61
61
  end
62
62
 
63
- form.fields_select name: 'user[language]', width: 'matchParent', label: 'Primary Language', options: options, value: 'nl'
64
- form.fields_select name: 'user[languages][]', width: 'matchParent', label: 'Primary Language', options: options, value: ['ja', 'de'], multiple: true
63
+ form.fields_select \
64
+ name: 'user[language]',
65
+ width: 'matchParent',
66
+ label: 'Primary Language',
67
+ options: options,
68
+ value: 'nl',
69
+ accessory: ->(accessory) do
70
+ accessory.header padding: { x: 16, y: 10 }, childViews: ->(header) do
71
+ header.label text: 'Header'
72
+ end
73
+ accessory.footer padding: { x: 16, y: 10 }, childViews: ->(header) do
74
+ header.label text: 'Footer'
75
+ end
76
+ # footer.label text: 'TEST123'
77
+ end
78
+
79
+ form.fields_select \
80
+ name: 'user[languages][]',
81
+ width: 'matchParent',
82
+ label: 'Primary Language',
83
+ options: options,
84
+ value: ['ja', 'de'],
85
+ multiple: true
65
86
 
66
87
  form.spacer height: 20
67
88
  form.h2 text: 'Select fields with empty values'
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
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
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.16.1
4
+ version: 3.16.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - ''
@@ -327,7 +327,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
327
327
  - !ruby/object:Gem::Version
328
328
  version: '0'
329
329
  requirements: []
330
- rubygems_version: 3.4.6
330
+ rubyforge_project:
331
+ rubygems_version: 2.7.6
331
332
  signing_key:
332
333
  specification_version: 4
333
334
  summary: ''