asab_webui_shell 27.1.2 → 27.1.4
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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') {
|
|
@@ -134,9 +134,8 @@ function InvitationScreen(props) {
|
|
|
134
134
|
fluid: true,
|
|
135
135
|
className: isInvitationSuccessful == undefined ? '' : 'h-100'
|
|
136
136
|
}, isInvitationSuccessful != undefined ? /*#__PURE__*/_react.default.createElement(_asab_webui_components.ResultCard, {
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
}) : /*#__PURE__*/_react.default.createElement(_reactstrap.Row, {
|
|
137
|
+
status: isInvitationSuccessful ? 'success' : 'danger'
|
|
138
|
+
}, isInvitationSuccessful ? /*#__PURE__*/_react.default.createElement(SuccessfulInvitationCardBody, null) : /*#__PURE__*/_react.default.createElement(UnsuccessfulInvitationCardBody, null)) : /*#__PURE__*/_react.default.createElement(_reactstrap.Row, {
|
|
140
139
|
className: "justify-content-center pt-5"
|
|
141
140
|
}, /*#__PURE__*/_react.default.createElement(_reactstrap.Col, {
|
|
142
141
|
md: "4"
|