glib-web 4.35.3 → 4.35.5

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: 139b8bb1e77c9778bb396d3ed8da72c74051d9cae9cacbae23dd713357ad9586
4
- data.tar.gz: 200ab9fae64c136049b7eb288898216ede1c261dba047e1f386166daa0ab0309
3
+ metadata.gz: bd64c82e1baa6874b8791fdc0a330916a9463e92145a5e7c8ac3a6b64ef271dd
4
+ data.tar.gz: 85ea472517490fd0d2fc572531869964240111df12d2e93b9fc35a569ece071d
5
5
  SHA512:
6
- metadata.gz: a5761de4b8433b8aec45ac23f3890cc66f1052426d133e37e40d25e3bb10109ef6ac13ee607554b3db7d7b0695086f7823e86f7cb432ea377317b83d35d26375
7
- data.tar.gz: d308d941d36c01460174449bc7375cbae1c767dd9797b56f4c008e86985605b890bb292c678d69a93e8a34e63e914921984d0fddde80d6eaa270cb6ae5275ae4
6
+ metadata.gz: 4cfd05eee3620fc4177e75f7e5f43904e1560084979aad3bc522beb837afc45e86b47f766feb2ada4b69d4f20a14b236907f04e4072968316d7b2b99100fdebe
7
+ data.tar.gz: 1afe10ae33a3688b85be1cd1f966ff8bd01d60eaca51fb3602d4d1c8d52b6276701371f455758d488248c1ea344c8e019e6c2b61878dcd5ea88be52725c15dd2
@@ -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
@@ -7,7 +7,7 @@ module Glib
7
7
  button: I18n.t('glib.accepts.max_file_size_error.button', default: nil) || 'Dismiss'
8
8
  }
9
9
  default_max_length_error = {
10
- body: I18n.t('glib.accepts.max_file_length_error.body', default: nil) || 'Files exceed the maximum limit per upload',
10
+ body: I18n.t('glib.accepts.max_file_length_error.body', default: nil) || 'Files exceed the maximum limit',
11
11
  button: I18n.t('glib.accepts.max_file_length_error.button', default: nil) || 'Dismiss'
12
12
  }
13
13
 
@@ -46,7 +46,15 @@ page.form options.merge(childViews: ->(form) do
46
46
  name: 'user[multi][]',
47
47
  id: 'upload_1',
48
48
  width: 360,
49
- accepts: { fileType: 'image', maxFileSize: 10 },
49
+ accepts: {
50
+ fileType: 'image',
51
+ maxFileSize: 10,
52
+ maxFileLength: 2,
53
+ maxFileLengthErrorText: {
54
+ body: 'try with a smaller number of files',
55
+ button: 'OK'
56
+ }
57
+ },
50
58
  directUploadUrl: glib_direct_uploads_url,
51
59
  uploadTitle: 'Files uploaded:',
52
60
  storagePrefix: 'glib',
@@ -70,7 +78,10 @@ page.form options.merge(childViews: ->(form) do
70
78
  name: 'user[multi2][]',
71
79
  id: 'upload_2',
72
80
  width: 360,
73
- accepts: { fileType: 'image', maxFileSize: 5000 },
81
+ accepts: {
82
+ fileType: 'image',
83
+ maxFileSize: 5000
84
+ },
74
85
  directUploadUrl: glib_direct_uploads_url,
75
86
  uploadTitle: 'Files uploaded:',
76
87
  onFinishUpload: ->(action) { action.forms_submit }
@@ -89,7 +100,7 @@ page.form options.merge(childViews: ->(form) do
89
100
  form.fields_multiUpload \
90
101
  name: 'user[multi3][]',
91
102
  width: 360,
92
- accepts: { fileType: 'image', maxFileSize: 100 },
103
+ accepts: { fileType: 'image', maxFileSize: 100, maxFileLength: 2 },
93
104
  uploadTitle: 'Files uploaded:',
94
105
  onFinishUpload: ->(action) { action.forms_submit }
95
106
 
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.35.3
4
+ version: 4.35.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - ''