glib-web 0.16.0 → 0.18.0

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/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/forms_helper.rb +0 -0
  6. data/app/helpers/glib/json_ui/action_builder/http.rb +1 -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 -8
  12. data/app/helpers/glib/json_ui/table_builders.rb +0 -0
  13. data/app/helpers/glib/json_ui/view_builder/charts.rb +11 -0
  14. data/app/helpers/glib/json_ui/view_builder.rb +10 -2
  15. data/app/helpers/glib/urls_helper.rb +0 -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/dynamic_text_record.rb +0 -0
  19. data/app/models/glib/text.rb +0 -0
  20. data/app/validators/email_typo_validator.rb +0 -0
  21. data/app/validators/email_validator.rb +0 -0
  22. data/app/validators/url_validator.rb +0 -0
  23. data/app/views/json_ui/garage/actions/_panels.json.jbuilder +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/_snackbars.json.jbuilder +0 -0
  27. data/app/views/json_ui/garage/actions/dialogs_oauth_post.json.jbuilder +0 -0
  28. data/app/views/json_ui/garage/forms/_partial_update_execute.json.jbuilder +8 -0
  29. data/app/views/json_ui/garage/forms/checkboxes.json.jbuilder +13 -1
  30. data/app/views/json_ui/garage/forms/dynamic_group.json.jbuilder +0 -0
  31. data/app/views/json_ui/garage/forms/dynamic_select_data.json.jbuilder +0 -0
  32. data/app/views/json_ui/garage/forms/floating_submit.json.jbuilder +0 -0
  33. data/app/views/json_ui/garage/forms/generic_post.json.jbuilder +0 -0
  34. data/app/views/json_ui/garage/forms/index.json.jbuilder +3 -1
  35. data/app/views/json_ui/garage/forms/page_update_on_response.json.jbuilder +2 -3
  36. data/app/views/json_ui/garage/forms/partial_update.json.jbuilder +51 -0
  37. data/app/views/json_ui/garage/forms/partial_update_response.json.jbuilder +3 -0
  38. data/app/views/json_ui/garage/forms/submission_flow.json.jbuilder +0 -0
  39. data/app/views/json_ui/garage/forms/submission_flow_post.json.jbuilder +0 -0
  40. data/app/views/json_ui/garage/forms/submission_indicator.json.jbuilder +0 -0
  41. data/app/views/json_ui/garage/forms/submission_indicator_post.json.jbuilder +0 -0
  42. data/app/views/json_ui/garage/home/blank.json.jbuilder +0 -0
  43. data/app/views/json_ui/garage/home/slow.json.jbuilder +0 -0
  44. data/app/views/json_ui/garage/lists/autoload_all.json.jbuilder +0 -0
  45. data/app/views/json_ui/garage/lists/autoload_as_needed.json.jbuilder +0 -0
  46. data/app/views/json_ui/garage/lists/chat_ui.json.jbuilder +0 -0
  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/charts.json.jbuilder +12 -0
  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/app/views/json_ui/garage/views/progress.json.jbuilder +5 -0
  76. data/config/routes.rb +0 -0
  77. data/lib/generators/glib/install_generator.rb +0 -0
  78. data/lib/generators/templates/20191017062519_create_texts.rb +0 -0
  79. data/lib/generators/templates/20191024063257_add_scope_to_texts.rb +0 -0
  80. data/lib/generators/templates/20191112095018_add_lang_to_texts.rb +0 -0
  81. data/lib/generators/templates/20191126071051_create_active_storage_tables.active_storage.rb +0 -0
  82. data/lib/generators/templates/database.yml +0 -0
  83. data/lib/generators/templates/dynamic_text.rb +0 -0
  84. data/lib/glib/crypt/utils.rb +0 -0
  85. data/lib/glib/crypt.rb +0 -0
  86. data/lib/glib/dynamic_text/config.rb +0 -0
  87. data/lib/glib/dynamic_text.rb +0 -0
  88. data/lib/glib/engine.rb +0 -0
  89. data/lib/glib/json_crawler/action_crawler.rb +0 -0
  90. data/lib/glib/json_crawler/action_crawlers/action_http.rb +0 -0
  91. data/lib/glib/json_crawler/action_crawlers/forms_submit.rb +0 -0
  92. data/lib/glib/json_crawler/action_crawlers/menu.rb +0 -0
  93. data/lib/glib/json_crawler/action_crawlers/nav_initiate.rb +1 -0
  94. data/lib/glib/json_crawler/action_crawlers/run_multiple.rb +0 -0
  95. data/lib/glib/json_crawler/action_crawlers/windows_open.rb +0 -0
  96. data/lib/glib/json_crawler/coverage.rb +0 -0
  97. data/lib/glib/json_crawler/router.rb +1 -1
  98. data/lib/glib/json_crawler.rb +0 -0
  99. data/lib/glib/mailer_tester.rb +0 -0
  100. data/lib/glib/value.rb +0 -0
  101. data/lib/glib/version.rb +0 -0
  102. data/lib/glib-web.rb +0 -0
  103. data/lib/tasks/db.rake +0 -0
  104. metadata +5 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 35210713e1cd16fb62b922a7b78f6c045a49d3eaa14e4a4adeb9630771c38059
4
- data.tar.gz: a923627989ea43af99a03ad68ffb7f7784837eb4a4b3053304122eca5a8d1eac
3
+ metadata.gz: 7ea3b32fee4311cabc939b7d63eab32160af8cf49d198e545d7e0788e0ab6b0d
4
+ data.tar.gz: f140508641634224a36c4d2d16faab221c457457bb9f3c5d43a81217ff491758
5
5
  SHA512:
6
- metadata.gz: d57258dec4e72d2301cb8489139900a2e03e5177c073537db94cffa8dd9ef7dd69fba94434ee469f1762ade2845772eabdb2e89f1aa4cf8c9230c6cdb46087fe
7
- data.tar.gz: d4e9622c9c1ad29f65b8b3d7505633845ffb003e910b498c4676c2ddf6cb9c14c9ebd8057325b0b031c2c7c0897e6ffea0c1ee8442fc0209ba2c671539dd891e
6
+ metadata.gz: d030ad0dd5d45d4a2cbb588643704b3584065406c10b3de2cf1b98738550bf45fcc69fb3856af44085e0032e2b5b283af1256fc0f8f969d6057aff735f2c3f73
7
+ data.tar.gz: 175f050a7acca85506161613f19aa41933334e5a8a1bf001029d98c3a33ad02682cadfa3a6f650bb2dcf06c87ddce3828b0779d7b05e12eb616564da87407b9f
File without changes
File without changes
File without changes
@@ -23,6 +23,7 @@ class Glib::JsonUi::ActionBuilder
23
23
  end
24
24
 
25
25
  class Get < AbstractHttp
26
+ string :historyUrl
26
27
  end
27
28
 
28
29
  class Post < AbstractHttp
File without changes
File without changes
File without changes
File without changes
@@ -64,7 +64,7 @@ module Glib
64
64
  end
65
65
 
66
66
  class Page
67
- attr_reader :json, :context, :view_builder, :action_builder, :menu_builder
67
+ attr_reader :json, :context, :view_builder, :sview_builder, :action_builder, :menu_builder
68
68
  attr_reader :list_section_builder, :table_section_builder, :drawer_content_builder
69
69
 
70
70
  # See Panels::Form
@@ -75,6 +75,7 @@ module Glib
75
75
  @context = context
76
76
 
77
77
  @view_builder = ViewBuilder.new(json, self, true)
78
+ @sview_builder = ViewBuilder.new(json, self, false)
78
79
  @action_builder = ActionBuilder.new(json, self, false)
79
80
  @menu_builder = MenuBuilder.new(json, self)
80
81
 
@@ -112,6 +113,9 @@ module Glib
112
113
  json.set! name, value
113
114
  end
114
115
  end
116
+ if options[:custom]
117
+ json.set!(:custom) { options[:custom].call(sview_builder) }
118
+ end
115
119
  options[:content]&.call drawer_content_builder
116
120
  end
117
121
  end
@@ -175,7 +179,7 @@ module Glib
175
179
 
176
180
  def form(options = {})
177
181
  form = Glib::JsonUi::ViewBuilder::Panels::Form.new(json, self)
178
- form.childViews(->(view_builder) {})
182
+ form.childViews(->(view_builder) { })
179
183
  panel_options = options.slice!(:url, :method, :local, :onSubmit, :paramNameForFormData, :model)
180
184
 
181
185
  json.fullPageForm do
@@ -211,18 +215,18 @@ module Glib
211
215
  raise "Invalid properties: #{options.keys}" if options.size > 0
212
216
  end
213
217
 
214
- # def onLoad(options = {})
215
- # json.onLoad do
216
- # yield @action_builder
217
- # end
218
- # end
219
-
220
218
  def on(options = {})
221
219
  if (on_load = options[:load])
222
220
  json.onLoad do
223
221
  on_load.call @action_builder
224
222
  end
225
223
  end
224
+
225
+ if (on_refocus = options[:refocus])
226
+ json.onRefocus do
227
+ on_refocus.call @action_builder
228
+ end
229
+ end
226
230
  end
227
231
  end
228
232
  end
File without changes
@@ -43,7 +43,18 @@ class Glib::JsonUi::ViewBuilder
43
43
  end
44
44
  end
45
45
  end
46
+ end
46
47
 
48
+ class Pie < View
49
+ def dataSeries(blocks)
50
+ json.dataSeries do
51
+ blocks.each do |block|
52
+ json.child! do
53
+ block.call
54
+ end
55
+ end
56
+ end
57
+ end
47
58
  end
48
59
  end
49
60
  end
@@ -25,9 +25,9 @@ module Glib
25
25
 
26
26
  def form_if_not_exists(*args)
27
27
  if page.current_form
28
- panels_responsive *args
28
+ panels_responsive(*args)
29
29
  else
30
- panels_form *args
30
+ panels_form(*args)
31
31
  end
32
32
  end
33
33
 
@@ -277,6 +277,14 @@ module Glib
277
277
  bool :reversed
278
278
  end
279
279
 
280
+ class ProgressCircle < View
281
+ int :rotate # from 0 to 360
282
+ int :size
283
+ int :value # from 0 to 100
284
+ color :color
285
+ string :text
286
+ end
287
+
280
288
  class ShareButton < View
281
289
  string :network, required: true
282
290
  string :url, required: true
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,8 @@
1
+ name = params[:name]
2
+ action.components_update targetId: 'greeting', views: ->(update) do
3
+ update.panels_vertical childViews: ->(vertical) do
4
+ vertical.label text: "Hello #{name},"
5
+ vertical.spacer height: 8
6
+ vertical.label text: 'Nice to meet you'
7
+ end
8
+ end
@@ -15,11 +15,23 @@ page.scroll childViews: ->(scroll) do
15
15
  name: 'user[skills][]',
16
16
  uncheckValue: 1,
17
17
  childViews: ->(group) do
18
- group.fields_check checkValue: 2, label: 'Game Development'
18
+ group.fields_check checkValue: 2, label: 'Game Development (readOnly)', readOnly: true
19
19
  group.fields_check checkValue: 3, label: 'Web Development'
20
20
  group.fields_check checkValue: 4, label: 'Mobile Development'
21
21
  end
22
22
 
23
+ form.spacer height: 20
24
+ form.h2 text: 'Check Group (readOnly)'
25
+ form.fields_checkGroup \
26
+ name: 'user[skills2][]',
27
+ readOnly: true,
28
+ uncheckValue: 1,
29
+ childViews: ->(group) do
30
+ group.fields_check checkValue: 2, label: 'Cooking'
31
+ group.fields_check checkValue: 3, label: 'Singing'
32
+ group.fields_check checkValue: 4, label: 'Photography'
33
+ end
34
+
23
35
  form.spacer height: 20
24
36
  form.button text: 'Submit', onClick: ->(action) { action.forms_submit }
25
37
  end
@@ -28,7 +28,9 @@ page.list sections: [
28
28
  template.thumbnail title: 'Dirty Prompt', onClick: ->(action) do
29
29
  action.windows_open url: json_ui_garage_url(path: 'forms/dirty_prompt')
30
30
  end
31
-
31
+ template.thumbnail title: 'Partial Update', onClick: ->(action) do
32
+ action.windows_open url: json_ui_garage_url(path: 'forms/partial_update')
33
+ end
32
34
  end
33
35
  end, ->(section) do
34
36
  section.header padding: glib_json_padding_list, childViews: ->(header) do
@@ -5,11 +5,10 @@ data = params[:user] || {}
5
5
  page = json_ui_page json
6
6
  render "#{@path_prefix}/nav_menu", json: json, page: page
7
7
 
8
- # page.form url: json_ui_garage_url(path: 'forms/get_request'), method: 'get', padding: glib_json_padding_body, childViews: ->(form) do
9
8
  page.scroll childViews: ->(scroll) do
10
9
  scroll.panels_form \
11
10
  width: 'matchParent',
12
- url: json_ui_garage_url(path: 'forms/get_request'),
11
+ url: json_ui_garage_url(path: 'forms/page_update_on_response'),
13
12
  method: 'get',
14
13
  padding: glib_json_padding_body,
15
14
  childViews: ->(form) do
@@ -34,7 +33,7 @@ page.scroll childViews: ->(scroll) do
34
33
 
35
34
  scroll.panels_form \
36
35
  width: 'matchParent',
37
- url: json_ui_garage_url(path: 'forms/get_request'),
36
+ url: json_ui_garage_url(path: 'forms/page_update_on_response'),
38
37
  method: 'post',
39
38
  padding: glib_json_padding_body,
40
39
  childViews: ->(form) do
@@ -0,0 +1,51 @@
1
+ json.title 'Forms'
2
+
3
+ page = json_ui_page json
4
+ render "#{@path_prefix}/nav_menu", json: json, page: page
5
+
6
+ page.scroll childViews: ->(scroll) do
7
+ scroll.panels_vertical padding: glib_json_padding_body, childViews: ->(vertical) do
8
+ scroll.h2 text: 'Partial update'
9
+ scroll.spacer height: 8
10
+ scroll.label text: 'The content below will be updated. This is a more efficient alternative to windows_reload.'
11
+ scroll.spacer height: 8
12
+ scroll.label text: 'The updated content should be committed to the page history as the user navigates back and forward.'
13
+ scroll.spacer height: 18
14
+ scroll.panels_vertical id: 'greeting', childViews: ->(inner) do
15
+ inner.label text: 'Hello'
16
+ end
17
+ end
18
+
19
+ scroll.spacer height: 18
20
+ scroll.hr width: 'matchParent'
21
+
22
+ scroll.panels_form url: json_ui_garage_url(path: 'forms/partial_update_response'), method: 'post', padding: glib_json_padding_body, childViews: ->(form) do
23
+ scroll.h2 text: 'Update via POST request'
24
+ scroll.spacer height: 8
25
+ scroll.fields_text name: 'name', width: 'matchParent', label: 'Name', value: 'Jane'
26
+ scroll.spacer height: 8
27
+ scroll.fields_submit text: 'Submit'
28
+ end
29
+
30
+ scroll.spacer height: 18
31
+ scroll.hr width: 'matchParent'
32
+
33
+ scroll.panels_vertical padding: glib_json_padding_body, childViews: ->(vertical) do
34
+ vertical.h2 text: 'Update via GET request'
35
+
36
+ vertical.spacer height: 8
37
+ vertical.button text: 'Update', onClick: ->(action) do
38
+ action.http_get url: json_ui_garage_url(path: 'forms/partial_update_response'), formData: { name: 'John' }, historyUrl: json_ui_garage_url(path: 'forms/partial_update', name: 'John')
39
+ end
40
+ vertical.spacer height: 18
41
+ end
42
+
43
+ end
44
+
45
+ if params[:name].present?
46
+ page.on load: ->(action) do
47
+ render "#{@path_prefix}/forms/partial_update_execute", action: action
48
+ end, refocus: ->(action) do
49
+ render "#{@path_prefix}/forms/partial_update_execute", action: action
50
+ end
51
+ end
@@ -0,0 +1,3 @@
1
+ json_ui_response_with_view json do |action|
2
+ render "#{@path_prefix}/forms/partial_update_execute", action: action
3
+ end
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
@@ -119,6 +119,18 @@ else
119
119
  json.points points
120
120
  end
121
121
  ]
122
+
123
+ scroll.h2 text: 'Pie chart'
124
+ scroll.charts_pie dataSeries: [
125
+ -> do
126
+ json.title 'Straberry'
127
+ json.value 25
128
+ end,
129
+ -> do
130
+ json.title 'Banana'
131
+ json.value 25
132
+ end
133
+ ]
122
134
  end
123
135
  end
124
136
 
File without changes
@@ -28,4 +28,9 @@ page.scroll padding: glib_json_padding_body, childViews: ->(scroll) do
28
28
  scroll.spacer height: 6
29
29
  scroll.progressBar value: 0.1, reversed: true
30
30
  scroll.spacer height: 20
31
+
32
+
33
+ scroll.h2 text: 'Progress circle'
34
+ scroll.spacer height: 6
35
+ scroll.progressCircle size: 150, value: 35, text: '35%', width: 25, color: '#272551'
31
36
  end
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
@@ -8,6 +8,7 @@ module Glib
8
8
  if (json = (@http.get args['url'], action, args.except('url'))) && (left_drawer = json['leftDrawer'])
9
9
  crawl left_drawer['header']&.[]('childViews')
10
10
  crawl left_drawer['rows']
11
+ crawl left_drawer['custom']&.[]('childViews')
11
12
  end
12
13
 
13
14
  if (on_load = (args.fetch('onLoad', nil)))
File without changes
@@ -48,7 +48,7 @@ module Glib
48
48
  end
49
49
 
50
50
  def process_action(http, spec)
51
- action = spec['action']
51
+ action = spec&.fetch('action')
52
52
  params = spec
53
53
 
54
54
  if action.present?
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.16.0
4
+ version: 0.18.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ''
@@ -144,6 +144,7 @@ files:
144
144
  - app/views/json_ui/garage/actions/index.json.jbuilder
145
145
  - app/views/json_ui/garage/forms/_alert_post_data.json.jbuilder
146
146
  - app/views/json_ui/garage/forms/_conditional_banner.json.jbuilder
147
+ - app/views/json_ui/garage/forms/_partial_update_execute.json.jbuilder
147
148
  - app/views/json_ui/garage/forms/_read_more_text.json.jbuilder
148
149
  - app/views/json_ui/garage/forms/basic.json.jbuilder
149
150
  - app/views/json_ui/garage/forms/basic_post.json.jbuilder
@@ -164,6 +165,8 @@ files:
164
165
  - app/views/json_ui/garage/forms/online_participant1.json.jbuilder
165
166
  - app/views/json_ui/garage/forms/online_participant2.json.jbuilder
166
167
  - app/views/json_ui/garage/forms/page_update_on_response.json.jbuilder
168
+ - app/views/json_ui/garage/forms/partial_update.json.jbuilder
169
+ - app/views/json_ui/garage/forms/partial_update_response.json.jbuilder
167
170
  - app/views/json_ui/garage/forms/payments.json.jbuilder
168
171
  - app/views/json_ui/garage/forms/pickers.json.jbuilder
169
172
  - app/views/json_ui/garage/forms/ratings.json.jbuilder
@@ -304,8 +307,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
304
307
  - !ruby/object:Gem::Version
305
308
  version: '0'
306
309
  requirements: []
307
- rubyforge_project:
308
- rubygems_version: 2.7.6
310
+ rubygems_version: 3.1.4
309
311
  signing_key:
310
312
  specification_version: 4
311
313
  summary: ''