asab_webui_shell 27.1.3 → 27.1.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.
@@ -240,7 +240,18 @@ class Application extends _react.Component {
240
240
  define recognition of the requests from the service perspective
241
241
  */
242
242
  axios.interceptors.request.use(function (config) {
243
- that.pushNetworkingIndicator();
243
+ var _config$headers, _config$headers2;
244
+ /* Usage of networking indicator is optional and can be set as following among other headers:
245
+ headers: { 'X-Networking-Indicator': 'off' }
246
+ */
247
+ var networkingIndicatorOff = (config === null || config === void 0 || (_config$headers = config.headers) === null || _config$headers === void 0 ? void 0 : _config$headers['X-Networking-Indicator']) === 'off';
248
+ // Store flag in config for response interceptors to access
249
+ config._networkingIndicatorOff = networkingIndicatorOff;
250
+ if (!networkingIndicatorOff) {
251
+ that.pushNetworkingIndicator();
252
+ }
253
+ // Remove the X-Networking-Indicator header before sending to service (its only for internal use)
254
+ config === null || config === void 0 || (_config$headers2 = config.headers) === null || _config$headers2 === void 0 || delete _config$headers2['X-Networking-Indicator'];
244
255
  config.headers['X-App'] = "webui"; // Include X-App header in every axios API request
245
256
  config.headers['X-Request-Id'] = that._generateUID(); // Include X-Request-Id header in every axios API request
246
257
  return config;
@@ -252,7 +263,9 @@ class Application extends _react.Component {
252
263
  axios.interceptors.response.use(function (response) {
253
264
  var _response$headers$con;
254
265
  // Call the `popNetworkingIndicator` method to remove the networking indicator (e.g., loading spinner)
255
- that.popNetworkingIndicator();
266
+ if (!response.config._networkingIndicatorOff) {
267
+ that.popNetworkingIndicator();
268
+ }
256
269
 
257
270
  /*
258
271
  Custom flag to control JSON parsing for specific requests.
@@ -293,8 +306,10 @@ class Application extends _react.Component {
293
306
  // If the request was satisfied (application/json and presence of BigInt) return the modified object. If not, we return unchanged object
294
307
  return response;
295
308
  }, function (error) {
296
- var _error$response, _error$response2;
297
- that.popNetworkingIndicator();
309
+ var _error$config, _error$response, _error$response2;
310
+ if (!((_error$config = error.config) !== null && _error$config !== void 0 && _error$config._networkingIndicatorOff)) {
311
+ that.popNetworkingIndicator();
312
+ }
298
313
  var contentType = error === null || error === void 0 || (_error$response = error.response) === null || _error$response === void 0 || (_error$response = _error$response.headers) === null || _error$response === void 0 ? void 0 : _error$response['content-type'];
299
314
  // Check if the response content type is 'application/json' and data is a string
300
315
  if (contentType !== null && contentType !== void 0 && contentType.startsWith('application/json') && typeof (error === null || error === void 0 || (_error$response2 = error.response) === null || _error$response2 === void 0 ? void 0 : _error$response2.data) === 'string') {
@@ -68,3 +68,7 @@
68
68
  .monaco-hover {
69
69
  position: fixed !important;
70
70
  }
71
+
72
+ .cursor-pointer {
73
+ cursor: pointer;
74
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "asab_webui_shell",
3
- "version": "27.1.3",
3
+ "version": "27.1.5",
4
4
  "license": "BSD-3-Clause",
5
5
  "description": "TeskaLabs ASAB WebUI Shell Application",
6
6
  "contributors": [