glib-web 4.10.6 → 4.11.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (78) 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/components.rb +2 -2
  6. data/app/helpers/glib/json_ui/action_builder/logics.rb +0 -1
  7. data/app/helpers/glib/json_ui/action_builder/sheets.rb +0 -0
  8. data/app/helpers/glib/json_ui/action_builder.rb +6 -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/view_builder/fields.rb +1 -0
  12. data/app/helpers/glib/json_ui/view_builder/panels.rb +7 -5
  13. data/app/models/glib/active_storage/attachment.rb +0 -0
  14. data/app/models/glib/active_storage/blob.rb +0 -0
  15. data/app/models/glib/dynamic_text_record.rb +0 -0
  16. data/app/models/glib/text.rb +0 -0
  17. data/app/validators/email_typo_validator.rb +0 -0
  18. data/app/validators/email_validator.rb +0 -0
  19. data/app/validators/url_validator.rb +0 -0
  20. data/app/views/json_ui/garage/actions/dialogs_oauth_post.json.jbuilder +0 -0
  21. data/app/views/json_ui/garage/forms/bulk_edit_post.json.jbuilder +0 -0
  22. data/app/views/json_ui/garage/forms/bulk_edit_post2.json.jbuilder +9 -5
  23. data/app/views/json_ui/garage/forms/dynamic_select_data.json.jbuilder +0 -0
  24. data/app/views/json_ui/garage/forms/generic_post.json.jbuilder +0 -0
  25. data/app/views/json_ui/garage/forms/submission_flow.json.jbuilder +0 -0
  26. data/app/views/json_ui/garage/forms/submission_flow_post.json.jbuilder +0 -0
  27. data/app/views/json_ui/garage/forms/submission_indicator.json.jbuilder +0 -0
  28. data/app/views/json_ui/garage/forms/submission_indicator_post.json.jbuilder +0 -0
  29. data/app/views/json_ui/garage/home/blank.json.jbuilder +0 -0
  30. data/app/views/json_ui/garage/home/slow.json.jbuilder +0 -0
  31. data/app/views/json_ui/garage/lists/autoload_all.json.jbuilder +0 -0
  32. data/app/views/json_ui/garage/lists/autoload_as_needed.json.jbuilder +0 -0
  33. data/app/views/json_ui/garage/lists/chat_ui.json.jbuilder +0 -0
  34. data/app/views/json_ui/garage/lists/fab.json.jbuilder +0 -0
  35. data/app/views/json_ui/garage/notifications/web_socket.json.jbuilder +0 -0
  36. data/app/views/json_ui/garage/pages/custom_style_class.json.jbuilder +0 -0
  37. data/app/views/json_ui/garage/pages/full_width.json.jbuilder +0 -0
  38. data/app/views/json_ui/garage/pages/full_width_height.json.jbuilder +0 -0
  39. data/app/views/json_ui/garage/pages/layout.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/bulk_edit.json.jbuilder +86 -11
  54. data/app/views/json_ui/garage/tables/export_import.json.jbuilder +0 -0
  55. data/app/views/json_ui/garage/tables/index.json.jbuilder +0 -0
  56. data/app/views/json_ui/garage/views/calendar_data.json.jbuilder +0 -0
  57. data/app/views/json_ui/garage/views/map_data.json.jbuilder +0 -0
  58. data/app/views/json_ui/garage/views/multimedia.json.jbuilder +0 -0
  59. data/app/views/layouts/json_ui/no_custom.html.erb +0 -0
  60. data/lib/generators/glib/install_generator.rb +0 -0
  61. data/lib/generators/templates/20191017062519_create_texts.rb +0 -0
  62. data/lib/generators/templates/20191024063257_add_scope_to_texts.rb +0 -0
  63. data/lib/generators/templates/20191112095018_add_lang_to_texts.rb +0 -0
  64. data/lib/generators/templates/20191126071051_create_active_storage_tables.active_storage.rb +0 -0
  65. data/lib/generators/templates/database.yml +0 -0
  66. data/lib/generators/templates/dynamic_text.rb +0 -0
  67. data/lib/glib/dynamic_text/config.rb +0 -0
  68. data/lib/glib/dynamic_text.rb +0 -0
  69. data/lib/glib/json_crawler/action_crawler.rb +0 -0
  70. data/lib/glib/json_crawler/action_crawlers/action_http.rb +0 -0
  71. data/lib/glib/json_crawler/action_crawlers/dialogs_alert.rb +0 -0
  72. data/lib/glib/json_crawler/action_crawlers/menu.rb +0 -0
  73. data/lib/glib/json_crawler/action_crawlers/run_multiple.rb +0 -0
  74. data/lib/glib/json_crawler/action_crawlers/windows_open.rb +0 -0
  75. data/lib/glib/json_crawler/coverage.rb +0 -0
  76. data/lib/glib/value.rb +0 -0
  77. data/lib/glib/version.rb +0 -0
  78. metadata +3 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0711a808828a6946ba4ec082755d8180a8437241b09c775ec674e4c1cb64388b
4
- data.tar.gz: 40b1bda454b973e258b2bf2dd5621515e0f4ef00ce32013f212ccd6603af3c45
3
+ metadata.gz: 3ebaad0db46b2de735aeab4b86abcbd6d436b2c9350d4a4da402f54f7fe6c8ec
4
+ data.tar.gz: 29433f78f6f0fb2b3a21ef52108feb97fdac0bf9af7693b37dde9b17f3b9070c
5
5
  SHA512:
6
- metadata.gz: d2a75a8f46b4acda54a0fdc37feb8fee6fadac5b342ff016412b16565d0cf9c4e7e77d26e4b4640f5a83df105f24f3bda48c4bca644ec80c7c411fc341ac9321
7
- data.tar.gz: 9554b47291f05a584dca44b56bc174986a820567e50e48a14007693818d48b7730101fcf2642c179b620e9bfba01f7a5a5a584b93cf7953a5fe663af1218970e
6
+ metadata.gz: f31a55f1ac2485426a381b933ece050fb967571b9de2255cce345be1a3f0136e45f432132c79118c45f376792aa32cb7b677d4d1594db014515348b0fcafeda5
7
+ data.tar.gz: 3f4f47a8b1566f503d8073f6817c73dde15ef2f70861ba89330781b2f62676da9fdd829e61e9de0fb2f64586b6581032cd4d958d4dd61c204b7c6eb1bc0fd26c
File without changes
File without changes
@@ -1,8 +1,8 @@
1
1
  class Glib::JsonUi::ActionBuilder
2
2
  module Components
3
- class Method < Action
3
+ class Invoke < Action
4
4
  string :name
5
- hash :parameter
5
+ hash :arguments
6
6
  end
7
7
 
8
8
  class Find < Action
@@ -8,7 +8,6 @@ class Glib::JsonUi::ActionBuilder
8
8
  hash :variables
9
9
  action :onSet
10
10
  bool :cacheData
11
- bool :debug
12
11
 
13
12
  def dataBuilder(block)
14
13
  json.data do
File without changes
@@ -17,6 +17,12 @@ module Glib
17
17
 
18
18
  class Action < JsonUiElement
19
19
  string :targetId
20
+ string :paramName
21
+
22
+ # TODO: Rename to fromFieldName or previousFieldName or valueFromFieldName or fieldValueFromName
23
+ string :fieldName
24
+ bool :debug
25
+
20
26
  # def analytics(value)
21
27
  # if value.is_a?(String)
22
28
  # @analyticsEnabled = true
File without changes
File without changes
@@ -201,6 +201,7 @@ class Glib::JsonUi::ViewBuilder
201
201
 
202
202
  panels_builder :accessory, :header, :footer
203
203
  bool :clearable
204
+ bool :csvMode
204
205
 
205
206
  def options(value)
206
207
  @_options = value
@@ -370,18 +370,20 @@ class Glib::JsonUi::ViewBuilder
370
370
  class BulkEdit2 < View
371
371
  hash :import, required: [:submitUrl, :paramName]
372
372
 
373
- string :statusViewIdPrefix
373
+ # string :statusViewIdPrefix
374
374
  array :viewHeaders
375
375
 
376
- action :onLoadRows
376
+ # string :paramNameForFormData
377
+ string :paramNameForRowId
377
378
  action :onCellChange
378
- string :paramNameForFormData
379
- action :onRowSelected
379
+ action :onRowsLoad
380
+ action :onRowsSelect
381
+ action :onRowsSucceed
380
382
  action :onSubmitStart
381
383
  action :onSubmitEnd
382
384
 
383
385
  # Experimental
384
- panels_builder :accessory, :header, :footer
386
+ # panels_builder :accessory, :header, :footer
385
387
 
386
388
  def viewCells(values)
387
389
  json.set! 'viewCells' do
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -1,8 +1,12 @@
1
- sleep 0.1
2
- row_id = params[:user]['rowId']
3
- # status = [:saved, :failed][rand(0..1)]
4
- status = :saved
1
+ sleep 1
2
+ row_id = params[:user]['row_id']
3
+ status = [:succeeded, :failed][rand(0..1)]
4
+ # status = :succeeded
5
+ #status = :failed
5
6
 
6
7
  json_ui_response json do |action|
7
- action.components_method targetId: 'bulkEdit', name: 'updateRow', parameter: { rowId: row_id, status: status }
8
+ action.components_invoke \
9
+ targetId: 'import_table',
10
+ name: 'updateRow',
11
+ arguments: { rowId: row_id, status: status, message: 'Response from server' }
8
12
  end
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -32,19 +32,46 @@ page.scroll childViews: ->(scroll) do
32
32
  # end
33
33
 
34
34
  options = [{ text: 'yes', value: 'yes' }, { text: 'no', value: 'no' }]
35
+ source_options = ['Generators', 'Power Station', 'Solar Panels'].map do |o|
36
+ { text: o, value: o }
37
+ end
38
+
39
+ # { text: 'Solar Panels', value: 'solar_panels' },
40
+ # { text: 'Generators', value: 'generators' },
41
+ # { text: 'Power Station', value: 'power_station' }
42
+
35
43
  scroll.button displayed: false, id: 'submit_top', text: 'submit', onClick: ->(action) do
36
44
  action.forms_submit targetId: 'bulkEdit'
37
45
  end
38
46
  scroll.panels_responsive styleClass: 'overflow-y-auto', width: 'matchParent', height: 500, childViews: ->(wres) do
47
+ wres.panels_horizontal align: 'middle', childViews: ->(horizontal) do
48
+ horizontal.label text: 'Total: '
49
+ horizontal.label id: 'loaded_count', text: '0'
50
+
51
+ horizontal.label text: " #{symbol_horizontal_separator} "
52
+
53
+ horizontal.label text: 'Selected: '
54
+ horizontal.label id: 'selected_count', text: '0'
55
+
56
+ horizontal.label text: " #{symbol_horizontal_separator} "
57
+ horizontal.chip \
58
+ id: 'succeeded_count',
59
+ styleClass: 'success',
60
+ text: 'Uploaded: ',
61
+ displayed: false
62
+ end
63
+
39
64
  scroll.panels_bulkEdit2 \
40
- id: 'bulkEdit',
65
+ id: 'import_table',
41
66
  width: 'matchParent',
42
67
  backgroundColor: '#e2e2e2',
68
+ paramNameForRowId: 'row_id',
43
69
  import: { submitUrl: json_ui_garage_url(path: 'forms/bulk_edit_post2'), paramName: 'user' },
44
70
  viewHeaders: [
45
71
  { text: 'Month', id: 'month', importable: true },
46
72
  { text: 'Electricity usage', id: 'electricity_usage', importable: true },
47
73
  { text: 'Gas usage', id: 'gas_usage', importable: true },
74
+ { text: 'Sources', id: 'sources', importable: true },
48
75
  { text: 'Compliant', id: 'compliant', importable: true }
49
76
  ],
50
77
  viewCells: [
@@ -57,35 +84,83 @@ page.scroll childViews: ->(scroll) do
57
84
  ->(view) do
58
85
  view.fields_number width: 'matchParent'
59
86
  end,
87
+ ->(view) do
88
+ view.fields_select width: 'matchParent', options: source_options, multiple: true
89
+ end,
60
90
  ->(view) do
61
91
  view.fields_select width: 'matchParent', options: options
62
92
  end
63
93
  ],
64
- paramNameForFormData: 'message',
94
+ # paramNameForFormData: 'message',
65
95
  onCellChange: ->(action) do
66
- action.snackbars_alert
67
- end,
68
- onLoadRows: ->(action) do
69
- action.runMultiple childActions: ->(multiple) do
70
- multiple.snackbars_alert message: 'rows loaded'
71
- multiple.components_set targetId: 'submit_top', data: { displayed: true }
72
- multiple.components_set targetId: 'submit_bottom', data: { displayed: true }
73
- end
96
+ action.snackbars_alert debug: true, paramName: 'message', fieldName: 'row'
74
97
  end,
75
98
  onSubmitStart: ->(action) do
76
99
  action.runMultiple childActions: ->(multiple) do
77
100
  multiple.components_set targetId: 'submit_top', data: { disabled: true }
78
101
  multiple.components_set targetId: 'submit_bottom', data: { disabled: true }
102
+ multiple.components_set targetId: 'cancel_button', data: { displayed: true }
79
103
  end
80
104
  end,
81
105
  onSubmitEnd: ->(action) do
82
106
  action.runMultiple childActions: ->(multiple) do
83
107
  multiple.components_set targetId: 'submit_top', data: { disabled: false }
84
108
  multiple.components_set targetId: 'submit_bottom', data: { disabled: false }
109
+ multiple.components_set targetId: 'cancel_button', data: { displayed: false }
110
+ end
111
+ end,
112
+ onRowsLoad: ->(action) do
113
+ action.runMultiple debug: true, fieldName: 'data', childActions: ->(multiple) do
114
+ multiple.logics_set \
115
+ targetId: 'loaded_count',
116
+ debug: true,
117
+ paramName: 'variables',
118
+ fieldName: 'data',
119
+ conditionalData: {
120
+ text: { "count": [{ "var": 'data.loadedRows' }] }
121
+ }
122
+ multiple.components_set targetId: 'submit_top', data: { displayed: true }
123
+ multiple.components_set targetId: 'submit_bottom', data: { displayed: true }
85
124
  end
125
+ end,
126
+ onRowsSelect: ->(action) do
127
+ action.logics_set \
128
+ targetId: 'selected_count',
129
+ debug: true,
130
+ paramName: 'variables',
131
+ fieldName: 'data',
132
+ conditionalData: {
133
+ text: { "count": [{ "var": 'data.selectedRows' }] }
134
+ }
135
+ end,
136
+ onRowsSucceed: ->(action) do
137
+ action.logics_set \
138
+ targetId: 'succeeded_count',
139
+ debug: true,
140
+ paramName: 'variables',
141
+ fieldName: 'data',
142
+ conditionalData: {
143
+ text: {
144
+ "printf": [
145
+ "Uploaded: {0}",
146
+ { "count": [{ "var": 'data.succeededRows' }] }
147
+ ]
148
+ },
149
+ displayed: true
150
+ }
86
151
  end
87
152
  end
88
153
  scroll.button displayed: false, id: 'submit_bottom', text: 'submit', onClick: ->(action) do
89
- action.forms_submit targetId: 'bulkEdit'
154
+ action.forms_submit targetId: 'import_table'
155
+ end
156
+
157
+ scroll.button displayed: false, id: 'cancel_button', text: 'Cancel', onClick: ->(action) do
158
+ action.sheets_select message: 'Are you sure?', buttons: ->(menu) do
159
+ menu.button text: 'Yes, cancel the import', onClick: ->(subaction) do
160
+ action.components_invoke \
161
+ targetId: 'import_table',
162
+ name: 'cancelImport'
163
+ end
164
+ end
90
165
  end
91
166
  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
File without changes
File without changes
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.6
4
+ version: 4.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ''
@@ -403,7 +403,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
403
403
  - !ruby/object:Gem::Version
404
404
  version: '0'
405
405
  requirements: []
406
- rubygems_version: 3.4.6
406
+ rubyforge_project:
407
+ rubygems_version: 2.7.6
407
408
  signing_key:
408
409
  specification_version: 4
409
410
  summary: ''