asab_webui_shell 26.1.1 → 26.1.3
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.
- package/dist/containers/Application.js +4 -17
- package/dist/modules/auth/index.js +91 -109
- package/dist/modules/auth/screens/AccessControlScreen.js +7 -1
- package/dist/modules/auth/screens/InvitationScreen.js +7 -1
- package/dist/modules/tenant/service.js +1 -1
- package/dist/screens/InvalidRouteScreen.js +6 -2
- package/dist/screens/UnauthorizedAccessScreen.js +5 -2
- package/package.json +1 -1
|
@@ -82,21 +82,8 @@ class Application extends _react.Component {
|
|
|
82
82
|
constructor(props) {
|
|
83
83
|
super(props);
|
|
84
84
|
|
|
85
|
-
//
|
|
86
|
-
|
|
87
|
-
state: null,
|
|
88
|
-
dispatch: null
|
|
89
|
-
}; // Create the store object (fields stays writable so the provider can update them)
|
|
90
|
-
Object.seal(appStore); // Lock the shape, so no adding/removing properties (but existing fields remain writable)
|
|
91
|
-
Object.defineProperty(this, 'AppStore', {
|
|
92
|
-
value: appStore,
|
|
93
|
-
writable: false,
|
|
94
|
-
// Can't reassign this.AppStore
|
|
95
|
-
configurable: false,
|
|
96
|
-
// Can't redefine/delete the property
|
|
97
|
-
enumerable: true // Makes it show up in Object.keys/console
|
|
98
|
-
}); // Define a read-only, non-configurable property on the instance
|
|
99
|
-
|
|
85
|
+
// Create App store with global AppStore variables
|
|
86
|
+
this.AppStore = (0, _asab_webui_components.createAppStore)();
|
|
100
87
|
this.Modules = [];
|
|
101
88
|
this.Services = {};
|
|
102
89
|
this.ReduxService = new _ReduxService.default(this, "ReduxService");
|
|
@@ -599,7 +586,7 @@ class Application extends _react.Component {
|
|
|
599
586
|
var _this$AppStore$dispat3, _this$AppStore3;
|
|
600
587
|
if (enabled === 0) {
|
|
601
588
|
var _state$advmode;
|
|
602
|
-
var state = this.AppStore.
|
|
589
|
+
var state = this.AppStore.getState();
|
|
603
590
|
enabled = !(state !== null && state !== void 0 && (_state$advmode = state.advmode) !== null && _state$advmode !== void 0 && _state$advmode.enabled);
|
|
604
591
|
}
|
|
605
592
|
(_this$AppStore$dispat3 = (_this$AppStore3 = this.AppStore).dispatch) === null || _this$AppStore$dispat3 === void 0 || _this$AppStore$dispat3.call(_this$AppStore3, {
|
|
@@ -619,7 +606,7 @@ class Application extends _react.Component {
|
|
|
619
606
|
*/
|
|
620
607
|
setFullScreenMode(status) {
|
|
621
608
|
var _state$fullscreenmode, _this$AppStore$dispat4, _this$AppStore4;
|
|
622
|
-
var state = this.AppStore.
|
|
609
|
+
var state = this.AppStore.getState();
|
|
623
610
|
if (status === 'on' && (state === null || state === void 0 || (_state$fullscreenmode = state.fullscreenmode) === null || _state$fullscreenmode === void 0 ? void 0 : _state$fullscreenmode.status) === 'on') {
|
|
624
611
|
status = 'off';
|
|
625
612
|
}
|
|
@@ -169,7 +169,7 @@ class AuthModule extends _asab_webui_components.Module {
|
|
|
169
169
|
type: _actions.types.AUTH_RESOURCES,
|
|
170
170
|
resources: resources
|
|
171
171
|
});
|
|
172
|
-
|
|
172
|
+
_this.validateNavigation({
|
|
173
173
|
resources
|
|
174
174
|
});
|
|
175
175
|
}
|
|
@@ -263,75 +263,57 @@ class AuthModule extends _asab_webui_components.Module {
|
|
|
263
263
|
window.location.reload();
|
|
264
264
|
});
|
|
265
265
|
}
|
|
266
|
-
|
|
267
|
-
// TODO: reconsider removing async/await with promise
|
|
268
266
|
validateNavigation(_ref) {
|
|
269
|
-
var
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
267
|
+
var _state$navigation, _this$App$AppStore$di, _this$App$AppStore;
|
|
268
|
+
var {
|
|
269
|
+
resources
|
|
270
|
+
} = _ref;
|
|
271
|
+
var state = this.App.AppStore.getState();
|
|
272
|
+
var navItems = (_state$navigation = state.navigation) === null || _state$navigation === void 0 ? void 0 : _state$navigation.navItems;
|
|
273
|
+
var authorizedNavItems = [];
|
|
274
|
+
navItems && navItems.map((itm, idx) => {
|
|
275
|
+
if (resources.indexOf('authz:superuser') !== -1) {
|
|
276
|
+
// If user is superuser, validate every navigation item
|
|
277
|
+
authorizedNavItems.push(itm);
|
|
278
|
+
} else {
|
|
279
|
+
if (itm.resource) {
|
|
280
|
+
if (itm.children) {
|
|
281
|
+
itm.children = this._validateChildrenNav(itm, resources);
|
|
282
|
+
}
|
|
283
|
+
// Item validation
|
|
284
|
+
var access_auth = this._validateItemNav(itm.resource, resources);
|
|
285
|
+
if (access_auth == true) {
|
|
282
286
|
authorizedNavItems.push(itm);
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
var access_auth = _this3._validateItemNav(itm.resource, resources);
|
|
290
|
-
if (access_auth == true) {
|
|
291
|
-
authorizedNavItems.push(itm);
|
|
292
|
-
}
|
|
293
|
-
} else {
|
|
294
|
-
if (itm.children) {
|
|
295
|
-
itm.children = yield _this3._validateChildrenNav(itm, resources);
|
|
296
|
-
if (itm.children.length > 0) {
|
|
297
|
-
authorizedNavItems.push(itm);
|
|
298
|
-
}
|
|
299
|
-
}
|
|
287
|
+
}
|
|
288
|
+
} else {
|
|
289
|
+
if (itm.children) {
|
|
290
|
+
itm.children = this._validateChildrenNav(itm, resources);
|
|
291
|
+
if (itm.children.length > 0) {
|
|
292
|
+
authorizedNavItems.push(itm);
|
|
300
293
|
}
|
|
301
294
|
}
|
|
302
|
-
}
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
navItems: authorizedNavItems
|
|
310
|
-
});
|
|
311
|
-
})();
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
});
|
|
298
|
+
(_this$App$AppStore$di = (_this$App$AppStore = this.App.AppStore).dispatch) === null || _this$App$AppStore$di === void 0 || _this$App$AppStore$di.call(_this$App$AppStore, {
|
|
299
|
+
type: _actions2.SET_NAVIGATION_ITEMS,
|
|
300
|
+
navItems: authorizedNavItems
|
|
301
|
+
});
|
|
312
302
|
}
|
|
313
303
|
|
|
314
304
|
// Validate sidebar's item children
|
|
315
305
|
_validateChildrenNav(itm, resources) {
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
}
|
|
328
|
-
});
|
|
329
|
-
return function (_x3, _x4) {
|
|
330
|
-
return _ref3.apply(this, arguments);
|
|
331
|
-
};
|
|
332
|
-
}()));
|
|
333
|
-
return authorizedNavChildren;
|
|
334
|
-
})();
|
|
306
|
+
// Item's children validation
|
|
307
|
+
var authorizedNavChildren = [];
|
|
308
|
+
itm.children.map((child, id) => {
|
|
309
|
+
if (child.resource) {
|
|
310
|
+
var access_auth = this._validateItemNav(child.resource, resources);
|
|
311
|
+
if (access_auth == true) {
|
|
312
|
+
authorizedNavChildren.push(child);
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
});
|
|
316
|
+
return authorizedNavChildren;
|
|
335
317
|
}
|
|
336
318
|
|
|
337
319
|
// Validate sidebar items
|
|
@@ -361,38 +343,38 @@ class AuthModule extends _asab_webui_components.Module {
|
|
|
361
343
|
return valid;
|
|
362
344
|
}
|
|
363
345
|
updateUserInfo() {
|
|
364
|
-
var
|
|
346
|
+
var _this3 = this;
|
|
365
347
|
return (0, _asyncToGenerator2.default)(function* () {
|
|
366
348
|
var _response$data;
|
|
367
349
|
var response;
|
|
368
350
|
try {
|
|
369
|
-
response = yield
|
|
351
|
+
response = yield _this3.Api.userinfo(_this3.OAuthTokens.access_token);
|
|
370
352
|
} catch (err) {
|
|
371
353
|
console.error("Failed to update user info", err);
|
|
372
|
-
|
|
373
|
-
if (
|
|
374
|
-
var
|
|
375
|
-
(
|
|
354
|
+
_this3.UserInfo = null;
|
|
355
|
+
if (_this3.App.AppStore) {
|
|
356
|
+
var _this3$App$AppStore$d, _this3$App$AppStore;
|
|
357
|
+
(_this3$App$AppStore$d = (_this3$App$AppStore = _this3.App.AppStore).dispatch) === null || _this3$App$AppStore$d === void 0 || _this3$App$AppStore$d.call(_this3$App$AppStore, {
|
|
376
358
|
type: _actions.types.AUTH_USERINFO,
|
|
377
|
-
payload:
|
|
359
|
+
payload: _this3.UserInfo
|
|
378
360
|
});
|
|
379
361
|
}
|
|
380
362
|
return false;
|
|
381
363
|
}
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
if (
|
|
385
|
-
var
|
|
386
|
-
(
|
|
364
|
+
_this3.UserInfo = response.data;
|
|
365
|
+
_this3.SessionExpiration = (_response$data = response.data) === null || _response$data === void 0 ? void 0 : _response$data.exp;
|
|
366
|
+
if (_this3.App.AppStore) {
|
|
367
|
+
var _this3$App$AppStore$d2, _this3$App$AppStore2;
|
|
368
|
+
(_this3$App$AppStore$d2 = (_this3$App$AppStore2 = _this3.App.AppStore).dispatch) === null || _this3$App$AppStore$d2 === void 0 || _this3$App$AppStore$d2.call(_this3$App$AppStore2, {
|
|
387
369
|
type: _actions.types.AUTH_USERINFO,
|
|
388
|
-
payload:
|
|
370
|
+
payload: _this3.UserInfo
|
|
389
371
|
});
|
|
390
372
|
}
|
|
391
373
|
|
|
392
374
|
/** Check for TenantService and pass tenants list obtained from userinfo */
|
|
393
|
-
var availableTenants =
|
|
394
|
-
if (
|
|
395
|
-
yield
|
|
375
|
+
var availableTenants = _this3.UserInfo.tenants;
|
|
376
|
+
if (_this3.App.Services.TenantService) {
|
|
377
|
+
yield _this3.App.Services.TenantService.setTenants(availableTenants, _this3._getAuthorizedTenant(_this3.UserInfo));
|
|
396
378
|
}
|
|
397
379
|
return true;
|
|
398
380
|
})();
|
|
@@ -400,11 +382,11 @@ class AuthModule extends _asab_webui_components.Module {
|
|
|
400
382
|
|
|
401
383
|
// Method for obtaining and storing the OAuth tokens based on authorization code
|
|
402
384
|
_exchangeCodeForTokens(authorization_code) {
|
|
403
|
-
var
|
|
385
|
+
var _this4 = this;
|
|
404
386
|
return (0, _asyncToGenerator2.default)(function* () {
|
|
405
387
|
try {
|
|
406
|
-
var response = yield
|
|
407
|
-
|
|
388
|
+
var response = yield _this4.Api.token_authorization_code(authorization_code, _this4.RedirectURL);
|
|
389
|
+
_this4.OAuthTokens = response.data;
|
|
408
390
|
sessionStorage.setItem('SeaCatOAuth2Tokens', JSON.stringify(response.data));
|
|
409
391
|
return true;
|
|
410
392
|
} catch (err) {
|
|
@@ -416,16 +398,16 @@ class AuthModule extends _asab_webui_components.Module {
|
|
|
416
398
|
|
|
417
399
|
// Method for refreshing OAuth tokens
|
|
418
400
|
_refreshTokens() {
|
|
419
|
-
var
|
|
401
|
+
var _this5 = this;
|
|
420
402
|
return (0, _asyncToGenerator2.default)(function* () {
|
|
421
|
-
var
|
|
403
|
+
var _this5$OAuthTokens;
|
|
422
404
|
// If no refresh_token found, return false
|
|
423
|
-
if (!((
|
|
405
|
+
if (!((_this5$OAuthTokens = _this5.OAuthTokens) !== null && _this5$OAuthTokens !== void 0 && _this5$OAuthTokens.refresh_token)) {
|
|
424
406
|
return false;
|
|
425
407
|
}
|
|
426
408
|
try {
|
|
427
|
-
var response = yield
|
|
428
|
-
|
|
409
|
+
var response = yield _this5.Api.token_refresh(_this5.OAuthTokens.refresh_token);
|
|
410
|
+
_this5.OAuthTokens = response.data;
|
|
429
411
|
sessionStorage.setItem('SeaCatOAuth2Tokens', JSON.stringify(response.data));
|
|
430
412
|
return true;
|
|
431
413
|
} catch (err) {
|
|
@@ -452,9 +434,9 @@ class AuthModule extends _asab_webui_components.Module {
|
|
|
452
434
|
|
|
453
435
|
// Loop validating session expiration
|
|
454
436
|
_startSessionExpirationValidation() {
|
|
455
|
-
var
|
|
437
|
+
var _this6 = this;
|
|
456
438
|
return (0, _asyncToGenerator2.default)(function* () {
|
|
457
|
-
if (!
|
|
439
|
+
if (!_this6.SessionExpiration) {
|
|
458
440
|
console.warn("Session expiration is not set.");
|
|
459
441
|
return;
|
|
460
442
|
}
|
|
@@ -463,7 +445,7 @@ class AuthModule extends _asab_webui_components.Module {
|
|
|
463
445
|
var MAX_SESSION_DURATION = Math.pow(2, 31) - 1;
|
|
464
446
|
|
|
465
447
|
// Proactivelly validate session expiration
|
|
466
|
-
var lastKnownExpiration =
|
|
448
|
+
var lastKnownExpiration = _this6.SessionExpiration; // Last known session expiration
|
|
467
449
|
var sessionStartTime = Date.now() / 1000; // Session start time
|
|
468
450
|
var sessionDuration = lastKnownExpiration - sessionStartTime; // Session duration
|
|
469
451
|
// Prevent glitches on very large time remaining values
|
|
@@ -476,9 +458,9 @@ class AuthModule extends _asab_webui_components.Module {
|
|
|
476
458
|
var warningDisplayed = false; // Tracks if the "about to expire" warning has been shown
|
|
477
459
|
|
|
478
460
|
var _validateSession = /*#__PURE__*/function () {
|
|
479
|
-
var
|
|
461
|
+
var _ref2 = (0, _asyncToGenerator2.default)(function* () {
|
|
480
462
|
var currentTime = Date.now() / 1000; // Convert milliseconds to seconds
|
|
481
|
-
var timeRemaining =
|
|
463
|
+
var timeRemaining = _this6.SessionExpiration - currentTime; // Time difference for triggering "about to expire" warning
|
|
482
464
|
// Prevent glitches on very large time remaining values
|
|
483
465
|
if (timeRemaining > MAX_SESSION_DURATION) {
|
|
484
466
|
// Set timeout to maximum allowed value
|
|
@@ -488,13 +470,13 @@ class AuthModule extends _asab_webui_components.Module {
|
|
|
488
470
|
// Validate session on half of the session expiration or if the remaining time is <= 5min
|
|
489
471
|
if (!refreshSessionDone && (timeRemaining <= 300 || currentTime >= sessionMidpoint)) {
|
|
490
472
|
refreshSessionDone = true;
|
|
491
|
-
var tokensRefreshed = yield
|
|
473
|
+
var tokensRefreshed = yield _this6._refreshTokens();
|
|
492
474
|
// Recalculate if session expiration was extended
|
|
493
475
|
if (tokensRefreshed) {
|
|
494
|
-
yield
|
|
476
|
+
yield _this6.updateUserInfo(); // Update userinfo
|
|
495
477
|
// If current session expiration differs from last known expiration, recalculate session variables
|
|
496
|
-
if (
|
|
497
|
-
lastKnownExpiration =
|
|
478
|
+
if (_this6.SessionExpiration !== lastKnownExpiration) {
|
|
479
|
+
lastKnownExpiration = _this6.SessionExpiration;
|
|
498
480
|
sessionStartTime = currentTime;
|
|
499
481
|
sessionDuration = lastKnownExpiration - sessionStartTime;
|
|
500
482
|
// Prevent glitches on very large time remaining values
|
|
@@ -510,31 +492,31 @@ class AuthModule extends _asab_webui_components.Module {
|
|
|
510
492
|
|
|
511
493
|
// If remaining time is between 1 and 60s, repetitivelly ask for userInfo and trigger "about to expire" warning
|
|
512
494
|
if (timeRemaining <= 60 && timeRemaining > 0) {
|
|
513
|
-
var _tokensRefreshed = yield
|
|
514
|
-
yield
|
|
495
|
+
var _tokensRefreshed = yield _this6._refreshTokens(); // Returns true/false if token is refreshed/not refreshed
|
|
496
|
+
yield _this6.updateUserInfo(); // Continue updating user info
|
|
515
497
|
if (!_tokensRefreshed && !warningDisplayed) {
|
|
516
|
-
|
|
498
|
+
_this6.App.addAlert("info", "General|Your session will expire soon", 30, true);
|
|
517
499
|
warningDisplayed = true; // Mark the warning as displayed
|
|
518
500
|
}
|
|
519
501
|
}
|
|
520
502
|
|
|
521
503
|
// Validation on expired session
|
|
522
|
-
if (
|
|
504
|
+
if (_this6.SessionExpiration <= currentTime) {
|
|
523
505
|
// Handle refresh token prior updating user info
|
|
524
|
-
yield
|
|
506
|
+
yield _this6._refreshTokens();
|
|
525
507
|
// Handle session expiration
|
|
526
|
-
var isUserInfoUpdated = yield
|
|
508
|
+
var isUserInfoUpdated = yield _this6.updateUserInfo();
|
|
527
509
|
if (!isUserInfoUpdated) {
|
|
528
510
|
// Stop further checks
|
|
529
|
-
clearTimeout(
|
|
530
|
-
|
|
531
|
-
|
|
511
|
+
clearTimeout(_this6.sessionValidationInterval);
|
|
512
|
+
_this6.sessionValidationInterval = null;
|
|
513
|
+
_this6.App.addAlert("info", "ASABAuthModule|Your session has expired.", 3600 * 1000, true, alert => /*#__PURE__*/_react.default.createElement(_SessionExpirationAlert.SessionExpirationAlert, {
|
|
532
514
|
alert: alert
|
|
533
515
|
}));
|
|
534
516
|
// Disable UI elements
|
|
535
|
-
if (
|
|
536
|
-
var
|
|
537
|
-
(
|
|
517
|
+
if (_this6.App.AppStore) {
|
|
518
|
+
var _this6$App$AppStore$d, _this6$App$AppStore;
|
|
519
|
+
(_this6$App$AppStore$d = (_this6$App$AppStore = _this6.App.AppStore).dispatch) === null || _this6$App$AppStore$d === void 0 || _this6$App$AppStore$d.call(_this6$App$AppStore, {
|
|
538
520
|
type: _actions.types.AUTH_SESSION_EXPIRATION,
|
|
539
521
|
sessionExpired: true
|
|
540
522
|
});
|
|
@@ -555,10 +537,10 @@ class AuthModule extends _asab_webui_components.Module {
|
|
|
555
537
|
}
|
|
556
538
|
|
|
557
539
|
// Re-trigger validation after 10 seconds
|
|
558
|
-
|
|
540
|
+
_this6.sessionValidationInterval = setTimeout(_validateSession, 10000);
|
|
559
541
|
});
|
|
560
542
|
return function validateSession() {
|
|
561
|
-
return
|
|
543
|
+
return _ref2.apply(this, arguments);
|
|
562
544
|
};
|
|
563
545
|
}();
|
|
564
546
|
|
|
@@ -58,7 +58,13 @@ function AccessControlCard(props) {
|
|
|
58
58
|
className: "flex-fill"
|
|
59
59
|
}, /*#__PURE__*/_react.default.createElement("h3", null, t('AccessControlScreen|Access control')))), /*#__PURE__*/_react.default.createElement("ul", {
|
|
60
60
|
className: "list-group list-group-flush"
|
|
61
|
-
},
|
|
61
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
62
|
+
className: "w-50 mx-auto"
|
|
63
|
+
}, /*#__PURE__*/_react.default.createElement(_asab_webui_components.FlowbiteIllustration, {
|
|
64
|
+
name: "access",
|
|
65
|
+
className: "py-4",
|
|
66
|
+
title: t('AccessControlScreen|Access control')
|
|
67
|
+
})), (userinfo === null || userinfo === void 0 ? void 0 : userinfo.username) && /*#__PURE__*/_react.default.createElement("li", {
|
|
62
68
|
className: "list-group-item"
|
|
63
69
|
}, /*#__PURE__*/_react.default.createElement(_reactstrap.Row, null, /*#__PURE__*/_react.default.createElement(_reactstrap.Col, {
|
|
64
70
|
className: "col-6"
|
|
@@ -152,7 +152,13 @@ function InvitationScreen(props) {
|
|
|
152
152
|
className: "flex-fill"
|
|
153
153
|
}, /*#__PURE__*/_react.default.createElement("h3", null, /*#__PURE__*/_react.default.createElement("i", {
|
|
154
154
|
className: "bi bi-person-plus pe-2"
|
|
155
|
-
}), t('InvitationScreen|Invite other user')))), /*#__PURE__*/_react.default.createElement(_reactstrap.CardBody, null, /*#__PURE__*/_react.default.createElement(
|
|
155
|
+
}), t('InvitationScreen|Invite other user')))), /*#__PURE__*/_react.default.createElement(_reactstrap.CardBody, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
156
|
+
className: "w-50 mx-auto"
|
|
157
|
+
}, /*#__PURE__*/_react.default.createElement(_asab_webui_components.FlowbiteIllustration, {
|
|
158
|
+
name: "invite",
|
|
159
|
+
className: "pb-3",
|
|
160
|
+
title: t('InvitationScreen|Invite other user')
|
|
161
|
+
})), /*#__PURE__*/_react.default.createElement(_reactstrap.Label, null, t('InvitationScreen|Enter the user\'s email address')), /*#__PURE__*/_react.default.createElement(_reactstrap.InputGroup, null, /*#__PURE__*/_react.default.createElement(_reactstrap.InputGroupText, null, /*#__PURE__*/_react.default.createElement("i", {
|
|
156
162
|
className: "bi bi-envelope-at"
|
|
157
163
|
})), /*#__PURE__*/_react.default.createElement(_reactstrap.Input, {
|
|
158
164
|
name: "email",
|
|
@@ -126,7 +126,7 @@ class TenantService extends _asab_webui_components.Service {
|
|
|
126
126
|
// getCurrentTenant() method is used for obtaining current tenant
|
|
127
127
|
getCurrentTenant() {
|
|
128
128
|
var _this$App, _state$tenant;
|
|
129
|
-
var state = (_this$App = this.App) === null || _this$App === void 0 || (_this$App = _this$App.AppStore) === null || _this$App === void 0 ? void 0 : _this$App.
|
|
129
|
+
var state = (_this$App = this.App) === null || _this$App === void 0 || (_this$App = _this$App.AppStore) === null || _this$App === void 0 ? void 0 : _this$App.getState();
|
|
130
130
|
var currentTenant = state === null || state === void 0 || (_state$tenant = state.tenant) === null || _state$tenant === void 0 ? void 0 : _state$tenant.current;
|
|
131
131
|
// If current tenant is not in Application store yet, get it from the URL params
|
|
132
132
|
if (!currentTenant) {
|
|
@@ -8,6 +8,7 @@ exports.default = InvalidRouteScreen;
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _reactI18next = require("react-i18next");
|
|
10
10
|
var _reactstrap = require("reactstrap");
|
|
11
|
+
var _asab_webui_components = require("asab_webui_components");
|
|
11
12
|
require("./InvalidRouteScreen.scss");
|
|
12
13
|
function InvalidRouteScreen(props) {
|
|
13
14
|
var {
|
|
@@ -22,8 +23,11 @@ function InvalidRouteScreen(props) {
|
|
|
22
23
|
className: "text-center invalid-route-cardbody"
|
|
23
24
|
}, /*#__PURE__*/_react.default.createElement(_reactstrap.Row, {
|
|
24
25
|
className: "justify-content-center"
|
|
25
|
-
}, /*#__PURE__*/_react.default.createElement(_reactstrap.Col, null, /*#__PURE__*/_react.default.createElement("
|
|
26
|
-
className: "
|
|
26
|
+
}, /*#__PURE__*/_react.default.createElement(_reactstrap.Col, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
27
|
+
className: "h-75"
|
|
28
|
+
}, /*#__PURE__*/_react.default.createElement(_asab_webui_components.FlowbiteIllustration, {
|
|
29
|
+
name: "error",
|
|
30
|
+
className: "pb-4",
|
|
27
31
|
title: t("InvalidRouteScreen|Nothing here")
|
|
28
32
|
})), /*#__PURE__*/_react.default.createElement("p", {
|
|
29
33
|
className: "card-text"
|
|
@@ -63,8 +63,11 @@ function UnauthorizedAccessScreen(props) {
|
|
|
63
63
|
className: "text-center unauthorized-cardbody"
|
|
64
64
|
}, /*#__PURE__*/_react.default.createElement(_reactstrap.Row, {
|
|
65
65
|
className: "justify-content-center"
|
|
66
|
-
}, /*#__PURE__*/_react.default.createElement(_reactstrap.Col, null, /*#__PURE__*/_react.default.createElement("
|
|
67
|
-
className: "
|
|
66
|
+
}, /*#__PURE__*/_react.default.createElement(_reactstrap.Col, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
67
|
+
className: "w-50 mx-auto"
|
|
68
|
+
}, /*#__PURE__*/_react.default.createElement(_asab_webui_components.FlowbiteIllustration, {
|
|
69
|
+
name: "unauthorized",
|
|
70
|
+
className: "pb-4",
|
|
68
71
|
title: t("UnauthorizedAccessScreen|Unauthorized access")
|
|
69
72
|
})), props.resource ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("p", {
|
|
70
73
|
className: "card-text"
|