asab_webui_shell 27.8.5 → 28.0.0-alpha.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/actions.js +15 -15
- package/dist/components/branding/BrandImage.js +3 -5
- package/dist/components/locationReplace.js +5 -11
- package/dist/config/ConfigReducer.js +2 -4
- package/dist/config/ConfigService.js +7 -10
- package/dist/containers/Alerts/index.js +34 -45
- package/dist/containers/Alerts/reducer.js +19 -20
- package/dist/containers/Application.js +200 -207
- package/dist/containers/FullscreenMode/reducer.js +5 -10
- package/dist/containers/Header/ApplicationScreenTitle/ApplicationScreenTitle.js +27 -32
- package/dist/containers/Header/ApplicationScreenTitle/index.js +8 -10
- package/dist/containers/Header/Help/HelpButton.js +58 -55
- package/dist/containers/Header/Help/HelpService.js +3 -4
- package/dist/containers/Header/index.js +23 -23
- package/dist/containers/Header/reducer.js +13 -15
- package/dist/containers/Navigation/index.js +4 -6
- package/dist/containers/Navigation/reducer.js +7 -11
- package/dist/containers/RouteErrorHandler/ErrorContainer.js +47 -31
- package/dist/containers/RouteErrorHandler/index.js +26 -27
- package/dist/containers/Router/ApplicationHashRouter.js +7 -8
- package/dist/containers/Router/ApplicationRouter.js +38 -38
- package/dist/containers/Router/index.js +2 -4
- package/dist/containers/Router/reducer.js +7 -11
- package/dist/containers/Sidebar/NavbarBrand.js +30 -38
- package/dist/containers/Sidebar/SidebarBottomItem.js +42 -36
- package/dist/containers/Sidebar/SidebarIcon.js +12 -9
- package/dist/containers/Sidebar/SidebarItem.js +135 -132
- package/dist/containers/Sidebar/SidebarItemRenderer.js +25 -26
- package/dist/containers/Sidebar/index.js +55 -70
- package/dist/containers/Sidebar/reducer.js +7 -11
- package/dist/containers/Sidebar/utils/sidebarRouteMatch.js +12 -15
- package/dist/containers/Sidepanel/Sidepanel.js +35 -40
- package/dist/containers/Toast/ToastComponent.js +21 -15
- package/dist/containers/Toast/ToastContainer.js +23 -32
- package/dist/containers/Toast/reducer.js +14 -16
- package/dist/index.js +10 -10
- package/dist/modules/about/AboutScreen.js +80 -65
- package/dist/modules/about/index.js +3 -3
- package/dist/modules/attentionrequired/attentionRequiredReducer.js +5 -10
- package/dist/modules/attentionrequired/components/OfflineIndication.js +9 -7
- package/dist/modules/attentionrequired/connectivityReducer.js +5 -10
- package/dist/modules/attentionrequired/index.js +2 -3
- package/dist/modules/attentionrequired/service.js +21 -24
- package/dist/modules/auth/actions.js +1 -1
- package/dist/modules/auth/api.js +53 -61
- package/dist/modules/auth/components/LoginLoopCard.js +24 -15
- package/dist/modules/auth/components/SessionExpirationAlert.js +26 -18
- package/dist/modules/auth/header.js +69 -62
- package/dist/modules/auth/index.js +418 -458
- package/dist/modules/auth/reducer.js +11 -14
- package/dist/modules/auth/screens/AccessControlScreen.js +71 -50
- package/dist/modules/i18n/actions.js +1 -1
- package/dist/modules/i18n/dropdown.js +52 -46
- package/dist/modules/i18n/escapeHtmlMinimal.js +2 -2
- package/dist/modules/i18n/index.js +2 -2
- package/dist/modules/i18n/reducer.js +5 -10
- package/dist/modules/i18n/service.js +52 -73
- package/dist/modules/invite/InvitationScreen.js +162 -138
- package/dist/modules/invite/index.js +5 -4
- package/dist/modules/tenant/TenantDropdown.js +52 -58
- package/dist/modules/tenant/access/AccessDeniedCard.js +52 -52
- package/dist/modules/tenant/actions.js +1 -1
- package/dist/modules/tenant/index.js +2 -2
- package/dist/modules/tenant/reducer.js +2 -4
- package/dist/modules/tenant/service.js +74 -91
- package/dist/screens/InvalidRouteScreen.js +30 -20
- package/dist/screens/SuspenseScreen.js +26 -24
- package/dist/screens/UnauthorizedAccessScreen.js +44 -33
- package/dist/screens/UnsupportedBrowserScreen.js +44 -38
- package/dist/services/BrandingService.js +16 -24
- package/dist/services/HeaderService.js +4 -7
- package/dist/services/TitleService.js +19 -20
- package/dist/theme/ThemeButton.js +18 -14
- package/dist/theme/ThemeReducer.js +3 -5
- package/dist/theme/ThemeService.js +6 -8
- package/dist/theme/actions.js +1 -1
- package/dist/utils/browserSupport.js +18 -23
- package/dist/utils/extractTenantFromUrl.js +3 -3
- package/dist/utils/jsonParseWithBigInt.js +10 -9
- package/dist/utils/pageLifecycle.js +5 -5
- package/dist/utils/statusAlerts.js +1 -1
- package/package.json +13 -13
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
@@ -12,6 +12,7 @@ var _asab_webui_components = require("asab_webui_components");
|
|
|
12
12
|
var _seacatAuth = require("asab_webui_components/seacat-auth");
|
|
13
13
|
var _reactstrap = require("reactstrap");
|
|
14
14
|
require("./header.scss");
|
|
15
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
16
|
/*
|
|
16
17
|
|
|
17
18
|
Language localizations for auth HeaderComponent can be added to the translation.json files of
|
|
@@ -30,69 +31,75 @@ require("./header.scss");
|
|
|
30
31
|
}
|
|
31
32
|
}
|
|
32
33
|
|
|
33
|
-
*/
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
return (_state$tenant = state.tenant) === null || _state$tenant === void 0 ? void 0 : _state$tenant.current;
|
|
42
|
-
});
|
|
43
|
-
var userinfo = (0, _asab_webui_components.useAppSelector)(state => {
|
|
44
|
-
var _state$auth;
|
|
45
|
-
return (_state$auth = state.auth) === null || _state$auth === void 0 ? void 0 : _state$auth.userinfo;
|
|
46
|
-
});
|
|
47
|
-
var isSuperuser = (0, _seacatAuth.isAuthorized)(['authz:superuser'], props.app);
|
|
48
|
-
var logout = () => {
|
|
34
|
+
*/function AuthHeaderDropdown(props) {
|
|
35
|
+
const {
|
|
36
|
+
t
|
|
37
|
+
} = (0, _reactI18next.useTranslation)();
|
|
38
|
+
const tenant = (0, _asab_webui_components.useAppSelector)(state => state.tenant?.current);
|
|
39
|
+
const userinfo = (0, _asab_webui_components.useAppSelector)(state => state.auth?.userinfo);
|
|
40
|
+
const isSuperuser = (0, _seacatAuth.isAuthorized)(['authz:superuser'], props.app);
|
|
41
|
+
const logout = () => {
|
|
49
42
|
props.AuthModule.logout();
|
|
50
43
|
};
|
|
51
44
|
|
|
52
45
|
// Validation on displaying the invite option
|
|
53
|
-
|
|
54
|
-
return /*#__PURE__*/
|
|
55
|
-
direction: "down"
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
46
|
+
const displayInvite = props.app?.Modules?.some(obj => obj?.Name === "InviteModule") && tenant && (0, _seacatAuth.isAuthorized)(['seacat:tenant:assign'], props.app);
|
|
47
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactstrap.UncontrolledDropdown, {
|
|
48
|
+
direction: "down",
|
|
49
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactstrap.DropdownToggle, {
|
|
50
|
+
nav: true,
|
|
51
|
+
caret: true,
|
|
52
|
+
title: isSuperuser ? t('AuthHeader|You have superuser privileges. Act responsibly.') : userinfo?.sub,
|
|
53
|
+
className: isSuperuser ? 'text-warning' : '',
|
|
54
|
+
children: [userinfo?.picture ? /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
55
|
+
src: userinfo?.picture,
|
|
56
|
+
className: "img-avatar",
|
|
57
|
+
alt: userinfo?.username
|
|
58
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)("i", {
|
|
59
|
+
alt: userinfo?.username,
|
|
60
|
+
className: `pe-2 bi ${isSuperuser ? 'bi-universal-access' : 'bi-person-gear'}`
|
|
61
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
62
|
+
children: userinfo?.username || userinfo?.sub
|
|
63
|
+
})]
|
|
64
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactstrap.DropdownMenu, {
|
|
65
|
+
className: "shadow",
|
|
66
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactstrap.DropdownItem, {
|
|
67
|
+
header: true,
|
|
68
|
+
children: t('AuthHeader|My account')
|
|
69
|
+
}), displayInvite && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
70
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactstrap.DropdownItem, {
|
|
71
|
+
divider: true
|
|
72
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactstrap.DropdownItem, {
|
|
73
|
+
tag: _reactRouter.Link,
|
|
74
|
+
to: "/auth/invite",
|
|
75
|
+
state: {
|
|
76
|
+
clearInvitation: true
|
|
77
|
+
},
|
|
78
|
+
children: t('AuthHeader|Invite other users')
|
|
79
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactstrap.DropdownItem, {
|
|
80
|
+
divider: true
|
|
81
|
+
})]
|
|
82
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactstrap.DropdownItem, {
|
|
83
|
+
tag: _reactRouter.Link,
|
|
84
|
+
to: "/auth/access-control",
|
|
85
|
+
children: t('AuthHeader|Access control')
|
|
86
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactstrap.DropdownItem, {
|
|
87
|
+
tag: _reactRouter.Link,
|
|
88
|
+
to: "/account",
|
|
89
|
+
children: t('AuthHeader|Account settings')
|
|
90
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactstrap.DropdownItem, {
|
|
91
|
+
tag: _reactRouter.Link,
|
|
92
|
+
to: "/account/password",
|
|
93
|
+
children: t('AuthHeader|Change password')
|
|
94
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactstrap.DropdownItem, {
|
|
95
|
+
onClick: () => {
|
|
96
|
+
logout();
|
|
97
|
+
},
|
|
98
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
99
|
+
className: "text-danger",
|
|
100
|
+
children: t('AuthHeader|Log out')
|
|
101
|
+
})
|
|
102
|
+
})]
|
|
103
|
+
})]
|
|
104
|
+
});
|
|
98
105
|
}
|