glib-web 4.42.2 → 4.42.3

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 (40) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/concerns/glib/json/libs.rb +2 -2
  3. data/app/views/json_ui/garage/test_page/_header.json.jbuilder +84 -14
  4. data/app/views/json_ui/garage/test_page/browsers.json.jbuilder +101 -0
  5. data/app/views/json_ui/garage/test_page/calendar.json.jbuilder +109 -0
  6. data/app/views/json_ui/garage/test_page/calendar_empty_data.json.jbuilder +3 -0
  7. data/app/views/json_ui/garage/test_page/carousel.json.jbuilder +70 -0
  8. data/app/views/json_ui/garage/test_page/charts.json.jbuilder +370 -0
  9. data/app/views/json_ui/garage/test_page/column.json.jbuilder +121 -0
  10. data/app/views/json_ui/garage/test_page/commands.json.jbuilder +98 -0
  11. data/app/views/json_ui/garage/test_page/components.json.jbuilder +143 -0
  12. data/app/views/json_ui/garage/test_page/cookies.json.jbuilder +109 -0
  13. data/app/views/json_ui/garage/test_page/custom.json.jbuilder +56 -0
  14. data/app/views/json_ui/garage/test_page/flow.json.jbuilder +70 -0
  15. data/app/views/json_ui/garage/test_page/forms.json.jbuilder +105 -0
  16. data/app/views/json_ui/garage/test_page/grid.json.jbuilder +68 -0
  17. data/app/views/json_ui/garage/test_page/horizontal.json.jbuilder +68 -0
  18. data/app/views/json_ui/garage/test_page/http.json.jbuilder +87 -37
  19. data/app/views/json_ui/garage/test_page/image.json.jbuilder +145 -0
  20. data/app/views/json_ui/garage/test_page/list.json.jbuilder +75 -0
  21. data/app/views/json_ui/garage/test_page/lists_append.json.jbuilder +151 -0
  22. data/app/views/json_ui/garage/test_page/logics_set.json.jbuilder +7 -6
  23. data/app/views/json_ui/garage/test_page/multimedia_video.json.jbuilder +118 -0
  24. data/app/views/json_ui/garage/test_page/pagination.json.jbuilder +64 -0
  25. data/app/views/json_ui/garage/test_page/panels.json.jbuilder +113 -0
  26. data/app/views/json_ui/garage/test_page/popovers.json.jbuilder +112 -0
  27. data/app/views/json_ui/garage/test_page/progressCircle.json.jbuilder +119 -0
  28. data/app/views/json_ui/garage/test_page/responsive.json.jbuilder +100 -0
  29. data/app/views/json_ui/garage/test_page/scroll.json.jbuilder +77 -0
  30. data/app/views/json_ui/garage/test_page/split.json.jbuilder +82 -0
  31. data/app/views/json_ui/garage/test_page/storage_items.json.jbuilder +144 -0
  32. data/app/views/json_ui/garage/test_page/table.json.jbuilder +99 -0
  33. data/app/views/json_ui/garage/test_page/timeline.json.jbuilder +97 -0
  34. data/app/views/json_ui/garage/test_page/timeouts.json.jbuilder +86 -0
  35. data/app/views/json_ui/garage/test_page/ul.json.jbuilder +68 -0
  36. data/app/views/json_ui/garage/test_page/vertical.json.jbuilder +68 -0
  37. data/app/views/json_ui/garage/test_page/web.json.jbuilder +64 -0
  38. data/app/views/json_ui/garage/test_page/windows.json.jbuilder +129 -0
  39. data/lib/tasks/db.rake +1 -0
  40. metadata +34 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3794a6fed57b589d09cfd6f2fe1f747673998520640e608c223be773a3161bc0
4
- data.tar.gz: 472d83c2de3a296222f412ddeb1fc6874e5fedb732d472a028adb47130bac721
3
+ metadata.gz: 2f83c2a0010d4f4a55930e7496803812b76116ee004904db891958f58ab8fd49
4
+ data.tar.gz: 7e27e4d5f4926260dccf08b8882df7d54c66aba82ce8d671cdd61157a0053971
5
5
  SHA512:
6
- metadata.gz: 34178d1b1dab6f1ab20db634f9628dbd67b21ecf675ef5fad566d96f9029c5644b14dd9002a264aefa2db52b82164ef594cc091f1a7f8f21c1e7989103ced652
7
- data.tar.gz: 5a113061150dffe37f69fa02b798abad3e4b96c99a66e26280ca44722b446071015c6fc50e871cffa555fab737dfdebb1f4a7607018176ed7cc3062b597a1f9e
6
+ metadata.gz: 3a46ba764a86d3ae29adcd30dc48aa620d4579e041101fe1d1c3be2315344006bb9f6a1bc01d9448abf3c4d75eb0848779df475e75601c654ae6a5053f820b8c
7
+ data.tar.gz: 3b4ba51006c0209c3eb846b560d57186e6e802f72919db13c7b4d999d0fadf5ed28a8274a362edfe65ffb3bcdffeb655b3c3eb65255d88a67944c06268779271
@@ -137,7 +137,7 @@ module Glib::Json::Libs
137
137
  end
138
138
  format.csv do
139
139
  if Rails.env.test?
140
- render status: :unauthorized
140
+ head :unauthorized
141
141
  else
142
142
  redirect_to sign_in_url, **redirect_options
143
143
  end
@@ -180,7 +180,7 @@ module Glib::Json::Libs
180
180
  end
181
181
  format.csv do
182
182
  if Rails.env.test?
183
- render status: :forbidden
183
+ head :forbidden
184
184
  else
185
185
  redirect_to user_default_url
186
186
  end
@@ -1,22 +1,92 @@
1
- navs = ['form', 'dialog', 'form_dynamic', 'auto_validate', 'multiupload', 'dirty_state', 'window', 'selectable', 'list_editable', 'lifecycle', 'file_upload_new', 'logics_set', 'http', 'sheets', 'snackbars']
1
+ nav_groups = {
2
+ 'Actions' => [
3
+ 'browsers',
4
+ 'commands',
5
+ 'components',
6
+ 'cookies',
7
+ 'dialog',
8
+ 'forms',
9
+ 'http',
10
+ 'lifecycle',
11
+ 'logics_set',
12
+ 'lists_append',
13
+ 'panels',
14
+ 'popovers',
15
+ 'sheets',
16
+ 'snackbars',
17
+ 'storage_items',
18
+ 'timeouts',
19
+ 'window',
20
+ 'windows'
21
+ ],
22
+ 'Forms' => [
23
+ 'auto_validate',
24
+ 'dirty_state',
25
+ 'file_upload_new',
26
+ 'form',
27
+ 'form_dynamic',
28
+ 'multiupload',
29
+ 'selectable'
30
+ ],
31
+ 'Lists' => [
32
+ 'list',
33
+ 'list_editable'
34
+ ],
35
+ 'Panels' => [
36
+ 'carousel',
37
+ 'column',
38
+ 'custom',
39
+ 'flow',
40
+ 'grid',
41
+ 'horizontal',
42
+ 'pagination',
43
+ 'responsive',
44
+ 'scroll',
45
+ 'split',
46
+ 'timeline',
47
+ 'ul',
48
+ 'vertical',
49
+ 'web'
50
+ ],
51
+ 'Tables' => [
52
+ 'table'
53
+ ],
54
+ 'Views' => [
55
+ 'calendar',
56
+ 'charts',
57
+ 'image',
58
+ 'multimedia_video',
59
+ 'progressCircle'
60
+ ]
61
+ }
2
62
 
3
- view.panels_flow(
4
- innerPadding: { bottom: 0 },
63
+ current_path = params[:path].to_s
64
+
65
+ view.panels_vertical(
5
66
  styleClass: 'align-right',
6
67
  width: 'matchParent',
7
68
  childViews: ->(res) do
8
- navs.each_with_index do |nav, index|
9
- if index < navs.size && index != 0
10
- res.spacer width: 4
11
- res.label text: '|'
12
- res.spacer width: 4
13
- end
14
- res.label(
15
- text: nav,
16
- onClick: ->(action) do
17
- action.windows_open url: json_ui_garage_url(path: "test_page/#{nav}")
69
+ nav_groups.each_with_index do |(group_name, items), group_index|
70
+ res.panels_flow innerPadding: { bottom: 0 }, childViews: ->(flow) do
71
+ flow.label text: "#{group_name}:"
72
+ flow.spacer width: 6
73
+ items.each_with_index do |nav, index|
74
+ nav_path = "test_page/#{nav}"
75
+ is_current = current_path == nav_path
76
+ if index != 0
77
+ flow.spacer width: 8
78
+ end
79
+ label_options = {
80
+ text: nav,
81
+ onClick: ->(action) do
82
+ action.windows_open url: json_ui_garage_url(path: nav_path)
83
+ end
84
+ }
85
+ label_options[:styleClass] = 'font-weight-bold' if is_current
86
+ flow.label(**label_options)
18
87
  end
19
- )
88
+ end
89
+ res.spacer height: 4 if group_index < nav_groups.size - 1
20
90
  end
21
91
  end
22
92
  )
@@ -0,0 +1,101 @@
1
+ json.title 'Test Page (Browsers)'
2
+
3
+ page = json_ui_page json
4
+
5
+ page.body(
6
+ childViews: ->(body) do
7
+ render 'json_ui/garage/test_page/header', view: body
8
+ body.panels_responsive(
9
+ padding: glib_json_padding_body,
10
+ childViews: ->(res) do
11
+ res.h2 text: 'Browsers'
12
+ res.label text: 'Browser detects for timezone and country.'
13
+ res.spacer height: 12
14
+ res.hr width: 'matchParent'
15
+ res.spacer height: 12
16
+
17
+ res.h2 text: 'Overview'
18
+ res.label text: 'Detect client timezone or country, then chain follow-up actions.'
19
+ res.spacer height: 12
20
+ res.hr width: 'matchParent'
21
+ res.spacer height: 12
22
+
23
+ res.h2 text: 'Basic example'
24
+ res.spacer height: 8
25
+ res.button(
26
+ text: 'browsers/detectTimezone',
27
+ onClick: ->(action) do
28
+ action.browsers_detectTimezone(
29
+ onDetect: ->(detect) do
30
+ detect.http_post url: json_ui_garage_url(path: 'forms/generic_post_all')
31
+ end
32
+ )
33
+ end
34
+ )
35
+
36
+ res.spacer height: 16
37
+ res.hr width: 'matchParent'
38
+ res.spacer height: 16
39
+
40
+ res.h2 text: 'Variants/props'
41
+ res.spacer height: 8
42
+ res.button(
43
+ text: 'browsers/detectCountry (with formData)',
44
+ onClick: ->(action) do
45
+ action.browsers_detectCountry(
46
+ onDetect: ->(detect) do
47
+ detect.http_post(
48
+ url: json_ui_garage_url(path: 'forms/generic_post_all'),
49
+ formData: {
50
+ message: 'hello'
51
+ }
52
+ )
53
+ end
54
+ )
55
+ end
56
+ )
57
+
58
+ res.spacer height: 16
59
+ res.hr width: 'matchParent'
60
+ res.spacer height: 16
61
+
62
+ res.h2 text: 'Actions/events'
63
+ res.spacer height: 8
64
+ res.label id: 'browsers_status', text: 'Status: idle'
65
+ res.spacer height: 8
66
+ res.button(
67
+ text: 'browsers/detectTimezone (update status)',
68
+ onClick: ->(action) do
69
+ action.browsers_detectTimezone(
70
+ onDetect: ->(detect) do
71
+ detect.runMultiple(
72
+ childActions: ->(multi) do
73
+ multi.logics_set targetId: 'browsers_status', data: { text: 'Status: detected timezone' }
74
+ multi.snackbars_alert message: 'Timezone detected'
75
+ end
76
+ )
77
+ end
78
+ )
79
+ end
80
+ )
81
+
82
+ res.spacer height: 16
83
+ res.hr width: 'matchParent'
84
+ res.spacer height: 16
85
+
86
+ res.h2 text: 'Edge/advanced'
87
+ res.spacer height: 8
88
+ res.button(
89
+ text: 'browsers/detectCountry (no formData)',
90
+ onClick: ->(action) do
91
+ action.browsers_detectCountry(
92
+ onDetect: ->(detect) do
93
+ detect.snackbars_alert message: 'Country detect requested'
94
+ end
95
+ )
96
+ end
97
+ )
98
+ end
99
+ )
100
+ end
101
+ )
@@ -0,0 +1,109 @@
1
+ json.title 'Test Page (Calendar)'
2
+
3
+ page = json_ui_page json
4
+
5
+ page.body(
6
+ childViews: ->(body) do
7
+ render 'json_ui/garage/test_page/header', view: body
8
+
9
+ body.panels_responsive(
10
+ padding: glib_json_padding_body,
11
+ childViews: ->(res) do
12
+ res.h2 text: 'Overview'
13
+ res.p text: 'Calendar renders events from a dataUrl and supports tap actions defined in each event.'
14
+ res.spacer height: 12
15
+ res.hr width: 'matchParent'
16
+ res.spacer height: 12
17
+
18
+ res.h2 text: 'Basic example'
19
+ res.spacer height: 8
20
+ res.calendar(
21
+ id: 'calendar_main',
22
+ width: 'matchParent',
23
+ height: 420,
24
+ dataUrl: json_ui_garage_url(path: 'views/calendar_data')
25
+ )
26
+
27
+ res.spacer height: 12
28
+ res.hr width: 'matchParent'
29
+ res.spacer height: 12
30
+
31
+ res.h2 text: 'Variants and props'
32
+ res.label text: 'Use the buttons to resize the calendar or switch its data source.'
33
+ res.spacer height: 8
34
+ res.panels_flow innerPadding: { bottom: 0 }, childViews: ->(flow) do
35
+ flow.button(
36
+ text: 'Default size',
37
+ onClick: ->(action) do
38
+ action.components_set(
39
+ targetId: 'calendar_main',
40
+ data: {
41
+ height: 420,
42
+ width: 'matchParent',
43
+ dataUrl: json_ui_garage_url(path: 'views/calendar_data')
44
+ }
45
+ )
46
+ end
47
+ )
48
+ flow.spacer width: 6
49
+ flow.button(
50
+ text: 'Compact',
51
+ onClick: ->(action) do
52
+ action.components_set targetId: 'calendar_main', data: { height: 320 }
53
+ end
54
+ )
55
+ flow.spacer width: 6
56
+ flow.button(
57
+ text: 'Tall',
58
+ onClick: ->(action) do
59
+ action.components_set targetId: 'calendar_main', data: { height: 560 }
60
+ end
61
+ )
62
+ flow.spacer width: 6
63
+ flow.button(
64
+ text: 'Fixed width',
65
+ onClick: ->(action) do
66
+ action.components_set targetId: 'calendar_main', data: { width: 720 }
67
+ end
68
+ )
69
+ end
70
+
71
+ res.spacer height: 12
72
+ res.hr width: 'matchParent'
73
+ res.spacer height: 12
74
+
75
+ res.h2 text: 'Actions and events'
76
+ res.label text: 'Tap an event to trigger its onClick alert from the data endpoint.'
77
+ res.spacer height: 12
78
+
79
+ res.hr width: 'matchParent'
80
+ res.spacer height: 12
81
+
82
+ res.h2 text: 'Edge and advanced'
83
+ res.label text: 'Swap to an empty data set to confirm the calendar handles no events.'
84
+ res.spacer height: 8
85
+ res.panels_flow innerPadding: { bottom: 0 }, childViews: ->(flow) do
86
+ flow.button(
87
+ text: 'Empty data',
88
+ onClick: ->(action) do
89
+ action.components_set(
90
+ targetId: 'calendar_main',
91
+ data: { dataUrl: json_ui_garage_url(path: 'test_page/calendar_empty_data') }
92
+ )
93
+ end
94
+ )
95
+ flow.spacer width: 6
96
+ flow.button(
97
+ text: 'Restore data',
98
+ onClick: ->(action) do
99
+ action.components_set(
100
+ targetId: 'calendar_main',
101
+ data: { dataUrl: json_ui_garage_url(path: 'views/calendar_data') }
102
+ )
103
+ end
104
+ )
105
+ end
106
+ end
107
+ )
108
+ end
109
+ )
@@ -0,0 +1,3 @@
1
+ section = json_ui_section json
2
+ section.rows builder: ->(row) do
3
+ end
@@ -0,0 +1,70 @@
1
+ json.title 'Test Page (Carousel)'
2
+
3
+ page = json_ui_page json
4
+
5
+ page.body childViews: ->(body) do
6
+ render 'json_ui/garage/test_page/header', view: body
7
+
8
+ body.panels_responsive padding: glib_json_padding_body, childViews: ->(res) do
9
+ res.h2 text: 'Overview'
10
+ res.p text: 'Carousel panels arrange child views horizontally in a scrollable strip.'
11
+
12
+ res.spacer height: 12
13
+ res.hr width: 'matchParent'
14
+
15
+ res.h2 text: 'Basic'
16
+ res.spacer height: 8
17
+ res.panels_carousel id: 'carousel_main', width: 'matchParent', childViews: ->(carousel) do
18
+ (1..3).each do |index|
19
+ carousel.panels_vertical width: 120, height: 80, backgroundColor: '#e6e6e6', align: 'center', childViews: ->(panel) do
20
+ panel.label text: "Card #{index}"
21
+ end
22
+ end
23
+ end
24
+
25
+ res.spacer height: 12
26
+ res.hr width: 'matchParent'
27
+
28
+ res.h2 text: 'Variants and Props'
29
+ res.spacer height: 8
30
+ res.panels_flow innerPadding: { bottom: 0 }, childViews: ->(flow) do
31
+ flow.button text: 'Fill equally', onClick: ->(action) do
32
+ action.components_set targetId: 'carousel_main', data: { distribution: 'fillEqually' }
33
+ end
34
+ flow.spacer width: 4
35
+ flow.button text: 'Space equally', onClick: ->(action) do
36
+ action.components_set targetId: 'carousel_main', data: { distribution: 'spaceEqually' }
37
+ end
38
+ flow.spacer width: 4
39
+ flow.button text: 'Clear distribution', onClick: ->(action) do
40
+ action.components_set targetId: 'carousel_main', data: { distribution: nil }
41
+ end
42
+ end
43
+
44
+ res.spacer height: 12
45
+ res.hr width: 'matchParent'
46
+
47
+ res.h2 text: 'Actions and Events'
48
+ res.spacer height: 8
49
+ res.label id: 'carousel_action_status', text: 'Action status: idle'
50
+ res.spacer height: 6
51
+ res.panels_carousel width: 'matchParent', childViews: ->(carousel) do
52
+ ['A', 'B', 'C'].each do |label|
53
+ carousel.panels_vertical width: 120, height: 60, backgroundColor: '#e6e6e6', align: 'center', childViews: ->(panel) do
54
+ panel.button text: "Pick #{label}", onClick: ->(action) do
55
+ action.components_set targetId: 'carousel_action_status', data: { text: "Action status: #{label}" }
56
+ end
57
+ end
58
+ end
59
+ end
60
+
61
+ res.spacer height: 12
62
+ res.hr width: 'matchParent'
63
+
64
+ res.h2 text: 'Edge and Advanced'
65
+ res.spacer height: 8
66
+ res.label text: 'Empty carousel'
67
+ res.panels_carousel width: 'matchParent', childViews: ->(_carousel) do
68
+ end
69
+ end
70
+ end