glib-web 4.10.1 → 4.10.2

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/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/view_builder/panels.rb +7 -0
  9. data/app/models/glib/active_storage/attachment.rb +0 -0
  10. data/app/models/glib/active_storage/blob.rb +0 -0
  11. data/app/models/glib/dynamic_text_record.rb +0 -0
  12. data/app/models/glib/text.rb +0 -0
  13. data/app/validators/email_typo_validator.rb +0 -0
  14. data/app/validators/email_validator.rb +0 -0
  15. data/app/validators/url_validator.rb +0 -0
  16. data/app/views/json_ui/garage/actions/dialogs_oauth_post.json.jbuilder +0 -0
  17. data/app/views/json_ui/garage/forms/bulk_edit_post.json.jbuilder +0 -0
  18. data/app/views/json_ui/garage/forms/dynamic_group.json.jbuilder +45 -40
  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/selects.json.jbuilder +7 -2
  22. data/app/views/json_ui/garage/forms/submission_flow.json.jbuilder +0 -0
  23. data/app/views/json_ui/garage/forms/submission_flow_post.json.jbuilder +0 -0
  24. data/app/views/json_ui/garage/forms/submission_indicator.json.jbuilder +0 -0
  25. data/app/views/json_ui/garage/forms/submission_indicator_post.json.jbuilder +0 -0
  26. data/app/views/json_ui/garage/home/blank.json.jbuilder +0 -0
  27. data/app/views/json_ui/garage/home/slow.json.jbuilder +0 -0
  28. data/app/views/json_ui/garage/lists/autoload_all.json.jbuilder +0 -0
  29. data/app/views/json_ui/garage/lists/autoload_as_needed.json.jbuilder +0 -0
  30. data/app/views/json_ui/garage/lists/chat_ui.json.jbuilder +0 -0
  31. data/app/views/json_ui/garage/lists/fab.json.jbuilder +0 -0
  32. data/app/views/json_ui/garage/notifications/web_socket.json.jbuilder +0 -0
  33. data/app/views/json_ui/garage/pages/custom_style_class.json.jbuilder +0 -0
  34. data/app/views/json_ui/garage/pages/full_width.json.jbuilder +0 -0
  35. data/app/views/json_ui/garage/pages/full_width_height.json.jbuilder +0 -0
  36. data/app/views/json_ui/garage/pages/layout.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/tables/panel_content.json.jbuilder +65 -25
  53. data/app/views/json_ui/garage/test_page/form.json.jbuilder +5 -5
  54. data/app/views/json_ui/garage/views/calendar_data.json.jbuilder +0 -0
  55. data/app/views/json_ui/garage/views/map_data.json.jbuilder +0 -0
  56. data/app/views/json_ui/garage/views/multimedia.json.jbuilder +0 -0
  57. data/app/views/layouts/json_ui/no_custom.html.erb +0 -0
  58. data/lib/generators/glib/install_generator.rb +0 -0
  59. data/lib/generators/templates/20191017062519_create_texts.rb +0 -0
  60. data/lib/generators/templates/20191024063257_add_scope_to_texts.rb +0 -0
  61. data/lib/generators/templates/20191112095018_add_lang_to_texts.rb +0 -0
  62. data/lib/generators/templates/20191126071051_create_active_storage_tables.active_storage.rb +0 -0
  63. data/lib/generators/templates/database.yml +0 -0
  64. data/lib/generators/templates/dynamic_text.rb +0 -0
  65. data/lib/glib/dynamic_text/config.rb +0 -0
  66. data/lib/glib/dynamic_text.rb +0 -0
  67. data/lib/glib/json_crawler/action_crawler.rb +0 -0
  68. data/lib/glib/json_crawler/action_crawlers/action_http.rb +0 -0
  69. data/lib/glib/json_crawler/action_crawlers/dialogs_alert.rb +0 -0
  70. data/lib/glib/json_crawler/action_crawlers/menu.rb +0 -0
  71. data/lib/glib/json_crawler/action_crawlers/run_multiple.rb +0 -0
  72. data/lib/glib/json_crawler/action_crawlers/windows_open.rb +0 -0
  73. data/lib/glib/json_crawler/coverage.rb +0 -0
  74. data/lib/glib/json_crawler/router.rb +2 -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: ddb48299bbf1685aed5b8fd994ca3ffc8eba555e097cc77dbd38cb7b48707e6c
4
- data.tar.gz: 8569bc0e88d99f4dae7e1d2be733168e2ee7f0acd499e565a5fef0cca2a50ca9
3
+ metadata.gz: 40fb8120f293f1162be2b6027432444a35b7b321f0db95a6efbcd8d7a52b964c
4
+ data.tar.gz: 839a67107c2a77d66fd0ad27dcc8cfb5e77f0754609f609447ec030f2357f07d
5
5
  SHA512:
6
- metadata.gz: 328b8d4f45b8cd8a0e99029f5edfe0e20469e860a27282cf26a7173a7538b8bfb2310ba8b877c53ac05ac963c395f32767c69e25f568a7c67db262ea58ccc144
7
- data.tar.gz: 5f1b8c282c4c82aa77474304f584e22426188b04135af2387da8ee0099cc2eef85e527333966d439fa511aa14ef5a32d6bf3301d040ed9eb38e9f79066fe4991
6
+ metadata.gz: 0e2d195b6f33253b5d2ab3ec2df96cf00d62d2fd56bf08d80f25577ad09526561006391b3c2ce370e80ce2ab18510b468dfa5b0ae46c72483feee395eace6a40
7
+ data.tar.gz: 1bc81f15016ee532f0c9395d35318a487807fa5854a546796772dedeaee6edae0183881b997c9495e1a0a044bcb773103794c01b06642c202f3fe72a036a722b
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -572,6 +572,13 @@ class Glib::JsonUi::ViewBuilder
572
572
  # end
573
573
  end
574
574
 
575
+ class Pagination < View
576
+ int :length
577
+ int :value
578
+ action :onChange
579
+ string :paramNameForFieldName
580
+ end
581
+
575
582
  module ModelPanel
576
583
  attr_reader :model_name # See Panels::Form.field_name
577
584
  attr_reader :assoc_order_index
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -28,7 +28,7 @@ page.form url: json_ui_garage_url(path: 'forms/generic_post'), method: 'post', p
28
28
  template.fields_text width: 'matchParent', name: 'question', label: 'Question', placeholder: 'Question'
29
29
 
30
30
  form.panels_responsive id: 'responsive_{{entry_index}}', childViews: ->(column) do
31
- options = [:rating, :yes_no]
31
+ options = [:rating, :yes_no, :choices]
32
32
  template.fields_select \
33
33
  width: 'matchParent',
34
34
  name: 'type',
@@ -36,56 +36,61 @@ page.form url: json_ui_garage_url(path: 'forms/generic_post'), method: 'post', p
36
36
  placeholder: 'Answer Type',
37
37
  options: options.map { |o| { text: o.to_s.humanize, value: o } },
38
38
  onChangeAndLoad: ->(action) do
39
- action.logics_set targetId: 'responsive_{{entry_index}}', dataBuilder: ->(set) do
40
- set.panels_responsive accessory: ->(accessory) do
41
- accessory.footer childViews: ->(footer) do
42
- # TODO: Is there a way to only show this if the selected option is "rating".
43
- # I.e. `showIf: { "==": [{ "var": 'user[evaluation][{{index}}][type]' }, 'rating'] }`
44
- footer.fields_check \
45
- width: 'matchParent',
46
- id: 'check_{{entry_index}}',
47
- name: 'enabled',
48
- label: 'Enable',
49
- checkValue: true
39
+ action.runMultiple childActions: ->(multiple) do
40
+ multiple.logics_set \
41
+ cacheData: true, # This is so that the the new data is retained when the `dynamicGroup` gets re-rendered.
42
+ debug: true,
43
+ targetId: 'responsive_{{entry_index}}', dataBuilder: ->(set) do
44
+ set.panels_responsive width: 'matchParent', accessory: ->(accessory) do
45
+ accessory.footer childViews: ->(footer) do
46
+ footer.fields_check \
47
+ width: 'matchParent',
48
+ id: 'check_{{entry_index}}',
49
+ name: 'enabled',
50
+ label: 'Enable',
51
+ checkValue: true
52
+
53
+ footer.panels_split width: 'matchParent', content: ->(split) do
54
+ split.right childViews: ->(right) do
55
+ right.label text: 'This should be right-aligned'
56
+ end
57
+ end
58
+ end
59
+ end
60
+ end, onSet: ->(subaction) do
61
+ subaction.logics_set \
62
+ targetId: 'check_{{entry_index}}',
63
+ conditionalData: {
64
+ value: {
65
+ "==": [{ "var": 'user[evaluation][{{entry_index}}][type]' }, 'rating']
66
+ }
67
+ }
50
68
  end
51
- end
52
- end, onSet: ->(subaction) do
53
- subaction.logics_set \
54
- targetId: 'check_{{entry_index}}',
69
+
70
+ multiple.logics_set \
71
+ targetId: 'choices_panel',
72
+ debug: true,
55
73
  conditionalData: {
56
- value: {
57
- "==": [{ "var": 'user[evaluation][{{entry_index}}][type]' }, 'rating']
74
+ displayed: {
75
+ "==": [{ "var": 'user[evaluation][{{entry_index}}][type]' }, 'choices']
58
76
  }
59
77
  }
60
78
  end
61
-
62
- # action.components_findClosest view: 'panels/responsive', onFind: ->(find) do
63
- # find.logics_set dataBuilder: ->(set) do
64
- # set.panels_responsive accessory: ->(accessory) do
65
- # accessory.footer childViews: ->(footer) do
66
- # # TODO: Is there a way to only show this if the selected option is "rating".
67
- # # I.e. `showIf: { "==": [{ "var": 'user[evaluation][{{index}}][type]' }, 'rating'] }`
68
- # footer.fields_check \
69
- # width: 'matchParent',
70
- # name: 'enabled',
71
- # label: 'Enable',
72
- # checkValue: '1'
73
- # end
74
- # end
75
- # end
76
- # end
77
79
  end
78
80
  end, accessory: ->(accessory) do
79
81
  accessory.footer childViews: ->(footer) do
82
+
80
83
  end
81
84
  end
82
85
 
83
- # template.fields_check \
84
- # width: 'matchParent',
85
- # name: 'enabled',
86
- # label: 'Enable',
87
- # checkValue: '1',
88
- # showIf: { "==": [{ "var": 'user[evaluation][{{index}}][type]' }, 'rating'] }
86
+ template.panels_vertical id: 'choices_panel', childViews: ->(vertical) do
87
+ (1..5).each do |i|
88
+ vertical.fields_text \
89
+ width: 'matchParent',
90
+ name: "choices[#{i}]",
91
+ label: "Choice #{i}"
92
+ end
93
+ end
89
94
 
90
95
  template.spacer height: 14
91
96
  end
@@ -17,13 +17,16 @@ page.form url: json_ui_garage_url(path: 'forms/generic_post'), method: 'post', p
17
17
  }
18
18
 
19
19
  form.panels_responsive childViews: ->(column) do
20
+ options = languages.map do |k, v|
21
+ { value: k, text: v }
22
+ end
20
23
  form.fields_select \
21
24
  name: 'user[city]',
22
25
  width: 'matchParent',
23
26
  clearable: true,
24
27
  label: 'City1',
25
28
  placeholder: 'This is a placeholder',
26
- options: languages.map { |k, v| { value: k, text: v } },
29
+ options: options,
27
30
  value: 'canberra',
28
31
  onChange: ->(action) do
29
32
  action.components_findClosest view: 'panels/responsive', onFind: ->(find) do
@@ -47,11 +50,13 @@ page.form url: json_ui_garage_url(path: 'forms/generic_post'), method: 'post', p
47
50
 
48
51
  form.spacer height: 6
49
52
 
53
+ options = languages.map { |k, v| { value: k, text: v, deselect: [-1] } }
54
+ options << { value: -1, text: 'None of the above', deselect: languages.keys }
50
55
  form.fields_select \
51
56
  name: 'user[cities][]',
52
57
  width: 'matchParent',
53
58
  label: 'Cities',
54
- options: languages.map { |k, v| { value: k, text: v } },
59
+ options: options,
55
60
  value: ['melbourne', 'sydney'],
56
61
  multiple: true,
57
62
  onChange: ->(action) do
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -3,34 +3,74 @@ json.title 'Tables'
3
3
  page = json_ui_page json
4
4
  render "#{@path_prefix}/nav_menu", json: json, page: page
5
5
 
6
- page.table styleClass: 'table--grid', sections: [
7
- ->(section) do
8
- section.header cellViews: ->(header) do
9
- header.label text: 'Vertical'
10
- header.label text: 'Horizontal'
11
- header.label text: 'Unordered List'
12
- end
13
-
14
- items = [1, 2, 3]
15
- section.rows objects: items, builder: ->(row, item, index) do
16
- row.default colStyles: [{ width: 200, backgroundColor: '#eeeeee' }], cellViews: ->(cell) do
17
- cell.panels_vertical childViews: ->(vertical) do
18
- vertical.h3 text: "Title #{item}"
19
- vertical.spacer height: 4
20
- vertical.label text: "Subtitle #{item}"
6
+ page.scroll padding: glib_json_padding_body, childViews: ->(scroll) do
7
+ scroll.panels_form childViews: ->(form) do
8
+ form.panels_table styleClass: 'table--grid', sections: [
9
+ ->(section) do
10
+ section.header cellViews: ->(header) do
11
+ header.panels_horizontal childViews: ->(horizontal) do
12
+ horizontal.fields_check name: 'check_all', checkValue: true, onChange: ->(action) do
13
+ action.runMultiple childActions: ->(multiple) do
14
+ check_ids = (0..2).map { |i| "item_#{i}" }
15
+ # action.logics_set targetIds: check_ids, conditionalData: {
16
+ # value: { 'var': 'check_all' }
17
+ # }
18
+ check_ids.each_with_index do |check_id, index|
19
+ record_id = "id_#{index}"
20
+ multiple.logics_set targetId: check_id, conditionalData: {
21
+ value: { "if": [ { 'var': 'check_all' }, record_id, nil ]}
22
+ }
23
+ end
24
+ end
25
+ end
26
+ end
27
+ header.label text: 'Vertical'
28
+ header.label text: 'Horizontal'
29
+ header.label text: 'Unordered List'
21
30
  end
22
31
 
23
- cell.panels_horizontal childViews: ->(vertical) do
24
- vertical.label text: "Left #{item}"
25
- vertical.spacer width: 10
26
- vertical.label text: "Right #{item}"
27
- end
32
+ items = [1, 2, 3]
33
+ section.rows objects: items, builder: ->(row, item, index) do
34
+ row.default colStyles: [{ width: 200, backgroundColor: '#eeeeee' }], cellViews: ->(cell) do
35
+ cell.panels_horizontal childViews: ->(horizontal) do
36
+ horizontal.fields_check \
37
+ id: "item_#{index}",
38
+ name: 'user[items][]',
39
+ checkValue: "id_#{index}", # In the real-world, this is going to be the ID of a DB record.
40
+ onChangeAndLoad: ->(action) do
41
+ # TODO: Fix fields_check so it can support arrays
42
+ action.logics_set targetId: 'submit_button', conditionalData: {
43
+ text: {
44
+ 'printf': [
45
+ 'Submit {0} items',
46
+ { 'countNonNull': [{ 'var': 'user[items][]' }] }
47
+ ]
48
+ }
49
+ }
50
+ end
51
+ end
52
+
53
+ cell.panels_vertical childViews: ->(vertical) do
54
+ vertical.h3 text: "Title #{item}"
55
+ vertical.spacer height: 4
56
+ vertical.label text: "Subtitle #{item}"
57
+ end
28
58
 
29
- cell.panels_ul childViews: ->(ul) do
30
- ul.label text: "Item A#{item}"
31
- ul.label text: "Item B#{item}"
59
+ cell.panels_horizontal childViews: ->(vertical) do
60
+ vertical.label text: "Left #{item}"
61
+ vertical.spacer width: 10
62
+ vertical.label text: "Right #{item}"
63
+ end
64
+
65
+ cell.panels_ul childViews: ->(ul) do
66
+ ul.label text: "Item A#{item}"
67
+ ul.label text: "Item B#{item}"
68
+ end
69
+ end
32
70
  end
33
71
  end
34
- end
72
+ ]
73
+
74
+ form.fields_submit id: 'submit_button', text: 'Submit'
35
75
  end
36
- ]
76
+ end
@@ -23,9 +23,9 @@ page.body childViews: ->(body) do
23
23
  end
24
24
  end
25
25
  hori.spacer width: 4
26
- hori.button text: 'logics/set', onClick: ->(action) do
27
- action.logics_set targetId: 'date', conditionalData: { value: { "+": [{ "var": ['user[date]'] }, 60 * 60 * 24 * 3] } }
28
- end
26
+ # hori.button text: 'logics/set', onClick: ->(action) do
27
+ # action.logics_set targetId: 'date', conditionalData: { value: { "+": [{ "var": ['user[date]'] }, 60 * 60 * 24 * 3] } }
28
+ # end
29
29
  hori.spacer width: 4
30
30
  hori.button text: 'components/replace', onClick: ->(action) do
31
31
  action.runMultiple childActions: ->(saction) do
@@ -73,8 +73,8 @@ page.body childViews: ->(body) do
73
73
  validation = { required: { message: 'Required' } }
74
74
  options = ['option1', 'option2', 'option3', 'option4'].map { |option| { 'text'=> option.humanize, 'value' => option } }
75
75
 
76
- form.fields_date width: 'matchParent', name: 'user[date]', id: 'date', value: Date.new(2024, 7, 24), validation: validation
77
- form.hr width: 'matchParent'
76
+ # form.fields_date width: 'matchParent', name: 'user[date]', id: 'date', value: Date.new(2024, 7, 24), validation: validation
77
+ # form.hr width: 'matchParent'
78
78
  form.fields_select clearable: true, multiple: true, width: 'matchParent', name: 'user[select][]', id: 'select', options: options, value: ['option1', 'option2'], validation: validation
79
79
  form.hr width: 'matchParent'
80
80
  form.panels_flow innerPadding: { bottom: 0 }, width: 'matchParent', id: 'select1', childViews: ->(flow) do
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
@@ -21,6 +21,8 @@ module Glib
21
21
  end
22
22
 
23
23
  def assert_target_ids_exist(args)
24
+ # This saves targetId so that later we can check to make sure that it indeed exists
25
+ # within the page.
24
26
  if (target_ids = args['targetIds'])
25
27
  target_ids.each do |target_id|
26
28
  @visitor.defer_action(nil, target_id)
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: 4.10.1
4
+ version: 4.10.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - ''
@@ -388,7 +388,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
388
388
  - !ruby/object:Gem::Version
389
389
  version: '0'
390
390
  requirements: []
391
- rubygems_version: 3.4.6
391
+ rubyforge_project:
392
+ rubygems_version: 2.7.6
392
393
  signing_key:
393
394
  specification_version: 4
394
395
  summary: ''