@gen-epix/ui-client-common 4.5.0 → 4.6.0
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/README.md +5 -4
- package/dist/@types/mui.d.ts +13 -5
- package/dist/@types/ui-client-common.d.ts +1 -0
- package/dist/_chunks/ApplicationFooter.js +45 -46
- package/dist/_chunks/ApplicationFooter.js.map +1 -1
- package/dist/_chunks/Breadcrumbs.js +14 -15
- package/dist/_chunks/CrudPage.js +301 -302
- package/dist/_chunks/CrudPage.js.map +1 -1
- package/dist/_chunks/GeoFilter.js +1 -2
- package/dist/_chunks/GeoFilter.js.map +1 -1
- package/dist/_chunks/Notifications.js +52 -53
- package/dist/_chunks/OutageList.js +30 -31
- package/dist/_chunks/OutageList.js.map +1 -1
- package/dist/_chunks/OutageUtil.js +4 -8
- package/dist/_chunks/OutageUtil.js.map +1 -1
- package/dist/_chunks/QueryClientProvider.js +1 -2
- package/dist/_chunks/QueryClientProvider.js.map +1 -1
- package/dist/_chunks/QueryClientService.js +101 -395
- package/dist/_chunks/QueryClientService.js.map +1 -1
- package/dist/_chunks/Reflect.js +1 -2
- package/dist/_chunks/Table.js +523 -522
- package/dist/_chunks/Table.js.map +1 -1
- package/dist/_chunks/TableUtil.js +10 -20
- package/dist/_chunks/TableUtil.js.map +1 -1
- package/dist/_chunks/TextFilter.js +18 -20
- package/dist/_chunks/TextFilter.js.map +1 -1
- package/dist/_chunks/UserInvitationsAdminPage.js +78 -79
- package/dist/_chunks/UserInvitationsAdminPage.js.map +1 -1
- package/dist/_chunks/UserManagerUtil.js +212 -213
- package/dist/_chunks/UserManagerUtil.js.map +1 -1
- package/dist/_chunks/_baseAssignValue.js +1 -2
- package/dist/_chunks/_baseFlatten.js +9 -10
- package/dist/_chunks/_baseFlatten.js.map +1 -1
- package/dist/_chunks/_baseGet.js +279 -0
- package/dist/_chunks/_baseGet.js.map +1 -0
- package/dist/_chunks/_baseIteratee.js +273 -0
- package/dist/_chunks/_baseIteratee.js.map +1 -0
- package/dist/_chunks/_baseUnset.js +22 -300
- package/dist/_chunks/_baseUnset.js.map +1 -1
- package/dist/_chunks/_cacheHas.js +1 -2
- package/dist/_chunks/_setToString.js +1 -2
- package/dist/_chunks/decorate.js +1 -2
- package/dist/_chunks/decorateParam.js +1 -2
- package/dist/_chunks/format.js +27 -54
- package/dist/_chunks/format.js.map +1 -1
- package/dist/_chunks/isArrayLike.js +1 -2
- package/dist/_chunks/isObject.js +1 -2
- package/dist/_chunks/isSymbol.js +1 -2
- package/dist/_chunks/last.js +12 -0
- package/dist/_chunks/last.js.map +1 -0
- package/dist/_chunks/middleware.js +2 -3
- package/dist/_chunks/middleware.js.map +1 -1
- package/dist/_chunks/omit.js +42 -42
- package/dist/_chunks/omit.js.map +1 -1
- package/dist/_chunks/query.js +8 -15
- package/dist/_chunks/query.js.map +1 -1
- package/dist/_chunks/react.js +2 -3
- package/dist/_chunks/react.js.map +1 -1
- package/dist/_chunks/rolldown-runtime.js +2 -3
- package/dist/_chunks/tableStore.js +231 -224
- package/dist/_chunks/tableStore.js.map +1 -1
- package/dist/_chunks/toDate.js +8 -14
- package/dist/_chunks/toDate.js.map +1 -1
- package/dist/_chunks/uniq.js +43 -0
- package/dist/_chunks/uniq.js.map +1 -0
- package/dist/_chunks/useColumnsMenu.js +3 -6
- package/dist/_chunks/useColumnsMenu.js.map +1 -1
- package/dist/_chunks/useMutation.js +24 -26
- package/dist/_chunks/useMutation.js.map +1 -1
- package/dist/_chunks/useQueryMemo.js +33 -22
- package/dist/_chunks/useQueryMemo.js.map +1 -1
- package/dist/_chunks/vanilla.js +1 -2
- package/dist/_chunks/vanilla.js.map +1 -1
- package/dist/_chunks/yup.js +2 -4
- package/dist/_chunks/yup.js.map +1 -1
- package/dist/classes/TableEventBus/index.js +1 -2
- package/dist/classes/abstracts/FilterAbstract/index.js +4 -3
- package/dist/classes/abstracts/FilterAbstract/index.js.map +1 -1
- package/dist/classes/filters/MultiSelectFilter.d.ts +1 -1
- package/dist/classes/services/AuthenticationService/AuthenticationService.d.ts +1 -1
- package/dist/classes/services/AuthenticationService/index.js +15 -16
- package/dist/classes/services/AuthenticationService/index.js.map +1 -1
- package/dist/classes/services/AuthorizationService/index.js +5 -6
- package/dist/classes/services/AuthorizationService/index.js.map +1 -1
- package/dist/classes/services/BackendVersionService/index.js +4 -4
- package/dist/classes/services/BackendVersionService/index.js.map +1 -1
- package/dist/classes/services/BreadcrumbService/index.js +16 -39
- package/dist/classes/services/BreadcrumbService/index.js.map +1 -1
- package/dist/classes/services/EmotionCacheService/index.js +10 -10
- package/dist/classes/services/EmotionCacheService/index.js.map +1 -1
- package/dist/classes/services/FeatureFlagsService/index.js +1 -2
- package/dist/classes/services/I18nService/index.js +12 -12
- package/dist/classes/services/I18nService/index.js.map +1 -1
- package/dist/classes/services/InactivityService/index.js +13 -14
- package/dist/classes/services/InactivityService/index.js.map +1 -1
- package/dist/classes/services/LogService/index.js +40 -35
- package/dist/classes/services/LogService/index.js.map +1 -1
- package/dist/classes/services/NavigationHistoryService/index.js +1 -2
- package/dist/classes/services/NotificationService/index.js +9 -10
- package/dist/classes/services/NotificationService/index.js.map +1 -1
- package/dist/classes/services/PageEventBusService/index.js +14 -11
- package/dist/classes/services/PageEventBusService/index.js.map +1 -1
- package/dist/classes/services/RouterService/index.js +4 -8
- package/dist/classes/services/RouterService/index.js.map +1 -1
- package/dist/classes/services/UserSettingsService/index.js +1 -2
- package/dist/components/app/App/App.d.ts +1 -1
- package/dist/components/app/App/index.js +35 -40
- package/dist/components/app/App/index.js.map +1 -1
- package/dist/components/app/ApplicationBootstrapWithAuthentication/index.js +29 -30
- package/dist/components/app/ApplicationBootstrapWithAuthentication/index.js.map +1 -1
- package/dist/components/app/ApplicationBootstrapWithoutAuthorization/index.js +48 -47
- package/dist/components/app/ApplicationBootstrapWithoutAuthorization/index.js.map +1 -1
- package/dist/components/app/AuthenticationWrapper/index.js +36 -37
- package/dist/components/app/AuthenticationWrapper/index.js.map +1 -1
- package/dist/components/app/AuthorizationWrapper/index.js +20 -21
- package/dist/components/app/AuthorizationWrapper/index.js.map +1 -1
- package/dist/components/app/RouterRoot/index.js +53 -52
- package/dist/components/app/RouterRoot/index.js.map +1 -1
- package/dist/components/epi/EpiContactDetailsDialog/index.js +22 -23
- package/dist/components/filters/BooleanFilterField/index.js +6 -7
- package/dist/components/filters/DateFilterField/index.js +4 -5
- package/dist/components/filters/GeoFilterField/index.js +5 -6
- package/dist/components/filters/MultiSelectFilterField/index.js +5 -6
- package/dist/components/filters/NumberRangeFilterField/index.js +4 -5
- package/dist/components/filters/TextFilterField/index.js +4 -5
- package/dist/components/ui/ApplicationBar/index.js +189 -190
- package/dist/components/ui/ApplicationBar/index.js.map +1 -1
- package/dist/components/ui/ConsentDialog/index.js +1 -2
- package/dist/components/ui/GenericErrorMessage/index.js +30 -31
- package/dist/components/ui/LicensesDialog/index.js +39 -40
- package/dist/components/ui/LicensesDialog/index.js.map +1 -1
- package/dist/components/ui/MyPermissionsDialog/index.js +17 -18
- package/dist/components/ui/NavLink/index.js +7 -8
- package/dist/components/ui/OrganizationSwitcherDialog/index.js +22 -23
- package/dist/components/ui/OrganizationSwitcherDialog/index.js.map +1 -1
- package/dist/components/ui/OutagesDialog/index.js +1 -2
- package/dist/components/ui/PageContainer/index.js +25 -26
- package/dist/components/ui/PageContainer/index.js.map +1 -1
- package/dist/components/ui/ResponseHandler/index.js +1 -2
- package/dist/components/ui/Sidebar/index.js +31 -32
- package/dist/components/ui/UserFeedbackDialog/index.js +13 -14
- package/dist/components/ui/UserInactivityConfirmation/index.js +1 -2
- package/dist/constants/api.constants.js +1 -2
- package/dist/constants/config.constants.d.ts +0 -2
- package/dist/constants/config.constants.js +3 -4
- package/dist/constants/config.constants.js.map +1 -1
- package/dist/constants/query.constants.js +1 -2
- package/dist/dataHooks/useIdentifierIssuerOwnOrganizationQuery/index.js +13 -14
- package/dist/dataHooks/useIdentifierIssuerOwnOrganizationQuery/index.js.map +1 -1
- package/dist/dataHooks/useIdentifierIssuerQuery/index.js +15 -16
- package/dist/dataHooks/useIdentifierIssuerQuery/index.js.map +1 -1
- package/dist/dataHooks/useInviteUserConstraintsQuery/index.js +13 -14
- package/dist/dataHooks/useInviteUserConstraintsQuery/index.js.map +1 -1
- package/dist/dataHooks/useOrganizationAdminPoliciesQuery/index.js +14 -15
- package/dist/dataHooks/useOrganizationAdminPoliciesQuery/index.js.map +1 -1
- package/dist/dataHooks/useOrganizationIdentifierIssuerLinksQuery/index.js +5 -6
- package/dist/dataHooks/useOrganizationsQuery/index.js +14 -15
- package/dist/dataHooks/useOrganizationsQuery/index.js.map +1 -1
- package/dist/dataHooks/useUsersQuery/index.js +11 -12
- package/dist/dataHooks/useUsersQuery/index.js.map +1 -1
- package/dist/hoc/withPermissions/index.js +1 -2
- package/dist/hooks/useConfig/index.js +3 -4
- package/dist/hooks/useConfig/index.js.map +1 -1
- package/dist/hooks/useCreateMutation/index.js +13 -14
- package/dist/hooks/useCreateMutation/index.js.map +1 -1
- package/dist/hooks/useDeleteMutation/index.js +17 -11
- package/dist/hooks/useDeleteMutation/index.js.map +1 -1
- package/dist/hooks/useEditMutation/index.js +49 -35
- package/dist/hooks/useEditMutation/index.js.map +1 -1
- package/dist/hooks/useInitializeTableStore/index.js +1 -2
- package/dist/hooks/useItemQuery/index.js +5 -6
- package/dist/hooks/useItemQuery/index.js.map +1 -1
- package/dist/hooks/useUpdateBreadcrumb/index.js +1 -2
- package/dist/hooks/useUpdateDocumentTitle/index.js +1 -2
- package/dist/locale/en.json +1 -0
- package/dist/locale/nl.json +1 -0
- package/dist/models/admin.models.js +1 -2
- package/dist/models/admin.models.js.map +1 -1
- package/dist/models/config.models.d.ts +1 -5
- package/dist/models/table.models.js +1 -2
- package/dist/models/table.models.js.map +1 -1
- package/dist/models/theme.models.d.ts +19 -16
- package/dist/pages/AcceptInvitationPage/index.js +26 -27
- package/dist/pages/AcceptInvitationPage/index.js.map +1 -1
- package/dist/pages/AdminPage/index.js +17 -18
- package/dist/pages/ChooseIdentityProviderPage/index.js +22 -23
- package/dist/pages/ErrorPage/index.js +1 -2
- package/dist/pages/IdentifierIssuersAdminPage/index.js +6 -7
- package/dist/pages/OrganizationAdminPoliciesAdminPage/index.js +6 -7
- package/dist/pages/OrganizationContactsAdminPage/index.js +7 -8
- package/dist/pages/OrganizationSitesAdminPage/index.js +10 -11
- package/dist/pages/OrganizationsAdminPage/index.js +14 -15
- package/dist/pages/OrganizationsAdminPage/index.js.map +1 -1
- package/dist/pages/OutagesAdminPage/index.js +21 -22
- package/dist/pages/PostLoginPage/index.js +8 -9
- package/dist/pages/PostLoginPage/index.js.map +1 -1
- package/dist/pages/PostLogoutPage/index.js +9 -10
- package/dist/pages/RouterErrorPage/index.js +1 -2
- package/dist/pages/UsersAdminPage/index.js +40 -41
- package/dist/pages/UsersAdminPage/index.js.map +1 -1
- package/dist/routes/index.js +1 -2
- package/dist/setup/setup.js +12 -6
- package/dist/setup/setup.js.map +1 -1
- package/dist/stores/oidcStore/index.js +1 -2
- package/dist/stores/outagesStore/index.js +1 -2
- package/dist/theme/demoTheme/index.js +18 -17
- package/dist/theme/demoTheme/index.js.map +1 -1
- package/dist/utils/AxiosUtil/index.js +1 -2
- package/dist/utils/DataHookUtil/index.js +2 -3
- package/dist/utils/DataHookUtil/index.js.map +1 -1
- package/dist/utils/DependencyContainerUtil/DependencyContainerUtil.d.ts +2 -3
- package/dist/utils/DependencyContainerUtil/index.js +10 -16
- package/dist/utils/DependencyContainerUtil/index.js.map +1 -1
- package/dist/utils/LoadableUtil/index.js +1 -2
- package/dist/utils/MenuDataUtil/index.js +2 -3
- package/dist/utils/MenuDataUtil/index.js.map +1 -1
- package/dist/utils/NotificationUtil/index.js +1 -2
- package/dist/utils/StandardConfigUtil/index.js +1 -6
- package/dist/utils/StandardConfigUtil/index.js.map +1 -1
- package/dist/utils/TimeUtil/index.js +2 -3
- package/dist/utils/TimeUtil/index.js.map +1 -1
- package/dist/utils/UserUtil/index.js +1 -2
- package/package.json +26 -29
- package/dist/context/ClientCommonConfigContext/ClientCommonConfigContext.d.ts +0 -9
- package/dist/context/ClientCommonConfigContext/ClientCommonConfigContextProvider.d.ts +0 -6
- package/dist/context/ClientCommonConfigContext/index.d.ts +0 -3
- package/dist/context/ClientCommonConfigContext/index.js +0 -34
- package/dist/context/ClientCommonConfigContext/index.js.map +0 -1
- package/dist/context/ClientCommonConfigContext/useClientCommonConfigContext.d.ts +0 -3
|
@@ -3,8 +3,8 @@ import { API_ORGANIZATION_TOKEN as t } from "../../constants/api.constants.js";
|
|
|
3
3
|
import { AuthorizationService as n } from "../../classes/services/AuthorizationService/index.js";
|
|
4
4
|
import { t as r } from "../../_chunks/CrudPage.js";
|
|
5
5
|
import { COMMON_QUERY_KEY as i } from "../../constants/query.constants.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
6
|
+
import { container as a } from "tsyringe";
|
|
7
|
+
import { CommonDbCommandName as o, CommonDbPermissionType as s } from "@gen-epix/api-commondb";
|
|
8
8
|
import { useCallback as c, useMemo as l } from "react";
|
|
9
9
|
import { jsx as u } from "react/jsx-runtime";
|
|
10
10
|
import { useTranslation as d } from "react-i18next";
|
|
@@ -13,16 +13,16 @@ import { TestIdUtil as p } from "@gen-epix/ui-core/utils/TestIdUtil";
|
|
|
13
13
|
import { FORM_FIELD_DEFINITION_TYPE as m } from "@gen-epix/ui-core-form/models/form.models";
|
|
14
14
|
import { SchemaUtil as h } from "@gen-epix/ui-core-form/utils/SchemaUtil";
|
|
15
15
|
import { useParams as g } from "react-router-dom";
|
|
16
|
-
|
|
16
|
+
// src/pages/OrganizationSitesAdminPage/OrganizationSitesAdminPage.tsx
|
|
17
17
|
var _ = () => {
|
|
18
|
-
let { organizationId: _ } = g(), { t: v } = d(), y = c(async (e) => (await
|
|
18
|
+
let { organizationId: _ } = g(), { t: v } = d(), y = c(async (e) => (await a.resolve(t).sitesGetAll(null, null, { signal: e })).data, []), b = c((e) => e.filter((e) => e.organization_id === _), [_]), x = c(async (e, n) => (await a.resolve(t).sitesPutOne(n.id, {
|
|
19
19
|
id: n.id,
|
|
20
20
|
name: e.name,
|
|
21
21
|
organization_id: _
|
|
22
|
-
})).data, [_]), S = c(async (e) => (await
|
|
22
|
+
})).data, [_]), S = c(async (e) => (await a.resolve(t).sitesPostOne({
|
|
23
23
|
name: e.name,
|
|
24
24
|
organization_id: _
|
|
25
|
-
})).data, [_]), C = c(async (e) => await
|
|
25
|
+
})).data, [_]), C = c(async (e) => await a.resolve(t).sitesDeleteOne(e.id), []), w = c((e) => e.name, []), T = l(() => f().shape({ name: h.name }), []), E = l(() => [{
|
|
26
26
|
definition: m.TEXTFIELD,
|
|
27
27
|
label: v`Name`,
|
|
28
28
|
name: "name"
|
|
@@ -34,9 +34,9 @@ var _ = () => {
|
|
|
34
34
|
id: t.id,
|
|
35
35
|
organization_id: t.organization_id,
|
|
36
36
|
...e
|
|
37
|
-
}), []), k = l(() =>
|
|
38
|
-
command_name:
|
|
39
|
-
permission_type:
|
|
37
|
+
}), []), k = l(() => a.resolve(n).doesUserHavePermission([{
|
|
38
|
+
command_name: o.ContactCrudCommand,
|
|
39
|
+
permission_type: s.READ
|
|
40
40
|
}]) ? [{
|
|
41
41
|
getPathName: (e) => `/management/organizations/${e.organization_id}/sites/${e.id}/contacts`,
|
|
42
42
|
label: v`Manage contacts`
|
|
@@ -44,7 +44,7 @@ var _ = () => {
|
|
|
44
44
|
return /* @__PURE__ */ u(r, {
|
|
45
45
|
createItemDialogTitle: v`Create new site`,
|
|
46
46
|
createOne: S,
|
|
47
|
-
crudCommandType:
|
|
47
|
+
crudCommandType: o.SiteCrudCommand,
|
|
48
48
|
defaultSortByField: "name",
|
|
49
49
|
defaultSortDirection: "asc",
|
|
50
50
|
deleteOne: C,
|
|
@@ -63,7 +63,6 @@ var _ = () => {
|
|
|
63
63
|
updateOne: x
|
|
64
64
|
});
|
|
65
65
|
};
|
|
66
|
-
//#endregion
|
|
67
66
|
export { _ as OrganizationSitesAdminPage };
|
|
68
67
|
|
|
69
68
|
//# sourceMappingURL=index.js.map
|
|
@@ -7,8 +7,8 @@ import { t as a } from "../../_chunks/CrudPage.js";
|
|
|
7
7
|
import { COMMON_QUERY_KEY as o } from "../../constants/query.constants.js";
|
|
8
8
|
import { useIdentifierIssuerOptionsQuery as s } from "../../dataHooks/useIdentifierIssuerQuery/index.js";
|
|
9
9
|
import { useOrganizationIdentifierIssuerLinksQuery as c } from "../../dataHooks/useOrganizationIdentifierIssuerLinksQuery/index.js";
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
10
|
+
import { container as l } from "tsyringe";
|
|
11
|
+
import { CommonDbCommandName as u, CommonDbPermissionType as d } from "@gen-epix/api-commondb";
|
|
12
12
|
import { useCallback as f, useMemo as p } from "react";
|
|
13
13
|
import { jsx as m } from "react/jsx-runtime";
|
|
14
14
|
import { useTranslation as h } from "react-i18next";
|
|
@@ -17,21 +17,21 @@ import { TestIdUtil as y } from "@gen-epix/ui-core/utils/TestIdUtil";
|
|
|
17
17
|
import { FORM_FIELD_DEFINITION_TYPE as b } from "@gen-epix/ui-core-form/models/form.models";
|
|
18
18
|
import { SchemaUtil as x } from "@gen-epix/ui-core-form/utils/SchemaUtil";
|
|
19
19
|
import { useArray as S } from "@gen-epix/ui-core/hooks/useArray";
|
|
20
|
-
|
|
20
|
+
// src/pages/OrganizationsAdminPage/OrganizationsAdminPage.tsx
|
|
21
21
|
var C = /* @__PURE__ */ e(i(), 1), w = () => {
|
|
22
|
-
let { t: e } = h(), i = s(), w = c(), T = S([i, w]), E = f(async (e) => (await
|
|
22
|
+
let { t: e } = h(), i = s(), w = c(), T = S([i, w]), E = f(async (e) => (await l.resolve(n).organizationsGetAll(null, null, { signal: e }))?.data, []), D = f(async (e, t) => (await l.resolve(n).organizationsPutIdentifierIssuers(t.id, { organization_identifier_issuer_links: e.identifierIssuerIds.map((e) => ({
|
|
23
23
|
identifier_issuer_id: e,
|
|
24
24
|
organization_id: t.id
|
|
25
|
-
})) }), (await
|
|
25
|
+
})) }), (await l.resolve(n).organizationsPutOne(t.id, {
|
|
26
26
|
id: t.id,
|
|
27
27
|
...e
|
|
28
28
|
})).data), []), O = f(async (e) => {
|
|
29
|
-
let t = (await
|
|
30
|
-
return await
|
|
29
|
+
let t = (await l.resolve(n).organizationsPostOne((0, C.default)(e, ["identifierIssuerIds"]))).data;
|
|
30
|
+
return await l.resolve(n).organizationsPutIdentifierIssuers(t.id, { organization_identifier_issuer_links: e.identifierIssuerIds.map((e) => ({
|
|
31
31
|
identifier_issuer_id: e,
|
|
32
32
|
organization_id: t.id
|
|
33
33
|
})) }), t;
|
|
34
|
-
}, []), k = f(async (e) => await
|
|
34
|
+
}, []), k = f(async (e) => await l.resolve(n).organizationsDeleteOne(e.id), []), A = f((e) => e.name, []), j = p(() => _().shape({
|
|
35
35
|
code: x.code,
|
|
36
36
|
description: x.description,
|
|
37
37
|
identifierIssuerIds: g().of(v().uuid4()).min(0).required(),
|
|
@@ -85,9 +85,9 @@ var C = /* @__PURE__ */ e(i(), 1), w = () => {
|
|
|
85
85
|
valueGetter: (e) => e.row.identifierIssuerIds.length,
|
|
86
86
|
widthFlex: .5
|
|
87
87
|
}
|
|
88
|
-
], [i.options.length, e]), P = p(() =>
|
|
89
|
-
command_name:
|
|
90
|
-
permission_type:
|
|
88
|
+
], [i.options.length, e]), P = p(() => l.resolve(r).doesUserHavePermission([{
|
|
89
|
+
command_name: u.SiteCrudCommand,
|
|
90
|
+
permission_type: d.READ
|
|
91
91
|
}]) ? [{
|
|
92
92
|
getPathName: (e) => `/management/organizations/${e.id}/sites`,
|
|
93
93
|
label: e`Manage sites`
|
|
@@ -98,15 +98,15 @@ var C = /* @__PURE__ */ e(i(), 1), w = () => {
|
|
|
98
98
|
identifierIssuerIds: t
|
|
99
99
|
};
|
|
100
100
|
}), [w.data]), I = p(() => [[o.IDENTIFIER_ISSUER_LINKS]], []), L = p(() => [{
|
|
101
|
-
command_name:
|
|
102
|
-
permission_type:
|
|
101
|
+
command_name: u.OrganizationIdentifierIssuerLinkUpdateAssociationCommand,
|
|
102
|
+
permission_type: d.EXECUTE
|
|
103
103
|
}], []);
|
|
104
104
|
return /* @__PURE__ */ m(a, {
|
|
105
105
|
associationQueryKeys: I,
|
|
106
106
|
convertToTableData: F,
|
|
107
107
|
createItemDialogTitle: e`Create new organization`,
|
|
108
108
|
createOne: O,
|
|
109
|
-
crudCommandType:
|
|
109
|
+
crudCommandType: u.OrganizationCrudCommand,
|
|
110
110
|
defaultSortByField: "name",
|
|
111
111
|
defaultSortDirection: "asc",
|
|
112
112
|
deleteOne: k,
|
|
@@ -127,7 +127,6 @@ var C = /* @__PURE__ */ e(i(), 1), w = () => {
|
|
|
127
127
|
updateOne: D
|
|
128
128
|
});
|
|
129
129
|
};
|
|
130
|
-
//#endregion
|
|
131
130
|
export { w as OrganizationsAdminPage };
|
|
132
131
|
|
|
133
132
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["omit","__toESM","require_omit","CrudPage","import_omit","OrganizationsAdminPage","useTranslation","identifierIssuerOptionsQuery","useIdentifierIssuerOptionsQuery","organizationIdentifierIssuerLinksQuery","useOrganizationIdentifierIssuerLinksQuery","loadables","useArray","fetchAll","useCallback","container","API_ORGANIZATION_TOKEN","updateOne","item","variables","createOne","resultItem","deleteOne","getName","schema","useMemo","object","SchemaUtil","array","string","formFieldDefinitions","FORM_FIELD_DEFINITION_TYPE","t","tableColumns","TableUtil","subPages","AuthorizationService","CommonDbCommandName","CommonDbPermissionType","convertToTableData","items","identifierIssuerIds","link","associationQueryKeys","COMMON_QUERY_KEY","extraPermissions","TestIdUtil"],"sources":["../../../src/pages/OrganizationsAdminPage/OrganizationsAdminPage.tsx"],"sourcesContent":["import { container } from 'tsyringe';\nimport {\n useCallback,\n useMemo,\n} from 'react';\nimport { useTranslation } from 'react-i18next';\nimport {\n array,\n object,\n string,\n} from 'yup';\nimport omit from 'lodash/omit';\nimport type {\n CommonDbApiPermission,\n CommonDbOrganization,\n} from '@gen-epix/api-commondb';\nimport {\n CommonDbCommandName,\n CommonDbPermissionType,\n} from '@gen-epix/api-commondb';\nimport { TestIdUtil } from '@gen-epix/ui-core/utils/TestIdUtil';\nimport { useArray } from '@gen-epix/ui-core/hooks/useArray';\nimport type { FormFieldDefinition } from '@gen-epix/ui-core-form/models/form.models';\nimport { FORM_FIELD_DEFINITION_TYPE } from '@gen-epix/ui-core-form/models/form.models';\nimport { SchemaUtil } from '@gen-epix/ui-core-form/utils/SchemaUtil';\n\nimport { API_ORGANIZATION_TOKEN } from '../../constants/api.constants';\nimport type { TableColumn } from '../../models/table.models';\nimport { TableUtil } from '../../utils/TableUtil';\nimport type { CrudPageSubPage } from '../CrudPage';\nimport { CrudPage } from '../CrudPage';\nimport { AuthorizationService } from '../../classes/services/AuthorizationService';\nimport { useIdentifierIssuerOptionsQuery } from '../../dataHooks/useIdentifierIssuerQuery';\nimport { useOrganizationIdentifierIssuerLinksQuery } from '../../dataHooks/useOrganizationIdentifierIssuerLinksQuery';\nimport type { OmitWithMetaData } from '../../models/data.models';\nimport { COMMON_QUERY_KEY } from '../../constants/query.constants';\n\ntype FormFields = OmitWithMetaData<TableData>;\n\ntype TableData = { identifierIssuerIds: string[] } & CommonDbOrganization;\n\nexport const OrganizationsAdminPage = () => {\n const { t } = useTranslation();\n const identifierIssuerOptionsQuery = useIdentifierIssuerOptionsQuery();\n const organizationIdentifierIssuerLinksQuery = useOrganizationIdentifierIssuerLinksQuery();\n\n const loadables = useArray([identifierIssuerOptionsQuery, organizationIdentifierIssuerLinksQuery]);\n\n const fetchAll = useCallback(async (signal: AbortSignal) => {\n return (await container.resolve(API_ORGANIZATION_TOKEN).organizationsGetAll(null, null, { signal }))?.data;\n }, []);\n\n const updateOne = useCallback(async (variables: FormFields, item: CommonDbOrganization) => {\n await container.resolve(API_ORGANIZATION_TOKEN).organizationsPutIdentifierIssuers(item.id, {\n organization_identifier_issuer_links: variables.identifierIssuerIds.map(identifier_issuer_id => ({\n identifier_issuer_id,\n organization_id: item.id,\n })),\n });\n return (await container.resolve(API_ORGANIZATION_TOKEN).organizationsPutOne(item.id, { id: item.id, ...variables })).data;\n }, []);\n\n const createOne = useCallback(async (variables: FormFields) => {\n const resultItem = (await container.resolve(API_ORGANIZATION_TOKEN).organizationsPostOne(omit(variables, ['identifierIssuerIds']))).data;\n await container.resolve(API_ORGANIZATION_TOKEN).organizationsPutIdentifierIssuers(resultItem.id, {\n organization_identifier_issuer_links: variables.identifierIssuerIds.map(identifier_issuer_id => ({\n identifier_issuer_id,\n organization_id: resultItem.id,\n })),\n });\n return resultItem;\n }, []);\n\n const deleteOne = useCallback(async (item: CommonDbOrganization) => {\n return await container.resolve(API_ORGANIZATION_TOKEN).organizationsDeleteOne(item.id);\n }, []);\n\n const getName = useCallback((item: CommonDbOrganization) => {\n return item.name;\n }, []);\n\n const schema = useMemo(() => {\n return object<FormFields>().shape({\n code: SchemaUtil.code,\n description: SchemaUtil.description,\n identifierIssuerIds: array().of(string().uuid4()).min(0).required(),\n name: SchemaUtil.name,\n });\n }, []);\n\n const formFieldDefinitions = useMemo<FormFieldDefinition<FormFields>[]>(() => {\n return [\n {\n definition: FORM_FIELD_DEFINITION_TYPE.TEXTFIELD,\n label: t`Name`,\n name: 'name',\n } as const satisfies FormFieldDefinition<FormFields>,\n {\n definition: FORM_FIELD_DEFINITION_TYPE.TEXTFIELD,\n label: t`Description`,\n multiline: true,\n name: 'description',\n rows: 5,\n } as const satisfies FormFieldDefinition<FormFields>,\n {\n definition: FORM_FIELD_DEFINITION_TYPE.TEXTFIELD,\n label: t`Code`,\n name: 'code',\n } as const satisfies FormFieldDefinition<FormFields>,\n {\n definition: FORM_FIELD_DEFINITION_TYPE.TRANSFER_LIST,\n label: t`Identifier issuers`,\n loading: identifierIssuerOptionsQuery.isLoading,\n name: 'identifierIssuerIds',\n options: identifierIssuerOptionsQuery.options,\n } as const satisfies FormFieldDefinition<FormFields>,\n ] as const;\n }, [identifierIssuerOptionsQuery.isLoading, identifierIssuerOptionsQuery.options, t]);\n\n const tableColumns = useMemo((): TableColumn<TableData>[] => {\n return [\n TableUtil.createTextColumn<TableData>({ advancedSort: true, id: 'name', name: t`Name` }),\n TableUtil.createTextColumn<TableData>({ id: 'code', name: t`Code` }),\n {\n displayValueGetter: (item) => `${item.row.identifierIssuerIds.length} / ${identifierIssuerOptionsQuery.options.length}`,\n headerName: t`Identifier issuer count`,\n id: 'numIdentifierIssuers',\n isInitiallyVisible: true,\n textAlign: 'right',\n type: 'number',\n valueGetter: (item) => item.row.identifierIssuerIds.length,\n widthFlex: 0.5,\n },\n ];\n }, [identifierIssuerOptionsQuery.options.length, t]);\n\n const subPages = useMemo<CrudPageSubPage<CommonDbOrganization>[]>(() => {\n if (!container.resolve(AuthorizationService).doesUserHavePermission([\n { command_name: CommonDbCommandName.SiteCrudCommand, permission_type: CommonDbPermissionType.READ },\n ])) {\n return [];\n }\n\n return [\n {\n getPathName: (item: CommonDbOrganization) => `/management/organizations/${item.id}/sites`,\n label: t`Manage sites`,\n } satisfies CrudPageSubPage<CommonDbOrganization>,\n ];\n }, [t]);\n\n const convertToTableData = useCallback((items: CommonDbOrganization[]) => {\n if (!items || !organizationIdentifierIssuerLinksQuery.data) {\n return [];\n }\n return items.map<TableData>((item) => {\n const identifierIssuerIds = organizationIdentifierIssuerLinksQuery.data.filter(link => link.organization_id === item.id).map(link => link.identifier_issuer_id);\n return {\n ...item,\n identifierIssuerIds,\n } satisfies TableData;\n });\n }, [organizationIdentifierIssuerLinksQuery.data]);\n\n const associationQueryKeys = useMemo(() => [\n [COMMON_QUERY_KEY.IDENTIFIER_ISSUER_LINKS],\n ], []);\n\n const extraPermissions = useMemo<CommonDbApiPermission[]>(() => [\n { command_name: CommonDbCommandName.OrganizationIdentifierIssuerLinkUpdateAssociationCommand, permission_type: CommonDbPermissionType.EXECUTE },\n ], []);\n\n return (\n <CrudPage<FormFields, CommonDbOrganization, TableData>\n associationQueryKeys={associationQueryKeys}\n convertToTableData={convertToTableData}\n createItemDialogTitle={t`Create new organization`}\n createOne={createOne}\n crudCommandType={CommonDbCommandName.OrganizationCrudCommand}\n defaultSortByField={'name'}\n defaultSortDirection={'asc'}\n deleteOne={deleteOne}\n extraCreateOnePermissions={extraPermissions}\n extraDeleteOnePermissions={extraPermissions}\n extraUpdateOnePermissions={extraPermissions}\n fetchAll={fetchAll}\n formFieldDefinitions={formFieldDefinitions}\n getName={getName}\n itemName={t`Organization`}\n loadables={loadables}\n resourceQueryKeyBase={COMMON_QUERY_KEY.ORGANIZATIONS}\n schema={schema}\n subPages={subPages}\n tableColumns={tableColumns}\n testIdAttributes={TestIdUtil.createAttributes('OrganizationsAdminPage')}\n title={t`Organizations`}\n updateOne={updateOne}\n />\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;mCAyCaK,UAA+B;CAC1C,IAAM,EAAE,SAAMC,EAAe,GACvBC,IAA+BC,EAAgC,GAC/DC,IAAyCC,EAA0C,GAEnFC,IAAYC,EAAS,CAACL,GAA8BE,CAAsC,CAAC,GAE3FI,IAAWC,EAAY,OAAO,OAC1B,MAAMC,EAAU,QAAQC,CAAsB,CAAC,CAAC,oBAAoB,MAAM,MAAM,EAAE,UAAO,CAAC,EAAA,EAAI,MACrG,CAAC,CAAC,GAECC,IAAYH,EAAY,OAAO,GAAuB,OAC1D,MAAMC,EAAU,QAAQC,CAAsB,CAAC,CAAC,kCAAkCE,EAAK,IAAI,EACzF,sCAAsCC,EAAU,oBAAoB,KAAI,OAAyB;EAC/F;EACA,iBAAiBD,EAAK;CACxB,EAAE,EACJ,CAAC,IACO,MAAMH,EAAU,QAAQC,CAAsB,CAAC,CAAC,oBAAoBE,EAAK,IAAI;EAAE,IAAIA,EAAK;EAAI,GAAGC;CAAU,CAAC,EAAA,CAAG,OACpH,CAAC,CAAC,GAECC,IAAYN,EAAY,OAAO,MAA0B;EAC7D,IAAMO,KAA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,EAAiB;EAC/B;EACE;EACI;EACd,kBAAkBE,EAAW,iBAAiB,wBAAwB;EACtE,OAAO,CAAC;EACG;CACZ,CAAA;AAEL"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["omit","__toESM","require_omit","CrudPage","import_omit","OrganizationsAdminPage","useTranslation","identifierIssuerOptionsQuery","useIdentifierIssuerOptionsQuery","organizationIdentifierIssuerLinksQuery","useOrganizationIdentifierIssuerLinksQuery","loadables","useArray","fetchAll","useCallback","container","API_ORGANIZATION_TOKEN","updateOne","item","variables","createOne","resultItem","deleteOne","getName","schema","useMemo","object","SchemaUtil","array","string","formFieldDefinitions","FORM_FIELD_DEFINITION_TYPE","t","tableColumns","TableUtil","subPages","AuthorizationService","CommonDbCommandName","CommonDbPermissionType","convertToTableData","items","identifierIssuerIds","link","associationQueryKeys","COMMON_QUERY_KEY","extraPermissions","TestIdUtil"],"sources":["../../../src/pages/OrganizationsAdminPage/OrganizationsAdminPage.tsx"],"sourcesContent":["import { container } from 'tsyringe';\nimport {\n useCallback,\n useMemo,\n} from 'react';\nimport { useTranslation } from 'react-i18next';\nimport {\n array,\n object,\n string,\n} from 'yup';\nimport omit from 'lodash/omit';\nimport type {\n CommonDbApiPermission,\n CommonDbOrganization,\n} from '@gen-epix/api-commondb';\nimport {\n CommonDbCommandName,\n CommonDbPermissionType,\n} from '@gen-epix/api-commondb';\nimport { TestIdUtil } from '@gen-epix/ui-core/utils/TestIdUtil';\nimport { useArray } from '@gen-epix/ui-core/hooks/useArray';\nimport type { FormFieldDefinition } from '@gen-epix/ui-core-form/models/form.models';\nimport { FORM_FIELD_DEFINITION_TYPE } from '@gen-epix/ui-core-form/models/form.models';\nimport { SchemaUtil } from '@gen-epix/ui-core-form/utils/SchemaUtil';\n\nimport { API_ORGANIZATION_TOKEN } from '../../constants/api.constants';\nimport type { TableColumn } from '../../models/table.models';\nimport { TableUtil } from '../../utils/TableUtil';\nimport type { CrudPageSubPage } from '../CrudPage';\nimport { CrudPage } from '../CrudPage';\nimport { AuthorizationService } from '../../classes/services/AuthorizationService';\nimport { useIdentifierIssuerOptionsQuery } from '../../dataHooks/useIdentifierIssuerQuery';\nimport { useOrganizationIdentifierIssuerLinksQuery } from '../../dataHooks/useOrganizationIdentifierIssuerLinksQuery';\nimport type { OmitWithMetaData } from '../../models/data.models';\nimport { COMMON_QUERY_KEY } from '../../constants/query.constants';\n\ntype FormFields = OmitWithMetaData<TableData>;\n\ntype TableData = { identifierIssuerIds: string[] } & CommonDbOrganization;\n\nexport const OrganizationsAdminPage = () => {\n const { t } = useTranslation();\n const identifierIssuerOptionsQuery = useIdentifierIssuerOptionsQuery();\n const organizationIdentifierIssuerLinksQuery = useOrganizationIdentifierIssuerLinksQuery();\n\n const loadables = useArray([identifierIssuerOptionsQuery, organizationIdentifierIssuerLinksQuery]);\n\n const fetchAll = useCallback(async (signal: AbortSignal) => {\n return (await container.resolve(API_ORGANIZATION_TOKEN).organizationsGetAll(null, null, { signal }))?.data;\n }, []);\n\n const updateOne = useCallback(async (variables: FormFields, item: CommonDbOrganization) => {\n await container.resolve(API_ORGANIZATION_TOKEN).organizationsPutIdentifierIssuers(item.id, {\n organization_identifier_issuer_links: variables.identifierIssuerIds.map(identifier_issuer_id => ({\n identifier_issuer_id,\n organization_id: item.id,\n })),\n });\n return (await container.resolve(API_ORGANIZATION_TOKEN).organizationsPutOne(item.id, { id: item.id, ...variables })).data;\n }, []);\n\n const createOne = useCallback(async (variables: FormFields) => {\n const resultItem = (await container.resolve(API_ORGANIZATION_TOKEN).organizationsPostOne(omit(variables, ['identifierIssuerIds']))).data;\n await container.resolve(API_ORGANIZATION_TOKEN).organizationsPutIdentifierIssuers(resultItem.id, {\n organization_identifier_issuer_links: variables.identifierIssuerIds.map(identifier_issuer_id => ({\n identifier_issuer_id,\n organization_id: resultItem.id,\n })),\n });\n return resultItem;\n }, []);\n\n const deleteOne = useCallback(async (item: CommonDbOrganization) => {\n return await container.resolve(API_ORGANIZATION_TOKEN).organizationsDeleteOne(item.id);\n }, []);\n\n const getName = useCallback((item: CommonDbOrganization) => {\n return item.name;\n }, []);\n\n const schema = useMemo(() => {\n return object<FormFields>().shape({\n code: SchemaUtil.code,\n description: SchemaUtil.description,\n identifierIssuerIds: array().of(string().uuid4()).min(0).required(),\n name: SchemaUtil.name,\n });\n }, []);\n\n const formFieldDefinitions = useMemo<FormFieldDefinition<FormFields>[]>(() => {\n return [\n {\n definition: FORM_FIELD_DEFINITION_TYPE.TEXTFIELD,\n label: t`Name`,\n name: 'name',\n } as const satisfies FormFieldDefinition<FormFields>,\n {\n definition: FORM_FIELD_DEFINITION_TYPE.TEXTFIELD,\n label: t`Description`,\n multiline: true,\n name: 'description',\n rows: 5,\n } as const satisfies FormFieldDefinition<FormFields>,\n {\n definition: FORM_FIELD_DEFINITION_TYPE.TEXTFIELD,\n label: t`Code`,\n name: 'code',\n } as const satisfies FormFieldDefinition<FormFields>,\n {\n definition: FORM_FIELD_DEFINITION_TYPE.TRANSFER_LIST,\n label: t`Identifier issuers`,\n loading: identifierIssuerOptionsQuery.isLoading,\n name: 'identifierIssuerIds',\n options: identifierIssuerOptionsQuery.options,\n } as const satisfies FormFieldDefinition<FormFields>,\n ] as const;\n }, [identifierIssuerOptionsQuery.isLoading, identifierIssuerOptionsQuery.options, t]);\n\n const tableColumns = useMemo((): TableColumn<TableData>[] => {\n return [\n TableUtil.createTextColumn<TableData>({ advancedSort: true, id: 'name', name: t`Name` }),\n TableUtil.createTextColumn<TableData>({ id: 'code', name: t`Code` }),\n {\n displayValueGetter: (item) => `${item.row.identifierIssuerIds.length} / ${identifierIssuerOptionsQuery.options.length}`,\n headerName: t`Identifier issuer count`,\n id: 'numIdentifierIssuers',\n isInitiallyVisible: true,\n textAlign: 'right',\n type: 'number',\n valueGetter: (item) => item.row.identifierIssuerIds.length,\n widthFlex: 0.5,\n },\n ];\n }, [identifierIssuerOptionsQuery.options.length, t]);\n\n const subPages = useMemo<CrudPageSubPage<CommonDbOrganization>[]>(() => {\n if (!container.resolve(AuthorizationService).doesUserHavePermission([\n { command_name: CommonDbCommandName.SiteCrudCommand, permission_type: CommonDbPermissionType.READ },\n ])) {\n return [];\n }\n\n return [\n {\n getPathName: (item: CommonDbOrganization) => `/management/organizations/${item.id}/sites`,\n label: t`Manage sites`,\n } satisfies CrudPageSubPage<CommonDbOrganization>,\n ];\n }, [t]);\n\n const convertToTableData = useCallback((items: CommonDbOrganization[]) => {\n if (!items || !organizationIdentifierIssuerLinksQuery.data) {\n return [];\n }\n return items.map<TableData>((item) => {\n const identifierIssuerIds = organizationIdentifierIssuerLinksQuery.data.filter(link => link.organization_id === item.id).map(link => link.identifier_issuer_id);\n return {\n ...item,\n identifierIssuerIds,\n } satisfies TableData;\n });\n }, [organizationIdentifierIssuerLinksQuery.data]);\n\n const associationQueryKeys = useMemo(() => [\n [COMMON_QUERY_KEY.IDENTIFIER_ISSUER_LINKS],\n ], []);\n\n const extraPermissions = useMemo<CommonDbApiPermission[]>(() => [\n { command_name: CommonDbCommandName.OrganizationIdentifierIssuerLinkUpdateAssociationCommand, permission_type: CommonDbPermissionType.EXECUTE },\n ], []);\n\n return (\n <CrudPage<FormFields, CommonDbOrganization, TableData>\n associationQueryKeys={associationQueryKeys}\n convertToTableData={convertToTableData}\n createItemDialogTitle={t`Create new organization`}\n createOne={createOne}\n crudCommandType={CommonDbCommandName.OrganizationCrudCommand}\n defaultSortByField={'name'}\n defaultSortDirection={'asc'}\n deleteOne={deleteOne}\n extraCreateOnePermissions={extraPermissions}\n extraDeleteOnePermissions={extraPermissions}\n extraUpdateOnePermissions={extraPermissions}\n fetchAll={fetchAll}\n formFieldDefinitions={formFieldDefinitions}\n getName={getName}\n itemName={t`Organization`}\n loadables={loadables}\n resourceQueryKeyBase={COMMON_QUERY_KEY.ORGANIZATIONS}\n schema={schema}\n subPages={subPages}\n tableColumns={tableColumns}\n testIdAttributes={TestIdUtil.createAttributes('OrganizationsAdminPage')}\n title={t`Organizations`}\n updateOne={updateOne}\n />\n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AACc,CAAC,CAAC,GAEAO,IAAqBzB,GAAa,MAClC,CAAC0B,KAAS,CAAC/B,EAAuC,OAC7C,CAAC,IAEH+B,EAAM,KAAgB,MAAS;EACpC,IAAMC,IAAsBhC,EAAuC,KAAK,QAAO,MAAQiC,EAAK,oBAAoBxB,EAAK,EAAE,CAAC,CAAC,KAAI,MAAQwB,EAAK,oBAAoB;EAC9J,OAAO;GACL,GAAGxB;GACH;EACF;CACF,CAAC,GACA,CAACT,EAAuC,IAAI,CAAC,GAE1CkC,IAAuBlB,QAAc,CACzC,CAACmB,EAAiB,uBAAuB,CAC3C,GAAG,CAAC,CAAC,GAECC,IAAmBpB,QAAuC,CAC9D;EAAE,cAAcY,EAAoB;EAA0D,iBAAiBC,EAAuB;CAAQ,CAChJ,GAAG,CAAC,CAAC;CAEL,OACE,kBAACnC,GAAD;EACwB;EACF;EACpB,uBAAuB,CAAC;EACb;EACX,iBAAiBkC,EAAoB;EACrC,oBAAoB;EACpB,sBAAsB;EACX;EACX,2BAA2BQ;EAC3B,2BAA2BA;EAC3B,2BAA2BA;EACjB;EACY;EACb;EACT,UAAU,CAAC;EACA;EACX,sBAAsBD,EAAiB;EAC/B;EACE;EACI;EACd,kBAAkBE,EAAW,iBAAiB,wBAAwB;EACtE,OAAO,CAAC;EACG;CACZ,CAAA;AAEL"}
|
|
@@ -2,9 +2,9 @@ import { t as e } from "../../_chunks/TableUtil.js";
|
|
|
2
2
|
import { API_SYSTEM_TOKEN as t } from "../../constants/api.constants.js";
|
|
3
3
|
import { t as n } from "../../_chunks/CrudPage.js";
|
|
4
4
|
import { COMMON_QUERY_KEY as r } from "../../constants/query.constants.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
5
|
+
import { container as i } from "tsyringe";
|
|
6
|
+
import { DATE_FORMAT as a } from "@gen-epix/ui-core/constants/date.constants";
|
|
7
|
+
import { CommonDbCommandName as o, CommonDbPermissionType as s } from "@gen-epix/api-commondb";
|
|
8
8
|
import { useCallback as c, useMemo as l } from "react";
|
|
9
9
|
import { jsx as u } from "react/jsx-runtime";
|
|
10
10
|
import { useTranslation as d } from "react-i18next";
|
|
@@ -12,12 +12,12 @@ import { boolean as f, object as p } from "yup";
|
|
|
12
12
|
import { TestIdUtil as m } from "@gen-epix/ui-core/utils/TestIdUtil";
|
|
13
13
|
import { FORM_FIELD_DEFINITION_TYPE as h } from "@gen-epix/ui-core-form/models/form.models";
|
|
14
14
|
import { SchemaUtil as g } from "@gen-epix/ui-core-form/utils/SchemaUtil";
|
|
15
|
-
|
|
15
|
+
// src/pages/OutagesAdminPage/OutagesAdminPage.tsx
|
|
16
16
|
var _ = () => {
|
|
17
|
-
let { t: _ } = d(), v = c(async (e) => (await
|
|
17
|
+
let { t: _ } = d(), v = c(async (e) => (await i.resolve(t).outagesGetAll(null, null, { signal: e }))?.data, []), y = c(async (e) => await i.resolve(t).outagesDeleteOne(e.id), []), b = c(async (e, n) => (await i.resolve(t).outagesPutOne(n.id, {
|
|
18
18
|
id: n.id,
|
|
19
19
|
...e
|
|
20
|
-
})).data, []), x = c(async (e) => (await
|
|
20
|
+
})).data, []), x = c(async (e) => (await i.resolve(t).outagesPostOne(e)).data, []), S = c((e) => e.description, []), C = l(() => p().shape({
|
|
21
21
|
active_from: g.isoString,
|
|
22
22
|
active_to: g.isoString,
|
|
23
23
|
description: g.description.required(),
|
|
@@ -34,25 +34,25 @@ var _ = () => {
|
|
|
34
34
|
rows: 5
|
|
35
35
|
},
|
|
36
36
|
{
|
|
37
|
-
dateFormat:
|
|
37
|
+
dateFormat: a.DATE_TIME,
|
|
38
38
|
definition: h.DATE,
|
|
39
39
|
label: _`Active from`,
|
|
40
40
|
name: "active_from"
|
|
41
41
|
},
|
|
42
42
|
{
|
|
43
|
-
dateFormat:
|
|
43
|
+
dateFormat: a.DATE_TIME,
|
|
44
44
|
definition: h.DATE,
|
|
45
45
|
label: _`Active to`,
|
|
46
46
|
name: "active_to"
|
|
47
47
|
},
|
|
48
48
|
{
|
|
49
|
-
dateFormat:
|
|
49
|
+
dateFormat: a.DATE_TIME,
|
|
50
50
|
definition: h.DATE,
|
|
51
51
|
label: _`Visible from`,
|
|
52
52
|
name: "visible_from"
|
|
53
53
|
},
|
|
54
54
|
{
|
|
55
|
-
dateFormat:
|
|
55
|
+
dateFormat: a.DATE_TIME,
|
|
56
56
|
definition: h.DATE,
|
|
57
57
|
label: _`Visible to`,
|
|
58
58
|
name: "visible_to"
|
|
@@ -69,22 +69,22 @@ var _ = () => {
|
|
|
69
69
|
}
|
|
70
70
|
], [_]), T = l(() => [
|
|
71
71
|
e.createDateColumn({
|
|
72
|
-
dateFormat:
|
|
72
|
+
dateFormat: a.DATE_TIME,
|
|
73
73
|
id: "active_from",
|
|
74
74
|
name: _`Active from`
|
|
75
75
|
}),
|
|
76
76
|
e.createDateColumn({
|
|
77
|
-
dateFormat:
|
|
77
|
+
dateFormat: a.DATE_TIME,
|
|
78
78
|
id: "active_to",
|
|
79
79
|
name: _`Active to`
|
|
80
80
|
}),
|
|
81
81
|
e.createDateColumn({
|
|
82
|
-
dateFormat:
|
|
82
|
+
dateFormat: a.DATE_TIME,
|
|
83
83
|
id: "visible_from",
|
|
84
84
|
name: _`Visible from`
|
|
85
85
|
}),
|
|
86
86
|
e.createDateColumn({
|
|
87
|
-
dateFormat:
|
|
87
|
+
dateFormat: a.DATE_TIME,
|
|
88
88
|
id: "visible_to",
|
|
89
89
|
name: _`Visible to`
|
|
90
90
|
}),
|
|
@@ -97,19 +97,19 @@ var _ = () => {
|
|
|
97
97
|
name: _`Is visible`
|
|
98
98
|
})
|
|
99
99
|
], [_]), E = l(() => [{
|
|
100
|
-
command_name:
|
|
101
|
-
permission_type:
|
|
100
|
+
command_name: o.OutageCrudCommand,
|
|
101
|
+
permission_type: s.CREATE
|
|
102
102
|
}], []), D = l(() => [{
|
|
103
|
-
command_name:
|
|
104
|
-
permission_type:
|
|
103
|
+
command_name: o.OutageCrudCommand,
|
|
104
|
+
permission_type: s.DELETE
|
|
105
105
|
}], []), O = l(() => [{
|
|
106
|
-
command_name:
|
|
107
|
-
permission_type:
|
|
106
|
+
command_name: o.OutageCrudCommand,
|
|
107
|
+
permission_type: s.UPDATE
|
|
108
108
|
}], []);
|
|
109
109
|
return /* @__PURE__ */ u(n, {
|
|
110
110
|
createItemDialogTitle: _`Create new outage`,
|
|
111
111
|
createOne: x,
|
|
112
|
-
crudCommandType:
|
|
112
|
+
crudCommandType: o.OutageCrudCommand,
|
|
113
113
|
defaultSortByField: "active_from",
|
|
114
114
|
defaultSortDirection: "asc",
|
|
115
115
|
deleteOne: y,
|
|
@@ -128,7 +128,6 @@ var _ = () => {
|
|
|
128
128
|
updateOne: b
|
|
129
129
|
});
|
|
130
130
|
};
|
|
131
|
-
//#endregion
|
|
132
131
|
export { _ as OutagesAdminPage };
|
|
133
132
|
|
|
134
133
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,27 +1,26 @@
|
|
|
1
1
|
import { RouterService as e } from "../../classes/services/RouterService/index.js";
|
|
2
2
|
import { PageContainer as t } from "../../components/ui/PageContainer/index.js";
|
|
3
3
|
import { container as n } from "tsyringe";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
4
|
+
import { CircularProgress as r } from "@mui/material";
|
|
5
|
+
import { useEffect as i } from "react";
|
|
6
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
7
7
|
import { useTranslation as o } from "react-i18next";
|
|
8
8
|
import { TestIdUtil as s } from "@gen-epix/ui-core/utils/TestIdUtil";
|
|
9
9
|
import { useAuth as c } from "react-oidc-context";
|
|
10
|
-
|
|
10
|
+
// src/pages/PostLoginPage/PostLoginPage.tsx
|
|
11
11
|
var l = () => {
|
|
12
12
|
let { t: l } = o(), u = c().user.state;
|
|
13
|
-
return
|
|
13
|
+
return i(() => {
|
|
14
14
|
let t = u?.preLoginLocation;
|
|
15
|
-
|
|
16
|
-
}, [u?.preLoginLocation]), /* @__PURE__ */
|
|
15
|
+
t?.pathname && t.pathname !== "/post-login" || (t = { pathname: "/" }), n.resolve(e).router.navigate(t);
|
|
16
|
+
}, [u?.preLoginLocation]), /* @__PURE__ */ a(t, {
|
|
17
17
|
ignorePageEvent: !0,
|
|
18
18
|
singleAction: !0,
|
|
19
19
|
testIdAttributes: s.createAttributes("PostLoginPage"),
|
|
20
20
|
title: l`Logged in`,
|
|
21
|
-
children: /* @__PURE__ */
|
|
21
|
+
children: /* @__PURE__ */ a(r, {})
|
|
22
22
|
});
|
|
23
23
|
};
|
|
24
|
-
//#endregion
|
|
25
24
|
export { l as PostLoginPage };
|
|
26
25
|
|
|
27
26
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["PostLoginPage","useTranslation","authState","useAuth","useEffect","path","container","RouterService","PageContainer","TestIdUtil","CircularProgress"],"sources":["../../../src/pages/PostLoginPage/PostLoginPage.tsx"],"sourcesContent":["import { container } from 'tsyringe';\nimport type { Path } from 'react-router-dom';\nimport { CircularProgress } from '@mui/material';\nimport { useEffect } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { useAuth } from 'react-oidc-context';\nimport { TestIdUtil } from '@gen-epix/ui-core/utils/TestIdUtil';\n\nimport { RouterService } from '../../classes/services/RouterService';\nimport { PageContainer } from '../../components/ui/PageContainer';\nimport type { AuthState } from '../../models/auth.models';\n\nexport const PostLoginPage = () => {\n const { t } = useTranslation();\n const auth = useAuth();\n const authState = auth.user.state as AuthState;\n\n useEffect(() => {\n let path: Partial<Path> = authState?.preLoginLocation;\n if (!path?.pathname || path.pathname === '/post-login') {\n path = {\n pathname: '/',\n };\n }\n\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n container.resolve(RouterService).router.navigate(path);\n }, [authState?.preLoginLocation]);\n\n return (\n <PageContainer\n ignorePageEvent\n singleAction\n testIdAttributes={TestIdUtil.createAttributes('PostLoginPage')}\n title={t`Logged in`}\n >\n <CircularProgress />\n </PageContainer>\n );\n};\n"],"mappings":";;;;;;;;;;AAYA,IAAaA,UAAsB;CACjC,IAAM,EAAE,SAAMC,EAAe,GAEvBC,IADOC,EACK,CAAA,CAAK,KAAK;CAc5B,OAZAC,QAAgB;EACd,IAAIC,IAAsBH,GAAW;EAQrC,
|
|
1
|
+
{"version":3,"file":"index.js","names":["PostLoginPage","useTranslation","authState","useAuth","useEffect","path","container","RouterService","PageContainer","TestIdUtil","CircularProgress"],"sources":["../../../src/pages/PostLoginPage/PostLoginPage.tsx"],"sourcesContent":["import { container } from 'tsyringe';\nimport type { Path } from 'react-router-dom';\nimport { CircularProgress } from '@mui/material';\nimport { useEffect } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { useAuth } from 'react-oidc-context';\nimport { TestIdUtil } from '@gen-epix/ui-core/utils/TestIdUtil';\n\nimport { RouterService } from '../../classes/services/RouterService';\nimport { PageContainer } from '../../components/ui/PageContainer';\nimport type { AuthState } from '../../models/auth.models';\n\nexport const PostLoginPage = () => {\n const { t } = useTranslation();\n const auth = useAuth();\n const authState = auth.user.state as AuthState;\n\n useEffect(() => {\n let path: Partial<Path> = authState?.preLoginLocation;\n if (!path?.pathname || path.pathname === '/post-login') {\n path = {\n pathname: '/',\n };\n }\n\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n container.resolve(RouterService).router.navigate(path);\n }, [authState?.preLoginLocation]);\n\n return (\n <PageContainer\n ignorePageEvent\n singleAction\n testIdAttributes={TestIdUtil.createAttributes('PostLoginPage')}\n title={t`Logged in`}\n >\n <CircularProgress />\n </PageContainer>\n );\n};\n"],"mappings":";;;;;;;;;;AAYA,IAAaA,UAAsB;CACjC,IAAM,EAAE,SAAMC,EAAe,GAEvBC,IADOC,EACK,CAAA,CAAK,KAAK;CAc5B,OAZAC,QAAgB;EACd,IAAIC,IAAsBH,GAAW;EAQrC,AAPKG,GAAM,YAAYA,EAAK,aAAa,kBACvC,IAAO,EACL,UAAU,IACZ,IAIFC,EAAU,QAAQC,CAAa,CAAC,CAAC,OAAO,SAASF,CAAI;CACvD,GAAG,CAACH,GAAW,gBAAgB,CAAC,GAG9B,kBAACM,GAAD;EACE,iBAAA;EACA,cAAA;EACA,kBAAkBC,EAAW,iBAAiB,eAAe;EAC7D,OAAO,CAAC;EAER,UAAA,kBAACC,GAAD,CAAmB,CAAA;CACN,CAAA;AAEnB"}
|
|
@@ -1,33 +1,32 @@
|
|
|
1
1
|
import { RouterService as e } from "../../classes/services/RouterService/index.js";
|
|
2
2
|
import { PageContainer as t } from "../../components/ui/PageContainer/index.js";
|
|
3
3
|
import { container as n } from "tsyringe";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
4
|
+
import { Box as r, Button as i, Typography as a } from "@mui/material";
|
|
5
|
+
import { useCallback as o } from "react";
|
|
6
|
+
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
7
7
|
import { useTranslation as l } from "react-i18next";
|
|
8
8
|
import { TestIdUtil as u } from "@gen-epix/ui-core/utils/TestIdUtil";
|
|
9
|
-
|
|
9
|
+
// src/pages/PostLogoutPage/PostLogoutPage.tsx
|
|
10
10
|
var d = () => {
|
|
11
|
-
let { t: d } = l(), f =
|
|
11
|
+
let { t: d } = l(), f = o(async () => {
|
|
12
12
|
await n.resolve(e).router.navigate("/");
|
|
13
13
|
}, []);
|
|
14
|
-
return /* @__PURE__ */
|
|
14
|
+
return /* @__PURE__ */ s(t, {
|
|
15
15
|
singleAction: !0,
|
|
16
16
|
testIdAttributes: u.createAttributes("PostLogoutPage"),
|
|
17
17
|
title: d`Logged out`,
|
|
18
|
-
children: /* @__PURE__ */
|
|
18
|
+
children: /* @__PURE__ */ c(r, {
|
|
19
19
|
sx: { textAlign: "center" },
|
|
20
|
-
children: [/* @__PURE__ */
|
|
20
|
+
children: [/* @__PURE__ */ s(a, {
|
|
21
21
|
sx: { marginBottom: 2 },
|
|
22
22
|
children: d`You have been logged out. You may close this window or log in again.`
|
|
23
|
-
}), /* @__PURE__ */ i
|
|
23
|
+
}), /* @__PURE__ */ s(i, {
|
|
24
24
|
onClick: f,
|
|
25
25
|
children: d`Log in again`
|
|
26
26
|
})]
|
|
27
27
|
})
|
|
28
28
|
});
|
|
29
29
|
};
|
|
30
|
-
//#endregion
|
|
31
30
|
export { d as PostLogoutPage };
|
|
32
31
|
|
|
33
32
|
//# sourceMappingURL=index.js.map
|
|
@@ -4,7 +4,7 @@ import { jsx as n } from "react/jsx-runtime";
|
|
|
4
4
|
import { useTranslation as r } from "react-i18next";
|
|
5
5
|
import { TestIdUtil as i } from "@gen-epix/ui-core/utils/TestIdUtil";
|
|
6
6
|
import { useRouteError as a } from "react-router-dom";
|
|
7
|
-
|
|
7
|
+
// src/pages/RouterErrorPage/RouterErrorPage.tsx
|
|
8
8
|
var o = () => {
|
|
9
9
|
let o = a(), { t: s } = r();
|
|
10
10
|
return /* @__PURE__ */ n(e, {
|
|
@@ -14,7 +14,6 @@ var o = () => {
|
|
|
14
14
|
children: /* @__PURE__ */ n(t, { error: o })
|
|
15
15
|
});
|
|
16
16
|
};
|
|
17
|
-
//#endregion
|
|
18
17
|
export { o as RouterErrorPage };
|
|
19
18
|
|
|
20
19
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { t as e } from "../../_chunks/TableUtil.js";
|
|
2
|
-
import { t } from "../../
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { API_ORGANIZATION_TOKEN as t } from "../../constants/api.constants.js";
|
|
3
|
+
import { AuthorizationService as n } from "../../classes/services/AuthorizationService/index.js";
|
|
4
|
+
import { t as r } from "../../_chunks/QueryClientService.js";
|
|
5
5
|
import { NotificationService as i } from "../../classes/services/NotificationService/index.js";
|
|
6
6
|
import { t as a } from "../../_chunks/CrudPage.js";
|
|
7
7
|
import { COMMON_QUERY_KEY as o } from "../../constants/query.constants.js";
|
|
8
8
|
import { useOrganizationOptionsQuery as s } from "../../dataHooks/useOrganizationsQuery/index.js";
|
|
9
9
|
import { useInviteUserConstraintsQuery as c } from "../../dataHooks/useInviteUserConstraintsQuery/index.js";
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
10
|
+
import { container as l } from "tsyringe";
|
|
11
|
+
import { CommonDbCommandName as u, CommonDbPermissionType as d } from "@gen-epix/api-commondb";
|
|
12
|
+
import { ListItemIcon as f, ListItemText as p, MenuItem as m } from "@mui/material";
|
|
13
|
+
import { useCallback as h, useMemo as g, useRef as _, useState as v } from "react";
|
|
14
|
+
import { Fragment as y, jsx as b, jsxs as x } from "react/jsx-runtime";
|
|
15
15
|
import { useTranslation as S } from "react-i18next";
|
|
16
16
|
import { array as C, boolean as w, object as T, string as E } from "yup";
|
|
17
17
|
import { TestIdUtil as D } from "@gen-epix/ui-core/utils/TestIdUtil";
|
|
@@ -20,44 +20,44 @@ import { SchemaUtil as k } from "@gen-epix/ui-core-form/utils/SchemaUtil";
|
|
|
20
20
|
import { useArray as A } from "@gen-epix/ui-core/hooks/useArray";
|
|
21
21
|
import j from "@mui/icons-material/PersonOff";
|
|
22
22
|
import { Confirmation as M } from "@gen-epix/ui-core-components/components/Confirmation";
|
|
23
|
-
|
|
23
|
+
// src/pages/UsersAdminPage/UsersAdminPage.tsx
|
|
24
24
|
var N = ({ subPages: N }) => {
|
|
25
|
-
let { t: P } = S(), F =
|
|
25
|
+
let { t: P } = S(), F = _(null), I = s(), L = c(), [R, z] = v([]), [B, V] = v([]), H = _(null), U = A([I, L]), W = l.resolve(n).user.roles, G = h((e) => {
|
|
26
26
|
let t = /* @__PURE__ */ new Set();
|
|
27
27
|
e.forEach((e) => {
|
|
28
28
|
e.roles.forEach((e) => t.add(e));
|
|
29
29
|
});
|
|
30
|
-
let
|
|
30
|
+
let r = Array.from(t).map((e) => ({
|
|
31
31
|
label: e,
|
|
32
32
|
value: e
|
|
33
33
|
}));
|
|
34
|
-
z(
|
|
34
|
+
z(r);
|
|
35
35
|
let i;
|
|
36
|
-
i =
|
|
37
|
-
command_name:
|
|
38
|
-
permission_type:
|
|
36
|
+
i = l.resolve(n).doesUserHavePermission([{
|
|
37
|
+
command_name: u.RetrieveInviteUserConstraintsCommand,
|
|
38
|
+
permission_type: d.EXECUTE
|
|
39
39
|
}]) && L?.data ? L.data.roles.map((e) => ({
|
|
40
40
|
label: e,
|
|
41
41
|
value: e
|
|
42
|
-
})) :
|
|
42
|
+
})) : r;
|
|
43
43
|
let a = W.filter((e) => !i.some((t) => t.value === e));
|
|
44
44
|
i.push(...a.map((e) => ({
|
|
45
45
|
disabled: !0,
|
|
46
46
|
label: e,
|
|
47
47
|
value: e
|
|
48
48
|
}))), V(i);
|
|
49
|
-
}, [L.data, W]), K =
|
|
49
|
+
}, [L.data, W]), K = h(async (e) => (await l.resolve(t).usersGetAll(null, null, { signal: e }))?.data, []), q = h(async (e, n) => (await l.resolve(t).updateUser(n.id, {
|
|
50
50
|
is_active: e.is_active,
|
|
51
|
-
organization_id:
|
|
51
|
+
organization_id: n.organization_id,
|
|
52
52
|
roles: e.roles
|
|
53
|
-
})).data, []), J =
|
|
53
|
+
})).data, []), J = h(async (e) => await l.resolve(t).usersDeleteOne(e.id), []), Y = h((e) => e.email, []), X = h((e) => l.resolve(n).user.email !== e.email, []), Z = g(() => T().shape({
|
|
54
54
|
description: k.description,
|
|
55
55
|
email: E().email().nullable(),
|
|
56
56
|
is_active: w().required(),
|
|
57
57
|
key: E().optional(),
|
|
58
58
|
name: E().nullable(),
|
|
59
59
|
roles: C().required().min(1)
|
|
60
|
-
}), []), Q =
|
|
60
|
+
}), []), Q = g(() => [
|
|
61
61
|
{
|
|
62
62
|
definition: O.TEXTFIELD,
|
|
63
63
|
disabled: !0,
|
|
@@ -96,7 +96,7 @@ var N = ({ subPages: N }) => {
|
|
|
96
96
|
P,
|
|
97
97
|
B,
|
|
98
98
|
L.isLoading
|
|
99
|
-
]), $ =
|
|
99
|
+
]), $ = g(() => [
|
|
100
100
|
e.createOptionsColumn({
|
|
101
101
|
id: "organization_id",
|
|
102
102
|
name: P`Organization`,
|
|
@@ -132,7 +132,7 @@ var N = ({ subPages: N }) => {
|
|
|
132
132
|
I.options,
|
|
133
133
|
R,
|
|
134
134
|
P
|
|
135
|
-
]), ee =
|
|
135
|
+
]), ee = h((e, t) => ({
|
|
136
136
|
email: t.email,
|
|
137
137
|
id: t.id,
|
|
138
138
|
is_active: t.is_active,
|
|
@@ -140,36 +140,36 @@ var N = ({ subPages: N }) => {
|
|
|
140
140
|
name: t.name,
|
|
141
141
|
organization_id: t.organization_id,
|
|
142
142
|
...e
|
|
143
|
-
}), []), te =
|
|
144
|
-
command_name:
|
|
145
|
-
permission_type:
|
|
146
|
-
}], []), ne =
|
|
147
|
-
command_name:
|
|
148
|
-
permission_type:
|
|
149
|
-
}], []), re =
|
|
150
|
-
let e = H.current?.email ?? H.current?.key,
|
|
143
|
+
}), []), te = g(() => [{
|
|
144
|
+
command_name: u.UpdateUserCommand,
|
|
145
|
+
permission_type: d.EXECUTE
|
|
146
|
+
}], []), ne = g(() => [{
|
|
147
|
+
command_name: u.UserCrudCommand,
|
|
148
|
+
permission_type: d.DELETE
|
|
149
|
+
}], []), re = h(async () => {
|
|
150
|
+
let e = H.current?.email ?? H.current?.key, n = l.resolve(i).showNotification({
|
|
151
151
|
isLoading: !0,
|
|
152
152
|
message: P("Anonymizing user: {{userName}}", { userName: e }),
|
|
153
153
|
severity: "info"
|
|
154
154
|
});
|
|
155
155
|
try {
|
|
156
|
-
await
|
|
156
|
+
await l.resolve(t).anonymizeUser(H.current.id), await l.resolve(r).invalidateQueryKeys(l.resolve(r).getQueryKeyDependencies([o.USERS], !0)), l.resolve(i).fulfillNotification(n, P("User anonymized successfully: {{userName}}", { userName: e }), "success");
|
|
157
157
|
} catch {
|
|
158
|
-
|
|
158
|
+
l.resolve(i).fulfillNotification(n, P("Error anonymizing user: {{userName}}", { userName: e }), "error");
|
|
159
159
|
}
|
|
160
|
-
}, [P]), ie =
|
|
160
|
+
}, [P]), ie = h((e) => {
|
|
161
161
|
let t = [];
|
|
162
|
-
return
|
|
163
|
-
command_name:
|
|
164
|
-
permission_type:
|
|
165
|
-
}]) && t.push(/* @__PURE__ */
|
|
162
|
+
return l.resolve(n).doesUserHavePermission([{
|
|
163
|
+
command_name: u.AnonymizeUserCommand,
|
|
164
|
+
permission_type: d.EXECUTE
|
|
165
|
+
}]) && t.push(/* @__PURE__ */ x(m, {
|
|
166
166
|
onClick: () => {
|
|
167
167
|
H.current = e.row, F.current.open();
|
|
168
168
|
},
|
|
169
|
-
children: [/* @__PURE__ */
|
|
169
|
+
children: [/* @__PURE__ */ b(f, { children: /* @__PURE__ */ b(j, { fontSize: "small" }) }), /* @__PURE__ */ b(p, { children: P`Anonymize user` })]
|
|
170
170
|
}, "custom-action-1")), t;
|
|
171
171
|
}, [P]);
|
|
172
|
-
return /* @__PURE__ */
|
|
172
|
+
return /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b(a, {
|
|
173
173
|
canEditItem: X,
|
|
174
174
|
createItemDialogTitle: P`Create new user`,
|
|
175
175
|
defaultSortByField: "name",
|
|
@@ -192,7 +192,7 @@ var N = ({ subPages: N }) => {
|
|
|
192
192
|
testIdAttributes: D.createAttributes("UsersAdminPage"),
|
|
193
193
|
title: P`Users`,
|
|
194
194
|
updateOne: q
|
|
195
|
-
}), /* @__PURE__ */
|
|
195
|
+
}), /* @__PURE__ */ b(M, {
|
|
196
196
|
body: P`Click the anonymize button to anonymize the user`,
|
|
197
197
|
cancelLabel: P`Cancel`,
|
|
198
198
|
confirmLabel: P`Anonymize`,
|
|
@@ -201,7 +201,6 @@ var N = ({ subPages: N }) => {
|
|
|
201
201
|
title: P`Are you sure you want to anonymize this user?`
|
|
202
202
|
})] });
|
|
203
203
|
};
|
|
204
|
-
//#endregion
|
|
205
204
|
export { N as UsersAdminPage };
|
|
206
205
|
|
|
207
206
|
//# sourceMappingURL=index.js.map
|