glib-web 4.30.4 → 4.31.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) 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/dialogs.rb +1 -0
  6. data/app/helpers/glib/json_ui/action_builder/fields.rb +1 -0
  7. data/app/helpers/glib/json_ui/analytics_helper.rb +0 -0
  8. data/app/helpers/glib/json_ui/generic_builders.rb +0 -0
  9. data/app/helpers/glib/json_ui/page_helper.rb +1 -1
  10. data/app/helpers/glib/json_ui/view_builder/fields.rb +15 -2
  11. data/app/helpers/glib/json_ui/view_builder/panels.rb +6 -1
  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.json.jbuilder +3 -1
  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/dirty_prompt.json.jbuilder +10 -5
  23. data/app/views/json_ui/garage/forms/dynamic_group.json.jbuilder +6 -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/slow.json.jbuilder +0 -0
  30. data/app/views/json_ui/garage/lists/autoload_all.json.jbuilder +0 -0
  31. data/app/views/json_ui/garage/lists/autoload_as_needed.json.jbuilder +0 -0
  32. data/app/views/json_ui/garage/lists/chat_ui.json.jbuilder +0 -0
  33. data/app/views/json_ui/garage/lists/fab.json.jbuilder +0 -0
  34. data/app/views/json_ui/garage/notifications/web_socket.json.jbuilder +0 -0
  35. data/app/views/json_ui/garage/pages/custom_style_class.json.jbuilder +0 -0
  36. data/app/views/json_ui/garage/pages/full_width.json.jbuilder +0 -0
  37. data/app/views/json_ui/garage/pages/full_width_height.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/loading_indicator.json.jbuilder +0 -0
  40. data/app/views/json_ui/garage/pages/nested_scroll.json.jbuilder +0 -0
  41. data/app/views/json_ui/garage/pages/redirect_onload.json.jbuilder +0 -0
  42. data/app/views/json_ui/garage/panels/_styled.json.jbuilder +0 -0
  43. data/app/views/json_ui/garage/panels/card.json.jbuilder +0 -0
  44. data/app/views/json_ui/garage/panels/custom.json.jbuilder +0 -0
  45. data/app/views/json_ui/garage/panels/outlined.json.jbuilder +0 -0
  46. data/app/views/json_ui/garage/panels/split.json.jbuilder +15 -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/views/calendar_data.json.jbuilder +0 -0
  55. data/app/views/json_ui/garage/views/controls.json.jbuilder +14 -0
  56. data/app/views/json_ui/garage/views/fields_focus.json.jbuilder +14 -2
  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/all_helpers.rb +17 -0
  68. data/lib/glib/dynamic_text/config.rb +0 -0
  69. data/lib/glib/dynamic_text.rb +0 -0
  70. data/lib/glib/json_crawler/action_crawler.rb +0 -0
  71. data/lib/glib/json_crawler/action_crawlers/action_http.rb +0 -0
  72. data/lib/glib/json_crawler/action_crawlers/dialogs_alert.rb +0 -0
  73. data/lib/glib/json_crawler/action_crawlers/menu.rb +0 -0
  74. data/lib/glib/json_crawler/action_crawlers/run_multiple.rb +0 -0
  75. data/lib/glib/json_crawler/action_crawlers/windows_open.rb +0 -0
  76. data/lib/glib/json_crawler/coverage.rb +0 -0
  77. data/lib/glib/value.rb +0 -0
  78. data/lib/glib/version.rb +0 -0
  79. metadata +8 -8
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '08cae857d234b7ba1055a101366e9fb1a9fcce486ce7e703af7c207fe750c5c5'
4
- data.tar.gz: e69dc991d8cf6a8bd0211cd40d729c868225c56f147493f4ae79b41022327b58
3
+ metadata.gz: d404f99ae7ff7d1e309c9bedca7b93145bc5331281c64308daa033b9ae6b4524
4
+ data.tar.gz: 2f89659ddffb2206989074678c6388176aad57dd872f9b14c43149c51b9e91b5
5
5
  SHA512:
6
- metadata.gz: e4931b052ff2188bfa259d94ebc31e424b7dade822dc600158e47dd0b7ba1504300e9fda5583f249a94fadeee47da769ea97eb372f36ef9568210795693dfb8f
7
- data.tar.gz: 01e399f17574a5554821f55a91c9eab9c0ac87373bd67293049d9c6c44f4397c4844b3371284ae85aa6532be6e9a9de548be8d7d2347c9d251426b5a8875b885
6
+ metadata.gz: de7bad6075a55452237fa31c44ad4a0405b6048fa84959385fe12003b1b37b53fc64576c59e658391b4c1efcb3608c62f772a1cffe050b6c2afacd87c86500ea
7
+ data.tar.gz: 418db2e1fdf0af1838af518595b4eea273bfe5fd140676870f1a84c3fe8788e585f1701beb23861b84a7b2ade8206d0aed535256eecc5e6669ff69bfbc603749
File without changes
File without changes
@@ -45,6 +45,7 @@ class Glib::JsonUi::ActionBuilder
45
45
  bool :disableCloseButton
46
46
  string :fullscreen # mobile, always
47
47
  length :width
48
+ action :onReload
48
49
  end
49
50
 
50
51
  class Close < Action
@@ -12,6 +12,7 @@ class Glib::JsonUi::ActionBuilder
12
12
  # deprecated, change to Clear at next major version release
13
13
  class Reset < Action
14
14
  string :targetId
15
+ array :targetIds
15
16
  action :onReset
16
17
  end
17
18
 
File without changes
File without changes
@@ -256,7 +256,7 @@ module Glib
256
256
  def form(options = {})
257
257
  form = Glib::JsonUi::ViewBuilder::Panels::Form.new(json, self)
258
258
  form.childViews(->(view_builder) { })
259
- panel_options = options.slice!(:url, :method, :local, :onSubmit, :paramNameForFormData, :model, :onChange, :onChangeAndLoad, :autoValidate)
259
+ panel_options = options.slice!(:url, :method, :local, :onSubmit, :paramNameForFormData, :model, :onChange, :onChangeAndLoad, :autoValidate, :disableDirtyCheck)
260
260
 
261
261
  json.fullPageForm do
262
262
  json.view 'panels/fullPageForm'
@@ -6,7 +6,6 @@ class Glib::JsonUi::ViewBuilder
6
6
 
7
7
  bool :readOnly
8
8
  bool :disabled
9
- bool :disableDirtyCheck
10
9
  bool :clearable
11
10
  action :onChange
12
11
  action :onChangeAndLoad
@@ -69,9 +68,14 @@ class Glib::JsonUi::ViewBuilder
69
68
  @autoValidate = autoValidate
70
69
  end
71
70
 
71
+ def disableDirtyCheck(value)
72
+ @disable_dirty_check = value
73
+ end
74
+
72
75
  # Override
73
76
  def created
74
- if @prop && (form = page.current_form)
77
+ form = page.current_form
78
+ if @prop && form
75
79
  context.field_assert_respond_to(@prop)
76
80
 
77
81
  @name ||= context.field_name(@prop, @multiple || false)
@@ -87,6 +91,15 @@ class Glib::JsonUi::ViewBuilder
87
91
  @value ||= determine_value(context, @prop)
88
92
  end
89
93
  end
94
+
95
+ if form.present? && !form.disable_dirty_check.nil?
96
+ json.set! 'disableDirtyCheck', form.disable_dirty_check
97
+ end
98
+
99
+ if !@disable_dirty_check.nil?
100
+ json.set! 'disableDirtyCheck', @disable_dirty_check
101
+ end
102
+
90
103
  json.name @name
91
104
  json.value @value if @value
92
105
  json.label @label if @label
@@ -5,6 +5,7 @@ class Glib::JsonUi::ViewBuilder
5
5
  class Form < View
6
6
  attr_reader :model_name # See Panels::Form.field_name
7
7
  attr_reader :_autoValidate
8
+ attr_reader :disable_dirty_check
8
9
  attr_accessor :current_dynamic_group
9
10
 
10
11
  action :onSubmit
@@ -21,6 +22,10 @@ class Glib::JsonUi::ViewBuilder
21
22
  @nested_associations ||= []
22
23
  end
23
24
 
25
+ def disableDirtyCheck(value)
26
+ @disable_dirty_check = value
27
+ end
28
+
24
29
  # TODO: Enable this when we know it won't break existing apps.
25
30
  # Even for pure client-side apps, this is required because form.validate() requires a URL to construct form data.
26
31
  # required :url
@@ -448,7 +453,7 @@ class Glib::JsonUi::ViewBuilder
448
453
  # def content(block)
449
454
  # block.call page.split_content_builder
450
455
  # end
451
-
456
+ string :align
452
457
  panels_builder :content, :left, :center, :right
453
458
  end
454
459
 
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -73,7 +73,9 @@ section.rows builder: ->(template) do
73
73
  action.runMultiple childActions: ->(saction) do
74
74
  saction.dialogs_open url: json_ui_garage_url(path: 'forms/dialogs_form')
75
75
  saction.timeouts_set interval: 1000, onTimeout: ->(ssaction) do
76
- ssaction.dialogs_reload
76
+ ssaction.dialogs_reload onReload: ->(xaction) do
77
+ xaction.snackbars_alert message: 'reload!'
78
+ end
77
79
  end
78
80
  end
79
81
  end
@@ -9,6 +9,7 @@ page.form \
9
9
  local: true,
10
10
  url: json_ui_garage_url(path: 'forms/local_request'),
11
11
  method: 'post',
12
+ # disableDirtyCheck: true,
12
13
  padding: glib_json_padding_body,
13
14
  childViews: ->(form) do
14
15
  form.h3 text: "Hello #{ data[:name] }"
@@ -37,11 +38,15 @@ page.form \
37
38
 
38
39
  form.h3 text: 'Radio'
39
40
  form.spacer height: 14
40
- form.fields_radioGroup name: 'user[gender]', value: 'F', childViews: ->(group) do
41
- group.fields_radio value: '', label: 'Unknown'
42
- group.fields_radio value: 'M', label: 'Male'
43
- group.fields_radio value: 'F', label: 'Female'
44
- end
41
+ form.fields_radioGroup \
42
+ name: 'user[gender]',
43
+ disableDirtyCheck: false,
44
+ value: 'F',
45
+ childViews: ->(group) do
46
+ group.fields_radio value: '', label: 'Unknown'
47
+ group.fields_radio value: 'M', label: 'Male'
48
+ group.fields_radio value: 'F', label: 'Female'
49
+ end
45
50
 
46
51
  form.h3 text: 'Check group'
47
52
  form.spacer height: 14
@@ -24,6 +24,10 @@ page.form url: json_ui_garage_url(path: 'forms/generic_post'), method: 'post', p
24
24
  { name: 'type', value: 'yes_no' },
25
25
  { name: '[primary_language]', selectedOptions: [ { value: 'id2', text: 'Item 2' } ] },
26
26
  { name: 'message[error]', value: 'Incompatible selection' }
27
+ ],
28
+ [
29
+ { name: 'question', value: 'Incomplete' },
30
+ { name: 'type', value: 'unspecified' },
27
31
  ]
28
32
  ]
29
33
  form.fields_dynamicGroup id: 'form_dynamic_group', width: 'matchParent', name: 'user[evaluation]', groupFieldProperties: properties, titlePrefix: 'Entry', content: ->(group) do
@@ -83,6 +87,8 @@ page.form url: json_ui_garage_url(path: 'forms/generic_post'), method: 'post', p
83
87
  # subaction.dialogs_alert message: 'Please select a valid type'
84
88
  # end
85
89
 
90
+ # This should run when the page loads, so if a field has `unspecified` value, this alert dialog
91
+ # should show right away.
86
92
  multiple.logics_run \
87
93
  condition: { "==": [{ "var": '{{entryPrefix}}[type]' }, 'unspecified'] },
88
94
  onTrue: ->(subaction) do
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -178,5 +178,20 @@ json_ui_page json do |page|
178
178
  end
179
179
  end
180
180
  end
181
+
182
+ scroll.label text: "\n"
183
+ scroll.h1 text: 'Align middle'
184
+ scroll.panels_split align: 'middle', height: 100, backgroundColor: '#b3bac2', width: 'matchParent', content: ->(content) do
185
+ content.left childViews: ->(left) do
186
+ left.button text: '1'
187
+ end
188
+ content.center childViews: ->(center) do
189
+ center.button height: 70, width: 'matchParent', text: '2'
190
+ end
191
+ content.right childViews: ->(right) do
192
+ right.button text: '3'
193
+ end
194
+
195
+ end
181
196
  end
182
197
  end
@@ -80,6 +80,20 @@ page.scroll padding: glib_json_padding_body, childViews: ->(scroll) do
80
80
  end
81
81
  end
82
82
 
83
+ scroll.spacer height: 10
84
+ scroll.button \
85
+ text: 'Refresh with tooltip',
86
+ tooltip: { text: 'This tooltip should disappear after refresh' },
87
+ onClick: ->(action) do
88
+ action.windows_reload
89
+ end
90
+
91
+ scroll.spacer height: 10
92
+ scroll.button \
93
+ text: 'Disabled button with tooltip',
94
+ tooltip: { text: 'Hello world' },
95
+ disabled: true
96
+
83
97
  scroll.spacer height: 20
84
98
  scroll.button \
85
99
  icon: 'info',
@@ -12,9 +12,13 @@ page.body padding: glib_json_padding_body, childViews: ->(body) do
12
12
  width: 300,
13
13
  childViews: ->(form) do
14
14
  res.fields_text id: 'first', name: 'user[full_name]', label: 'Full name', placeholder: 'Full name', width: 'matchParent'
15
- res.spacer height: 8
15
+ res.spacer height: 4
16
16
  res.fields_number id: 'second', name: 'user[age]', label: 'Age', placeholder: 'Age', width: 'matchParent'
17
17
  res.spacer height: 4
18
+ res.fields_textarea id: 'third', name: 'user[boi]', label: 'Bio', placeholder: 'Bio', width: 'matchParent'
19
+ res.spacer height: 4
20
+ res.fields_date id: 'fourth', name: 'user[birth_date]', label: 'Birth date', placeholder: 'Birth date', width: 'matchParent'
21
+ res.spacer height: 4
18
22
  res.panels_horizontal childViews: ->(hori) do
19
23
  res.button text: 'focus1', onClick: ->(action) do
20
24
  action.fields_focus targetId: 'first'
@@ -24,6 +28,14 @@ page.body padding: glib_json_padding_body, childViews: ->(body) do
24
28
  action.fields_focus targetId: 'second'
25
29
  end
26
30
  res.spacer width: 4
31
+ res.button text: 'focus3', onClick: ->(action) do
32
+ action.fields_focus targetId: 'third'
33
+ end
34
+ res.spacer width: 4
35
+ res.button text: 'focus4', onClick: ->(action) do
36
+ action.fields_focus targetId: 'fourth'
37
+ end
38
+ res.spacer width: 4
27
39
  res.button text: 'blur', onClick: ->(action) do
28
40
  action.fields_focus targetId: 'first', onFocus: ->(saction) do
29
41
  saction.timeouts_set interval: 1000, onTimeout: ->(ssaction) { ssaction.fields_blur }
@@ -31,7 +43,7 @@ page.body padding: glib_json_padding_body, childViews: ->(body) do
31
43
  end
32
44
  res.spacer width: 4
33
45
  res.button text: 'reset', onClick: ->(action) do
34
- action.fields_reset targetId: 'first', onReset: ->(saction) do
46
+ action.fields_reset targetIds: ['first', 'second', 'third', 'fourth'], onReset: ->(saction) do
35
47
  saction.snackbars_alert styleClasses: ['success'], message: 'Reset full name!'
36
48
  end
37
49
  end
File without changes
File without changes
File without changes
File without changes
@@ -0,0 +1,17 @@
1
+ module Glib
2
+ module AllHelpers
3
+ def self.included(base)
4
+ base.helper Glib::UrlsHelper
5
+ base.helper Glib::FormsHelper
6
+ base.helper Glib::EnumHelper
7
+ base.helper Glib::DynamicTextsHelper
8
+ base.helper Glib::DynamicImagesHelper
9
+ base.helper Glib::AppFeatureSupportHelper
10
+ base.helper Glib::TestHelpers
11
+ base.helper Glib::JsonUi::StylingHelper
12
+ base.helper Glib::JsonUi::ResponseHelper
13
+ base.helper Glib::JsonUi::PageHelper
14
+ base.helper Glib::JsonUi::AnalyticsHelper
15
+ end
16
+ end
17
+ end
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,11 +1,11 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: glib-web
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.30.4
4
+ version: 4.31.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - ''
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
  date: 2019-10-04 00:00:00.000000000 Z
@@ -94,7 +94,7 @@ dependencies:
94
94
  - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
- description:
97
+ description:
98
98
  email: ''
99
99
  executables: []
100
100
  extensions: []
@@ -368,6 +368,7 @@ files:
368
368
  - lib/generators/templates/database.yml
369
369
  - lib/generators/templates/dynamic_text.rb
370
370
  - lib/glib-web.rb
371
+ - lib/glib/all_helpers.rb
371
372
  - lib/glib/crypt/utils.rb
372
373
  - lib/glib/dynamic_text.rb
373
374
  - lib/glib/dynamic_text/config.rb
@@ -394,10 +395,10 @@ files:
394
395
  - lib/glib/value.rb
395
396
  - lib/glib/version.rb
396
397
  - lib/tasks/db.rake
397
- homepage:
398
+ homepage:
398
399
  licenses: []
399
400
  metadata: {}
400
- post_install_message:
401
+ post_install_message:
401
402
  rdoc_options: []
402
403
  require_paths:
403
404
  - lib
@@ -412,9 +413,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
412
413
  - !ruby/object:Gem::Version
413
414
  version: '0'
414
415
  requirements: []
415
- rubyforge_project:
416
- rubygems_version: 2.7.6
417
- signing_key:
416
+ rubygems_version: 3.4.6
417
+ signing_key:
418
418
  specification_version: 4
419
419
  summary: ''
420
420
  test_files: []