glib-web 0.15.4 → 0.17.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (102) 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/sheets.rb +0 -0
  7. data/app/helpers/glib/json_ui/action_builder/snackbars.rb +0 -0
  8. data/app/helpers/glib/json_ui/analytics_helper.rb +0 -0
  9. data/app/helpers/glib/json_ui/generic_builders.rb +0 -0
  10. data/app/helpers/glib/json_ui/table_builders.rb +0 -0
  11. data/app/helpers/glib/json_ui/view_builder/charts.rb +11 -0
  12. data/app/helpers/glib/json_ui/view_builder/fields.rb +1 -1
  13. data/app/helpers/glib/json_ui/view_builder.rb +10 -2
  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/_panels.json.jbuilder +0 -0
  23. data/app/views/json_ui/garage/actions/_reload.json.jbuilder +0 -0
  24. data/app/views/json_ui/garage/actions/_sheets.json.jbuilder +0 -0
  25. data/app/views/json_ui/garage/actions/_snackbars.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/_conditional_banner.json.jbuilder +11 -4
  28. data/app/views/json_ui/garage/forms/_read_more_text.json.jbuilder +13 -6
  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/show_hide.json.jbuilder +32 -34
  35. data/app/views/json_ui/garage/forms/submission_flow.json.jbuilder +0 -0
  36. data/app/views/json_ui/garage/forms/submission_flow_post.json.jbuilder +0 -0
  37. data/app/views/json_ui/garage/forms/submission_indicator.json.jbuilder +0 -0
  38. data/app/views/json_ui/garage/forms/submission_indicator_post.json.jbuilder +0 -0
  39. data/app/views/json_ui/garage/forms/submit_on_change.json.jbuilder +2 -2
  40. data/app/views/json_ui/garage/home/blank.json.jbuilder +0 -0
  41. data/app/views/json_ui/garage/home/slow.json.jbuilder +0 -0
  42. data/app/views/json_ui/garage/lists/autoload_all.json.jbuilder +0 -0
  43. data/app/views/json_ui/garage/lists/autoload_as_needed.json.jbuilder +0 -0
  44. data/app/views/json_ui/garage/lists/chat_ui.json.jbuilder +0 -0
  45. data/app/views/json_ui/garage/lists/fab.json.jbuilder +0 -0
  46. data/app/views/json_ui/garage/notifications/web_socket.json.jbuilder +0 -0
  47. data/app/views/json_ui/garage/pages/flat_centered.json.jbuilder +0 -0
  48. data/app/views/json_ui/garage/pages/full_width.json.jbuilder +0 -0
  49. data/app/views/json_ui/garage/pages/full_width_height.json.jbuilder +0 -0
  50. data/app/views/json_ui/garage/pages/index.json.jbuilder +0 -0
  51. data/app/views/json_ui/garage/pages/layout.json.jbuilder +0 -0
  52. data/app/views/json_ui/garage/pages/lifecycle_hooks.json.jbuilder +0 -0
  53. data/app/views/json_ui/garage/pages/loading_indicator.json.jbuilder +0 -0
  54. data/app/views/json_ui/garage/pages/nested_scroll.json.jbuilder +0 -0
  55. data/app/views/json_ui/garage/panels/_styled.json.jbuilder +0 -0
  56. data/app/views/json_ui/garage/panels/card.json.jbuilder +0 -0
  57. data/app/views/json_ui/garage/panels/custom.json.jbuilder +0 -0
  58. data/app/views/json_ui/garage/panels/outlined.json.jbuilder +0 -0
  59. data/app/views/json_ui/garage/services/dynamic_text.json.jbuilder +0 -0
  60. data/app/views/json_ui/garage/services/image.json.jbuilder +0 -0
  61. data/app/views/json_ui/garage/services/index.json.jbuilder +0 -0
  62. data/app/views/json_ui/garage/tables/_autoload_section.json.jbuilder +0 -0
  63. data/app/views/json_ui/garage/tables/autoload_all.json.jbuilder +0 -0
  64. data/app/views/json_ui/garage/tables/autoload_as_needed.json.jbuilder +0 -0
  65. data/app/views/json_ui/garage/tables/export_import.json.jbuilder +0 -0
  66. data/app/views/json_ui/garage/tables/index.json.jbuilder +0 -0
  67. data/app/views/json_ui/garage/views/calendar_data.json.jbuilder +0 -0
  68. data/app/views/json_ui/garage/views/charts.json.jbuilder +12 -0
  69. data/app/views/json_ui/garage/views/links.json.jbuilder +0 -0
  70. data/app/views/json_ui/garage/views/map_cluster_data.json.jbuilder +0 -0
  71. data/app/views/json_ui/garage/views/map_data.json.jbuilder +0 -0
  72. data/app/views/json_ui/garage/views/multimedia.json.jbuilder +0 -0
  73. data/app/views/json_ui/garage/views/progress.json.jbuilder +5 -0
  74. data/config/routes.rb +0 -0
  75. data/lib/generators/glib/install_generator.rb +0 -0
  76. data/lib/generators/templates/20191017062519_create_texts.rb +0 -0
  77. data/lib/generators/templates/20191024063257_add_scope_to_texts.rb +0 -0
  78. data/lib/generators/templates/20191112095018_add_lang_to_texts.rb +0 -0
  79. data/lib/generators/templates/20191126071051_create_active_storage_tables.active_storage.rb +0 -0
  80. data/lib/generators/templates/database.yml +0 -0
  81. data/lib/generators/templates/dynamic_text.rb +0 -0
  82. data/lib/glib/crypt/utils.rb +0 -0
  83. data/lib/glib/crypt.rb +0 -0
  84. data/lib/glib/dynamic_text/config.rb +0 -0
  85. data/lib/glib/dynamic_text.rb +0 -0
  86. data/lib/glib/engine.rb +0 -0
  87. data/lib/glib/json_crawler/action_crawler.rb +0 -0
  88. data/lib/glib/json_crawler/action_crawlers/action_http.rb +0 -0
  89. data/lib/glib/json_crawler/action_crawlers/forms_submit.rb +0 -0
  90. data/lib/glib/json_crawler/action_crawlers/menu.rb +0 -0
  91. data/lib/glib/json_crawler/action_crawlers/nav_initiate.rb +0 -0
  92. data/lib/glib/json_crawler/action_crawlers/run_multiple.rb +0 -0
  93. data/lib/glib/json_crawler/action_crawlers/windows_open.rb +0 -0
  94. data/lib/glib/json_crawler/coverage.rb +0 -0
  95. data/lib/glib/json_crawler/router.rb +1 -1
  96. data/lib/glib/json_crawler.rb +0 -0
  97. data/lib/glib/mailer_tester.rb +0 -0
  98. data/lib/glib/value.rb +0 -0
  99. data/lib/glib/version.rb +0 -0
  100. data/lib/glib-web.rb +0 -0
  101. data/lib/tasks/db.rake +0 -0
  102. metadata +2 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 99bf3258f6448750d3db9022e35d80e45f67e8b7e60ce5aecccabc7d19906c58
4
- data.tar.gz: 0c51b914c22854ec4632dcc755a0fe55789f9a8ad4d40a4db722ecdd07e2e619
3
+ metadata.gz: a3408746883480d7dab22a76683d03de859c62f766e99b2fac1b1a629e5a7804
4
+ data.tar.gz: 429eca98ab5b70592e209917779e87742821880c53d057bd21f49bfb355a1f7f
5
5
  SHA512:
6
- metadata.gz: a310b5e78a79a69e85b91f56a0f7ed91caf37db79ff655607d890dad1b449613ec885394a418f01db3d535e209bff140de5ff103711b4e4a3bd0806f27701d7c
7
- data.tar.gz: da97a6021872ad5b623ef57d1969e82d3d692fb62cf965cf0bd460174f36a89fa10e974d11ed7dc2888894d5dd432b27845c3986efdb5a796ed88297cb970b95
6
+ metadata.gz: a7333639d20f585a61267eddf04fdf77261d4c8c62355031eb878077f203f2346d50be2b9e1ae009b369edf29407b8960c09c7ae9bce613374a9ee1eb6c60085
7
+ data.tar.gz: b9f37f67f46b83d8fe859458a1e4b97345d4617e730ea102bc849d5ba5808829db730673a77a36ab8bd1f5e1525fe70eadfc9a1ee37e2c54159a06d56579a619
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
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
@@ -4,9 +4,9 @@ class Glib::JsonUi::ViewBuilder
4
4
  class AbstractField < View
5
5
  bool :readOnly
6
6
  hash :validation
7
- # bool :submitOnChange
8
7
  bool :disableDirtyCheck
9
8
  action :onChange
9
+ string :paramNameForFormData
10
10
 
11
11
  def label(label)
12
12
  @label = label
@@ -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
@@ -1,6 +1,11 @@
1
- panel.panels_form width: 'matchParent', childViews: ->(visibility) do
1
+ # display_key = local_assigns[:display_key] || :has_content
2
+ display_key = :has_content
3
+ @__banner_index ||= 0
4
+ toggle_name = "__banner_#{@__banner_index}"
5
+
6
+ panel.form_if_not_exists width: 'matchParent', childViews: ->(visibility) do
2
7
  state = {
3
- has_content: false
8
+ display_key => false
4
9
  }
5
10
  style_classes ||= nil
6
11
  style_class ||= nil
@@ -19,10 +24,12 @@ panel.panels_form width: 'matchParent', childViews: ->(visibility) do
19
24
  showIf: {
20
25
  "==": [
21
26
  {
22
- "var": 'banner'
27
+ "var": toggle_name
23
28
  },
24
29
  'show'
25
30
  ]
26
31
  }
27
- visibility.fields_hidden name: 'banner', value: state[:has_content] ? 'show' : 'hide'
32
+ visibility.fields_hidden name: toggle_name, value: state[display_key] ? 'show' : 'hide'
28
33
  end
34
+
35
+ @__banner_index += 1
@@ -1,14 +1,17 @@
1
1
  if text.length > min_chars
2
+ @__read_more_index ||= 0
3
+
2
4
  panel.form_if_not_exists childViews: ->(form) do
5
+ toggle_name = "__expand_#{@__read_more_index}"
3
6
  form.markdown \
4
7
  text: text.truncate(min_chars),
5
8
  styleClasses: ['line-clamp', "line-clamp-#{max_lines}"],
6
9
  showIf: {
7
10
  "!=": [
8
11
  {
9
- "var": 'expand'
12
+ "var": toggle_name
10
13
  },
11
- 'expand'
14
+ 'true'
12
15
  ]
13
16
  }
14
17
  form.markdown \
@@ -16,21 +19,25 @@ if text.length > min_chars
16
19
  showIf: {
17
20
  "==": [
18
21
  {
19
- "var": 'expand'
22
+ "var": toggle_name
20
23
  },
21
- 'expand'
24
+ 'true'
22
25
  ]
23
26
  }
27
+
28
+ # NOTE: Don't put a valueIf here in an attempt to implement accordions. It won't work due to circular updates, presumably between valueIf and the on/off icons and labels.
24
29
  form.fields_check \
25
30
  width: 'matchParent',
26
31
  offIcon: 'expand_more',
27
32
  onIcon: 'expand_less',
28
33
  label: 'Read more',
29
34
  onLabel: 'Read less',
30
- checkValue: 'expand',
35
+ checkValue: 'true',
31
36
  uncheckValue: nil,
32
- name: 'expand',
37
+ name: toggle_name,
33
38
  disableDirtyCheck: true
39
+
40
+ @__read_more_index += 1
34
41
  end
35
42
  else
36
43
  panel.markdown text: text
@@ -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
@@ -4,7 +4,6 @@ page = json_ui_page json
4
4
  render "#{@path_prefix}/nav_menu", json: json, page: page
5
5
 
6
6
  page.form url: json_ui_garage_url(path: 'forms/generic_post'), method: 'post', padding: glib_json_padding_body, childViews: ->(form) do
7
- # page.scroll childViews: ->(form) do
8
7
  form.h1 text: 'Text'
9
8
  form.fields_password name: 'user[text1]', width: 'matchParent', label: 'Type "show"', value: ''
10
9
  form.label text: 'Typed', showIf: {
@@ -136,7 +135,6 @@ page.form url: json_ui_garage_url(path: 'forms/generic_post'), method: 'post', p
136
135
 
137
136
  form.spacer height: 20
138
137
  form.h1 text: 'Show/hide another field'
139
- form.label text: ''
140
138
  form.spacer height: 10
141
139
  form.fields_check name: 'user[check3]', checkValue: 'on', label: 'Show field'
142
140
  form.spacer height: 10
@@ -151,7 +149,14 @@ page.form url: json_ui_garage_url(path: 'forms/generic_post'), method: 'post', p
151
149
 
152
150
  form.spacer height: 20
153
151
  form.h1 text: 'Show more/less text'
154
- form.label text: ''
152
+ form.spacer height: 10
153
+ render "#{@path_prefix}/forms/read_more_text",
154
+ panel: form,
155
+ min_chars: 300,
156
+ max_lines: 2,
157
+ text: "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum."
158
+
159
+ form.spacer height: 10
155
160
  render "#{@path_prefix}/forms/read_more_text",
156
161
  panel: form,
157
162
  min_chars: 300,
@@ -159,37 +164,30 @@ page.form url: json_ui_garage_url(path: 'forms/generic_post'), method: 'post', p
159
164
  text: "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum."
160
165
 
161
166
  form.spacer height: 20
162
- form.fields_submit text: 'Submit'
163
- form.spacer height: 40
164
- end
167
+ form.h1 text: 'Show/hide conditional banner'
168
+ form.spacer height: 10
169
+ form.label text: 'The following banner does not appear because its menu is empty'
170
+ form.spacer height: 8
171
+
172
+ render "#{@path_prefix}/forms/conditional_banner", panel: form, message: 'Admin menu 1' do |menu, state|
173
+ # This banner will not show because it does not have any content
174
+ # state[:has_content] = false
175
+ end
165
176
 
166
- # panel.panels_form width: 'matchParent', childViews: ->(visibility) do
167
- # state = {
168
- # has_content: false
169
- # }
170
- # style_classes ||= nil
171
- # style_class ||= nil
172
- # padding ||= nil
173
- # id ||= nil
174
-
175
- # visibility.banners_select \
176
- # id: id,
177
- # width: 'matchParent',
178
- # styleClass: style_class || (style_classes ? nil : 'warning'),
179
- # message: message,
180
- # padding: padding,
181
- # buttons: ->(menu) do
182
- # yield(menu, state)
183
- # end,
184
- # showIf: {
185
- # "==": [
186
- # {
187
- # "var": 'banner'
188
- # },
189
- # 'show'
190
- # ]
191
- # }
192
- # visibility.fields_hidden name: 'banner', value: state[:has_content] ? 'show' : 'hide'
193
- # end
177
+ form.spacer height: 10
178
+ form.label text: 'The following banner appears because it has at least one menu item'
179
+ form.spacer height: 8
180
+
181
+ render "#{@path_prefix}/forms/conditional_banner", panel: form, message: 'Admin menu 2' do |menu, state|
182
+ state[:has_content] = true
194
183
 
184
+ menu.button styleClass: 'link', text: 'Add', onClick: ->(action) do
185
+ action.dialogs_alert message: 'Do something'
186
+ end
187
+ end
195
188
 
189
+ form.spacer height: 20
190
+ form.fields_submit text: 'Submit'
191
+
192
+ form.spacer height: 40
193
+ end
@@ -79,12 +79,12 @@ page.scroll childViews: ->(scroll) do
79
79
  end
80
80
 
81
81
  form.spacer height: 20
82
- form.h2 text: 'Text (Asynchronous) -- TODO'
82
+ form.h2 text: 'Text (Asynchronous)'
83
83
  form.fields_text \
84
84
  name: 'user[video_url]',
85
85
  width: 'matchParent',
86
86
  onChange: ->(action) do
87
- action.http_post # TODO
87
+ action.http_post url: json_ui_garage_url(path: 'forms/generic_post')
88
88
  end
89
89
  end
90
90
 
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
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.15.4
4
+ version: 0.17.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ''
@@ -304,8 +304,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
304
304
  - !ruby/object:Gem::Version
305
305
  version: '0'
306
306
  requirements: []
307
- rubyforge_project:
308
- rubygems_version: 2.7.6
307
+ rubygems_version: 3.1.4
309
308
  signing_key:
310
309
  specification_version: 4
311
310
  summary: ''