glib-web 0.14.3 → 0.15.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (104) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/concerns/glib/json/new_dynamic_text.rb +0 -0
  3. data/app/controllers/concerns/glib/json/traversal.rb +16 -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/forms_helper.rb +0 -0
  7. data/app/helpers/glib/json_ui/action_builder/sheets.rb +0 -0
  8. data/app/helpers/glib/json_ui/action_builder/snackbars.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/page_helper.rb +12 -2
  12. data/app/helpers/glib/json_ui/table_builders.rb +0 -0
  13. data/app/helpers/glib/json_ui/view_builder.rb +1 -1
  14. data/app/helpers/glib/urls_helper.rb +0 -0
  15. data/app/models/glib/active_storage/attachment.rb +0 -0
  16. data/app/models/glib/active_storage/blob.rb +0 -0
  17. data/app/models/glib/dynamic_text_record.rb +0 -0
  18. data/app/models/glib/text.rb +0 -0
  19. data/app/validators/email_typo_validator.rb +0 -0
  20. data/app/validators/email_validator.rb +0 -0
  21. data/app/validators/url_validator.rb +0 -0
  22. data/app/views/json_ui/garage/actions/_dialogs.json.jbuilder +0 -0
  23. data/app/views/json_ui/garage/actions/_dialogs_show.json.jbuilder +0 -0
  24. data/app/views/json_ui/garage/actions/_panels.json.jbuilder +0 -0
  25. data/app/views/json_ui/garage/actions/_reload.json.jbuilder +0 -0
  26. data/app/views/json_ui/garage/actions/_sheets.json.jbuilder +0 -0
  27. data/app/views/json_ui/garage/actions/_snackbars.json.jbuilder +0 -0
  28. data/app/views/json_ui/garage/actions/dialogs_oauth_post.json.jbuilder +0 -0
  29. data/app/views/json_ui/garage/forms/dynamic_group.json.jbuilder +0 -0
  30. data/app/views/json_ui/garage/forms/dynamic_select_data.json.jbuilder +0 -0
  31. data/app/views/json_ui/garage/forms/floating_submit.json.jbuilder +0 -0
  32. data/app/views/json_ui/garage/forms/full_page_form.json.jbuilder +28 -0
  33. data/app/views/json_ui/garage/forms/full_page_form_dialog.json.jbuilder +21 -0
  34. data/app/views/json_ui/garage/forms/generic_post.json.jbuilder +0 -0
  35. data/app/views/json_ui/garage/forms/index.json.jbuilder +5 -5
  36. data/app/views/json_ui/garage/forms/show_hide.json.jbuilder +69 -0
  37. data/app/views/json_ui/garage/forms/submission_flow.json.jbuilder +45 -7
  38. data/app/views/json_ui/garage/forms/submission_flow_post.json.jbuilder +0 -0
  39. data/app/views/json_ui/garage/forms/submission_indicator.json.jbuilder +0 -0
  40. data/app/views/json_ui/garage/forms/submission_indicator_post.json.jbuilder +0 -0
  41. data/app/views/json_ui/garage/home/blank.json.jbuilder +0 -0
  42. data/app/views/json_ui/garage/home/slow.json.jbuilder +0 -0
  43. data/app/views/json_ui/garage/lists/autoload_all.json.jbuilder +0 -0
  44. data/app/views/json_ui/garage/lists/autoload_as_needed.json.jbuilder +0 -0
  45. data/app/views/json_ui/garage/lists/chat_ui.json.jbuilder +0 -0
  46. data/app/views/json_ui/garage/lists/edit_mode.json.jbuilder +18 -1
  47. data/app/views/json_ui/garage/lists/fab.json.jbuilder +0 -0
  48. data/app/views/json_ui/garage/notifications/web_socket.json.jbuilder +0 -0
  49. data/app/views/json_ui/garage/pages/flat_centered.json.jbuilder +0 -0
  50. data/app/views/json_ui/garage/pages/full_width.json.jbuilder +0 -0
  51. data/app/views/json_ui/garage/pages/full_width_height.json.jbuilder +0 -0
  52. data/app/views/json_ui/garage/pages/index.json.jbuilder +0 -0
  53. data/app/views/json_ui/garage/pages/layout.json.jbuilder +0 -0
  54. data/app/views/json_ui/garage/pages/lifecycle_hooks.json.jbuilder +0 -0
  55. data/app/views/json_ui/garage/pages/loading_indicator.json.jbuilder +0 -0
  56. data/app/views/json_ui/garage/pages/nested_scroll.json.jbuilder +0 -0
  57. data/app/views/json_ui/garage/panels/_styled.json.jbuilder +0 -0
  58. data/app/views/json_ui/garage/panels/card.json.jbuilder +0 -0
  59. data/app/views/json_ui/garage/panels/custom.json.jbuilder +0 -0
  60. data/app/views/json_ui/garage/panels/outlined.json.jbuilder +0 -0
  61. data/app/views/json_ui/garage/services/dynamic_text.json.jbuilder +0 -0
  62. data/app/views/json_ui/garage/services/image.json.jbuilder +0 -0
  63. data/app/views/json_ui/garage/services/index.json.jbuilder +0 -0
  64. data/app/views/json_ui/garage/tables/_autoload_section.json.jbuilder +0 -0
  65. data/app/views/json_ui/garage/tables/autoload_all.json.jbuilder +0 -0
  66. data/app/views/json_ui/garage/tables/autoload_as_needed.json.jbuilder +0 -0
  67. data/app/views/json_ui/garage/tables/export_import.json.jbuilder +0 -0
  68. data/app/views/json_ui/garage/tables/index.json.jbuilder +0 -0
  69. data/app/views/json_ui/garage/views/calendar_data.json.jbuilder +0 -0
  70. data/app/views/json_ui/garage/views/images.json.jbuilder +8 -2
  71. data/app/views/json_ui/garage/views/links.json.jbuilder +0 -0
  72. data/app/views/json_ui/garage/views/map_cluster_data.json.jbuilder +0 -0
  73. data/app/views/json_ui/garage/views/map_data.json.jbuilder +0 -0
  74. data/app/views/json_ui/garage/views/multimedia.json.jbuilder +0 -0
  75. data/config/routes.rb +0 -0
  76. data/lib/generators/glib/install_generator.rb +0 -0
  77. data/lib/generators/templates/20191017062519_create_texts.rb +0 -0
  78. data/lib/generators/templates/20191024063257_add_scope_to_texts.rb +0 -0
  79. data/lib/generators/templates/20191112095018_add_lang_to_texts.rb +0 -0
  80. data/lib/generators/templates/20191126071051_create_active_storage_tables.active_storage.rb +0 -0
  81. data/lib/generators/templates/database.yml +0 -0
  82. data/lib/generators/templates/dynamic_text.rb +0 -0
  83. data/lib/glib/crypt/utils.rb +0 -0
  84. data/lib/glib/crypt.rb +0 -0
  85. data/lib/glib/dynamic_text/config.rb +0 -0
  86. data/lib/glib/dynamic_text.rb +0 -0
  87. data/lib/glib/engine.rb +0 -0
  88. data/lib/glib/json_crawler/action_crawler.rb +0 -0
  89. data/lib/glib/json_crawler/action_crawlers/action_http.rb +0 -0
  90. data/lib/glib/json_crawler/action_crawlers/forms_submit.rb +13 -1
  91. data/lib/glib/json_crawler/action_crawlers/menu.rb +0 -0
  92. data/lib/glib/json_crawler/action_crawlers/nav_initiate.rb +0 -0
  93. data/lib/glib/json_crawler/action_crawlers/run_multiple.rb +0 -0
  94. data/lib/glib/json_crawler/action_crawlers/windows_open.rb +4 -0
  95. data/lib/glib/json_crawler/coverage.rb +0 -0
  96. data/lib/glib/json_crawler/router.rb +14 -3
  97. data/lib/glib/json_crawler.rb +0 -0
  98. data/lib/glib/mailer_tester.rb +0 -0
  99. data/lib/glib/value.rb +0 -0
  100. data/lib/glib/version.rb +0 -0
  101. data/lib/glib-web.rb +0 -0
  102. data/lib/tasks/db.rake +0 -0
  103. metadata +5 -3
  104. data/app/views/json_ui/garage/forms/full_window_form.json.jbuilder +0 -19
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a291c995ace4d47df8d25452fb05610864b635e2b9d5389cc8355350d3deef22
4
- data.tar.gz: 74ae4397312a86bca319d08e21f06d166d27ac98e4e5bb7181e8d18877a70eed
3
+ metadata.gz: 6ee300b7e05299ffaed9427513fada06ef2f248c68f8329bc6d07de7faf947a0
4
+ data.tar.gz: 8c11c15ae46e15b7fcfaf5c43744fbe2f872a6b6ea2e185e75f882759473c3db
5
5
  SHA512:
6
- metadata.gz: 87a1ba8c343d1bd48978452a14ede6ee419cfe7694eb5935c72ae3437e4077264d29a15dc23f049fddbc9c6bf6f3d4622904cd534fbef509c3b67f332420084e
7
- data.tar.gz: 99894f959d190a9ce3c515b5a4c9bece814e59ffa87826f69675c78f6592ec1400f387f7d7226c7bc9d236ec0e705c77c45ce9d7d9d1502c3177bc65068f1266
6
+ metadata.gz: 4b97228f7f53ea4f1fb86877c08c1cecadf12aaee9536e2ee8488eed58ffff4502c253984c9bc38d0e7df839e46283a5ac5aebbc6b63de63dcc98fa968e77bd6
7
+ data.tar.gz: b5a3e5a45469e5486465a7b5f3c12400d15ade17bcee01c237528cda747b404478cbc500347b5442992a1a8ae84efd0895f8fb9eefa4ef91493a340977d0df6a
@@ -39,6 +39,22 @@ module Glib::Json::Traversal
39
39
  @forms = []
40
40
  end
41
41
 
42
+ def fullPageForm(spec)
43
+ spec['fullPageForm']
44
+ end
45
+
46
+ def begin_page(spec)
47
+ if (form = fullPageForm(spec))
48
+ @forms << form
49
+ end
50
+ end
51
+
52
+ def end_page(spec)
53
+ if fullPageForm(spec)
54
+ @forms.pop
55
+ end
56
+ end
57
+
42
58
  def traverse_multiple(views, block)
43
59
  if views.is_a? Array
44
60
  views.each do |view|
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -174,9 +174,19 @@ module Glib
174
174
  end
175
175
 
176
176
  def form(options = {})
177
- scroll childViews: ->(scroll) do
178
- @view_builder.add_view('panels_form', options.reverse_merge(width: 'matchParent'))
177
+ form = Glib::JsonUi::ViewBuilder::Panels::Form.new(json, self)
178
+ form.childViews(->(view_builder) {})
179
+ panel_options = options.slice!(:url, :method, :local, :onSubmit, :paramNameForFormData, :model)
180
+
181
+ json.fullPageForm do
182
+ json.view 'panels/fullPageForm'
183
+ form.props(options)
179
184
  end
185
+
186
+ # So that the containing fields have context (e.g. can use form's model for naming).
187
+ self.current_form = form
188
+ scroll panel_options
189
+ self.current_form = nil
180
190
  end
181
191
 
182
192
  def data(options = {})
File without changes
@@ -24,7 +24,6 @@ module Glib
24
24
  end
25
25
 
26
26
  class View < JsonUiElement
27
- string :compId
28
27
  string :id
29
28
  length :width
30
29
  length :height
@@ -140,6 +139,7 @@ module Glib
140
139
 
141
140
  int :size
142
141
  string :url
142
+ string :base64Data
143
143
  action :onClick
144
144
  end
145
145
 
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -0,0 +1,28 @@
1
+ json.title 'Forms'
2
+
3
+ page = json_ui_page json
4
+
5
+ render "#{@path_prefix}/nav_menu", json: json, page: page
6
+
7
+ page.form url: json_ui_garage_url(path: 'forms/basic_post'), method: 'post', padding: glib_json_padding_body, childViews: ->(form) do
8
+ form.fields_text name: 'user[name]', width: 'matchParent', label: 'Name'
9
+ form.fields_password name: 'user[password]', width: 'matchParent', label: 'Password'
10
+ end
11
+
12
+ page.footer padding: glib_json_padding_body, backgroundColor: '#b3bac2', childViews: ->(footer) do
13
+ footer.label text: 'This button will submit the form above because this whole page is wrapped in a giant form.'
14
+ footer.spacer height: 6
15
+
16
+ footer.panels_split width: 'matchParent', content: ->(content) do
17
+ content.left childViews: ->(left) do
18
+ left.panels_horizontal height: 'matchParent', align: 'middle', childViews: ->(horizontal) do
19
+ horizontal.label styleClass: 'link', text: 'Open Nested Form', onClick: ->(action) do
20
+ action.dialogs_open url: json_ui_garage_url(path: 'forms/full_page_form_dialog', mode: 'dialog')
21
+ end
22
+ end
23
+ end
24
+ content.right childViews: ->(right) do
25
+ right.fields_submit text: 'Submit'
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,21 @@
1
+ json.title 'Forms'
2
+
3
+ page = json_ui_page json
4
+
5
+ render "#{@path_prefix}/nav_menu", json: json, page: page
6
+
7
+ page.form url: json_ui_garage_url(path: 'forms/basic_post?id=dialog'), method: 'post', padding: glib_json_padding_body, childViews: ->(form) do
8
+ form.fields_text name: 'user[name]', width: 'matchParent', label: 'Name'
9
+ form.fields_password name: 'user[password]', width: 'matchParent', label: 'Password'
10
+ end
11
+
12
+ page.footer padding: glib_json_padding_body, backgroundColor: '#b3bac2', childViews: ->(footer) do
13
+ footer.label text: 'This button will submit the form above because this whole page is wrapped in a giant form.'
14
+ footer.spacer height: 6
15
+
16
+ footer.panels_split width: 'matchParent', content: ->(content) do
17
+ content.right childViews: ->(right) do
18
+ right.fields_submit text: 'Submit'
19
+ end
20
+ end
21
+ end
@@ -91,11 +91,11 @@ page.list sections: [
91
91
  action.windows_open url: json_ui_garage_url(path: 'forms/styled_boxes')
92
92
  end
93
93
  end
94
- # section.rows builder: ->(template) do
95
- # template.thumbnail title: 'Full Window', onClick: ->(action) do
96
- # action.windows_open url: json_ui_garage_url(path: 'forms/full_window_form')
97
- # end
98
- # end
94
+ section.rows builder: ->(template) do
95
+ template.thumbnail title: 'Full Page', onClick: ->(action) do
96
+ action.windows_open url: json_ui_garage_url(path: 'forms/full_page_form')
97
+ end
98
+ end
99
99
  end, ->(section) do
100
100
  section.header padding: glib_json_padding_list, childViews: ->(header) do
101
101
  header.h2 text: 'Web Only'
@@ -152,3 +152,72 @@ page.form url: json_ui_garage_url(path: 'forms/generic_post'), method: 'post', p
152
152
  form.fields_submit text: 'Submit'
153
153
  form.spacer height: 40
154
154
  end
155
+
156
+ # if text.length > 100
157
+ # inner_column.panels_form local: true, childViews: ->(form) do
158
+ # form.markdown \
159
+ # text: text,
160
+ # styleClasses: ['many-line'],
161
+ # showIf: {
162
+ # "!=": [
163
+ # {
164
+ # "var": 'expand[bundle_description]'
165
+ # },
166
+ # 'expand'
167
+ # ]
168
+ # }
169
+ # form.markdown \
170
+ # text: text,
171
+ # showIf: {
172
+ # "==": [
173
+ # {
174
+ # "var": 'expand[bundle_description]'
175
+ # },
176
+ # 'expand'
177
+ # ]
178
+ # }
179
+ # form.fields_check \
180
+ # width: 'matchParent',
181
+ # offIcon: 'expand_more',
182
+ # onIcon: 'expand_less',
183
+ # label: 'Read more',
184
+ # onLabel: 'Read less',
185
+ # checkValue: 'expand',
186
+ # uncheckValue: nil,
187
+ # name: 'expand[bundle_description]',
188
+ # disableDirtyCheck: true
189
+ # end
190
+ # else
191
+ # inner_column.markdown text: text
192
+ # end
193
+
194
+ # panel.panels_form width: 'matchParent', childViews: ->(visibility) do
195
+ # state = {
196
+ # has_content: false
197
+ # }
198
+ # style_classes ||= nil
199
+ # style_class ||= nil
200
+ # padding ||= nil
201
+ # id ||= nil
202
+
203
+ # visibility.banners_select \
204
+ # id: id,
205
+ # width: 'matchParent',
206
+ # styleClass: style_class || (style_classes ? nil : 'warning'),
207
+ # message: message,
208
+ # padding: padding,
209
+ # buttons: ->(menu) do
210
+ # yield(menu, state)
211
+ # end,
212
+ # showIf: {
213
+ # "==": [
214
+ # {
215
+ # "var": 'banner'
216
+ # },
217
+ # 'show'
218
+ # ]
219
+ # }
220
+ # visibility.fields_hidden name: 'banner', value: state[:has_content] ? 'show' : 'hide'
221
+ # end
222
+
223
+
@@ -36,31 +36,69 @@ page.scroll childViews: ->(scroll) do
36
36
  group.fields_radio value: 'alert_close', label: 'alert+close - useful for non-model form (e.g. contact us)'
37
37
  end
38
38
 
39
- form.spacer height: 14
39
+ form.spacer height: 6
40
40
  form.button text: 'Submit', onClick: ->(action) { action.forms_submit }
41
41
  end
42
42
 
43
+ scroll.spacer height: 14
43
44
  scroll.panels_form \
45
+ width: 'matchParent',
44
46
  url: json_ui_garage_url(path: 'forms/generic_post'),
45
47
  method: 'post',
46
48
  padding: { top: 12, left: 20, right: 20, bottom: 12 },
47
49
  childViews: ->(form) do
48
50
  form.h3 text: 'Perform custom actions on submit'
51
+ form.spacer height: 6
52
+ form.label text: 'This also works when you press ENTER in the following text fields'
53
+ form.spacer height: 6
49
54
 
50
- form.fields_text width: 'matchParent', styleClass: 'outlined', name: 'user[text]', value: 'Hello'
51
-
52
- form.spacer height: 14
53
- # form.button text: 'Submit', onClick: ->(action) { action.forms_submit }
55
+ form.fields_text width: 'matchParent', styleClass: 'outlined', name: 'user[first_name]', value: 'Jane'
56
+ form.fields_text width: 'matchParent', styleClass: 'outlined', name: 'user[last_name]', value: 'Doe'
54
57
 
58
+ form.spacer height: 6
55
59
  form.fields_submit text: 'Submit'
56
60
  end,
57
61
  onSubmit: ->(action) do
58
- # action.forms_submit
59
-
60
62
  action.dialogs_alert \
61
63
  message: 'The form will submit after the dialog is closed',
62
64
  onClose: ->(subaction) do
63
65
  subaction.forms_submit
64
66
  end
65
67
  end
68
+
69
+ scroll.spacer height: 14
70
+ scroll.panels_form \
71
+ width: 'matchParent',
72
+ url: json_ui_garage_url(path: 'forms/generic_post'),
73
+ method: 'post',
74
+ padding: { top: 12, left: 20, right: 20, bottom: 12 },
75
+ childViews: ->(form) do
76
+ form.h3 text: 'Submit without using a submit button'
77
+ form.spacer height: 6
78
+ form.label text: 'Note: In general using a submit button is better because it will allow the browser to handle the form functionality in a consistent manner.'
79
+ form.spacer height: 6
80
+ form.label text: 'For example, without a submit button, you cannot submit the form by pressing ENTER in the following text fields'
81
+ form.spacer height: 6
82
+
83
+ form.fields_text width: 'matchParent', styleClass: 'outlined', name: 'user[first_name]', value: 'John'
84
+ form.fields_text width: 'matchParent', styleClass: 'outlined', name: 'user[last_name]', value: 'Doe'
85
+
86
+ form.spacer height: 6
87
+
88
+ form.panels_split width: 'matchParent', content: ->(split) do
89
+ split.left childViews: ->(left) do
90
+ left.panels_horizontal height: 'matchParent', align: 'middle', childViews: ->(horizontal) do
91
+ horizontal.label text: 'Submit using label', onClick: ->(subaction) do
92
+ subaction.forms_submit
93
+ end
94
+ end
95
+ end
96
+
97
+ split.right childViews: ->(right) do
98
+ right.banners_select width: 'matchParent', message: 'Banner Menu', buttons: ->(menu) do
99
+ menu.button text: 'Submit using banner', onClick: ->(action) { action.forms_submit }
100
+ end
101
+ end
102
+ end
103
+ end
66
104
  end
File without changes
File without changes
File without changes
@@ -4,6 +4,22 @@ json.title 'Lists'
4
4
 
5
5
  render "#{@path_prefix}/nav_menu", json: json, page: page
6
6
 
7
+ tab_index = params[:tab].to_i
8
+
9
+ page.header childViews: ->(header) do
10
+ # Allow navigating to another "edit mode" page to test reuse issues.
11
+ header.tabBar buttons: ->(menu) do
12
+ ['FIRST', 'SECOND'].each_with_index do |text, index|
13
+ menu.button \
14
+ text: text,
15
+ disabled: tab_index == index,
16
+ onClick: ->(action) do
17
+ action.windows_reload url: json_ui_garage_url(path: 'lists/edit_mode', tab: index)
18
+ end
19
+ end
20
+ end
21
+ end
22
+
7
23
  page.form \
8
24
  width: 'matchParent',
9
25
  url: json_ui_garage_url(path: 'forms/generic_post'),
@@ -34,7 +50,8 @@ page.form \
34
50
  section.rows builder: ->(row) do
35
51
  batch_count = 20
36
52
  batch_count.times do |index|
37
- row.thumbnail title: "Item #{index}", recordId: "PK_#{index}"
53
+ id = (batch_count * tab_index) + index
54
+ row.thumbnail title: "Item #{id}", recordId: "PK_#{id}"
38
55
  end
39
56
  end
40
57
  end
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -19,13 +19,19 @@ page.scroll padding: glib_json_padding_body, childViews: ->(scroll) do
19
19
  url: glib_json_image_avatar_url,
20
20
  badge: { text: '1', backgroundColor: '#0000ff' }
21
21
 
22
+ base64_data = 'data:image/gif;base64,R0lGODlhPQBEAPeoAJosM//AwO/AwHVYZ/z595kzAP/s7P+goOXMv8+fhw/v739/f+8PD98fH/8mJl+fn/9ZWb8/PzWlwv///6wWGbImAPgTEMImIN9gUFCEm/gDALULDN8PAD6atYdCTX9gUNKlj8wZAKUsAOzZz+UMAOsJAP/Z2ccMDA8PD/95eX5NWvsJCOVNQPtfX/8zM8+QePLl38MGBr8JCP+zs9myn/8GBqwpAP/GxgwJCPny78lzYLgjAJ8vAP9fX/+MjMUcAN8zM/9wcM8ZGcATEL+QePdZWf/29uc/P9cmJu9MTDImIN+/r7+/vz8/P8VNQGNugV8AAF9fX8swMNgTAFlDOICAgPNSUnNWSMQ5MBAQEJE3QPIGAM9AQMqGcG9vb6MhJsEdGM8vLx8fH98AANIWAMuQeL8fABkTEPPQ0OM5OSYdGFl5jo+Pj/+pqcsTE78wMFNGQLYmID4dGPvd3UBAQJmTkP+8vH9QUK+vr8ZWSHpzcJMmILdwcLOGcHRQUHxwcK9PT9DQ0O/v70w5MLypoG8wKOuwsP/g4P/Q0IcwKEswKMl8aJ9fX2xjdOtGRs/Pz+Dg4GImIP8gIH0sKEAwKKmTiKZ8aB/f39Wsl+LFt8dgUE9PT5x5aHBwcP+AgP+WltdgYMyZfyywz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jDv9aaXOEBteBqmuuxgEHoLX6Kqx+yXqqBANsgCtit4FWQAEkrNbpq7HSOmtwag5w57GrmlJBASEU18ADjUYb3ADTinIttsgSB1oJFfA63bduimuqKB1keqwUhoCSK374wbujvOSu4QG6UvxBRydcpKsav++Ca6G8A6Pr1x2kVMyHwsVxUALDq/krnrhPSOzXG1lUTIoffqGR7Goi2MAxbv6O2kEG56I7CSlRsEFKFVyovDJoIRTg7sugNRDGqCJzJgcKE0ywc0ELm6KBCCJo8DIPFeCWNGcyqNFE06ToAfV0HBRgxsvLThHn1oddQMrXj5DyAQgjEHSAJMWZwS3HPxT/QMbabI/iBCliMLEJKX2EEkomBAUCxRi42VDADxyTYDVogV+wSChqmKxEKCDAYFDFj4OmwbY7bDGdBhtrnTQYOigeChUmc1K3QTnAUfEgGFgAWt88hKA6aCRIXhxnQ1yg3BCayK44EWdkUQcBByEQChFXfCB776aQsG0BIlQgQgE8qO26X1h8cEUep8ngRBnOy74E9QgRgEAC8SvOfQkh7FDBDmS43PmGoIiKUUEGkMEC/PJHgxw0xH74yx/3XnaYRJgMB8obxQW6kL9QYEJ0FIFgByfIL7/IQAlvQwEpnAC7DtLNJCKUoO/w45c44GwCXiAFB/OXAATQryUxdN4LfFiwgjCNYg+kYMIEFkCKDs6PKAIJouyGWMS1FSKJOMRB/BoIxYJIUXFUxNwoIkEKPAgCBZSQHQ1A2EWDfDEUVLyADj5AChSIQW6gu10bE/JG2VnCZGfo4R4d0sdQoBAHhPjhIB94v/wRoRKQWGRHgrhGSQJxCS+0pCZbEhAAOw=='
23
+
24
+ scroll.h2 text: 'Avatar with base64 data '
25
+ scroll.spacer height: 6
26
+ scroll.avatar \
27
+ base64Data: base64_data
28
+
22
29
  scroll.spacer height: 20
23
30
  scroll.h2 text: 'Image with base64 data'
24
31
  scroll.spacer height: 6
25
32
  scroll.image \
26
- height: 100,
27
33
  tooltip: { text: 'This is a tooltip' },
28
- base64Data: 'data:image/gif;base64,R0lGODlhPQBEAPeoAJos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eChUmc1K3QTnAUfEgGFgAWt88hKA6aCRIXhxnQ1yg3BCayK44EWdkUQcBByEQChFXfCB776aQsG0BIlQgQgE8qO26X1h8cEUep8ngRBnOy74E9QgRgEAC8SvOfQkh7FDBDmS43PmGoIiKUUEGkMEC/PJHgxw0xH74yx/3XnaYRJgMB8obxQW6kL9QYEJ0FIFgByfIL7/IQAlvQwEpnAC7DtLNJCKUoO/w45c44GwCXiAFB/OXAATQryUxdN4LfFiwgjCNYg+kYMIEFkCKDs6PKAIJouyGWMS1FSKJOMRB/BoIxYJIUXFUxNwoIkEKPAgCBZSQHQ1A2EWDfDEUVLyADj5AChSIQW6gu10bE/JG2VnCZGfo4R4d0sdQoBAHhPjhIB94v/wRoRKQWGRHgrhGSQJxCS+0pCZbEhAAOw=='
34
+ base64Data: base64_data
29
35
 
30
36
  scroll.spacer height: 20
31
37
  scroll.h2 text: 'QR Code as base64 image'
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
@@ -1,3 +1,4 @@
1
+
1
2
  module Glib
2
3
  module JsonCrawler
3
4
  class FormsSubmit < ActionCrawler
@@ -24,7 +25,18 @@ module Glib
24
25
  url = view['url']
25
26
  fields = []
26
27
  params = {}
27
- @http.router.crawl_multiple view['childViews'], ->(child) do
28
+ child_views = view['childViews'] || []
29
+
30
+ # If this form is page level, we need to check the child views of the entire page.
31
+ if view['view'] == 'panels/fullPageForm'
32
+ child_views += @http.router.page_spec['header']&.[]('childViews') || []
33
+ child_views += @http.router.page_spec['body']&.[]('childViews') || []
34
+ child_views += @http.router.page_spec['footer']&.[]('childViews') || []
35
+ end
36
+
37
+ @http.router.crawl_multiple child_views, ->(child) do
38
+ next if child['template'].present?
39
+
28
40
  name = child['view']
29
41
  if name.start_with?('fields/')
30
42
  fields << child
File without changes
@@ -8,6 +8,8 @@ module Glib
8
8
  json = @http.get(url, action, args.except('url'))
9
9
 
10
10
  unless json.nil?
11
+ @http.router.begin_page(json)
12
+
11
13
  crawl json['header']&.[]('childViews')
12
14
  crawl json['body']&.[]('childViews')
13
15
  crawl json['footer']&.[]('childViews')
@@ -25,6 +27,8 @@ module Glib
25
27
  if (on_load = (args.fetch('onLoad', nil)))
26
28
  perform(on_load)
27
29
  end
30
+
31
+ @http.router.end_page(json)
28
32
  end
29
33
  end
30
34
  end
File without changes
@@ -1,7 +1,7 @@
1
1
  module Glib
2
2
  module JsonCrawler
3
3
  class Router
4
- attr_reader :read_only_actions, :logger
4
+ attr_reader :read_only_actions, :logger, :page_spec
5
5
  attr_accessor :host
6
6
 
7
7
  def log(action, url, response = nil)
@@ -19,6 +19,7 @@ module Glib
19
19
  @read_only_actions = Set.new
20
20
  # default rails's development host
21
21
  @host ||= 'localhost:3000'
22
+ @page_spec = nil
22
23
  end
23
24
 
24
25
  def step(http, args)
@@ -53,7 +54,8 @@ module Glib
53
54
  JsonCrawler::NavInitiate.new(http, params, action)
54
55
  when 'runMultiple-v1', 'runMultiple'
55
56
  JsonCrawler::RunMultiple.new(http, params, action)
56
- when 'windows/open-v1', 'dialogs/open-v1', 'windows/reload-v1', 'windows/open', 'dialogs/open', 'windows/reload', 'windows/openWeb', 'windows/openWeb-v1'
57
+ when 'windows/open-v1', 'dialogs/open-v1', 'windows/reload-v1', 'windows/open',
58
+ 'dialogs/open', 'windows/reload', 'windows/openWeb', 'windows/openWeb-v1'
57
59
  if allowed?(params['url'])
58
60
  @read_only_actions.add([action, params['url']])
59
61
  JsonCrawler::WindowsOpen.new(http, params, action)
@@ -66,7 +68,6 @@ module Glib
66
68
  JsonCrawler::ActionHttp.new(:post, http, params, action)
67
69
  when 'forms/submit-v1', 'forms/submit'
68
70
  forms = @visitor.forms
69
- # raise 'Submit action needs to be inside a form' if forms.size < 1
70
71
  JsonCrawler::FormsSubmit.new(http, forms.last)
71
72
  else
72
73
  unless [
@@ -93,6 +94,16 @@ module Glib
93
94
  @visitor.traverse_multiple views, block
94
95
  end
95
96
 
97
+ def begin_page(spec)
98
+ @page_spec = spec
99
+ @visitor.begin_page spec
100
+ end
101
+
102
+ def end_page(spec)
103
+ @page_spec = nil
104
+ @visitor.end_page spec
105
+ end
106
+
96
107
  def allowed?(url)
97
108
  regex = Regexp.new("#{host}.+(?<!\.pdf)$")
98
109
  regex.match(url)
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
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: 0.14.3
4
+ version: 0.15.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - ''
@@ -153,7 +153,8 @@ files:
153
153
  - app/views/json_ui/garage/forms/dynamic_select_data.json.jbuilder
154
154
  - app/views/json_ui/garage/forms/file_upload.json.jbuilder
155
155
  - app/views/json_ui/garage/forms/floating_submit.json.jbuilder
156
- - app/views/json_ui/garage/forms/full_window_form.json.jbuilder
156
+ - app/views/json_ui/garage/forms/full_page_form.json.jbuilder
157
+ - app/views/json_ui/garage/forms/full_page_form_dialog.json.jbuilder
157
158
  - app/views/json_ui/garage/forms/generic_post.json.jbuilder
158
159
  - app/views/json_ui/garage/forms/index.json.jbuilder
159
160
  - app/views/json_ui/garage/forms/local_request.json.jbuilder
@@ -301,7 +302,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
301
302
  - !ruby/object:Gem::Version
302
303
  version: '0'
303
304
  requirements: []
304
- rubygems_version: 3.1.4
305
+ rubyforge_project:
306
+ rubygems_version: 2.7.6
305
307
  signing_key:
306
308
  specification_version: 4
307
309
  summary: ''
@@ -1,19 +0,0 @@
1
- json.title 'Forms'
2
-
3
- page = json_ui_page json
4
-
5
- render "#{@path_prefix}/nav_menu", json: json, page: page
6
-
7
- # The form will be automatically injected into the window.
8
- #page.template 'full_window_form'
9
-
10
- # TODO: This needs to produce page-level form attributes
11
- page.form url: json_ui_garage_url(path: 'forms/basic_post'), method: 'post', padding: glib_json_padding_body, childViews: ->(form) do
12
- # page.scroll padding: glib_json_padding_body, childViews: ->(form) do
13
- form.fields_text name: 'user[name]', width: 'matchParent', label: 'Name'
14
- form.fields_password name: 'user[password]', width: 'matchParent', label: 'Password'
15
- end
16
-
17
- page.footer padding: glib_json_padding_body, backgroundColor: '#b3bac2', childViews: ->(footer) do
18
- footer.fields_submit text: 'Submit'
19
- end