glib-web 3.28.0 → 4.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (105) 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/abstract_builder.rb +0 -8
  6. data/app/helpers/glib/json_ui/action_builder/components.rb +0 -5
  7. data/app/helpers/glib/json_ui/action_builder/dialogs.rb +0 -23
  8. data/app/helpers/glib/json_ui/action_builder/logics.rb +11 -0
  9. data/app/helpers/glib/json_ui/action_builder/popovers.rb +0 -9
  10. data/app/helpers/glib/json_ui/action_builder/sheets.rb +0 -0
  11. data/app/helpers/glib/json_ui/action_builder/windows.rb +1 -5
  12. data/app/helpers/glib/json_ui/action_builder.rb +0 -24
  13. data/app/helpers/glib/json_ui/analytics_helper.rb +0 -0
  14. data/app/helpers/glib/json_ui/builder/mouse_events.rb +0 -7
  15. data/app/helpers/glib/json_ui/default.rb +4 -4
  16. data/app/helpers/glib/json_ui/generic_builders.rb +0 -0
  17. data/app/helpers/glib/json_ui/list_builders.rb +0 -3
  18. data/app/helpers/glib/json_ui/page_helper.rb +7 -1
  19. data/app/helpers/glib/json_ui/view_builder/fields.rb +7 -38
  20. data/app/helpers/glib/json_ui/view_builder/panels.rb +1 -0
  21. data/app/helpers/glib/json_ui/view_builder.rb +3 -14
  22. data/app/models/glib/active_storage/attachment.rb +0 -0
  23. data/app/models/glib/active_storage/blob.rb +0 -0
  24. data/app/models/glib/dynamic_text_record.rb +0 -0
  25. data/app/models/glib/text.rb +0 -0
  26. data/app/policies/glib/application_policy.rb +0 -6
  27. data/app/validators/email_typo_validator.rb +0 -0
  28. data/app/validators/email_validator.rb +0 -0
  29. data/app/validators/url_validator.rb +0 -0
  30. data/app/views/json_ui/garage/actions/_components.json.jbuilder +2 -6
  31. data/app/views/json_ui/garage/actions/_dialogs.json.jbuilder +0 -14
  32. data/app/views/json_ui/garage/actions/_reload.json.jbuilder +1 -1
  33. data/app/views/json_ui/garage/actions/dialogs_oauth_post.json.jbuilder +0 -0
  34. data/app/views/json_ui/garage/actions/partial_update.json.jbuilder +1 -1
  35. data/app/views/json_ui/garage/forms/_alert_post_data.json.jbuilder +1 -3
  36. data/app/views/json_ui/garage/forms/_partial_update_execute.json.jbuilder +1 -1
  37. data/app/views/json_ui/garage/forms/_read_more_text.json.jbuilder +27 -20
  38. data/app/views/json_ui/garage/forms/conditional_value.json.jbuilder +49 -68
  39. data/app/views/json_ui/garage/forms/dirty_prompt.json.jbuilder +0 -28
  40. data/app/views/json_ui/garage/forms/dynamic_select_data.json.jbuilder +0 -0
  41. data/app/views/json_ui/garage/forms/file_upload.json.jbuilder +1 -3
  42. data/app/views/json_ui/garage/forms/generic_post.json.jbuilder +0 -0
  43. data/app/views/json_ui/garage/forms/otp_field.json.jbuilder +11 -9
  44. data/app/views/json_ui/garage/forms/rich_text_preview.json.jbuilder +0 -1
  45. data/app/views/json_ui/garage/forms/selects.json.jbuilder +17 -24
  46. data/app/views/json_ui/garage/forms/show_hide.json.jbuilder +317 -271
  47. data/app/views/json_ui/garage/forms/submission_flow.json.jbuilder +0 -0
  48. data/app/views/json_ui/garage/forms/submission_flow_post.json.jbuilder +0 -0
  49. data/app/views/json_ui/garage/forms/submission_indicator.json.jbuilder +0 -0
  50. data/app/views/json_ui/garage/forms/submission_indicator_post.json.jbuilder +0 -0
  51. data/app/views/json_ui/garage/forms/timers.json.jbuilder +0 -90
  52. data/app/views/json_ui/garage/home/blank.json.jbuilder +0 -0
  53. data/app/views/json_ui/garage/home/slow.json.jbuilder +0 -0
  54. data/app/views/json_ui/garage/lists/autoload_all.json.jbuilder +0 -0
  55. data/app/views/json_ui/garage/lists/autoload_as_needed.json.jbuilder +0 -0
  56. data/app/views/json_ui/garage/lists/chat_ui.json.jbuilder +0 -0
  57. data/app/views/json_ui/garage/lists/fab.json.jbuilder +0 -0
  58. data/app/views/json_ui/garage/notifications/action_cable.json.jbuilder +3 -3
  59. data/app/views/json_ui/garage/notifications/web_socket.json.jbuilder +0 -0
  60. data/app/views/json_ui/garage/pages/custom_style_class.json.jbuilder +0 -0
  61. data/app/views/json_ui/garage/pages/full_width.json.jbuilder +0 -0
  62. data/app/views/json_ui/garage/pages/full_width_height.json.jbuilder +0 -0
  63. data/app/views/json_ui/garage/pages/layout.json.jbuilder +0 -0
  64. data/app/views/json_ui/garage/pages/lifecycle_hooks.json.jbuilder +4 -0
  65. data/app/views/json_ui/garage/pages/loading_indicator.json.jbuilder +0 -0
  66. data/app/views/json_ui/garage/pages/nested_scroll.json.jbuilder +0 -0
  67. data/app/views/json_ui/garage/pages/redirect_onload.json.jbuilder +0 -0
  68. data/app/views/json_ui/garage/panels/_styled.json.jbuilder +0 -0
  69. data/app/views/json_ui/garage/panels/card.json.jbuilder +0 -0
  70. data/app/views/json_ui/garage/panels/custom.json.jbuilder +0 -0
  71. data/app/views/json_ui/garage/panels/outlined.json.jbuilder +0 -0
  72. data/app/views/json_ui/garage/services/dynamic_text.json.jbuilder +0 -0
  73. data/app/views/json_ui/garage/services/image.json.jbuilder +0 -0
  74. data/app/views/json_ui/garage/services/index.json.jbuilder +0 -0
  75. data/app/views/json_ui/garage/tables/_autoload_section.json.jbuilder +0 -0
  76. data/app/views/json_ui/garage/tables/autoload_all.json.jbuilder +0 -0
  77. data/app/views/json_ui/garage/tables/autoload_as_needed.json.jbuilder +0 -0
  78. data/app/views/json_ui/garage/tables/export_import.json.jbuilder +0 -0
  79. data/app/views/json_ui/garage/tables/index.json.jbuilder +0 -0
  80. data/app/views/json_ui/garage/views/calendar_data.json.jbuilder +0 -0
  81. data/app/views/json_ui/garage/views/{components_update.json.jbuilder → components_replace.json.jbuilder} +6 -6
  82. data/app/views/json_ui/garage/views/controls.json.jbuilder +0 -32
  83. data/app/views/json_ui/garage/views/links.json.jbuilder +0 -0
  84. data/app/views/json_ui/garage/views/map_data.json.jbuilder +0 -0
  85. data/app/views/json_ui/garage/views/multimedia.json.jbuilder +0 -0
  86. data/app/views/layouts/json_ui/no_custom.html.erb +0 -0
  87. data/lib/generators/glib/install_generator.rb +0 -0
  88. data/lib/generators/templates/20191017062519_create_texts.rb +0 -0
  89. data/lib/generators/templates/20191024063257_add_scope_to_texts.rb +0 -0
  90. data/lib/generators/templates/20191112095018_add_lang_to_texts.rb +0 -0
  91. data/lib/generators/templates/20191126071051_create_active_storage_tables.active_storage.rb +0 -0
  92. data/lib/generators/templates/database.yml +0 -0
  93. data/lib/generators/templates/dynamic_text.rb +0 -0
  94. data/lib/glib/dynamic_text/config.rb +0 -0
  95. data/lib/glib/dynamic_text.rb +0 -0
  96. data/lib/glib/json_crawler/action_crawler.rb +0 -0
  97. data/lib/glib/json_crawler/action_crawlers/action_http.rb +0 -0
  98. data/lib/glib/json_crawler/action_crawlers/dialogs_alert.rb +0 -0
  99. data/lib/glib/json_crawler/action_crawlers/menu.rb +0 -0
  100. data/lib/glib/json_crawler/action_crawlers/run_multiple.rb +0 -0
  101. data/lib/glib/json_crawler/action_crawlers/windows_open.rb +0 -0
  102. data/lib/glib/json_crawler/coverage.rb +0 -0
  103. data/lib/glib/value.rb +0 -0
  104. data/lib/glib/version.rb +0 -0
  105. metadata +4 -4
@@ -3,75 +3,56 @@ json.title 'Forms'
3
3
  page = json_ui_page json
4
4
  render "#{@path_prefix}/nav_menu", json: json, page: page
5
5
 
6
- page.form url: json_ui_garage_url(path: 'forms/generic_post'), method: 'post', padding: glib_json_padding_body, childViews: ->(form) do
7
- form.spacer height: 20
8
- form.h2 text: 'Date'
9
- form.label text: 'End date will be adjusted automatically when start date changes'
10
- form.spacer height: 6
11
- form.fields_date name: 'user[date_start]', width: 'matchParent', label: 'Start Date', min: '2010-01-01', max: '2012-01-01', value: '2010-02-01'
12
- form.fields_date name: 'user[date_end]', width: 'matchParent', label: 'End Date', min: '2010-01-01', max: '2012-01-01', valueIf: {
13
- "+": [
14
- {
15
- "var": 'user[date_start]'
16
- },
17
- 24 * 3600
18
- ]
19
- }
6
+ page.form \
7
+ url: json_ui_garage_url(path: 'forms/generic_post'),
8
+ method: 'post',
9
+ padding: glib_json_padding_body,
10
+ childViews: ->(form) do
11
+ form.spacer height: 20
12
+ form.h2 text: 'Date'
13
+ form.label text: 'End date will be adjusted automatically when start date changes'
14
+ form.spacer height: 6
15
+ form.fields_date name: 'user[date_start]', width: 'matchParent', label: 'Start Date', min: '2010-01-01', max: '2012-01-01', value: '2010-02-01', onChangeAndLoad: ->(action) do
16
+ action.logics_set targetId: 'date1', conditionalData: { value: { "+": [{ "var": 'user[date_start]' }, 24 * 3600] } }
17
+ end
18
+ form.fields_date id: 'date1', name: 'user[date_end]', width: 'matchParent', label: 'End Date', min: '2010-01-01', max: '2012-01-01'
20
19
 
21
- form.spacer height: 20
22
- form.h2 text: 'Date/Time'
23
- form.label text: 'End date/time will be adjusted automatically when start date/time changes'
24
- form.spacer height: 6
25
- form.fields_datetime name: 'user[datetime_start]', width: 'matchParent', label: 'Start Date', min: '2010-01-01', max: '2012-01-01', value: '2010-02-01T01:00'
26
- form.fields_datetime name: 'user[datetime_end]', width: 'matchParent', label: 'End Date', min: '2010-01-01', max: '2012-01-01', valueIf: {
27
- "+": [
28
- {
29
- "var": 'user[datetime_start]'
30
- },
31
- 3600
32
- ]
33
- }
20
+ form.spacer height: 20
21
+ form.h2 text: 'Date/Time'
22
+ form.label text: 'End date/time will be adjusted automatically when start date/time changes'
23
+ form.spacer height: 6
24
+ form.fields_datetime name: 'user[datetime_start]', width: 'matchParent', label: 'Start Date', min: '2010-01-01', max: '2012-01-01', value: '2010-02-01T01:00', onChangeAndLoad: ->(action) do
25
+ action.logics_set targetId: 'date2', conditionalData: { value: { "+": [{ "var": 'user[datetime_start]' }, 3600] } }
26
+ end
27
+ form.fields_datetime id: 'date2', name: 'user[datetime_end]', width: 'matchParent', label: 'End Date', min: '2010-01-01', max: '2012-01-01'
34
28
 
35
- form.spacer height: 20
36
- form.h2 text: 'Check/uncheck All'
37
- form.spacer height: 6
38
- form.fields_check name: 'user[check_all]', label: 'All', checkValue: true
39
- form.fields_check name: 'user[check1]', label: 'Check 1', checkValue: true, valueIf: {
40
- "==": [
41
- {
42
- "var": 'user[check_all]'
43
- },
44
- true
45
- ]
46
- }
47
- form.fields_check name: 'user[check2]', label: 'Check 2', checkValue: true, valueIf: {
48
- "==": [
49
- {
50
- "var": 'user[check_all]'
51
- },
52
- true
53
- ]
54
- }
55
- form.fields_check name: 'user[check3]', label: 'Check 3', checkValue: true, valueIf: {
56
- "==": [
57
- {
58
- "var": 'user[check_all]'
59
- },
60
- true
61
- ]
62
- }
29
+ form.spacer height: 20
30
+ form.h2 text: 'Check/uncheck All'
31
+ form.spacer height: 6
32
+ form.fields_check name: 'user[check_all]', label: 'All', checkValue: true, onChangeAndLoad: ->(action) do
33
+ action.runMultiple childActions: ->(saction) do
34
+ saction.logics_set targetId: 'check1', conditionalData: { value: { "==": [{ "var": 'user[check_all]' }, true] } }
35
+ saction.logics_set targetId: 'check2', conditionalData: { value: { "==": [{ "var": 'user[check_all]' }, true] } }
36
+ saction.logics_set targetId: 'check3', conditionalData: { value: { "==": [{ "var": 'user[check_all]' }, true] } }
37
+ end
38
+ end
39
+ form.fields_check id: 'check1', name: 'user[check1]', label: 'Check 1', checkValue: true
40
+ form.fields_check id: 'check2', name: 'user[check2]', label: 'Check 2', checkValue: true
41
+ form.fields_check id: 'check3', name: 'user[check3]', label: 'Check 3', checkValue: true
63
42
 
64
- form.spacer height: 20
65
- form.h2 text: 'Divided by 3 (with precision set)'
66
- form.spacer height: 6
67
- form.fields_number name: 'user[number1]', width: 'matchParent', value: 10
68
- form.fields_number \
69
- name: 'user[number2]',
70
- width: 'matchParent',
71
- precision: 1,
72
- valueIf: { "/": [{ "var": 'user[number1]' }, 3] }
43
+ form.spacer height: 20
44
+ form.h2 text: 'Divided by 3 (with precision set)'
45
+ form.spacer height: 6
46
+ form.fields_number name: 'user[number1]', width: 'matchParent', value: 10, onChangeAndLoad: ->(action) do
47
+ action.logics_set targetId: 'number1', conditionalData: { value: { "/": [{ "var": 'user[number1]' }, 3] } }
48
+ end
49
+ form.fields_number \
50
+ name: 'user[number2]',
51
+ width: 'matchParent',
52
+ id: 'number1',
53
+ precision: 1
73
54
 
74
- form.spacer height: 20
75
- form.fields_submit text: 'Submit'
76
- form.spacer height: 40
77
- end
55
+ form.spacer height: 20
56
+ form.fields_submit text: 'Submit'
57
+ form.spacer height: 40
58
+ end
@@ -38,34 +38,6 @@ page.form \
38
38
  form.fields_chipGroup name: 'user[dirty_chipgroup]', width: 'matchParent', label: 'Chipgroup', value: ['option_2'], options: options
39
39
  form.spacer height: 14
40
40
 
41
- form.h3 text: 'valueIf'
42
- form.fields_check name: 'user[check_all]', label: 'All', checkValue: true
43
-
44
- form.fields_check name: 'user[check1]', label: 'Check 1', checkValue: true, valueIf: {
45
- "==": [
46
- {
47
- "var": 'user[check_all]'
48
- },
49
- true
50
- ]
51
- }
52
- form.fields_check name: 'user[check2]', label: 'Check 2', checkValue: true, valueIf: {
53
- "==": [
54
- {
55
- "var": 'user[check_all]'
56
- },
57
- true
58
- ]
59
- }
60
- form.fields_check name: 'user[check3]', label: 'Check 3', checkValue: true, valueIf: {
61
- "==": [
62
- {
63
- "var": 'user[check_all]'
64
- },
65
- true
66
- ]
67
- }
68
-
69
41
  form.h3 text: 'Radio'
70
42
  form.spacer height: 14
71
43
  form.fields_radioGroup name: 'user[gender]', value: 'F', childViews: ->(group) do
@@ -42,10 +42,9 @@ page.form options.merge(childViews: ->(form) do
42
42
  form.fields_multiUpload \
43
43
  name: 'user[multi][]',
44
44
  width: 360,
45
- accepts: { fileType: 'image', maxFileSize: 5000 },
45
+ accepts: { fileType: 'image', maxFileSize: 10 },
46
46
  directUploadUrl: rails_direct_uploads_url,
47
47
  uploadTitle: 'Files uploaded:',
48
- uploadFailedText: '(UPLOAD FAILED)',
49
48
  storagePrefix: 'glib',
50
49
  metadata: {
51
50
  foo: 'bar',
@@ -63,7 +62,6 @@ page.form options.merge(childViews: ->(form) do
63
62
  accepts: { fileType: 'image', maxFileSize: 5000 },
64
63
  directUploadUrl: rails_direct_uploads_url,
65
64
  uploadTitle: 'Files uploaded:',
66
- uploadFailedText: '(UPLOAD FAILED)',
67
65
  onFinishUpload: ->(action) { action.forms_submit }
68
66
  form.spacer height: 16
69
67
  form.label text: 'Sign'
@@ -35,15 +35,17 @@ page.form \
35
35
 
36
36
  form.spacer height: 20
37
37
  form.h2 text: 'OTP with Value If'
38
- form.fields_otp name: 'user[otp_summary4]', width: 'matchParent', value: 60000, length: 5
39
- form.fields_otp name: 'user[otp_summary5]', width: 'matchParent', length: 5, valueIf: {
40
- "*": [
41
- {
42
- "var": 'user[otp_summary4]'
43
- },
44
- (20/100.to_f)
45
- ]
46
- }
38
+ form.fields_otp name: 'user[otp_summary4]', width: 'matchParent', value: 60000, length: 5, onChange: ->(action) do
39
+ action.logics_set targetId: 'otp1', conditionalData: { value: {
40
+ "*": [
41
+ {
42
+ "var": 'user[otp_summary4]'
43
+ },
44
+ (20/100.to_f)
45
+ ]
46
+ } }
47
+ end
48
+ form.fields_otp id: 'otp1', name: 'user[otp_summary5]', width: 'matchParent', length: 5
47
49
 
48
50
  form.spacer height: 20
49
51
  form.fields_submit text: 'Submit'
@@ -1,7 +1,6 @@
1
1
  data = params[:user] || {}
2
2
 
3
3
  json_ui_response_with_view json do |action|
4
- # Experimental. Continue to use `components_update` instead.
5
4
  action.components_replace targetId: 'preview', newView: ->(update) do
6
5
  update.panels_vertical childViews: ->(vertical) do
7
6
  vertical.label text: "Hello #{data[:name]},"
@@ -31,26 +31,26 @@ page.form url: json_ui_garage_url(path: 'forms/generic_post'), method: 'post', p
31
31
  form.spacer height: 6
32
32
 
33
33
  languages = {
34
- "East Asia" => {
35
- "zh" => "Chinese",
36
- "ja" => "Japanese",
37
- "ko" => "Korean",
34
+ 'East Asia' => {
35
+ 'zh' => 'Chinese',
36
+ 'ja' => 'Japanese',
37
+ 'ko' => 'Korean',
38
38
  },
39
- "Middle East" => {
40
- "ar" => 'Arabic',
41
- "hi" => "Hindi",
39
+ 'Middle East' => {
40
+ 'ar' => 'Arabic',
41
+ 'hi' => 'Hindi',
42
42
  },
43
- "Europe" => {
44
- "nl" => "Dutch",
45
- "en" => "English",
46
- "fr" => "French",
47
- "de" => "German",
48
- "it" => "Italian",
49
- "pt" => "Portuguese",
50
- "es" => "Spanish",
43
+ 'Europe' => {
44
+ 'nl' => 'Dutch',
45
+ 'en' => 'English',
46
+ 'fr' => 'French',
47
+ 'de' => 'German',
48
+ 'it' => 'Italian',
49
+ 'pt' => 'Portuguese',
50
+ 'es' => 'Spanish',
51
51
  },
52
- "Eastern Europe" => {
53
- "ru" => "Russian",
52
+ 'Eastern Europe' => {
53
+ 'ru' => 'Russian',
54
54
  }
55
55
  }
56
56
  options = []
@@ -116,13 +116,6 @@ page.form url: json_ui_garage_url(path: 'forms/generic_post'), method: 'post', p
116
116
  form.spacer height: 6
117
117
  form.fields_timeZone name: 'user[time_zone]', width: 'matchParent', label: 'Time Zone'
118
118
 
119
- # TODO: Remove
120
- form.spacer height: 20
121
- form.h2 text: 'Autocomplete (select with manual entry) -- DEPRECATED: Confusing UX, promote bad backend design'
122
- form.spacer height: 6
123
- skills = ['Singing', 'Dancing', 'Fighting']
124
- form.fields_autocomplete name: 'user[skill]', width: 'matchParent', label: 'Skill', options: skills, value: 'Singing'
125
- form.fields_autocomplete name: 'user[skills][]', width: 'matchParent', label: 'Skills', options: skills, value: ['Dancing', 'Fencing'], multiple: true
126
119
 
127
120
  form.button text: 'Submit', onClick: ->(action) { action.forms_submit }
128
121