@gen-epix/ui-client-common 4.4.2 → 4.5.1
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 +7 -6
- package/dist/@types/mui.d.ts +13 -5
- package/dist/@types/ui-client-common.d.ts +1 -0
- package/dist/_chunks/ApplicationFooter.js +44 -44
- package/dist/_chunks/ApplicationFooter.js.map +1 -1
- package/dist/_chunks/Breadcrumbs.js +13 -13
- package/dist/_chunks/Breadcrumbs.js.map +1 -1
- package/dist/_chunks/CrudPage.js +300 -300
- package/dist/_chunks/CrudPage.js.map +1 -1
- package/dist/_chunks/Notifications.js +51 -51
- package/dist/_chunks/Notifications.js.map +1 -1
- package/dist/_chunks/OutageList.js +29 -29
- package/dist/_chunks/OutageUtil.js +1 -2
- package/dist/_chunks/OutageUtil.js.map +1 -1
- package/dist/_chunks/QueryClientService.js +96 -388
- package/dist/_chunks/QueryClientService.js.map +1 -1
- package/dist/_chunks/Table.js +518 -512
- package/dist/_chunks/Table.js.map +1 -1
- package/dist/_chunks/TableUtil.js +8 -16
- package/dist/_chunks/TableUtil.js.map +1 -1
- package/dist/_chunks/TextFilter.js +14 -12
- package/dist/_chunks/TextFilter.js.map +1 -1
- package/dist/_chunks/UserInvitationsAdminPage.js +77 -77
- package/dist/_chunks/UserInvitationsAdminPage.js.map +1 -1
- package/dist/_chunks/UserManagerUtil.js +210 -209
- package/dist/_chunks/UserManagerUtil.js.map +1 -1
- package/dist/_chunks/_baseFlatten.js +8 -8
- package/dist/_chunks/_baseFlatten.js.map +1 -1
- package/dist/_chunks/_baseGet.js +280 -0
- package/dist/_chunks/_baseGet.js.map +1 -0
- package/dist/_chunks/_baseIteratee.js +274 -0
- package/dist/_chunks/_baseIteratee.js.map +1 -0
- package/dist/_chunks/_baseUnset.js +22 -299
- package/dist/_chunks/_baseUnset.js.map +1 -1
- package/dist/_chunks/last.js +13 -0
- package/dist/_chunks/last.js.map +1 -0
- package/dist/_chunks/omit.js +41 -40
- package/dist/_chunks/omit.js.map +1 -1
- package/dist/_chunks/tableStore.js +190 -183
- package/dist/_chunks/tableStore.js.map +1 -1
- package/dist/_chunks/uniq.js +44 -0
- package/dist/_chunks/uniq.js.map +1 -0
- package/dist/_chunks/useMutation.js +22 -22
- package/dist/_chunks/useMutation.js.map +1 -1
- package/dist/_chunks/useQueryMemo.js +25 -8
- package/dist/_chunks/useQueryMemo.js.map +1 -1
- package/dist/classes/abstracts/FilterAbstract/index.js +3 -1
- 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 -15
- package/dist/classes/services/AuthenticationService/index.js.map +1 -1
- package/dist/classes/services/AuthorizationService/index.js +4 -4
- package/dist/classes/services/AuthorizationService/index.js.map +1 -1
- package/dist/classes/services/BackendVersionService/index.js +3 -2
- package/dist/classes/services/BackendVersionService/index.js.map +1 -1
- package/dist/classes/services/BreadcrumbService/index.js +16 -38
- package/dist/classes/services/BreadcrumbService/index.js.map +1 -1
- package/dist/classes/services/EmotionCacheService/index.js +9 -8
- package/dist/classes/services/EmotionCacheService/index.js.map +1 -1
- package/dist/classes/services/I18nService/index.js +11 -10
- package/dist/classes/services/I18nService/index.js.map +1 -1
- package/dist/classes/services/InactivityService/index.js +12 -12
- package/dist/classes/services/InactivityService/index.js.map +1 -1
- package/dist/classes/services/LogService/index.js +39 -33
- package/dist/classes/services/LogService/index.js.map +1 -1
- package/dist/classes/services/NotificationService/index.js +8 -8
- package/dist/classes/services/NotificationService/index.js.map +1 -1
- package/dist/classes/services/PageEventBusService/index.js +13 -9
- package/dist/classes/services/PageEventBusService/index.js.map +1 -1
- package/dist/classes/services/RouterService/index.js +3 -6
- package/dist/classes/services/RouterService/index.js.map +1 -1
- package/dist/components/app/App/App.d.ts +1 -1
- package/dist/components/app/App/index.js +34 -38
- package/dist/components/app/App/index.js.map +1 -1
- package/dist/components/app/ApplicationBootstrapWithAuthentication/index.js +28 -28
- package/dist/components/app/ApplicationBootstrapWithAuthentication/index.js.map +1 -1
- package/dist/components/app/ApplicationBootstrapWithoutAuthorization/index.js +47 -45
- package/dist/components/app/ApplicationBootstrapWithoutAuthorization/index.js.map +1 -1
- package/dist/components/app/AuthenticationWrapper/index.js +35 -35
- package/dist/components/app/AuthenticationWrapper/index.js.map +1 -1
- package/dist/components/app/AuthorizationWrapper/index.js +19 -19
- package/dist/components/app/AuthorizationWrapper/index.js.map +1 -1
- package/dist/components/app/RouterRoot/index.js +52 -50
- package/dist/components/app/RouterRoot/index.js.map +1 -1
- package/dist/components/epi/EpiContactDetailsDialog/index.js +21 -21
- package/dist/components/epi/EpiContactDetailsDialog/index.js.map +1 -1
- package/dist/components/filters/BooleanFilterField/index.js +5 -5
- package/dist/components/filters/DateFilterField/index.js +3 -3
- package/dist/components/filters/GeoFilterField/index.js +4 -4
- package/dist/components/filters/MultiSelectFilterField/index.js +4 -4
- package/dist/components/filters/NumberRangeFilterField/index.js +3 -3
- package/dist/components/filters/TextFilterField/index.js +3 -3
- package/dist/components/ui/ApplicationBar/index.js +188 -188
- package/dist/components/ui/ApplicationBar/index.js.map +1 -1
- package/dist/components/ui/GenericErrorMessage/index.js +29 -29
- package/dist/components/ui/GenericErrorMessage/index.js.map +1 -1
- package/dist/components/ui/LicensesDialog/index.js +38 -38
- package/dist/components/ui/LicensesDialog/index.js.map +1 -1
- package/dist/components/ui/MyPermissionsDialog/index.js +16 -16
- package/dist/components/ui/MyPermissionsDialog/index.js.map +1 -1
- package/dist/components/ui/NavLink/index.js +6 -6
- package/dist/components/ui/OrganizationSwitcherDialog/index.js +21 -21
- package/dist/components/ui/OrganizationSwitcherDialog/index.js.map +1 -1
- package/dist/components/ui/PageContainer/index.js +24 -24
- package/dist/components/ui/PageContainer/index.js.map +1 -1
- package/dist/components/ui/Sidebar/index.js +30 -30
- package/dist/components/ui/UserFeedbackDialog/index.js +12 -12
- package/dist/components/ui/UserFeedbackDialog/index.js.map +1 -1
- package/dist/components/ui/UserInactivityConfirmation/index.js.map +1 -1
- package/dist/constants/config.constants.d.ts +0 -2
- package/dist/constants/config.constants.js +2 -2
- package/dist/constants/config.constants.js.map +1 -1
- package/dist/dataHooks/useIdentifierIssuerOwnOrganizationQuery/index.js +12 -12
- package/dist/dataHooks/useIdentifierIssuerOwnOrganizationQuery/index.js.map +1 -1
- package/dist/dataHooks/useIdentifierIssuerQuery/index.js +14 -14
- package/dist/dataHooks/useIdentifierIssuerQuery/index.js.map +1 -1
- package/dist/dataHooks/useInviteUserConstraintsQuery/index.js +12 -12
- package/dist/dataHooks/useInviteUserConstraintsQuery/index.js.map +1 -1
- package/dist/dataHooks/useOrganizationAdminPoliciesQuery/index.js +13 -13
- package/dist/dataHooks/useOrganizationAdminPoliciesQuery/index.js.map +1 -1
- package/dist/dataHooks/useOrganizationIdentifierIssuerLinksQuery/index.js +4 -4
- package/dist/dataHooks/useOrganizationIdentifierIssuerLinksQuery/index.js.map +1 -1
- package/dist/dataHooks/useOrganizationsQuery/index.js +13 -13
- package/dist/dataHooks/useOrganizationsQuery/index.js.map +1 -1
- package/dist/dataHooks/useUsersQuery/index.js +10 -10
- package/dist/dataHooks/useUsersQuery/index.js.map +1 -1
- package/dist/hoc/withPermissions/index.js.map +1 -1
- package/dist/hooks/useConfig/index.js +2 -2
- package/dist/hooks/useConfig/index.js.map +1 -1
- package/dist/hooks/useCreateMutation/index.js +12 -12
- package/dist/hooks/useCreateMutation/index.js.map +1 -1
- package/dist/hooks/useDeleteMutation/index.js +16 -9
- package/dist/hooks/useDeleteMutation/index.js.map +1 -1
- package/dist/hooks/useEditMutation/index.js +48 -33
- package/dist/hooks/useEditMutation/index.js.map +1 -1
- package/dist/hooks/useItemQuery/index.js +4 -4
- package/dist/hooks/useItemQuery/index.js.map +1 -1
- package/dist/hooks/useUpdateBreadcrumb/index.js.map +1 -1
- package/dist/locale/en.json +1 -0
- package/dist/locale/nl.json +1 -0
- package/dist/models/config.models.d.ts +1 -5
- package/dist/models/theme.models.d.ts +19 -16
- package/dist/pages/AcceptInvitationPage/index.js +25 -25
- package/dist/pages/AcceptInvitationPage/index.js.map +1 -1
- package/dist/pages/AdminPage/index.js +16 -16
- package/dist/pages/AdminPage/index.js.map +1 -1
- package/dist/pages/ChooseIdentityProviderPage/index.js +21 -21
- package/dist/pages/ChooseIdentityProviderPage/index.js.map +1 -1
- package/dist/pages/IdentifierIssuersAdminPage/index.js +5 -5
- package/dist/pages/IdentifierIssuersAdminPage/index.js.map +1 -1
- package/dist/pages/OrganizationAdminPoliciesAdminPage/index.js +5 -5
- package/dist/pages/OrganizationAdminPoliciesAdminPage/index.js.map +1 -1
- package/dist/pages/OrganizationContactsAdminPage/index.js +6 -6
- package/dist/pages/OrganizationContactsAdminPage/index.js.map +1 -1
- package/dist/pages/OrganizationSitesAdminPage/index.js +9 -9
- package/dist/pages/OrganizationSitesAdminPage/index.js.map +1 -1
- package/dist/pages/OrganizationsAdminPage/index.js +13 -13
- package/dist/pages/OrganizationsAdminPage/index.js.map +1 -1
- package/dist/pages/OutagesAdminPage/index.js +20 -20
- package/dist/pages/OutagesAdminPage/index.js.map +1 -1
- package/dist/pages/PostLoginPage/index.js +6 -6
- package/dist/pages/PostLoginPage/index.js.map +1 -1
- package/dist/pages/PostLogoutPage/index.js +8 -8
- package/dist/pages/PostLogoutPage/index.js.map +1 -1
- package/dist/pages/UsersAdminPage/index.js +39 -39
- package/dist/pages/UsersAdminPage/index.js.map +1 -1
- package/dist/setup/setup.d.ts +1 -1
- package/dist/setup/setup.js +11 -4
- package/dist/setup/setup.js.map +1 -1
- package/dist/theme/demoTheme/index.js +17 -15
- package/dist/theme/demoTheme/index.js.map +1 -1
- package/dist/utils/DataHookUtil/index.js +1 -1
- 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/MenuDataUtil/index.js +1 -1
- package/dist/utils/MenuDataUtil/index.js.map +1 -1
- package/dist/utils/StandardConfigUtil/index.js +0 -4
- package/dist/utils/StandardConfigUtil/index.js.map +1 -1
- package/dist/utils/TimeUtil/index.js +1 -1
- package/dist/utils/TimeUtil/index.js.map +1 -1
- package/package.json +11 -14
- package/dist/context/uiClientCommonConfigContext/UiClientCommonConfigContext.d.ts +0 -9
- package/dist/context/uiClientCommonConfigContext/UiClientCommonConfigContextProvider.d.ts +0 -6
- package/dist/context/uiClientCommonConfigContext/index.d.ts +0 -3
- package/dist/context/uiClientCommonConfigContext/index.js +0 -34
- package/dist/context/uiClientCommonConfigContext/index.js.map +0 -1
- package/dist/context/uiClientCommonConfigContext/useUiClientCommonConfigContext.d.ts +0 -3
|
@@ -1,53 +1,53 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t } from "../../
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
1
|
+
import { API_ORGANIZATION_TOKEN as e } from "../../constants/api.constants.js";
|
|
2
|
+
import { useConfig as t } from "../../hooks/useConfig/index.js";
|
|
3
|
+
import { PageContainer as n } from "../../components/ui/PageContainer/index.js";
|
|
4
|
+
import { ResponseHandler as r } from "../../components/ui/ResponseHandler/index.js";
|
|
5
|
+
import { t as i } from "../../_chunks/useQueryMemo.js";
|
|
6
|
+
import { t as a } from "../../_chunks/QueryClientService.js";
|
|
7
7
|
import { COMMON_QUERY_KEY as o } from "../../constants/query.constants.js";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
8
|
+
import { container as s } from "tsyringe";
|
|
9
|
+
import { WindowService as c } from "@gen-epix/ui-core/classes/services/WindowService";
|
|
10
|
+
import { Box as l, Button as u, Typography as d } from "@mui/material";
|
|
11
|
+
import { useCallback as f, useState as p } from "react";
|
|
12
|
+
import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
13
13
|
import { useTranslation as _ } from "react-i18next";
|
|
14
14
|
import { TestIdUtil as v } from "@gen-epix/ui-core/utils/TestIdUtil";
|
|
15
15
|
import { useParams as y } from "react-router-dom";
|
|
16
16
|
//#region src/pages/AcceptInvitationPage/AcceptInvitationPage.tsx
|
|
17
17
|
var b = () => {
|
|
18
|
-
let { token: b } = y(), x =
|
|
18
|
+
let { token: b } = y(), x = t(), [S, C] = p(!1), { data: w, error: T, isLoading: E } = i({
|
|
19
19
|
enabled: S,
|
|
20
20
|
gcTime: 0,
|
|
21
|
-
queryFn: async ({ signal:
|
|
22
|
-
queryKey:
|
|
21
|
+
queryFn: async ({ signal: t }) => (await s.resolve(e).userRegistrationsPostOne(b, { signal: t })).data,
|
|
22
|
+
queryKey: s.resolve(a).getGenericKey(o.USER_INVITATIONS, b),
|
|
23
23
|
staleTime: 0
|
|
24
|
-
}), { t: D } = _(), O =
|
|
25
|
-
s.
|
|
26
|
-
}, []), k =
|
|
24
|
+
}), { t: D } = _(), O = f(() => {
|
|
25
|
+
s.resolve(c).window.location.href = "/";
|
|
26
|
+
}, []), k = f(() => {
|
|
27
27
|
C(!0);
|
|
28
28
|
}, []);
|
|
29
|
-
return /* @__PURE__ */
|
|
29
|
+
return /* @__PURE__ */ h(n, {
|
|
30
30
|
singleAction: !0,
|
|
31
31
|
testIdAttributes: v.createAttributes("AcceptInvitationPage"),
|
|
32
32
|
title: D`Invitation`,
|
|
33
|
-
children: /* @__PURE__ */
|
|
33
|
+
children: /* @__PURE__ */ g(r, {
|
|
34
34
|
enabled: S,
|
|
35
35
|
error: T,
|
|
36
36
|
isLoading: E,
|
|
37
|
-
children: [!w && /* @__PURE__ */
|
|
37
|
+
children: [!w && /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h(l, {
|
|
38
38
|
sx: { marginY: 2 },
|
|
39
|
-
children: /* @__PURE__ */
|
|
40
|
-
}), /* @__PURE__ */
|
|
39
|
+
children: /* @__PURE__ */ h(d, { children: D("You have been invited to join {{applicationName}}.", { applicationName: x.applicationName }) })
|
|
40
|
+
}), /* @__PURE__ */ h(l, {
|
|
41
41
|
sx: { marginY: 2 },
|
|
42
|
-
children: /* @__PURE__ */
|
|
42
|
+
children: /* @__PURE__ */ h(u, {
|
|
43
43
|
color: "primary",
|
|
44
44
|
onClick: k,
|
|
45
45
|
type: "submit",
|
|
46
46
|
children: D`Complete registration`
|
|
47
47
|
})
|
|
48
|
-
})] }), w && /* @__PURE__ */
|
|
48
|
+
})] }), w && /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h(l, { children: /* @__PURE__ */ h(d, { children: D("You have been successfully registered to {{applicationName}}.", { applicationName: x.applicationName }) }) }), /* @__PURE__ */ h(l, {
|
|
49
49
|
sx: { marginY: 2 },
|
|
50
|
-
children: /* @__PURE__ */
|
|
50
|
+
children: /* @__PURE__ */ h(u, {
|
|
51
51
|
color: "primary",
|
|
52
52
|
onClick: O,
|
|
53
53
|
children: D`Click here to visit the home page`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["
|
|
1
|
+
{"version":3,"file":"index.js","names":["_Fragment","useQueryMemo","QueryClientService","Fragment$1","AcceptInvitationPage","useParams","config","useConfig","shouldRegister","setShouldRegister","useState","container","API_ORGANIZATION_TOKEN","token","COMMON_QUERY_KEY","useTranslation","onGoToHomePageButtonClick","useCallback","WindowService","onCompleteRegistrationButtonClick","PageContainer","TestIdUtil","ResponseHandler","data","Box","Typography","t","Button"],"sources":["../../../src/pages/AcceptInvitationPage/AcceptInvitationPage.tsx"],"sourcesContent":["import { container } from 'tsyringe';\nimport { useTranslation } from 'react-i18next';\nimport { useParams } from 'react-router-dom';\nimport {\n Box,\n Button,\n Typography,\n} from '@mui/material';\nimport {\n useCallback,\n useState,\n} from 'react';\nimport { TestIdUtil } from '@gen-epix/ui-core/utils/TestIdUtil';\nimport { WindowService } from '@gen-epix/ui-core/classes/services/WindowService';\n\nimport { API_ORGANIZATION_TOKEN } from '../../constants/api.constants';\nimport { PageContainer } from '../../components/ui/PageContainer';\nimport { ResponseHandler } from '../../components/ui/ResponseHandler';\nimport { useQueryMemo } from '../../hooks/useQueryMemo';\nimport { QueryClientService } from '../../classes/services/QueryClientService';\nimport { COMMON_QUERY_KEY } from '../../constants/query.constants';\nimport { useConfig } from '../../hooks/useConfig';\n\nexport const AcceptInvitationPage = () => {\n const { token } = useParams();\n const config = useConfig();\n const [shouldRegister, setShouldRegister] = useState(false);\n\n const { data, error, isLoading } = useQueryMemo({\n enabled: shouldRegister,\n gcTime: 0,\n queryFn: async ({ signal }) => {\n const response = await container.resolve(API_ORGANIZATION_TOKEN).userRegistrationsPostOne(token, { signal });\n return response.data;\n },\n queryKey: container.resolve(QueryClientService).getGenericKey(COMMON_QUERY_KEY.USER_INVITATIONS, token),\n staleTime: 0,\n });\n\n const { t } = useTranslation();\n\n const onGoToHomePageButtonClick = useCallback(() => {\n container.resolve(WindowService).window.location.href = '/';\n }, []);\n\n const onCompleteRegistrationButtonClick = useCallback(() => {\n setShouldRegister(true);\n }, []);\n\n return (\n <PageContainer\n singleAction\n testIdAttributes={TestIdUtil.createAttributes('AcceptInvitationPage')}\n title={t`Invitation`}\n >\n <ResponseHandler\n enabled={shouldRegister}\n error={error}\n isLoading={isLoading}\n >\n {!data && (\n <>\n <Box\n sx={{\n marginY: 2,\n }}\n >\n <Typography>\n {t('You have been invited to join {{applicationName}}.', { applicationName: config.applicationName })}\n </Typography>\n </Box>\n <Box\n sx={{\n marginY: 2,\n }}\n >\n <Button\n color={'primary'}\n onClick={onCompleteRegistrationButtonClick}\n type={'submit'}\n >\n {t`Complete registration`}\n </Button>\n </Box>\n </>\n )}\n {data && (\n <>\n <Box>\n <Typography>\n {t('You have been successfully registered to {{applicationName}}.', { applicationName: config.applicationName })}\n </Typography>\n </Box>\n <Box\n sx={{\n marginY: 2,\n }}\n >\n <Button\n color={'primary'}\n onClick={onGoToHomePageButtonClick}\n >\n {t`Click here to visit the home page`}\n </Button>\n </Box>\n </>\n )}\n </ResponseHandler>\n </PageContainer>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;AAuBA,IAAaI,UAA6B;CACxC,IAAM,EAAE,aAAUC,EAAU,GACtBC,IAASC,EAAU,GACnB,CAACC,GAAgBC,KAAqBC,EAAS,EAAK,GAEpD,EAAE,SAAM,UAAO,iBAAcT,EAAa;EAC9C,SAASO;EACT,QAAQ;EACR,SAAS,OAAO,EAAE,iBAET,MADgBG,EAAU,QAAQC,CAAsB,CAAC,CAAC,yBAAyBC,GAAO,EAAE,UAAO,CAAC,EAAA,CAC3F;EAElB,UAAUF,EAAU,QAAQT,CAAkB,CAAC,CAAC,cAAcY,EAAiB,kBAAkBD,CAAK;EACtG,WAAW;CACb,CAAC,GAEK,EAAE,SAAME,EAAe,GAEvBC,IAA4BC,QAAkB;EAClD,EAAU,QAAQC,CAAa,CAAC,CAAC,OAAO,SAAS,OAAO;CAC1D,GAAG,CAAC,CAAC,GAECC,IAAoCF,QAAkB;EAC1D,EAAkB,EAAI;CACxB,GAAG,CAAC,CAAC;CAEL,OACE,kBAACG,GAAD;EACE,cAAA;EACA,kBAAkBC,EAAW,iBAAiB,sBAAsB;EACpE,OAAO,CAAC;EAER,UAAA,kBAACC,GAAD;GACE,SAASd;GACF;GACI;GAHb,UAAA,CAKG,CAACe,KACA,kBAAAvB,GAAA,EAAA,UAAA,CACE,kBAACwB,GAAD;IACE,IAAI,EACF,SAAS,EACX;IAEA,UAAA,kBAACC,GAAD,EAAA,UACGC,EAAE,sDAAsD,EAAE,iBAAiBpB,EAAO,gBAAgB,CAAC,EAC1F,CAAA;GACT,CAAA,GACL,kBAACkB,GAAD;IACE,IAAI,EACF,SAAS,EACX;IAEA,UAAA,kBAACG,GAAD;KACE,OAAO;KACP,SAASR;KACT,MAAM;KAEL,UAAA,CAAC;IACI,CAAA;GACL,CAAA,CACL,EAAA,CAAA,GAEHI,KACC,kBAAAvB,GAAA,EAAA,UAAA,CACE,kBAACwB,GAAD,EAAA,UACE,kBAACC,GAAD,EAAA,UACGC,EAAE,iEAAiE,EAAE,iBAAiBpB,EAAO,gBAAgB,CAAC,EACrG,CAAA,EACT,CAAA,GACL,kBAACkB,GAAD;IACE,IAAI,EACF,SAAS,EACX;IAEA,UAAA,kBAACG,GAAD;KACE,OAAO;KACP,SAASX;KAER,UAAA,CAAC;IACI,CAAA;GACL,CAAA,CACL,EAAA,CAAA,CAEW;;CACJ,CAAA;AAEnB"}
|
|
@@ -3,24 +3,24 @@ import { AuthorizationService as t } from "../../classes/services/AuthorizationS
|
|
|
3
3
|
import { RouterService as n } from "../../classes/services/RouterService/index.js";
|
|
4
4
|
import { PageContainer as r } from "../../components/ui/PageContainer/index.js";
|
|
5
5
|
import { container as i } from "tsyringe";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
6
|
+
import { Box as a, Card as o, CardActionArea as s, CardContent as c, CardHeader as l, Divider as u, Typography as d, useTheme as f } from "@mui/material";
|
|
7
|
+
import { useCallback as p, useMemo as m } from "react";
|
|
8
|
+
import { jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
9
9
|
import { useTranslation as _ } from "react-i18next";
|
|
10
10
|
import { TestIdUtil as v } from "@gen-epix/ui-core/utils/TestIdUtil";
|
|
11
11
|
import { Outlet as y, useLocation as b } from "react-router-dom";
|
|
12
12
|
//#region src/pages/AdminPage/AdminPage.tsx
|
|
13
13
|
var x = () => {
|
|
14
|
-
let { t: x } = _(), S = b(), C =
|
|
14
|
+
let { t: x } = _(), S = b(), C = f(), w = m(() => i.resolve(n).adminRoutes.map((e) => e.children?.length ? e.children.find((e) => e.index) : e).filter((e) => {
|
|
15
15
|
let n = i.resolve(t).doesUserHavePermission(e.handle.requiredPermissions);
|
|
16
16
|
return !e.handle?.hidden && n;
|
|
17
|
-
}), []), T =
|
|
17
|
+
}), []), T = m(() => ({
|
|
18
18
|
[e.ACCESS_RIGHTS]: x`Access rights`,
|
|
19
19
|
[e.HELPERS]: x`Helpers`,
|
|
20
20
|
[e.REFERENCE_DATA]: x`Reference data`,
|
|
21
21
|
[e.SYSTEM]: x`System`,
|
|
22
22
|
[e.USERS_AND_ORGANIZATIONS]: x`Users and organizations`
|
|
23
|
-
}), [x]), E =
|
|
23
|
+
}), [x]), E = m(() => [
|
|
24
24
|
e.USERS_AND_ORGANIZATIONS,
|
|
25
25
|
e.ACCESS_RIGHTS,
|
|
26
26
|
e.SYSTEM,
|
|
@@ -30,26 +30,26 @@ var x = () => {
|
|
|
30
30
|
items: w.filter((t) => t.handle.category === e),
|
|
31
31
|
label: T[e],
|
|
32
32
|
name: e
|
|
33
|
-
})).filter((e) => e.items.length), [T, w]), D =
|
|
33
|
+
})).filter((e) => e.items.length), [T, w]), D = p(async (e) => {
|
|
34
34
|
await i.resolve(n).router.navigate(e);
|
|
35
35
|
}, []);
|
|
36
|
-
return S?.pathname === "/management" ? /* @__PURE__ */
|
|
36
|
+
return S?.pathname === "/management" ? /* @__PURE__ */ h(r, {
|
|
37
37
|
showBreadcrumbs: !0,
|
|
38
38
|
testIdAttributes: v.createAttributes("AdminPage"),
|
|
39
39
|
title: x`Management`,
|
|
40
|
-
children: /* @__PURE__ */
|
|
40
|
+
children: /* @__PURE__ */ h(a, { children: E.map((e) => /* @__PURE__ */ g(a, {
|
|
41
41
|
sx: {
|
|
42
42
|
marginBottom: 3,
|
|
43
43
|
marginTop: 1
|
|
44
44
|
},
|
|
45
45
|
children: [
|
|
46
|
-
/* @__PURE__ */
|
|
46
|
+
/* @__PURE__ */ h(d, {
|
|
47
47
|
component: "h2",
|
|
48
48
|
sx: { marginBottom: 1 },
|
|
49
49
|
variant: "h3",
|
|
50
50
|
children: e.label
|
|
51
51
|
}),
|
|
52
|
-
/* @__PURE__ */
|
|
52
|
+
/* @__PURE__ */ h(a, {
|
|
53
53
|
sx: {
|
|
54
54
|
display: "grid",
|
|
55
55
|
gap: C.spacing(1),
|
|
@@ -58,25 +58,25 @@ var x = () => {
|
|
|
58
58
|
[C.breakpoints.up("md")]: { gridTemplateColumns: "repeat(2, 1fr)" },
|
|
59
59
|
[C.breakpoints.up("xl")]: { gridTemplateColumns: "repeat(4, 1fr)" }
|
|
60
60
|
},
|
|
61
|
-
children: e.items.map((e) => /* @__PURE__ */
|
|
61
|
+
children: e.items.map((e) => /* @__PURE__ */ h(o, {
|
|
62
62
|
square: !0,
|
|
63
63
|
sx: {
|
|
64
64
|
flexDirection: "column",
|
|
65
65
|
justifyContent: "space-between"
|
|
66
66
|
},
|
|
67
|
-
children: /* @__PURE__ */
|
|
67
|
+
children: /* @__PURE__ */ g(s, {
|
|
68
68
|
onClick: async () => D(e.path),
|
|
69
|
-
children: [/* @__PURE__ */
|
|
69
|
+
children: [/* @__PURE__ */ h(l, { title: e.handle.title }), /* @__PURE__ */ h(c, { children: e.handle.subTitle })]
|
|
70
70
|
})
|
|
71
71
|
}, e.path))
|
|
72
72
|
}),
|
|
73
|
-
/* @__PURE__ */
|
|
73
|
+
/* @__PURE__ */ h(u, { sx: {
|
|
74
74
|
marginBottom: 2,
|
|
75
75
|
marginTop: 2
|
|
76
76
|
} })
|
|
77
77
|
]
|
|
78
78
|
}, e.name)) })
|
|
79
|
-
}) : /* @__PURE__ */
|
|
79
|
+
}) : /* @__PURE__ */ h(y, {});
|
|
80
80
|
};
|
|
81
81
|
//#endregion
|
|
82
82
|
export { x as AdminPage };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["
|
|
1
|
+
{"version":3,"file":"index.js","names":["AdminPage","useTranslation","location","useLocation","theme","useTheme","menuItems","useMemo","container","RouterService","r","child","hasPermission","AuthorizationService","categoryToLabelMap","ADMIN_PAGE_CATEGORY","t","categories","category","c","onCardClick","useCallback","path","PageContainer","TestIdUtil","Box","Typography","Card","CardActionArea","item","CardHeader","CardContent","Divider","Outlet"],"sources":["../../../src/pages/AdminPage/AdminPage.tsx"],"sourcesContent":["import { container } from 'tsyringe';\nimport { useTranslation } from 'react-i18next';\nimport {\n Outlet,\n useLocation,\n} from 'react-router-dom';\nimport {\n Box,\n Card,\n CardActionArea,\n CardContent,\n CardHeader,\n Divider,\n Typography,\n useTheme,\n} from '@mui/material';\nimport {\n useCallback,\n useMemo,\n} from 'react';\nimport { TestIdUtil } from '@gen-epix/ui-core/utils/TestIdUtil';\n\nimport { AuthorizationService } from '../../classes/services/AuthorizationService';\nimport { RouterService } from '../../classes/services/RouterService';\nimport { PageContainer } from '../../components/ui/PageContainer';\nimport { ADMIN_PAGE_CATEGORY } from '../../models/admin.models';\nimport type { MyNonIndexRouteObject } from '../../models/react-router.models';\n\n\ntype Category = {\n items: MyNonIndexRouteObject[];\n label: string;\n name: string;\n};\n\nexport const AdminPage = () => {\n const { t } = useTranslation();\n const location = useLocation();\n const theme = useTheme();\n\n const menuItems = useMemo(() => {\n const items = container.resolve(RouterService).adminRoutes\n .map(r => r.children?.length ? r.children.find(child => child.index) as MyNonIndexRouteObject : r)\n .filter(r => {\n const hasPermission = container.resolve(AuthorizationService).doesUserHavePermission(r.handle.requiredPermissions);\n return !r.handle?.hidden && hasPermission;\n });\n return items;\n }, []);\n\n const categoryToLabelMap = useMemo<Record<ADMIN_PAGE_CATEGORY, string>>(() => {\n return {\n [ADMIN_PAGE_CATEGORY.ACCESS_RIGHTS]: t`Access rights`,\n [ADMIN_PAGE_CATEGORY.HELPERS]: t`Helpers`,\n [ADMIN_PAGE_CATEGORY.REFERENCE_DATA]: t`Reference data`,\n [ADMIN_PAGE_CATEGORY.SYSTEM]: t`System`,\n [ADMIN_PAGE_CATEGORY.USERS_AND_ORGANIZATIONS]: t`Users and organizations`,\n };\n }, [t]);\n\n\n const categories = useMemo<Category[]>(() => {\n return [\n ADMIN_PAGE_CATEGORY.USERS_AND_ORGANIZATIONS,\n ADMIN_PAGE_CATEGORY.ACCESS_RIGHTS,\n ADMIN_PAGE_CATEGORY.SYSTEM,\n ADMIN_PAGE_CATEGORY.REFERENCE_DATA,\n ADMIN_PAGE_CATEGORY.HELPERS,\n ].map(category => {\n return {\n items: menuItems.filter(r => r.handle.category as ADMIN_PAGE_CATEGORY === category),\n label: categoryToLabelMap[category],\n name: category,\n };\n }).filter(c => c.items.length);\n }, [categoryToLabelMap, menuItems]);\n\n const onCardClick = useCallback(async (path: string) => {\n await container.resolve(RouterService).router.navigate(path);\n }, []);\n\n if (location?.pathname !== '/management') {\n return (\n <Outlet />\n );\n }\n\n return (\n <PageContainer\n showBreadcrumbs\n testIdAttributes={TestIdUtil.createAttributes('AdminPage')}\n title={t`Management`}\n >\n <Box>\n {categories.map(category => (\n <Box\n key={category.name}\n sx={{\n marginBottom: 3,\n marginTop: 1,\n }}\n >\n <Typography\n component={'h2'}\n sx={{\n marginBottom: 1,\n }}\n variant={'h3'}\n >\n {category.label}\n </Typography>\n <Box\n sx={{\n display: 'grid',\n gap: theme.spacing(1),\n gridTemplateColumns: 'repeat(1, 1fr)',\n [theme.breakpoints.up('lg')]: {\n gridTemplateColumns: 'repeat(3, 1fr)',\n },\n [theme.breakpoints.up('md')]: {\n gridTemplateColumns: 'repeat(2, 1fr)',\n },\n [theme.breakpoints.up('xl')]: {\n gridTemplateColumns: 'repeat(4, 1fr)',\n },\n }}\n >\n {category.items.map(item => (\n <Card\n key={item.path}\n square\n sx={{\n flexDirection: 'column',\n justifyContent: 'space-between',\n }}\n >\n <CardActionArea\n // eslint-disable-next-line @eslint-react/kit/jsx-no-bind\n onClick={async () => onCardClick(item.path)}\n >\n <CardHeader title={item.handle.title} />\n <CardContent>\n {item.handle.subTitle}\n </CardContent>\n </CardActionArea>\n </Card>\n ))}\n </Box>\n <Divider\n sx={{\n marginBottom: 2,\n marginTop: 2,\n }}\n />\n </Box>\n ))}\n </Box>\n </PageContainer>\n );\n};\n"],"mappings":";;;;;;;;;;;;AAmCA,IAAaA,UAAkB;CAC7B,IAAM,EAAE,SAAMC,EAAe,GACvBC,IAAWC,EAAY,GACvBC,IAAQC,EAAS,GAEjBC,IAAYC,QACFC,EAAU,QAAQC,CAAa,CAAC,CAAC,YAC5C,KAAI,MAAKC,EAAE,UAAU,SAASA,EAAE,SAAS,MAAK,MAASC,EAAM,KAAK,IAA6BD,CAAC,CAAC,CACjG,QAAO,MAAK;EACX,IAAME,IAAgBJ,EAAU,QAAQK,CAAoB,CAAC,CAAC,uBAAuBH,EAAE,OAAO,mBAAmB;EACjH,OAAO,CAACA,EAAE,QAAQ,UAAUE;CAC9B,CACK,GACN,CAAC,CAAC,GAECE,IAAqBP,SAClB;GACJQ,EAAoB,gBAAgB,CAAC;GACrCA,EAAoB,UAAU,CAAC;GAC/BA,EAAoB,iBAAiB,CAAC;GACtCA,EAAoB,SAAS,CAAC;GAC9BA,EAAoB,0BAA0B,CAAC;CAClD,IACC,CAACC,CAAC,CAAC,GAGAC,IAAaV,QACV;EACLQ,EAAoB;EACpBA,EAAoB;EACpBA,EAAoB;EACpBA,EAAoB;EACpBA,EAAoB;CACtB,CAAC,CAAC,KAAI,OACG;EACL,OAAOT,EAAU,QAAO,MAAKI,EAAE,OAAO,aAAoCQ,CAAQ;EAClF,OAAOJ,EAAmBI;EAC1B,MAAMA;CACR,EACD,CAAC,CAAC,QAAO,MAAKC,EAAE,MAAM,MAAM,GAC5B,CAACL,GAAoBR,CAAS,CAAC,GAE5Bc,IAAcC,EAAY,OAAO,MAAiB;EACtD,MAAMb,EAAU,QAAQC,CAAa,CAAC,CAAC,OAAO,SAASa,CAAI;CAC7D,GAAG,CAAC,CAAC;CAQL,OANIpB,GAAU,aAAa,gBAOzB,kBAACqB,GAAD;EACE,iBAAA;EACA,kBAAkBC,EAAW,iBAAiB,WAAW;EACzD,OAAO,CAAC;EAER,UAAA,kBAACC,GAAD,EAAA,UACGR,EAAW,KAAI,MACd,kBAACQ,GAAD;GAEE,IAAI;IACF,cAAc;IACd,WAAW;GACb;GALF,UAAA;IAOE,kBAACC,GAAD;KACE,WAAW;KACX,IAAI,EACF,cAAc,EAChB;KACA,SAAS;KAER,UAAAR,EAAS;IACA,CAAA;IACZ,kBAACO,GAAD;KACE,IAAI;MACF,SAAS;MACT,KAAKrB,EAAM,QAAQ,CAAC;MACpB,qBAAqB;OACpBA,EAAM,YAAY,GAAG,IAAI,IAAI,EAC5B,qBAAqB,iBACvB;OACCA,EAAM,YAAY,GAAG,IAAI,IAAI,EAC5B,qBAAqB,iBACvB;OACCA,EAAM,YAAY,GAAG,IAAI,IAAI,EAC5B,qBAAqB,iBACvB;KACF;KAEC,UAAAc,EAAS,MAAM,KAAI,MAClB,kBAACS,GAAD;MAEE,QAAA;MACA,IAAI;OACF,eAAe;OACf,gBAAgB;MAClB;MAEA,UAAA,kBAACC,GAAD;OAEE,SAAS,YAAYR,EAAYS,EAAK,IAAI;OAF5C,UAAA,CAIE,kBAACC,GAAD,EAAY,OAAOD,EAAK,OAAO,MAAQ,CAAA,GACvC,kBAACE,GAAD,EAAA,UACGF,EAAK,OAAO,SACF,CAAA,CACC;;KACZ,GAhBCA,EAAK,IAgBN,CACP;IACE,CAAA;IACL,kBAACG,GAAD,EACE,IAAI;KACF,cAAc;KACd,WAAW;IACb,EACD,CAAA;GACE;EA1DE,GAAAd,EAAS,IA0DX,CACN,EACE,CAAA;CACQ,CAAA,IA1Eb,kBAACe,GAAD,CAAS,CAAA;AA4Ef"}
|
|
@@ -2,79 +2,79 @@ import { useConfig as e } from "../../hooks/useConfig/index.js";
|
|
|
2
2
|
import { PageContainer as t } from "../../components/ui/PageContainer/index.js";
|
|
3
3
|
import { AuthenticationService as n } from "../../classes/services/AuthenticationService/index.js";
|
|
4
4
|
import { container as r } from "tsyringe";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
5
|
+
import { Alert as i, AlertTitle as a, Box as o, Button as s, Tooltip as c, Typography as l } from "@mui/material";
|
|
6
|
+
import { useCallback as u, useMemo as d } from "react";
|
|
7
|
+
import { jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
8
8
|
import { useTranslation as m } from "react-i18next";
|
|
9
9
|
import { TestIdUtil as h } from "@gen-epix/ui-core/utils/TestIdUtil";
|
|
10
10
|
//#region src/pages/ChooseIdentityProviderPage/ChooseIdentityProviderPage.tsx
|
|
11
11
|
var g = ({ identityProvidersWithAvailability: g }) => {
|
|
12
|
-
let { t: _ } = m(), v = e(), y = v.login?.AfterIdentityProviderSelection, b =
|
|
12
|
+
let { t: _ } = m(), v = e(), y = v.login?.AfterIdentityProviderSelection, b = u((e) => {
|
|
13
13
|
let t = e.target.getAttribute("data-name");
|
|
14
14
|
r.resolve(n).next(g.find((e) => e.provider.name === t).provider);
|
|
15
|
-
}, [g]), x =
|
|
15
|
+
}, [g]), x = d(() => g?.filter((e) => e.isAvailable) ?? [], [g]), S = u(() => {
|
|
16
16
|
window.location.reload();
|
|
17
|
-
}, []), C =
|
|
17
|
+
}, []), C = d(() => /* @__PURE__ */ f(s, {
|
|
18
18
|
color: "inherit",
|
|
19
19
|
onClick: S,
|
|
20
20
|
sx: { marginTop: 2 },
|
|
21
21
|
variant: "outlined",
|
|
22
22
|
children: _("Refresh")
|
|
23
23
|
}), [S, _]);
|
|
24
|
-
return /* @__PURE__ */
|
|
24
|
+
return /* @__PURE__ */ p(t, {
|
|
25
25
|
singleAction: !0,
|
|
26
26
|
testIdAttributes: h.createAttributes("ChooseIdentityProviderPage"),
|
|
27
27
|
title: _`Choose identity provider`,
|
|
28
28
|
children: [
|
|
29
|
-
x.length === 0 && /* @__PURE__ */ o
|
|
29
|
+
x.length === 0 && /* @__PURE__ */ f(o, {
|
|
30
30
|
sx: {
|
|
31
31
|
marginBottom: 4,
|
|
32
32
|
marginTop: 1
|
|
33
33
|
},
|
|
34
|
-
children: /* @__PURE__ */
|
|
34
|
+
children: /* @__PURE__ */ p(i, {
|
|
35
35
|
severity: "error",
|
|
36
|
-
children: [/* @__PURE__ */
|
|
36
|
+
children: [/* @__PURE__ */ f(a, { children: _("No identity providers are currently available. Please try again later.") }), C]
|
|
37
37
|
})
|
|
38
38
|
}),
|
|
39
|
-
x.length > 0 && x.length !== g.length && /* @__PURE__ */ o
|
|
39
|
+
x.length > 0 && x.length !== g.length && /* @__PURE__ */ f(o, {
|
|
40
40
|
sx: {
|
|
41
41
|
marginBottom: 4,
|
|
42
42
|
marginTop: 1
|
|
43
43
|
},
|
|
44
|
-
children: /* @__PURE__ */
|
|
44
|
+
children: /* @__PURE__ */ p(i, {
|
|
45
45
|
severity: "info",
|
|
46
|
-
children: [/* @__PURE__ */
|
|
46
|
+
children: [/* @__PURE__ */ f(a, { children: _("Some identity providers are currently unavailable.") }), C]
|
|
47
47
|
})
|
|
48
48
|
}),
|
|
49
|
-
/* @__PURE__ */
|
|
49
|
+
/* @__PURE__ */ p(o, {
|
|
50
50
|
sx: { textAlign: "center" },
|
|
51
51
|
children: [
|
|
52
|
-
/* @__PURE__ */
|
|
52
|
+
/* @__PURE__ */ f(l, {
|
|
53
53
|
sx: { marginBottom: 2 },
|
|
54
54
|
variant: "h1",
|
|
55
55
|
children: _("Welcome to {{applicationName}}", { applicationName: v.applicationName })
|
|
56
56
|
}),
|
|
57
|
-
/* @__PURE__ */
|
|
57
|
+
/* @__PURE__ */ f(l, {
|
|
58
58
|
sx: { marginBottom: 2 },
|
|
59
59
|
children: _`Please login with one of the following identity providers:`
|
|
60
60
|
}),
|
|
61
61
|
g.map((e) => {
|
|
62
|
-
let t = /* @__PURE__ */
|
|
62
|
+
let t = /* @__PURE__ */ f(s, {
|
|
63
63
|
"data-name": e.provider.name,
|
|
64
64
|
disabled: !e.isAvailable,
|
|
65
65
|
onClick: b,
|
|
66
66
|
children: e.provider.label
|
|
67
67
|
});
|
|
68
|
-
return /* @__PURE__ */
|
|
68
|
+
return /* @__PURE__ */ p(o, {
|
|
69
69
|
sx: { marginY: 2 },
|
|
70
|
-
children: [e.isAvailable && t, !e.isAvailable && /* @__PURE__ */
|
|
70
|
+
children: [e.isAvailable && t, !e.isAvailable && /* @__PURE__ */ f(c, {
|
|
71
71
|
arrow: !0,
|
|
72
72
|
title: e.isAvailable ? "" : _("This identity provider is currently unavailable. Please try again later."),
|
|
73
|
-
children: /* @__PURE__ */
|
|
73
|
+
children: /* @__PURE__ */ f("span", { children: t })
|
|
74
74
|
})]
|
|
75
75
|
}, e.provider.name);
|
|
76
76
|
}),
|
|
77
|
-
y && /* @__PURE__ */
|
|
77
|
+
y && /* @__PURE__ */ f(y, {})
|
|
78
78
|
]
|
|
79
79
|
})
|
|
80
80
|
]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["ChooseIdentityProviderPage","useTranslation","config","useConfig","AfterIdentityProviderSelection","onIdentityProviderButtonClick","useCallback","name","event","AuthenticationService","identityProvidersWithAvailability","identityProviderWithAvailability","availableIdentityProviders","useMemo","x","onRefreshButtonClick","refreshButton","Button","t","PageContainer","TestIdUtil","Box","Alert","AlertTitle","Typography","button","Tooltip"],"sources":["../../../src/pages/ChooseIdentityProviderPage/ChooseIdentityProviderPage.tsx"],"sourcesContent":["import { container
|
|
1
|
+
{"version":3,"file":"index.js","names":["ChooseIdentityProviderPage","useTranslation","config","useConfig","AfterIdentityProviderSelection","onIdentityProviderButtonClick","useCallback","name","event","AuthenticationService","identityProvidersWithAvailability","identityProviderWithAvailability","availableIdentityProviders","useMemo","x","onRefreshButtonClick","refreshButton","Button","t","PageContainer","TestIdUtil","Box","Alert","AlertTitle","Typography","button","Tooltip"],"sources":["../../../src/pages/ChooseIdentityProviderPage/ChooseIdentityProviderPage.tsx"],"sourcesContent":["import { container } from 'tsyringe';\nimport {\n Alert,\n AlertTitle,\n Box,\n Button,\n Tooltip,\n Typography,\n} from '@mui/material';\nimport type { MouseEvent } from 'react';\nimport {\n useCallback,\n useMemo,\n} from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { TestIdUtil } from '@gen-epix/ui-core/utils/TestIdUtil';\n\nimport { AuthenticationService } from '../../classes/services/AuthenticationService';\nimport { PageContainer } from '../../components/ui/PageContainer';\nimport type { IdentityProviderWithAvailability } from '../../models/auth.models';\nimport { useConfig } from '../../hooks/useConfig';\n\nexport type ChooseIdentityProviderPageProps = {\n readonly identityProvidersWithAvailability: IdentityProviderWithAvailability[];\n};\n\nexport const ChooseIdentityProviderPage = ({\n identityProvidersWithAvailability,\n}: ChooseIdentityProviderPageProps) => {\n const { t } = useTranslation();\n const config = useConfig();\n\n const AfterIdentityProviderSelection = config.login?.AfterIdentityProviderSelection;\n\n const onIdentityProviderButtonClick = useCallback(\n (event: MouseEvent<HTMLButtonElement>) => {\n const name = (event.target as HTMLButtonElement).getAttribute(\n 'data-name',\n );\n\n container.resolve(AuthenticationService).next(\n identityProvidersWithAvailability.find(\n (identityProviderWithAvailability) =>\n identityProviderWithAvailability.provider.name === name,\n ).provider,\n );\n },\n [identityProvidersWithAvailability],\n );\n\n const availableIdentityProviders = useMemo<\n IdentityProviderWithAvailability[]\n >(() => {\n return (\n identityProvidersWithAvailability?.filter((x) => x.isAvailable) ?? []\n );\n }, [identityProvidersWithAvailability]);\n\n const onRefreshButtonClick = useCallback(() => {\n window.location.reload();\n }, []);\n\n const refreshButton = useMemo(\n () => (\n <Button\n color={'inherit'}\n onClick={onRefreshButtonClick}\n sx={{ marginTop: 2 }}\n variant={'outlined'}\n >\n {t('Refresh')}\n </Button>\n ),\n [onRefreshButtonClick, t],\n );\n\n return (\n <PageContainer\n singleAction\n testIdAttributes={TestIdUtil.createAttributes(\n 'ChooseIdentityProviderPage',\n )}\n title={t`Choose identity provider`}\n >\n {availableIdentityProviders.length === 0 && (\n <Box\n sx={{\n marginBottom: 4,\n marginTop: 1,\n }}\n >\n <Alert severity={'error'}>\n <AlertTitle>\n {t(\n 'No identity providers are currently available. Please try again later.',\n )}\n </AlertTitle>\n {refreshButton}\n </Alert>\n </Box>\n )}\n {availableIdentityProviders.length > 0 && availableIdentityProviders.length !==\n identityProvidersWithAvailability.length && (\n <Box\n sx={{\n marginBottom: 4,\n marginTop: 1,\n }}\n >\n <Alert severity={'info'}>\n <AlertTitle>\n {t('Some identity providers are currently unavailable.')}\n </AlertTitle>\n {refreshButton}\n </Alert>\n </Box>\n )}\n <Box sx={{ textAlign: 'center' }}>\n <Typography\n sx={{\n marginBottom: 2,\n }}\n variant={'h1'}\n >\n {t('Welcome to {{applicationName}}', {\n applicationName: config.applicationName,\n })}\n </Typography>\n <Typography\n sx={{\n marginBottom: 2,\n }}\n >\n {t`Please login with one of the following identity providers:`}\n </Typography>\n {identityProvidersWithAvailability.map(\n (identityProviderWithAvailability) => {\n const button = (\n <Button\n data-name={identityProviderWithAvailability.provider.name}\n disabled={!identityProviderWithAvailability.isAvailable}\n onClick={onIdentityProviderButtonClick}\n >\n {identityProviderWithAvailability.provider.label}\n </Button>\n );\n return (\n <Box\n key={identityProviderWithAvailability.provider.name}\n sx={{\n marginY: 2,\n }}\n >\n {identityProviderWithAvailability.isAvailable && button}\n {!identityProviderWithAvailability.isAvailable && (\n <Tooltip\n arrow\n title={\n identityProviderWithAvailability.isAvailable\n ? ''\n : t(\n 'This identity provider is currently unavailable. Please try again later.',\n )\n }\n >\n <span>\n {button}\n </span>\n </Tooltip>\n )}\n </Box>\n );\n },\n )}\n {AfterIdentityProviderSelection && <AfterIdentityProviderSelection />}\n </Box>\n </PageContainer>\n );\n};\n"],"mappings":";;;;;;;;;;AA0BA,IAAaA,KAA8B,EACzC,2CACqC;CACrC,IAAM,EAAE,SAAMC,EAAe,GACvBC,IAASC,EAAU,GAEnBC,IAAiCF,EAAO,OAAO,gCAE/CG,IAAgCC,GACnC,MAAyC;EACxC,IAAMC,IAAQC,EAAM,OAA6B,aAC/C,WACF;EAEA,EAAU,QAAQC,CAAqB,CAAC,CAAC,KACvCC,EAAkC,MAC/B,MACCC,EAAiC,SAAS,SAASJ,CACvD,CAAC,CAAC,QACJ;CACF,GACA,CAACG,CAAiC,CACpC,GAEME,IAA6BC,QAI/BH,GAAmC,QAAQ,MAAMI,EAAE,WAAW,KAAK,CAAC,GAErE,CAACJ,CAAiC,CAAC,GAEhCK,IAAuBT,QAAkB;EAC7C,OAAO,SAAS,OAAO;CACzB,GAAG,CAAC,CAAC,GAECU,IAAgBH,QAElB,kBAACI,GAAD;EACE,OAAO;EACP,SAASF;EACT,IAAI,EAAE,WAAW,EAAE;EACnB,SAAS;EAER,UAAAG,EAAE,SAAS;CACN,CAAA,GAEV,CAACH,GAAsBG,CAAC,CAC1B;CAEA,OACE,kBAACC,GAAD;EACE,cAAA;EACA,kBAAkBC,EAAW,iBAC3B,4BACF;EACA,OAAO,CAAC;EALV,UAAA;GAOGR,EAA2B,WAAW,KACrC,kBAACS,GAAD;IACE,IAAI;KACF,cAAc;KACd,WAAW;IACb;IAEA,UAAA,kBAACC,GAAD;KAAO,UAAU;KAAjB,UAAA,CACE,kBAACC,GAAD,EAAA,UACGL,EACC,wEACF,EACU,CAAA,GACXF,CACI;;GACJ,CAAA;GAENJ,EAA2B,SAAS,KAAKA,EAA2B,WACnEF,EAAkC,UAClC,kBAACW,GAAD;IACE,IAAI;KACF,cAAc;KACd,WAAW;IACb;IAEA,UAAA,kBAACC,GAAD;KAAO,UAAU;KAAjB,UAAA,CACE,kBAACC,GAAD,EAAA,UACGL,EAAE,oDAAoD,EAC7C,CAAA,GACXF,CACI;;GACJ,CAAA;GAEP,kBAACK,GAAD;IAAK,IAAI,EAAE,WAAW,SAAS;IAA/B,UAAA;KACE,kBAACG,GAAD;MACE,IAAI,EACF,cAAc,EAChB;MACA,SAAS;MAER,UAAAN,EAAE,kCAAkC,EACnC,iBAAiBhB,EAAO,gBAC1B,CAAC;KACS,CAAA;KACZ,kBAACsB,GAAD;MACE,IAAI,EACF,cAAc,EAChB;MAEC,UAAA,CAAC;KACQ,CAAA;KACXd,EAAkC,KAChC,MAAqC;MACpC,IAAMe,IACJ,kBAACR,GAAD;OACE,aAAWN,EAAiC,SAAS;OACrD,UAAU,CAACA,EAAiC;OAC5C,SAASN;OAER,UAAAM,EAAiC,SAAS;MACrC,CAAA;MAEV,OACE,kBAACU,GAAD;OAEE,IAAI,EACF,SAAS,EACX;OAJF,UAAA,CAMGV,EAAiC,eAAec,GAChD,CAACd,EAAiC,eACjC,kBAACe,GAAD;QACE,OAAA;QACA,OACEf,EAAiC,cAC7B,KACAO,EACA,0EACF;QAGJ,UAAA,kBAAC,QAAD,EAAA,UACGO,EACG,CAAA;OACC,CAAA,CAER;MAtBE,GAAAd,EAAiC,SAAS,IAsB5C;KAET,CACF;KACCP,KAAkC,kBAACA,GAAD,CAAiC,CAAA;IACjE;;EACQ;;AAEnB"}
|
|
@@ -2,8 +2,8 @@ import { t as e } from "../../_chunks/TableUtil.js";
|
|
|
2
2
|
import { API_ORGANIZATION_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 {
|
|
5
|
+
import { container as i } from "tsyringe";
|
|
6
|
+
import { CommonDbCommandName as a } from "@gen-epix/api-commondb";
|
|
7
7
|
import { useCallback as o, useMemo as s } from "react";
|
|
8
8
|
import { jsx as c } from "react/jsx-runtime";
|
|
9
9
|
import { useTranslation as l } from "react-i18next";
|
|
@@ -13,10 +13,10 @@ import { FORM_FIELD_DEFINITION_TYPE as f } from "@gen-epix/ui-core-form/models/f
|
|
|
13
13
|
import { SchemaUtil as p } from "@gen-epix/ui-core-form/utils/SchemaUtil";
|
|
14
14
|
//#region src/pages/IdentifierIssuersAdminPage/IdentifierIssuersAdminPage.tsx
|
|
15
15
|
var m = () => {
|
|
16
|
-
let { t: m } = l(), h = o(async (e) => (await
|
|
16
|
+
let { t: m } = l(), h = o(async (e) => (await i.resolve(t).identifierIssuersGetAll(null, null, { signal: e }))?.data, []), g = o(async (e) => await i.resolve(t).identifierIssuersDeleteOne(e.id), []), _ = o(async (e, n) => (await i.resolve(t).identifierIssuersPutOne(n.id, {
|
|
17
17
|
id: n.id,
|
|
18
18
|
...e
|
|
19
|
-
})).data, []), v = o(async (e) => (await
|
|
19
|
+
})).data, []), v = o(async (e) => (await i.resolve(t).identifierIssuersPostOne(e)).data, []), y = o((e) => e.name, []), b = s(() => u().shape({
|
|
20
20
|
code: p.code,
|
|
21
21
|
description: p.description,
|
|
22
22
|
name: p.name
|
|
@@ -48,7 +48,7 @@ var m = () => {
|
|
|
48
48
|
return /* @__PURE__ */ c(n, {
|
|
49
49
|
createItemDialogTitle: m`Create new identifier issuer`,
|
|
50
50
|
createOne: v,
|
|
51
|
-
crudCommandType:
|
|
51
|
+
crudCommandType: a.IdentifierIssuerCrudCommand,
|
|
52
52
|
defaultSortByField: "code",
|
|
53
53
|
defaultSortDirection: "asc",
|
|
54
54
|
deleteOne: g,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["
|
|
1
|
+
{"version":3,"file":"index.js","names":["TableUtil","CrudPage","IdentifierIssuersAdminPage","useTranslation","fetchAll","useCallback","container","API_ORGANIZATION_TOKEN","deleteOne","item","updateOne","variables","createOne","getName","schema","useMemo","object","SchemaUtil","formFieldDefinitions","FORM_FIELD_DEFINITION_TYPE","t","tableColumns","CommonDbCommandName","COMMON_QUERY_KEY","TestIdUtil"],"sources":["../../../src/pages/IdentifierIssuersAdminPage/IdentifierIssuersAdminPage.tsx"],"sourcesContent":["import { container } from 'tsyringe';\nimport {\n useCallback,\n useMemo,\n} from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { object } from 'yup';\nimport type { CommonDbIdentifierIssuer } from '@gen-epix/api-commondb';\nimport { CommonDbCommandName } from '@gen-epix/api-commondb';\nimport { TestIdUtil } from '@gen-epix/ui-core/utils/TestIdUtil';\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 { CrudPage } from '../CrudPage';\nimport type { OmitWithMetaData } from '../../models/data.models';\nimport { COMMON_QUERY_KEY } from '../../constants/query.constants';\n\ntype FormFields = OmitWithMetaData<CommonDbIdentifierIssuer>;\n\nexport const IdentifierIssuersAdminPage = () => {\n const { t } = useTranslation();\n\n\n const fetchAll = useCallback(async (signal: AbortSignal) => {\n return (await container.resolve(API_ORGANIZATION_TOKEN).identifierIssuersGetAll(null, null, { signal }))?.data;\n }, []);\n\n const deleteOne = useCallback(async (item: CommonDbIdentifierIssuer) => {\n return await container.resolve(API_ORGANIZATION_TOKEN).identifierIssuersDeleteOne(item.id);\n }, []);\n\n const updateOne = useCallback(async (variables: FormFields, item: CommonDbIdentifierIssuer) => {\n return (await container.resolve(API_ORGANIZATION_TOKEN).identifierIssuersPutOne(item.id, { id: item.id, ...variables })).data;\n }, []);\n\n const createOne = useCallback(async (variables: FormFields) => {\n return (await container.resolve(API_ORGANIZATION_TOKEN).identifierIssuersPostOne(variables)).data;\n }, []);\n\n const getName = useCallback((item: CommonDbIdentifierIssuer) => {\n return item.name;\n }, []);\n\n const schema = useMemo(() => {\n return object<FormFields>().shape({\n code: SchemaUtil.code,\n description: SchemaUtil.description,\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 ] as const;\n }, [t]);\n\n const tableColumns = useMemo((): TableColumn<CommonDbIdentifierIssuer>[] => {\n return [\n TableUtil.createTextColumn<CommonDbIdentifierIssuer>({ id: 'code', name: t`Code` }),\n TableUtil.createTextColumn<CommonDbIdentifierIssuer>({ id: 'name', name: t`Name` }),\n ];\n }, [t]);\n\n return (\n <CrudPage<FormFields, CommonDbIdentifierIssuer>\n createItemDialogTitle={t`Create new identifier issuer`}\n createOne={createOne}\n crudCommandType={CommonDbCommandName.IdentifierIssuerCrudCommand}\n defaultSortByField={'code'}\n defaultSortDirection={'asc'}\n deleteOne={deleteOne}\n fetchAll={fetchAll}\n formFieldDefinitions={formFieldDefinitions}\n getName={getName}\n itemName={t`Identifier issuer`}\n resourceQueryKeyBase={COMMON_QUERY_KEY.IDENTIFIER_ISSUERS}\n schema={schema}\n tableColumns={tableColumns}\n testIdAttributes={TestIdUtil.createAttributes('IdentifierIssuersAdminPage')}\n title={t`Identifier Issuers`}\n updateOne={updateOne}\n />\n );\n};\n"],"mappings":";;;;;;;;;;;;;;AAuBA,IAAaE,UAAmC;CAC9C,IAAM,EAAE,SAAMC,EAAe,GAGvBC,IAAWC,EAAY,OAAO,OAC1B,MAAMC,EAAU,QAAQC,CAAsB,CAAC,CAAC,wBAAwB,MAAM,MAAM,EAAE,UAAO,CAAC,EAAA,EAAI,MACzG,CAAC,CAAC,GAECC,IAAYH,EAAY,OAAO,MAC5B,MAAMC,EAAU,QAAQC,CAAsB,CAAC,CAAC,2BAA2BE,EAAK,EAAE,GACxF,CAAC,CAAC,GAECC,IAAYL,EAAY,OAAO,GAAuB,OAClD,MAAMC,EAAU,QAAQC,CAAsB,CAAC,CAAC,wBAAwBE,EAAK,IAAI;EAAE,IAAIA,EAAK;EAAI,GAAGE;CAAU,CAAC,EAAA,CAAG,MACxH,CAAC,CAAC,GAECC,IAAYP,EAAY,OAAO,OAC3B,MAAMC,EAAU,QAAQC,CAAsB,CAAC,CAAC,yBAAyBI,CAAS,EAAA,CAAG,MAC5F,CAAC,CAAC,GAECE,IAAUR,GAAa,MACpBI,EAAK,MACX,CAAC,CAAC,GAECK,IAASC,QACNC,EAAmB,CAAC,CAAC,MAAM;EAChC,MAAMC,EAAW;EACjB,aAAaA,EAAW;EACxB,MAAMA,EAAW;CACnB,CAAC,GACA,CAAC,CAAC,GAECC,IAAuBH,QACpB;EACL;GACE,YAAYI,EAA2B;GACvC,OAAO,CAAC;GACR,MAAM;EACR;EACA;GACE,YAAYA,EAA2B;GACvC,OAAO,CAAC;GACR,WAAW;GACX,MAAM;GACN,MAAM;EACR;EACA;GACE,YAAYA,EAA2B;GACvC,OAAO,CAAC;GACR,MAAM;EACR;CACF,GACC,CAACC,CAAC,CAAC,GAEAC,IAAeN,QACZ,CACLf,EAAU,iBAA2C;EAAE,IAAI;EAAQ,MAAM,CAAC;CAAO,CAAC,GAClFA,EAAU,iBAA2C;EAAE,IAAI;EAAQ,MAAM,CAAC;CAAO,CAAC,CACpF,GACC,CAACoB,CAAC,CAAC;CAEN,OACE,kBAACnB,GAAD;EACE,uBAAuB,CAAC;EACb;EACX,iBAAiBqB,EAAoB;EACrC,oBAAoB;EACpB,sBAAsB;EACX;EACD;EACY;EACb;EACT,UAAU,CAAC;EACX,sBAAsBC,EAAiB;EAC/B;EACM;EACd,kBAAkBC,EAAW,iBAAiB,4BAA4B;EAC1E,OAAO,CAAC;EACG;CACZ,CAAA;AAEL"}
|
|
@@ -5,8 +5,8 @@ import { COMMON_QUERY_KEY as r } from "../../constants/query.constants.js";
|
|
|
5
5
|
import { useOrganizationOptionsQuery as i } from "../../dataHooks/useOrganizationsQuery/index.js";
|
|
6
6
|
import { useUserOptionsQuery as a } from "../../dataHooks/useUsersQuery/index.js";
|
|
7
7
|
import { useOrganizationAdminPolicyNameFactory as o } from "../../dataHooks/useOrganizationAdminPoliciesQuery/index.js";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
8
|
+
import { container as s } from "tsyringe";
|
|
9
|
+
import { CommonDbCommandName as c } from "@gen-epix/api-commondb";
|
|
10
10
|
import { useCallback as l, useMemo as u } from "react";
|
|
11
11
|
import { jsx as d } from "react/jsx-runtime";
|
|
12
12
|
import { useTranslation as f } from "react-i18next";
|
|
@@ -20,10 +20,10 @@ var y = () => {
|
|
|
20
20
|
b,
|
|
21
21
|
x,
|
|
22
22
|
S
|
|
23
|
-
]), w = l(async (e) => (await
|
|
23
|
+
]), w = l(async (e) => (await s.resolve(t).organizationAdminPoliciesGetAll(null, null, { signal: e }))?.data, []), T = l(async (e) => await s.resolve(t).organizationAdminPoliciesDeleteOne(e.id), []), E = l(async (e, n) => (await s.resolve(t).organizationAdminPoliciesPutOne(n.id, {
|
|
24
24
|
id: n.id,
|
|
25
25
|
...e
|
|
26
|
-
})).data, []), D = l(async (e) => (await
|
|
26
|
+
})).data, []), D = l(async (e) => (await s.resolve(t).organizationAdminPoliciesPostOne(e)).data, []), O = l((e) => S.getName(e) ?? e.id, [S]), k = u(() => m().shape({
|
|
27
27
|
is_active: p(),
|
|
28
28
|
organization_id: h().required().uuid4(),
|
|
29
29
|
user_id: h().required().uuid4()
|
|
@@ -76,7 +76,7 @@ var y = () => {
|
|
|
76
76
|
return /* @__PURE__ */ d(n, {
|
|
77
77
|
createItemDialogTitle: y`Create new organization admin policy`,
|
|
78
78
|
createOne: D,
|
|
79
|
-
crudCommandType:
|
|
79
|
+
crudCommandType: c.OrganizationAdminPolicyCrudCommand,
|
|
80
80
|
defaultSortByField: "organization_id",
|
|
81
81
|
defaultSortDirection: "asc",
|
|
82
82
|
deleteOne: T,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["
|
|
1
|
+
{"version":3,"file":"index.js","names":["TableUtil","CrudPage","OrganizationAdminPoliciesAdminPage","useTranslation","organizationOptionsQuery","useOrganizationOptionsQuery","userOptionsQuery","useUserOptionsQuery","organizationAdminPolicyNameFactory","useOrganizationAdminPolicyNameFactory","loadables","useArray","fetchAll","useCallback","container","API_ABAC_TOKEN","deleteOne","item","updateOne","variables","createOne","getName","schema","useMemo","object","boolean","string","formFieldDefinitions","FORM_FIELD_DEFINITION_TYPE","t","tableColumns","CommonDbCommandName","COMMON_QUERY_KEY","TestIdUtil"],"sources":["../../../src/pages/OrganizationAdminPoliciesAdminPage/OrganizationAdminPoliciesAdminPage.tsx"],"sourcesContent":["import { container } from 'tsyringe';\nimport {\n useCallback,\n useMemo,\n} from 'react';\nimport { useTranslation } from 'react-i18next';\nimport {\n boolean,\n object,\n string,\n} from 'yup';\nimport type { CommonDbOrganizationAdminPolicy } from '@gen-epix/api-commondb';\nimport { CommonDbCommandName } 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';\n\nimport { API_ABAC_TOKEN } from '../../constants/api.constants';\nimport { useOrganizationAdminPolicyNameFactory } from '../../dataHooks/useOrganizationAdminPoliciesQuery';\nimport { useOrganizationOptionsQuery } from '../../dataHooks/useOrganizationsQuery';\nimport { useUserOptionsQuery } from '../../dataHooks/useUsersQuery';\nimport type { TableColumn } from '../../models/table.models';\nimport { TableUtil } from '../../utils/TableUtil';\nimport type { OmitWithMetaData } from '../../models/data.models';\nimport { CrudPage } from '../CrudPage';\nimport { COMMON_QUERY_KEY } from '../../constants/query.constants';\n\ntype FormFields = OmitWithMetaData<CommonDbOrganizationAdminPolicy, 'organization' | 'user'>;\n\nexport const OrganizationAdminPoliciesAdminPage = () => {\n const { t } = useTranslation();\n const organizationOptionsQuery = useOrganizationOptionsQuery();\n const userOptionsQuery = useUserOptionsQuery();\n const organizationAdminPolicyNameFactory = useOrganizationAdminPolicyNameFactory();\n\n const loadables = useArray([organizationOptionsQuery, userOptionsQuery, organizationAdminPolicyNameFactory]);\n\n const fetchAll = useCallback(async (signal: AbortSignal) => {\n return (await container.resolve(API_ABAC_TOKEN).organizationAdminPoliciesGetAll(null, null, { signal }))?.data;\n }, []);\n\n const deleteOne = useCallback(async (item: CommonDbOrganizationAdminPolicy) => {\n return await container.resolve(API_ABAC_TOKEN).organizationAdminPoliciesDeleteOne(item.id);\n }, []);\n\n const updateOne = useCallback(async (variables: FormFields, item: CommonDbOrganizationAdminPolicy) => {\n return (await container.resolve(API_ABAC_TOKEN).organizationAdminPoliciesPutOne(item.id, { id: item.id, ...variables })).data;\n }, []);\n\n const createOne = useCallback(async (variables: FormFields) => {\n return (await container.resolve(API_ABAC_TOKEN).organizationAdminPoliciesPostOne(variables)).data;\n }, []);\n\n const getName = useCallback((item: CommonDbOrganizationAdminPolicy) => {\n return organizationAdminPolicyNameFactory.getName(item) ?? item.id;\n }, [organizationAdminPolicyNameFactory]);\n\n const schema = useMemo(() => {\n return object<FormFields>().shape({\n is_active: boolean(),\n organization_id: string().required().uuid4(),\n user_id: string().required().uuid4(),\n });\n }, []);\n\n const formFieldDefinitions = useMemo<FormFieldDefinition<FormFields>[]>(() => {\n return [\n {\n definition: FORM_FIELD_DEFINITION_TYPE.AUTOCOMPLETE,\n label: t`Organization`,\n loading: organizationOptionsQuery.isLoading,\n name: 'organization_id',\n options: organizationOptionsQuery.options,\n } as const satisfies FormFieldDefinition<FormFields>,\n {\n definition: FORM_FIELD_DEFINITION_TYPE.AUTOCOMPLETE,\n label: t`User`,\n loading: userOptionsQuery.isLoading,\n name: 'user_id',\n options: userOptionsQuery.options,\n } as const satisfies FormFieldDefinition<FormFields>,\n {\n definition: FORM_FIELD_DEFINITION_TYPE.BOOLEAN,\n label: t`Active`,\n name: 'is_active',\n } as const satisfies FormFieldDefinition<FormFields>,\n ] as const;\n }, [organizationOptionsQuery.isLoading, organizationOptionsQuery.options, t, userOptionsQuery.isLoading, userOptionsQuery.options]);\n\n const tableColumns = useMemo((): TableColumn<CommonDbOrganizationAdminPolicy>[] => {\n return [\n TableUtil.createOptionsColumn<CommonDbOrganizationAdminPolicy>({ id: 'organization_id', name: t`Organization`, options: organizationOptionsQuery.options }),\n TableUtil.createOptionsColumn<CommonDbOrganizationAdminPolicy>({ id: 'user_id', name: t`User`, options: userOptionsQuery.options }),\n TableUtil.createBooleanColumn<CommonDbOrganizationAdminPolicy>({ id: 'is_active', name: t`Is active` }),\n ];\n }, [organizationOptionsQuery.options, t, userOptionsQuery.options]);\n\n return (\n <CrudPage<FormFields, CommonDbOrganizationAdminPolicy>\n createItemDialogTitle={t`Create new organization admin policy`}\n createOne={createOne}\n crudCommandType={CommonDbCommandName.OrganizationAdminPolicyCrudCommand}\n defaultSortByField={'organization_id'}\n defaultSortDirection={'asc'}\n deleteOne={deleteOne}\n fetchAll={fetchAll}\n formFieldDefinitions={formFieldDefinitions}\n getName={getName}\n itemName={t`Organization admin policy`}\n loadables={loadables}\n resourceQueryKeyBase={COMMON_QUERY_KEY.ORGANIZATION_ADMIN_POLICIES}\n schema={schema}\n tableColumns={tableColumns}\n testIdAttributes={TestIdUtil.createAttributes('OrganizationAdminPoliciesAdminPage')}\n title={t`Organization admin policies`}\n updateOne={updateOne}\n />\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;AA8BA,IAAaE,UAA2C;CACtD,IAAM,EAAE,SAAMC,EAAe,GACvBC,IAA2BC,EAA4B,GACvDC,IAAmBC,EAAoB,GACvCC,IAAqCC,EAAsC,GAE3EC,IAAYC,EAAS;EAACP;EAA0BE;EAAkBE;CAAkC,CAAC,GAErGI,IAAWC,EAAY,OAAO,OAC1B,MAAMC,EAAU,QAAQC,CAAc,CAAC,CAAC,gCAAgC,MAAM,MAAM,EAAE,UAAO,CAAC,EAAA,EAAI,MACzG,CAAC,CAAC,GAECC,IAAYH,EAAY,OAAO,MAC5B,MAAMC,EAAU,QAAQC,CAAc,CAAC,CAAC,mCAAmCE,EAAK,EAAE,GACxF,CAAC,CAAC,GAECC,IAAYL,EAAY,OAAO,GAAuB,OAClD,MAAMC,EAAU,QAAQC,CAAc,CAAC,CAAC,gCAAgCE,EAAK,IAAI;EAAE,IAAIA,EAAK;EAAI,GAAGE;CAAU,CAAC,EAAA,CAAG,MACxH,CAAC,CAAC,GAECC,IAAYP,EAAY,OAAO,OAC3B,MAAMC,EAAU,QAAQC,CAAc,CAAC,CAAC,iCAAiCI,CAAS,EAAA,CAAG,MAC5F,CAAC,CAAC,GAECE,IAAUR,GAAa,MACpBL,EAAmC,QAAQS,CAAI,KAAKA,EAAK,IAC/D,CAACT,CAAkC,CAAC,GAEjCc,IAASC,QACNC,EAAmB,CAAC,CAAC,MAAM;EAChC,WAAWC,EAAQ;EACnB,iBAAiBC,EAAO,CAAC,CAAC,SAAS,CAAC,CAAC,MAAM;EAC3C,SAASA,EAAO,CAAC,CAAC,SAAS,CAAC,CAAC,MAAM;CACrC,CAAC,GACA,CAAC,CAAC,GAECC,IAAuBJ,QACpB;EACL;GACE,YAAYK,EAA2B;GACvC,OAAO,CAAC;GACR,SAASxB,EAAyB;GAClC,MAAM;GACN,SAASA,EAAyB;EACpC;EACA;GACE,YAAYwB,EAA2B;GACvC,OAAO,CAAC;GACR,SAAStB,EAAiB;GAC1B,MAAM;GACN,SAASA,EAAiB;EAC5B;EACA;GACE,YAAYsB,EAA2B;GACvC,OAAO,CAAC;GACR,MAAM;EACR;CACF,GACC;EAACxB,EAAyB;EAAWA,EAAyB;EAASyB;EAAGvB,EAAiB;EAAWA,EAAiB;CAAO,CAAC,GAE5HwB,IAAeP,QACZ;EACLvB,EAAU,oBAAqD;GAAE,IAAI;GAAmB,MAAM,CAAC;GAAgB,SAASI,EAAyB;EAAQ,CAAC;EAC1JJ,EAAU,oBAAqD;GAAE,IAAI;GAAW,MAAM,CAAC;GAAQ,SAASM,EAAiB;EAAQ,CAAC;EAClIN,EAAU,oBAAqD;GAAE,IAAI;GAAa,MAAM,CAAC;EAAY,CAAC;CACxG,GACC;EAACI,EAAyB;EAASyB;EAAGvB,EAAiB;CAAO,CAAC;CAElE,OACE,kBAACL,GAAD;EACE,uBAAuB,CAAC;EACb;EACX,iBAAiB8B,EAAoB;EACrC,oBAAoB;EACpB,sBAAsB;EACX;EACD;EACY;EACb;EACT,UAAU,CAAC;EACA;EACX,sBAAsBC,EAAiB;EAC/B;EACM;EACd,kBAAkBC,EAAW,iBAAiB,oCAAoC;EAClF,OAAO,CAAC;EACG;CACZ,CAAA;AAEL"}
|
|
@@ -2,8 +2,8 @@ import { t as e } from "../../_chunks/TableUtil.js";
|
|
|
2
2
|
import { API_ORGANIZATION_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 {
|
|
5
|
+
import { container as i } from "tsyringe";
|
|
6
|
+
import { CommonDbCommandName as a } from "@gen-epix/api-commondb";
|
|
7
7
|
import { useCallback as o, useMemo as s } from "react";
|
|
8
8
|
import { jsx as c } from "react/jsx-runtime";
|
|
9
9
|
import { useTranslation as l } from "react-i18next";
|
|
@@ -14,14 +14,14 @@ import { SchemaUtil as m } from "@gen-epix/ui-core-form/utils/SchemaUtil";
|
|
|
14
14
|
import { useParams as h } from "react-router-dom";
|
|
15
15
|
//#region src/pages/OrganizationContactsAdminPage/OrganizationContactsAdminPage.tsx
|
|
16
16
|
var g = () => {
|
|
17
|
-
let { siteId: g } = h(), { t: _ } = l(), v = o(async (e) => (await
|
|
17
|
+
let { siteId: g } = h(), { t: _ } = l(), v = o(async (e) => (await i.resolve(t).contactsGetAll(null, null, { signal: e })).data, []), y = o((e) => e.filter((e) => e.site_id === g), [g]), b = o(async (e, n) => (await i.resolve(t).contactsPutOne(n.id, {
|
|
18
18
|
id: n.id,
|
|
19
19
|
site_id: g,
|
|
20
20
|
...e
|
|
21
|
-
})).data, [g]), x = o(async (e) => (await
|
|
21
|
+
})).data, [g]), x = o(async (e) => (await i.resolve(t).contactsPostOne({
|
|
22
22
|
site_id: g,
|
|
23
23
|
...e
|
|
24
|
-
})).data, [g]), S = o(async (e) => await
|
|
24
|
+
})).data, [g]), S = o(async (e) => await i.resolve(t).contactsDeleteOne(e.id), []), C = o((e) => e.name, []), w = s(() => u().shape({
|
|
25
25
|
email: d().email().max(256),
|
|
26
26
|
name: m.name,
|
|
27
27
|
phone: d().extendedAlphaNumeric().max(100)
|
|
@@ -63,7 +63,7 @@ var g = () => {
|
|
|
63
63
|
return /* @__PURE__ */ c(n, {
|
|
64
64
|
createItemDialogTitle: _`Create new contact`,
|
|
65
65
|
createOne: x,
|
|
66
|
-
crudCommandType:
|
|
66
|
+
crudCommandType: a.ContactCrudCommand,
|
|
67
67
|
defaultSortByField: "name",
|
|
68
68
|
defaultSortDirection: "asc",
|
|
69
69
|
deleteOne: S,
|