glib-web 4.8.2 → 4.10.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/controllers/concerns/glib/json/traversal.rb +4 -2
  4. data/app/controllers/glib/errors_controller.rb +7 -0
  5. data/app/helpers/glib/app_feature_support_helper.rb +0 -0
  6. data/app/helpers/glib/dynamic_texts_helper.rb +0 -0
  7. data/app/helpers/glib/json_ui/abstract_builder.rb +1 -1
  8. data/app/helpers/glib/json_ui/action_builder/sheets.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/view_builder/panels.rb +27 -22
  12. data/app/models/glib/active_storage/attachment.rb +0 -0
  13. data/app/models/glib/active_storage/blob.rb +0 -0
  14. data/app/models/glib/dynamic_text_record.rb +0 -0
  15. data/app/models/glib/text.rb +0 -0
  16. data/app/validators/email_typo_validator.rb +0 -0
  17. data/app/validators/email_validator.rb +0 -0
  18. data/app/validators/url_validator.rb +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/_partial_update_execute.json.jbuilder +1 -1
  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 +12 -13
  23. data/app/views/json_ui/garage/forms/checkboxes.json.jbuilder +3 -1
  24. data/app/views/json_ui/garage/forms/dynamic_select_data.json.jbuilder +0 -0
  25. data/app/views/json_ui/garage/forms/generic_post.json.jbuilder +0 -0
  26. data/app/views/json_ui/garage/forms/partial_update.json.jbuilder +3 -0
  27. data/app/views/json_ui/garage/forms/partial_update_response.json.jbuilder +4 -0
  28. data/app/views/json_ui/garage/forms/selects.json.jbuilder +21 -0
  29. data/app/views/json_ui/garage/forms/submission_flow.json.jbuilder +0 -0
  30. data/app/views/json_ui/garage/forms/submission_flow_post.json.jbuilder +0 -0
  31. data/app/views/json_ui/garage/forms/submission_indicator.json.jbuilder +0 -0
  32. data/app/views/json_ui/garage/forms/submission_indicator_post.json.jbuilder +0 -0
  33. data/app/views/json_ui/garage/forms/update_options.json.jbuilder +13 -0
  34. data/app/views/json_ui/garage/home/blank.json.jbuilder +0 -0
  35. data/app/views/json_ui/garage/home/slow.json.jbuilder +0 -0
  36. data/app/views/json_ui/garage/lists/autoload_all.json.jbuilder +0 -0
  37. data/app/views/json_ui/garage/lists/autoload_as_needed.json.jbuilder +0 -0
  38. data/app/views/json_ui/garage/lists/chat_ui.json.jbuilder +0 -0
  39. data/app/views/json_ui/garage/lists/fab.json.jbuilder +0 -0
  40. data/app/views/json_ui/garage/notifications/web_socket.json.jbuilder +0 -0
  41. data/app/views/json_ui/garage/pages/custom_style_class.json.jbuilder +0 -0
  42. data/app/views/json_ui/garage/pages/full_width.json.jbuilder +0 -0
  43. data/app/views/json_ui/garage/pages/full_width_height.json.jbuilder +0 -0
  44. data/app/views/json_ui/garage/pages/layout.json.jbuilder +0 -0
  45. data/app/views/json_ui/garage/pages/loading_indicator.json.jbuilder +0 -0
  46. data/app/views/json_ui/garage/pages/nested_scroll.json.jbuilder +0 -0
  47. data/app/views/json_ui/garage/pages/redirect_onload.json.jbuilder +0 -0
  48. data/app/views/json_ui/garage/panels/_styled.json.jbuilder +0 -0
  49. data/app/views/json_ui/garage/panels/card.json.jbuilder +0 -0
  50. data/app/views/json_ui/garage/panels/custom.json.jbuilder +0 -0
  51. data/app/views/json_ui/garage/panels/outlined.json.jbuilder +0 -0
  52. data/app/views/json_ui/garage/services/dynamic_text.json.jbuilder +0 -0
  53. data/app/views/json_ui/garage/services/image.json.jbuilder +0 -0
  54. data/app/views/json_ui/garage/services/index.json.jbuilder +0 -0
  55. data/app/views/json_ui/garage/tables/_autoload_section.json.jbuilder +0 -0
  56. data/app/views/json_ui/garage/tables/autoload_all.json.jbuilder +0 -0
  57. data/app/views/json_ui/garage/tables/autoload_as_needed.json.jbuilder +0 -0
  58. data/app/views/json_ui/garage/tables/bulk_edit.json.jbuilder +4 -8
  59. data/app/views/json_ui/garage/tables/export_import.json.jbuilder +0 -0
  60. data/app/views/json_ui/garage/tables/index.json.jbuilder +0 -0
  61. data/app/views/json_ui/garage/views/calendar_data.json.jbuilder +0 -0
  62. data/app/views/json_ui/garage/views/controls.json.jbuilder +1 -1
  63. data/app/views/json_ui/garage/views/map_data.json.jbuilder +0 -0
  64. data/app/views/json_ui/garage/views/multimedia.json.jbuilder +0 -0
  65. data/app/views/layouts/json_ui/no_custom.html.erb +0 -0
  66. data/config/routes.rb +1 -0
  67. data/lib/generators/glib/install_generator.rb +0 -0
  68. data/lib/generators/templates/20191017062519_create_texts.rb +0 -0
  69. data/lib/generators/templates/20191024063257_add_scope_to_texts.rb +0 -0
  70. data/lib/generators/templates/20191112095018_add_lang_to_texts.rb +0 -0
  71. data/lib/generators/templates/20191126071051_create_active_storage_tables.active_storage.rb +0 -0
  72. data/lib/generators/templates/database.yml +0 -0
  73. data/lib/generators/templates/dynamic_text.rb +0 -0
  74. data/lib/glib/dynamic_text/config.rb +0 -0
  75. data/lib/glib/dynamic_text.rb +0 -0
  76. data/lib/glib/json_crawler/action_crawler.rb +0 -0
  77. data/lib/glib/json_crawler/action_crawlers/action_http.rb +0 -0
  78. data/lib/glib/json_crawler/action_crawlers/dialogs_alert.rb +0 -0
  79. data/lib/glib/json_crawler/action_crawlers/menu.rb +0 -0
  80. data/lib/glib/json_crawler/action_crawlers/run_multiple.rb +0 -0
  81. data/lib/glib/json_crawler/action_crawlers/windows_open.rb +0 -0
  82. data/lib/glib/json_crawler/coverage.rb +0 -0
  83. data/lib/glib/value.rb +0 -0
  84. data/lib/glib/version.rb +0 -0
  85. metadata +4 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bd7cc62da4019492821f41a143535746725e97014c265ee5d887271bc8350f92
4
- data.tar.gz: 6cb94c5b31c3ee5a21f3bb7de0dadf622144a4986a68e82820103d9194145973
3
+ metadata.gz: bfd1804082f7f14167a579c42e2d1bde31ad7dbd928bc764ca3de0ba0259ad99
4
+ data.tar.gz: 1cde932d484baa31d4074ce52bdf5d955c51fc70008016b8bbcb6ead85746107
5
5
  SHA512:
6
- metadata.gz: 404991efb9cc61da56f2c886beeeb5a4779e0731dc03dcd30d70d143568e2cc0934dd2a9999b566f71a3fe30f76e17e323b210735606c5627c28f4db8a7105b3
7
- data.tar.gz: b50e1fc04dab26be8c9bed1ac410cac570b556146fde3397987aaab6c09bd1283169cec978ebb317c2cd2517c223c7d3d81227e6e99e3508e80c15b471b1e695
6
+ metadata.gz: 73d15de9c4abe80f6148b67b328ac4c4ece94231900a62c3fcddabd06db453efb462ef296659dfdd8f36674e353815c58dd4a4d337ab15f07385eaa96e2a09e0
7
+ data.tar.gz: aea3aba2adb595aa2eaaef5275b2bf6b8e1b04731b910678c651d1f170ae1e2127035735955c30bf4d8e7238491fabdb236f9f9b6531239a77f639c799460599
@@ -99,11 +99,13 @@ module Glib::Json::Traversal
99
99
  end
100
100
 
101
101
  def current_deferred_actions
102
- @deferred_actions.last
102
+ # Add "|| []" because it broke on hz
103
+ @deferred_actions.last || []
103
104
  end
104
105
 
105
106
  def current_component_registry
106
- @component_registries.last
107
+ # Add "|| {}" because it broke on hz
108
+ @component_registries.last || {}
107
109
  end
108
110
 
109
111
  def defer_action(action_crawler, target_id)
@@ -0,0 +1,7 @@
1
+ module Glib
2
+ class ErrorsController < ::ActionController::Base
3
+ def create
4
+ Rollbar.error(params[:stack], params[:message])
5
+ end
6
+ end
7
+ end
File without changes
File without changes
@@ -314,7 +314,7 @@ module Glib
314
314
  array arrayName
315
315
 
316
316
  define_method(singletonName) do |value|
317
- json.set! arrayName, [value]
317
+ json.set! arrayName, value.to_s.split(' ').compact_blank
318
318
  end
319
319
  end
320
320
 
File without changes
File without changes
File without changes
@@ -326,36 +326,18 @@ class Glib::JsonUi::ViewBuilder
326
326
  end
327
327
  end
328
328
 
329
- class BulkEdit2 < View
329
+ class Table2 < View
330
330
  attr_reader :template
331
331
 
332
- hash :export, required: [:label, :fileName]
333
- hash :import, required: [:submitUrl, :paramName]
334
-
335
- action :onLoadRows
336
- action :onCellChange
337
-
338
- string :paramNameForFormData
339
-
340
- array :viewHeaders
341
- action :onRowSelected
332
+ hash :nextPage
333
+ action :onScrollToTop
334
+ action :onScrollToBottom
342
335
 
343
336
  def initialize(json, page)
344
337
  super
345
338
  @template = Glib::JsonUi::TableBuilders::Template.new(json, self)
346
339
  end
347
340
 
348
- # Experimental
349
- panels_builder :accessory, :header, :footer
350
-
351
- def viewCells(values)
352
- json.set! 'viewCells' do
353
- values.each do |value|
354
- value.call(page.view_builder)
355
- end
356
- end
357
- end
358
-
359
341
  def header(options = {})
360
342
  json.header do
361
343
  json.backgroundColor options.delete(:backgroundColor)
@@ -383,6 +365,29 @@ class Glib::JsonUi::ViewBuilder
383
365
 
384
366
  raise "Invalid properties: #{options.keys}" if options.size > 0
385
367
  end
368
+ end
369
+
370
+ class BulkEdit2 < View
371
+ hash :import, required: [:submitUrl, :paramName]
372
+
373
+ string :statusViewIdPrefix
374
+ array :viewHeaders
375
+
376
+ action :onLoadRows
377
+ action :onCellChange
378
+ string :paramNameForFormData
379
+ action :onRowSelected
380
+
381
+ # Experimental
382
+ panels_builder :accessory, :header, :footer
383
+
384
+ def viewCells(values)
385
+ json.set! 'viewCells' do
386
+ values.each do |value|
387
+ value.call(page.view_builder)
388
+ end
389
+ end
390
+ end
386
391
 
387
392
  def dataRows(value)
388
393
  json.dataRows value
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -1,5 +1,5 @@
1
1
  name = params[:name]
2
- action.components_replace targetId: 'greeting', views: ->(update) do
2
+ action.components_replace targetId: 'greeting', newView: ->(update) do
3
3
  update.panels_vertical childViews: ->(vertical) do
4
4
  name = params[:name]
5
5
  vertical.fields_hidden name: 'name', value: name
@@ -1,16 +1,15 @@
1
+ sleep 0.1
2
+ status_cell = params[:user]['statusCompId']
1
3
  json_ui_response json do |action|
2
- action.runMultiple childActions: ->(multiple) do
3
- # render "#{@path_prefix}/forms/alert_post_data", action: multiple
4
-
5
- status_cell = params[:user]['columns'][0]['compId']
6
-
7
- multiple.components_set \
8
- targetId: status_cell,
9
- data: {
10
- styleClasses: ['success'],
11
- material: {
12
- name: 'verified'
13
- }
4
+ action.components_set \
5
+ targetId: status_cell,
6
+ data: {
7
+ styleClasses: ['success'],
8
+ material: {
9
+ name: 'verified'
10
+ },
11
+ tooltip: {
12
+ text: 'Saved'
14
13
  }
15
- end
14
+ }
16
15
  end
@@ -35,7 +35,9 @@ page.scroll childViews: ->(scroll) do
35
35
  form.spacer height: 20
36
36
  form.h2 text: 'Check without group'
37
37
  form.spacer height: 4
38
- form.fields_check name: 'user[driver]', label: 'Do you have driver license?'
38
+ form.fields_check name: 'user[choice][]', label: 'Choice 1', checkValue: 'choice_1'
39
+ form.fields_check name: 'user[choice][]', label: 'Choice 2', checkValue: 'choice_2'
40
+
39
41
 
40
42
  form.spacer height: 20
41
43
  form.button text: 'Submit', onClick: ->(action) { action.forms_submit }
@@ -38,6 +38,9 @@ page.scroll childViews: ->(scroll) do
38
38
  vertical.button text: 'Update', onClick: ->(action) do
39
39
  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')
40
40
  end
41
+ vertical.button text: 'Update with retry', onClick: ->(action) do
42
+ action.http_get url: json_ui_garage_url(path: 'forms/partial_update_response', error: true)
43
+ end
41
44
  vertical.spacer height: 18
42
45
  end
43
46
 
@@ -1,3 +1,7 @@
1
+ if params[:error].present?
2
+ abort 'Sorry, something went wrong.'
3
+ end
4
+
1
5
  json_ui_response_with_view json do |action|
2
6
  render "#{@path_prefix}/forms/partial_update_execute", action: action
3
7
  end
@@ -129,6 +129,27 @@ page.form url: json_ui_garage_url(path: 'forms/generic_post'), method: 'post', p
129
129
  value: ['ja', 'de'],
130
130
  multiple: true
131
131
 
132
+ form.spacer height: 6
133
+ form.label text: 'Options from http/get'
134
+ form.spacer height: 6
135
+
136
+ form.fields_select \
137
+ name: 'user[animal_or_plant]',
138
+ width: 'matchParent',
139
+ label: 'Animal or Plant',
140
+ options: [{ text: 'Animal', value: 'animal' }, { text: 'Plant', value: 'plant' }],
141
+ value: 'animal',
142
+ onChangeAndLoad: ->(action) do
143
+ action.http_get url: json_ui_garage_url(path: 'forms/update_options')
144
+ end
145
+
146
+ form.fields_select \
147
+ id: 'options',
148
+ name: 'user[choose_animal_or_plant]',
149
+ width: 'matchParent',
150
+ label: 'Choose',
151
+ options: []
152
+
132
153
  form.spacer height: 20
133
154
  form.h2 text: 'Select fields with empty values'
134
155
  form.spacer height: 6
@@ -0,0 +1,13 @@
1
+ sleep 0.5
2
+
3
+ value = params.require(:user).to_unsafe_h['animal_or_plant']
4
+ options = {
5
+ 'animal' => ['cat', 'dog', 'bird'].map { |v| { text: v.humanize, value: v } },
6
+ 'plant' => ['herb', 'rice', 'vegetable'].map { |v| { text: v.humanize, value: v } }
7
+ }[value]
8
+
9
+ json_ui_response_with_view json do |action|
10
+ action.components_set targetId: 'options', data: {
11
+ options: options
12
+ }
13
+ end
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -45,7 +45,6 @@ page.scroll childViews: ->(scroll) do
45
45
  backgroundColor: '#e2e2e2',
46
46
  import: { submitUrl: json_ui_garage_url(path: 'forms/bulk_edit_post2'), paramName: 'user' },
47
47
  viewHeaders: [
48
- { text: '', id: 'status', minWidth: 24 },
49
48
  { text: 'Month', id: 'month', importable: true },
50
49
  { text: 'Electricity usage', id: 'electricity_usage', importable: true },
51
50
  { text: 'Gas usage', id: 'gas_usage', importable: true },
@@ -53,19 +52,16 @@ page.scroll childViews: ->(scroll) do
53
52
  ],
54
53
  viewCells: [
55
54
  ->(view) do
56
- view.icon name: params[:icon] || 'preview', styleClasses: ['warning'], tooltip: { text: params[:icon] || 'preview' }
55
+ view.fields_number width: 'matchParent'
57
56
  end,
58
57
  ->(view) do
59
- view.fields_number width: 100
58
+ view.fields_number width: 'matchParent'
60
59
  end,
61
60
  ->(view) do
62
- view.fields_number width: 150
61
+ view.fields_number width: 'matchParent'
63
62
  end,
64
63
  ->(view) do
65
- view.fields_number width: 100
66
- end,
67
- ->(view) do
68
- view.fields_select options: options
64
+ view.fields_select width: 'matchParent', options: options
69
65
  end
70
66
  ],
71
67
  paramNameForFormData: 'message',
File without changes
@@ -39,7 +39,7 @@ page.scroll padding: glib_json_padding_body, childViews: ->(scroll) do
39
39
  dialog.body padding: glib_json_padding_body, childViews: ->(view) do
40
40
  view.panels_responsive styleClass: 'popover-menu', width: 200, childViews: ->(res) do
41
41
  res.label text: 'Item 1', styleClass: 'popover-menu-item', onClick: ->(saction) do
42
- saction.popovers_close key: 'menu'
42
+ saction.windows_open url: 'http://localhost:3000/glib/json_ui_garage?path=pages%2Findex'
43
43
  end
44
44
  res.label text: 'Item 2', styleClass: 'popover-menu-item', onClick: ->(saction) do
45
45
  saction.popovers_close key: 'menu'
File without changes
data/config/routes.rb CHANGED
@@ -7,5 +7,6 @@ Glib::Web::Engine.routes.draw do
7
7
  post 'chat', to: 'home#chat'
8
8
 
9
9
  resources :glib_direct_uploads, only: [:create]
10
+ resources :errors, only: [:create]
10
11
  end
11
12
  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
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.8.2
4
+ version: 4.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ''
@@ -100,6 +100,7 @@ files:
100
100
  - app/controllers/concerns/glib/json/traversal.rb
101
101
  - app/controllers/concerns/glib/json/ui.rb
102
102
  - app/controllers/concerns/glib/json/validation.rb
103
+ - app/controllers/glib/errors_controller.rb
103
104
  - app/controllers/glib/glib_direct_uploads_controller.rb
104
105
  - app/controllers/glib/home_controller.rb
105
106
  - app/helpers/glib/app_feature_support_helper.rb
@@ -234,6 +235,7 @@ files:
234
235
  - app/views/json_ui/garage/forms/submit_on_change.json.jbuilder
235
236
  - app/views/json_ui/garage/forms/text_validation.json.jbuilder
236
237
  - app/views/json_ui/garage/forms/timers.json.jbuilder
238
+ - app/views/json_ui/garage/forms/update_options.json.jbuilder
237
239
  - app/views/json_ui/garage/home/blank.json.jbuilder
238
240
  - app/views/json_ui/garage/home/index.json.jbuilder
239
241
  - app/views/json_ui/garage/home/slow.json.jbuilder
@@ -386,8 +388,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
386
388
  - !ruby/object:Gem::Version
387
389
  version: '0'
388
390
  requirements: []
389
- rubyforge_project:
390
- rubygems_version: 2.7.6
391
+ rubygems_version: 3.4.6
391
392
  signing_key:
392
393
  specification_version: 4
393
394
  summary: ''