glib-web 4.35.4 → 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: f43a25bddae602f3006f9f75962217e4fc736dfdf0a5fc6c5bb8f7662fcff5d0
4
- data.tar.gz: d927ddec574668cb4410835c1ad04052076ab8d18b1172d69881c906bc0bcce2
3
+ metadata.gz: bd64c82e1baa6874b8791fdc0a330916a9463e92145a5e7c8ac3a6b64ef271dd
4
+ data.tar.gz: 85ea472517490fd0d2fc572531869964240111df12d2e93b9fc35a569ece071d
5
5
  SHA512:
6
- metadata.gz: c9d47057c841b84141c4b6b89fd1100ea23f161c8ee6b24428e94c5bf5438a6c76541e5b1fddc3f25e5763da547653dea76c0b26091cbe471f8e736bc8be8daf
7
- data.tar.gz: 261879367984016d4ed1f140209ab079d5bb31c85721ec56654f4c100d3d8e890327ba8752eb6b55b04ca492e65b8d0142f856107ff573825bffe8a81251d215
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
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.4
4
+ version: 4.35.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - ''