glib-web 3.16.2 → 3.17.0

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/charts.rb +20 -26
  10. data/app/helpers/glib/json_ui/view_builder/fields.rb +25 -7
  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/generic_post.json.jbuilder +0 -0
  22. data/app/views/json_ui/garage/forms/selects.json.jbuilder +23 -2
  23. data/app/views/json_ui/garage/forms/submission_flow.json.jbuilder +0 -0
  24. data/app/views/json_ui/garage/forms/submission_flow_post.json.jbuilder +0 -0
  25. data/app/views/json_ui/garage/forms/submission_indicator.json.jbuilder +0 -0
  26. data/app/views/json_ui/garage/forms/submission_indicator_post.json.jbuilder +0 -0
  27. data/app/views/json_ui/garage/home/blank.json.jbuilder +0 -0
  28. data/app/views/json_ui/garage/home/slow.json.jbuilder +0 -0
  29. data/app/views/json_ui/garage/lists/autoload_all.json.jbuilder +0 -0
  30. data/app/views/json_ui/garage/lists/autoload_as_needed.json.jbuilder +0 -0
  31. data/app/views/json_ui/garage/lists/chat_ui.json.jbuilder +0 -0
  32. data/app/views/json_ui/garage/lists/fab.json.jbuilder +0 -0
  33. data/app/views/json_ui/garage/notifications/web_socket.json.jbuilder +0 -0
  34. data/app/views/json_ui/garage/pages/custom_style_class.json.jbuilder +0 -0
  35. data/app/views/json_ui/garage/pages/full_width.json.jbuilder +0 -0
  36. data/app/views/json_ui/garage/pages/full_width_height.json.jbuilder +0 -0
  37. data/app/views/json_ui/garage/pages/index.json.jbuilder +0 -0
  38. data/app/views/json_ui/garage/pages/layout.json.jbuilder +0 -0
  39. data/app/views/json_ui/garage/pages/lifecycle_hooks.json.jbuilder +0 -0
  40. data/app/views/json_ui/garage/pages/loading_indicator.json.jbuilder +0 -0
  41. data/app/views/json_ui/garage/pages/nested_scroll.json.jbuilder +0 -0
  42. data/app/views/json_ui/garage/pages/redirect_onload.json.jbuilder +0 -0
  43. data/app/views/json_ui/garage/panels/_styled.json.jbuilder +0 -0
  44. data/app/views/json_ui/garage/panels/card.json.jbuilder +0 -0
  45. data/app/views/json_ui/garage/panels/custom.json.jbuilder +0 -0
  46. data/app/views/json_ui/garage/panels/outlined.json.jbuilder +0 -0
  47. data/app/views/json_ui/garage/services/dynamic_text.json.jbuilder +0 -0
  48. data/app/views/json_ui/garage/services/image.json.jbuilder +0 -0
  49. data/app/views/json_ui/garage/services/index.json.jbuilder +0 -0
  50. data/app/views/json_ui/garage/tables/_autoload_section.json.jbuilder +0 -0
  51. data/app/views/json_ui/garage/tables/autoload_all.json.jbuilder +0 -0
  52. data/app/views/json_ui/garage/tables/autoload_as_needed.json.jbuilder +0 -0
  53. data/app/views/json_ui/garage/tables/export_import.json.jbuilder +0 -0
  54. data/app/views/json_ui/garage/tables/index.json.jbuilder +0 -0
  55. data/app/views/json_ui/garage/views/calendar_data.json.jbuilder +0 -0
  56. data/app/views/json_ui/garage/views/charts.json.jbuilder +43 -42
  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 +2 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6d5b87ed40b6899921ff69c27b36f7a7fdbd5bda372cc66e862fa118e5b3829e
4
- data.tar.gz: d48ca7297c13cb43a969e274bf3090cd72bfed50dda1fa150de961db3cb53dfa
3
+ metadata.gz: f1d722ffb4523a19dec06cb824aabfd33ad049b49e307b5d1d2b56bc8c82ce49
4
+ data.tar.gz: 67a81620f13a428079cef376169c0268aa17adf4c72ebf0f5b3c5c3f58100eff
5
5
  SHA512:
6
- metadata.gz: 93ec58c318c1568c69dcd7007b1cff9effd8a7048e885cf10df17c3065c7ad64d37220d8c30e9a44af01d592664f18d617832da3b88297e779893954f6aa95aa
7
- data.tar.gz: 1aecb33728606c762df28283bfab3b21399748f27b9a709158a13859e8cd147031eee7cdfd71ada6d10f56fe13450f8f1615f175fb1648363fefbc03402dcec9
6
+ metadata.gz: 0a95ba9bd199538e98b0d49d3801057902d3631137475ef1198ded587234a5a5adee025c80c10ea0c5f7b680e3beaa9ebf8e99c932a7ab3bea6634dbd340013b
7
+ data.tar.gz: 76d489f4984445da7168d9a8b33b997f4c75cbf0b820958c9497e7535fa2e18c322730686ea94fa9617dccfbf0bd613fa1b43dcd2e8ab2169c174146fd0cd459
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -34,48 +34,42 @@ class Glib::JsonUi::ViewBuilder
34
34
  end
35
35
  end
36
36
 
37
+ module Attributes
38
+ extend ActiveSupport::Concern
39
+
40
+ included do
41
+ array :colors
42
+ string :prefix
43
+ string :suffix
44
+ int :min
45
+ int :max
46
+ hash :legend
47
+ hash :plugins
48
+ end
49
+ end
50
+
37
51
  class Line < View
38
52
  include Series
39
- array :colors
40
- string :prefix
41
- string :suffix
42
- int :min
43
- int :max
44
- string :legend
45
- # idea for the future
46
- # hash :nextPage
53
+ include Attributes
47
54
  end
48
55
 
49
56
  class Column < View
50
57
  include Series
58
+ include Attributes
51
59
 
52
60
  bool :stacked
53
- array :colors
54
- string :prefix
55
- string :suffix
56
- int :min
57
- int :max
58
- string :legend
59
61
  end
60
62
 
61
63
  class Pie < View
62
64
  include Series
63
- array :colors
64
- string :prefix
65
- string :suffix
66
- int :min
67
- int :max
68
- string :legend
69
-
65
+ include Attributes
66
+ array :dataPoints
70
67
  end
71
68
 
72
69
  class Area < View
73
70
  include Series
74
- array :colors
75
- string :prefix
76
- string :suffix
77
- int :min
78
- int :max
71
+ include Attributes
72
+ array :dataPoints
79
73
  end
80
74
 
81
75
  end
@@ -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,9 @@ 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
- association = form.nested_associations.last
315
- context = association || form
331
+ if @prop && context
332
+ # association = form.nested_associations.last
333
+ # context = association || form
316
334
 
317
335
  @files ||= context.field_value(@prop, collect_ids: false).to_a.map { |file| { name: file.blob&.filename, signed_id: file.signed_id } }
318
336
  end
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -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
@@ -1,3 +1,14 @@
1
+ default_plugins = {
2
+ datalabels: {
3
+ backgroundColor: 'skyblue',
4
+ borderRadius: 4,
5
+ color: 'white',
6
+ font: {
7
+ weight: 'bold'
8
+ },
9
+ padding: 6
10
+ }
11
+ }
1
12
 
2
13
  if params[:data_only].present?
3
14
  json_ui_page json do |page|
@@ -43,7 +54,8 @@ else
43
54
  json.points points.map { |k, v| { x: k, y: v } }
44
55
  end
45
56
  ],
46
- colors: ['#79AC78', '#3085C3'], legend: 'bottom'
57
+ plugins: default_plugins,
58
+ colors: ['#79AC78', '#3085C3'], legend: { display: false }
47
59
 
48
60
  # scroll.spacer height: 20
49
61
  # scroll.h1 text: 'Line chart using remote data'
@@ -79,7 +91,8 @@ else
79
91
  json.points points
80
92
  end
81
93
  ],
82
- colors: ['#b00', '#666', '#E55604'], legend: 'left'
94
+ plugins: default_plugins,
95
+ colors: ['lightgreen', 'whitesmoke', 'skyblue'], legend: { position: 'left' }
83
96
 
84
97
  scroll.h2 text: 'Column chart (Stacked)'
85
98
  scroll.charts_column stacked: true, dataGroups: [
@@ -110,54 +123,42 @@ else
110
123
  }
111
124
  json.points points
112
125
  end
113
- ], legend: 'bottom'
126
+ ], plugins: default_plugins, legend: { position: 'bottom', align: 'start' }
114
127
 
128
+ plugins = default_plugins.deep_dup
129
+ plugins[:datalabels][:formatType] = 'label'
115
130
  scroll.h2 text: 'Pie chart'
116
- scroll.charts_pie dataSeries: [
117
- -> do
118
- json.title 'Straberry'
119
- json.value 25
120
- end,
121
- -> do
122
- json.title 'Banana'
123
- json.value 25
124
- end
125
- ], legend: 'bottom'
131
+ scroll.charts_pie \
132
+ colors: ['#fc5a8d', '#F5E216'],
133
+ plugins: plugins,
134
+ dataPoints: [{ title: 'Strawberry', value: 25 }, { title: 'Banana', value: 75 }], legend: { display: false }
126
135
 
127
136
  scroll.h2 text: 'Donut chart'
128
137
  scroll.charts_pie \
129
138
  styleClasses: ['donut'],
130
- dataSeries: [
131
- -> do
132
- json.title 'Straberry'
133
- json.value 25
134
- end,
135
- -> do
136
- json.title 'Banana'
137
- json.value 25
138
- end
139
- ], legend: 'bottom'
139
+ suffix: '%',
140
+ colors: ['#fc5a8d', '#F5E216'],
141
+ plugins: default_plugins.merge({
142
+ centerLabel: {
143
+ labels: [
144
+ {
145
+ text: 'Fruits',
146
+ font: {
147
+ weigth: 'bold',
148
+ size: 20
149
+ }
150
+ },
151
+ { text: 'You like' }
152
+ ]
153
+ }
154
+ }),
155
+ dataPoints: [{ title: 'Strawberry', value: 25 }, { title: 'Banana', value: 75 }],
156
+ legend: { position: 'right' }
140
157
 
141
158
  scroll.h2 text: 'Area chart'
142
- scroll.charts_area dataSeries: [
143
- -> do
144
- json.title 'Jan'
145
- json.value 25
146
- end,
147
- -> do
148
- json.title 'Feb'
149
- json.value 55
150
- end,
151
- -> do
152
- json.title 'Mar'
153
- json.value 60
154
- end,
155
- -> do
156
- json.title 'June'
157
- json.value 20
158
- end
159
- ],
160
- colors: ['#5B0888']
159
+ scroll.charts_area \
160
+ dataPoints: [{ title: 'Jan', value: 25 }, { title: 'Feb', value: 55 }, { title: 'Mar', value: 60 }, { title: 'Apr', value: 45 }],
161
+ colors: ['#5B0888']
161
162
  end
162
163
  end
163
164
 
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.2
4
+ version: 3.17.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ''
@@ -327,8 +327,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
327
327
  - !ruby/object:Gem::Version
328
328
  version: '0'
329
329
  requirements: []
330
- rubyforge_project:
331
- rubygems_version: 2.7.6
330
+ rubygems_version: 3.4.6
332
331
  signing_key:
333
332
  specification_version: 4
334
333
  summary: ''