glib-web 4.36.0 → 4.36.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 94b3768dec74f3a05c32ffd19612d151afce3829643e070f173899d02627e72f
4
- data.tar.gz: e7f8124643269e1634a979683210b93a7ca613fd1cf975a0ff20419a3f08f9f2
3
+ metadata.gz: e4fa3a5bc80fc1354db7030f213da3db807b948797c729500015f8f1d9e11ba1
4
+ data.tar.gz: b9174c228c32924fdbc7ecb87214bfce37d4c63ce0a5d3b905be0e4ac0c2143f
5
5
  SHA512:
6
- metadata.gz: 91cf7697395548ce7d8ee306269688c1166ed9e9d1ca0778a5d2d2dfd72d26dab277a3d22069a1d4ef31727511816854bd12de8ef984629069b4413f295095c5
7
- data.tar.gz: 4b655db49df2bfba84b0c524d02e41fdaadcacfb687418f7d3651c24712c9c7a55ed1b5bf4a1951b3107264a5db09b348b892293efaee7212c06d05b9b36408e
6
+ metadata.gz: 9609485c6c0339b27600efbfd1fbea22f8b676c16b792c69cdb2a1c6a44f75ad3d2632d9868ed142bdfef70dd8fc22b876c1946c4d5de208d0a4d4ee0225d595
7
+ data.tar.gz: e2e758483ccba38788bd0e06139aef0ad4acd2c0c9a71d85cd017aa92ac1320abb51b45613d46480a798f31e851da480b2e8f93929d0ee6c8b3f2ad6540c0fc9
@@ -68,10 +68,10 @@ module Glib::Json::Libs
68
68
 
69
69
  # As much as possible, try retaining the front fragment by matching the back, because
70
70
  # the front could be either a `?` or `&`
71
- url = url.sub(/format=json\&/, '');
71
+ url = url.sub(/format=json\&/, '')
72
72
 
73
73
  # If no match, then we replace the front fragment
74
- url.sub(/[\&\?]format=json/, '');
74
+ url.sub(/[\&\?]format=json/, '')
75
75
  end
76
76
 
77
77
  def glib_redirect_to(url, return_to_previous: false, status: :ok)
@@ -87,6 +87,13 @@ module Glib::Json::Libs
87
87
  return
88
88
  end
89
89
 
90
+ # Inside a dialog, it's easier to simply use HTTP redirect, as opposed to trying to
91
+ # get the dialog to perform manual redirection.
92
+ if glib_json_dialog_mode?
93
+ redirect_to url
94
+ return
95
+ end
96
+
90
97
  json_ui_redirect_to url, status: status
91
98
  end
92
99
  end
@@ -152,14 +159,14 @@ module Glib::Json::Libs
152
159
  end
153
160
 
154
161
  render json: if glib_json_dialog_mode?
155
- { onLoad: __glib_error_dialog('Access denied', "Make sure you're logged in with the correct account.") }
156
- else
157
- {
158
- onResponse: {
159
- action: 'windows/open', url: user_default_url
160
- }
161
- }
162
- end, status: Rails.env.test? ? :forbidden : :ok
162
+ { onLoad: __glib_error_dialog('Access denied', "Make sure you're logged in with the correct account.") }
163
+ else
164
+ {
165
+ onResponse: {
166
+ action: 'windows/open', url: user_default_url
167
+ }
168
+ }
169
+ end, status: Rails.env.test? ? :forbidden : :ok
163
170
  end
164
171
  format.csv do
165
172
  if Rails.env.test?
@@ -229,7 +236,7 @@ module Glib::Json::Libs
229
236
  if json_ui_activated?
230
237
  if Rails.env.production? || preview_mode
231
238
  if defined?(Rollbar) && !preview_mode
232
- Rollbar.error(exception, :use_exception_level_filters => true)
239
+ Rollbar.error(exception, use_exception_level_filters: true)
233
240
  end
234
241
 
235
242
  render file: Rails.root.join('public', '500.html'), status: :internal_server_error
@@ -261,7 +268,7 @@ module Glib::Json::Libs
261
268
  if glib_json_dialog_mode?
262
269
  # Only do this in dialog mode because this seems to add to the rendering time
263
270
  # (i.e. longer flicker time), presumably due to the use of things like `nextTick()`.
264
- on_response = { action: 'dialogs/close', onClose: on_load }
271
+ on_response = { action: 'dialogs/close', onClose: on_response }
265
272
  end
266
273
 
267
274
  # Use onResponse because it is harder to guarantee that `onLoad` executes in Vuejs because it relies
@@ -162,6 +162,9 @@ module Glib
162
162
  # hash :actionCable
163
163
  # string :format
164
164
  action :onClick
165
+
166
+ # Whether the label is focusable using the Tab key.
167
+ bool :disableKeyboardFocus
165
168
  end
166
169
 
167
170
  class Image < View
@@ -13,7 +13,54 @@ section.rows builder: ->(row) do
13
13
  if local_assigns[:reorder]
14
14
  row.thumbnail title: "Item #{index}"
15
15
  else
16
- row.thumbnail title: "Item #{index}", subtitle: "Sub Item #{index}", subsubtitle: "Sub Sub Item #{index}"
16
+ row.thumbnail \
17
+ title: "Item #{index}",
18
+ subtitle: "Sub Item #{index}",
19
+ subsubtitle: "Sub Sub Item #{index}"
20
+ # onClick: ->(action) do
21
+ # action.windows_openWeb url: 'https://www.google.com'
22
+ # end,
23
+ # content: ->(content) do
24
+ # content.footer \
25
+ # childViews: ->(footer) do
26
+ # footer.panels_horizontal \
27
+ # padding: { x: 10, y: 5 },
28
+ # childViews: ->(horizontal) do
29
+ # horizontal.label \
30
+ # text: 'View',
31
+ # onClick: ->(action) do
32
+ # # TODO: For some reason this causes the auto-scrolling issue
33
+ # # action.windows_openWeb url: frontend_place_url(place)
34
+
35
+ # # action.windows_openWeb url: frontend_place_url(place)
36
+ # end
37
+
38
+ # horizontal.spacer styleClass: 'width-sm'
39
+
40
+ # horizontal.label \
41
+ # text: symbol_horizontal_separator,
42
+ # styleClasses: ['text-muted']
43
+
44
+ # horizontal.spacer styleClass: 'width-sm'
45
+
46
+ # horizontal.label \
47
+ # text: 'Delete',
48
+ # onClick: ->(action) do
49
+ # action.windows_openWeb url: 'https://www.google.com'
50
+ # # action.windows_openWeb url: frontend_place_url(place)
51
+
52
+ # # render \
53
+ # # 'shared/confirmation_sheet',
54
+ # # panel: action,
55
+ # # message: 'Are you sure you want to delete this favorite?',
56
+ # # confirmation_text: 'Yes, delete the favorite',
57
+ # # confirmation_action: ->(subsubaction) do
58
+ # # subsubaction.http_delete url: favorite_list_favorite_url(@favorite_list, favorite)
59
+ # # end
60
+ # end
61
+ # end
62
+ # end
63
+ # end
17
64
  end
18
65
  end
19
66
  end
@@ -13,6 +13,16 @@ end
13
13
 
14
14
  page.scroll padding: glib_json_padding_body, childViews: ->(scroll) do
15
15
  (1..100).each do |index|
16
- scroll.label text: 'Content'
16
+ scroll.panels_vertical \
17
+ width: 'matchParent',
18
+ backgroundColor: '#b3bac2',
19
+ height: 'matchParent',
20
+ childViews: ->(panels) do
21
+ panels.label text: 'Content'
22
+ panels.spacer height: 4
23
+ panels.label text: 'view', onClick: ->(action) do
24
+ action.windows_openWeb url: 'https://www.google.com'
25
+ end
26
+ end
17
27
  end
18
28
  end
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.36.0
4
+ version: 4.36.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - ''