@gen-epix/ui-client-common 4.6.1 → 4.7.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 +2 -2
- package/dist/_chunks/Breadcrumbs.js +4 -4
- package/dist/_chunks/CrudPage.js +166 -166
- package/dist/_chunks/CrudPage.js.map +1 -1
- package/dist/_chunks/Notifications.js +16 -16
- package/dist/_chunks/QueryClientProvider.js +1 -1
- package/dist/_chunks/QueryClientProvider.js.map +1 -1
- package/dist/_chunks/QueryClientService.js +73 -72
- package/dist/_chunks/QueryClientService.js.map +1 -1
- package/dist/_chunks/Table.js +853 -744
- package/dist/_chunks/Table.js.map +1 -1
- package/dist/_chunks/TableUtil.js +38 -38
- package/dist/_chunks/TableUtil.js.map +1 -1
- package/dist/_chunks/UserInvitationsAdminPage.js +131 -131
- package/dist/_chunks/UserInvitationsAdminPage.js.map +1 -1
- package/dist/_chunks/_baseFlatten.js +12 -12
- package/dist/_chunks/_baseFlatten.js.map +1 -1
- package/dist/_chunks/_baseIteratee.js +78 -78
- package/dist/_chunks/_baseIteratee.js.map +1 -1
- package/dist/_chunks/decorate.js +1 -1
- package/dist/_chunks/decorateParam.js +1 -1
- package/dist/_chunks/middleware.js +66 -70
- package/dist/_chunks/middleware.js.map +1 -1
- package/dist/_chunks/omit.js +98 -98
- package/dist/_chunks/omit.js.map +1 -1
- package/dist/_chunks/query.js +108 -92
- package/dist/_chunks/query.js.map +1 -1
- package/dist/_chunks/react.js +1 -1
- package/dist/_chunks/react.js.map +1 -1
- package/dist/_chunks/tableStore.js +61 -58
- package/dist/_chunks/tableStore.js.map +1 -1
- package/dist/_chunks/useColumnsMenu.js +73 -71
- package/dist/_chunks/useColumnsMenu.js.map +1 -1
- package/dist/_chunks/useMutation.js +2 -2
- package/dist/_chunks/useMutation.js.map +1 -1
- package/dist/_chunks/useQueryMemo.js +15 -16
- package/dist/_chunks/useQueryMemo.js.map +1 -1
- package/dist/_chunks/vanilla.js +1 -1
- package/dist/_chunks/vanilla.js.map +1 -1
- package/dist/_chunks/yup.js +2 -2
- package/dist/_chunks/yup.js.map +1 -1
- package/dist/classes/services/AuthenticationService/index.js +8 -8
- 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/BreadcrumbService/index.js +4 -4
- package/dist/classes/services/BreadcrumbService/index.js.map +1 -1
- package/dist/classes/services/EmotionCacheService/index.js.map +1 -1
- package/dist/classes/services/InactivityService/index.js +30 -30
- package/dist/classes/services/InactivityService/index.js.map +1 -1
- package/dist/classes/services/LogService/index.js +15 -15
- package/dist/classes/services/LogService/index.js.map +1 -1
- package/dist/classes/services/PageEventBusService/index.js.map +1 -1
- package/dist/components/app/App/index.js +26 -24
- package/dist/components/app/App/index.js.map +1 -1
- package/dist/components/app/ApplicationBootstrapWithAuthentication/index.js +18 -18
- package/dist/components/app/ApplicationBootstrapWithAuthentication/index.js.map +1 -1
- package/dist/components/app/ApplicationBootstrapWithoutAuthorization/index.js +18 -18
- package/dist/components/app/ApplicationBootstrapWithoutAuthorization/index.js.map +1 -1
- package/dist/components/app/AuthenticationWrapper/index.js +15 -15
- package/dist/components/app/AuthorizationWrapper/index.js +16 -16
- package/dist/components/app/AuthorizationWrapper/index.js.map +1 -1
- package/dist/components/app/RouterRoot/index.js +33 -33
- package/dist/components/app/RouterRoot/index.js.map +1 -1
- package/dist/components/epi/EpiContactDetailsDialog/index.js +4 -4
- package/dist/components/epi/EpiContactDetailsDialog/index.js.map +1 -1
- package/dist/components/ui/ApplicationBar/index.js +234 -234
- package/dist/components/ui/ApplicationBar/index.js.map +1 -1
- package/dist/components/ui/GenericErrorMessage/index.js +13 -13
- package/dist/components/ui/LicensesDialog/index.js +6 -6
- package/dist/components/ui/OrganizationSwitcherDialog/index.js +11 -11
- package/dist/components/ui/OutagesDialog/index.js +4 -4
- package/dist/components/ui/OutagesDialog/index.js.map +1 -1
- package/dist/components/ui/PageContainer/index.js +5 -5
- package/dist/components/ui/PageContainer/index.js.map +1 -1
- package/dist/components/ui/ResponseHandler/index.js +4 -4
- package/dist/components/ui/SortableList/SortableList.d.ts +5 -3
- package/dist/components/ui/Table/Table.d.ts +5 -2
- package/dist/components/ui/Table/TableColumnsEditorDialog.d.ts +13 -2
- package/dist/components/ui/Table/index.d.ts +1 -0
- package/dist/components/ui/Table/index.js +1 -1
- package/dist/components/ui/UserFeedbackDialog/index.js +15 -15
- package/dist/dataHooks/useIdentifierIssuerOwnOrganizationQuery/index.js +12 -12
- package/dist/dataHooks/useIdentifierIssuerQuery/index.js +11 -11
- package/dist/dataHooks/useInviteUserConstraintsQuery/index.js +5 -5
- package/dist/dataHooks/useInviteUserConstraintsQuery/index.js.map +1 -1
- package/dist/dataHooks/useOrganizationAdminPoliciesQuery/index.js +15 -15
- package/dist/dataHooks/useOrganizationsQuery/index.js +7 -7
- package/dist/dataHooks/useUsersQuery/index.js +10 -10
- package/dist/hooks/useCreateMutation/index.js +14 -14
- package/dist/hooks/useCreateMutation/index.js.map +1 -1
- package/dist/hooks/useDeleteMutation/index.js +17 -17
- package/dist/hooks/useDeleteMutation/index.js.map +1 -1
- package/dist/hooks/useEditMutation/index.js +22 -22
- package/dist/hooks/useEditMutation/index.js.map +1 -1
- package/dist/hooks/useInitializeTableStore/index.js +6 -6
- package/dist/hooks/useInitializeTableStore/index.js.map +1 -1
- package/dist/locale/en.json +13 -5
- package/dist/locale/nl.json +13 -5
- package/dist/pages/AcceptInvitationPage/index.js +10 -10
- package/dist/pages/AdminPage/index.js +19 -19
- package/dist/pages/ChooseIdentityProviderPage/index.js +5 -5
- package/dist/pages/ErrorPage/index.js +4 -4
- package/dist/pages/IdentifierIssuersAdminPage/index.js +7 -7
- package/dist/pages/IdentifierIssuersAdminPage/index.js.map +1 -1
- package/dist/pages/OrganizationAdminPoliciesAdminPage/index.js +16 -16
- package/dist/pages/OrganizationContactsAdminPage/index.js +10 -10
- package/dist/pages/OrganizationContactsAdminPage/index.js.map +1 -1
- package/dist/pages/OrganizationSitesAdminPage/index.js +12 -12
- package/dist/pages/OrganizationSitesAdminPage/index.js.map +1 -1
- package/dist/pages/OrganizationsAdminPage/index.js +20 -20
- package/dist/pages/OrganizationsAdminPage/index.js.map +1 -1
- package/dist/pages/OutagesAdminPage/index.js +11 -11
- package/dist/pages/OutagesAdminPage/index.js.map +1 -1
- package/dist/pages/RouterErrorPage/index.js +4 -4
- package/dist/pages/UsersAdminPage/index.js +34 -34
- package/dist/pages/UsersAdminPage/index.js.map +1 -1
- package/dist/setup/setup.js +4 -4
- package/dist/setup/setup.js.map +1 -1
- package/dist/stores/oidcStore/oidcStore.d.ts +1 -1
- package/dist/utils/StandardConfigUtil/index.js +2 -2
- package/dist/utils/StandardConfigUtil/index.js.map +1 -1
- package/package.json +33 -33
|
@@ -1,56 +1,56 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t } from "../../
|
|
3
|
-
import { t as n } from "../../_chunks/
|
|
4
|
-
import {
|
|
1
|
+
import { t as e } from "../../_chunks/useMutation.js";
|
|
2
|
+
import { NotificationService as t } from "../../classes/services/NotificationService/index.js";
|
|
3
|
+
import { t as n } from "../../_chunks/QueryClientService.js";
|
|
4
|
+
import { NotificationUtil as r } from "../../utils/NotificationUtil/index.js";
|
|
5
5
|
import { container as i } from "tsyringe";
|
|
6
6
|
import { useCallback as a, useMemo as o } from "react";
|
|
7
7
|
import { ObjectUtil as s } from "@gen-epix/ui-core/utils/ObjectUtil";
|
|
8
8
|
// src/hooks/useEditMutation/useEditMutation.ts
|
|
9
9
|
var c = (e) => !Array.isArray(e), l = ({ associationQueryKeys: l, getErrorNotificationMessage: u, getIntermediateItem: d, getProgressNotificationMessage: f, getSuccessNotificationMessage: p, onError: m, onSuccess: h, queryFn: g, resourceQueryKey: _ }) => {
|
|
10
|
-
let v = i.resolve(
|
|
10
|
+
let v = i.resolve(n).queryClient, y = a(async ({ previousItem: e, variables: t }) => {
|
|
11
11
|
if (!g) throw Error("Edit mutation queryFn is required");
|
|
12
12
|
return g(s.deepNullifyEmptyStrings(t), e);
|
|
13
|
-
}, [g]), b =
|
|
13
|
+
}, [g]), b = e({
|
|
14
14
|
mutationFn: y,
|
|
15
|
-
onError: async (
|
|
15
|
+
onError: async (e, a, o) => {
|
|
16
16
|
let s = o ?? {};
|
|
17
|
-
_ && Array.isArray(s.previousData) && v.setQueryData(_, s.previousData), await i.resolve(
|
|
18
|
-
let c = s.item ? u(s.item, a.variables,
|
|
19
|
-
s.notificationKey && i.resolve(
|
|
17
|
+
_ && Array.isArray(s.previousData) && v.setQueryData(_, s.previousData), await i.resolve(n).invalidateQueryKeys(l), m && await m(e, a.variables, s);
|
|
18
|
+
let c = s.item ? u(s.item, a.variables, e) : String(e);
|
|
19
|
+
s.notificationKey && i.resolve(t).fulfillNotification(s.notificationKey, r.wrapErrorNotificationMessage(c, e), "error");
|
|
20
20
|
},
|
|
21
|
-
onMutate: async ({ previousItem: e, variables:
|
|
21
|
+
onMutate: async ({ previousItem: e, variables: n }) => {
|
|
22
22
|
if (!e) throw Error("previousItem is not set");
|
|
23
|
-
let
|
|
23
|
+
let r = i.resolve(t).showNotification({
|
|
24
24
|
isLoading: !0,
|
|
25
|
-
message: f(e,
|
|
25
|
+
message: f(e, n),
|
|
26
26
|
severity: "info"
|
|
27
27
|
});
|
|
28
28
|
if (_) {
|
|
29
29
|
await v.cancelQueries({ queryKey: _ });
|
|
30
|
-
let
|
|
31
|
-
if (Array.isArray(
|
|
32
|
-
let i = d ? d(
|
|
33
|
-
...
|
|
30
|
+
let t = v.getQueryData(_);
|
|
31
|
+
if (Array.isArray(t) && !Array.isArray(n)) {
|
|
32
|
+
let i = d ? d(n, e) : {
|
|
33
|
+
...n,
|
|
34
34
|
id: e.id
|
|
35
35
|
};
|
|
36
36
|
return v.setQueryData(_, (t) => t.map((t) => t.id === e.id ? i : t)), {
|
|
37
37
|
item: e,
|
|
38
|
-
notificationKey:
|
|
39
|
-
previousData:
|
|
38
|
+
notificationKey: r,
|
|
39
|
+
previousData: t
|
|
40
40
|
};
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
return {
|
|
44
44
|
item: e,
|
|
45
|
-
notificationKey:
|
|
45
|
+
notificationKey: r
|
|
46
46
|
};
|
|
47
47
|
},
|
|
48
|
-
onSuccess: async (e,
|
|
48
|
+
onSuccess: async (e, r, a) => {
|
|
49
49
|
if (_ && Array.isArray(a?.previousData) && c(e)) {
|
|
50
50
|
let t = a.item?.id;
|
|
51
51
|
v.setQueryData(_, (n) => Array.isArray(n) ? n.map((n) => n.id === t ? e : n) : n);
|
|
52
52
|
}
|
|
53
|
-
await i.resolve(
|
|
53
|
+
await i.resolve(n).invalidateQueryKeys(l), h && await h(e, r.variables, a), i.resolve(t).fulfillNotification(a.notificationKey, p(e, a), "success");
|
|
54
54
|
}
|
|
55
55
|
}), x = b.mutate, S = o(() => (e, t) => {
|
|
56
56
|
x({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["useMutation","isSingleGenericData","item","useEditMutation","queryClient","container","
|
|
1
|
+
{"version":3,"file":"index.js","names":["useMutation","QueryClientService","isSingleGenericData","item","useEditMutation","queryClient","container","mutationFn","useCallback","queryFn","ObjectUtil","variables","previousItem","editMutation","safeContext","context","resourceQueryKey","associationQueryKeys","onError","error","mutationVariables","errorMessage","getErrorNotificationMessage","NotificationService","NotificationUtil","notificationKey","getProgressNotificationMessage","previousData","intermediateItem","getIntermediateItem","oldItems","x","previousItemId","oldItem","onSuccess","getSuccessNotificationMessage","editMutate","mutate","useMemo","isMutating"],"sources":["../../../src/hooks/useEditMutation/useEditMutation.ts"],"sourcesContent":["import { container } from 'tsyringe';\nimport { useMutation } from '@tanstack/react-query';\nimport type { ReactElement } from 'react';\nimport {\n useCallback,\n useMemo,\n} from 'react';\nimport { ObjectUtil } from '@gen-epix/ui-core/utils/ObjectUtil';\n\nimport { NotificationService } from '../../classes/services/NotificationService';\nimport { QueryClientService } from '../../classes/services/QueryClientService';\nimport type { GenericData } from '../../models/data.models';\nimport { NotificationUtil } from '../../utils/NotificationUtil';\n\nexport type MutationContextEdit<TData> = { item?: TData; notificationKey?: string; previousData?: TData[] };\n\nexport type UseEditMutationProps<TData, TVariables = TData> = {\n readonly associationQueryKeys?: string[][];\n readonly getErrorNotificationMessage: (data: TData, variables: TVariables, error: unknown) => ReactElement | string;\n // Optional function to get an intermediate item to be set in the query cache before the mutation is completed.\n // This is useful for optimistic updates where you want to show a temporary state before the mutation is confirmed.\n // The function receives the variables and the previous item, and should return the intermediate item.\n // Only needed if the variables are different from the previous item.\n readonly getIntermediateItem?: (variables: TVariables, previousItem: TData) => TData;\n readonly getProgressNotificationMessage: (data: TData, variables: TVariables) => ReactElement | string;\n readonly getSuccessNotificationMessage: (data: TData, context: MutationContextEdit<TData>) => ReactElement | string;\n readonly onError?: (error: unknown, variables: TVariables, context: MutationContextEdit<TData>) => Promise<void> | void;\n readonly onSuccess?: (item: TData, variables: TVariables, context: MutationContextEdit<TData>) => Promise<void> | void;\n readonly queryFn?: (variables: TVariables, previousData: TData) => Promise<TData>;\n readonly resourceQueryKey?: string[];\n};\n\ntype EditMutationVariables<TData, TVariables> = {\n readonly previousItem: TData;\n readonly variables: TVariables;\n};\n\nconst isSingleGenericData = (item: GenericData | GenericData[]): item is GenericData => !Array.isArray(item);\n\nexport const useEditMutation = <TData extends GenericData | GenericData[], TVariables = TData>({\n associationQueryKeys,\n getErrorNotificationMessage,\n getIntermediateItem,\n getProgressNotificationMessage,\n getSuccessNotificationMessage,\n onError,\n onSuccess,\n queryFn,\n resourceQueryKey,\n}: UseEditMutationProps<TData, TVariables>) => {\n const queryClient = container.resolve(QueryClientService).queryClient;\n\n const mutationFn = useCallback(async ({ previousItem, variables }: EditMutationVariables<TData, TVariables>) => {\n if (!queryFn) {\n throw new Error('Edit mutation queryFn is required');\n }\n return queryFn(ObjectUtil.deepNullifyEmptyStrings(variables), previousItem);\n }, [queryFn]);\n\n const editMutation = useMutation<TData, Error, EditMutationVariables<TData, TVariables>, MutationContextEdit<TData>>({\n mutationFn,\n onError: async (error, mutationVariables, context) => {\n const safeContext: MutationContextEdit<TData> = context ?? {};\n if (resourceQueryKey && Array.isArray(safeContext.previousData)) {\n queryClient.setQueryData<TData[]>(resourceQueryKey, safeContext.previousData);\n }\n await container.resolve(QueryClientService).invalidateQueryKeys(associationQueryKeys);\n if (onError) {\n await onError(error, mutationVariables.variables, safeContext);\n }\n const errorMessage = safeContext.item\n ? getErrorNotificationMessage(safeContext.item, mutationVariables.variables, error)\n : String(error);\n if (safeContext.notificationKey) {\n container.resolve(NotificationService).fulfillNotification(safeContext.notificationKey, NotificationUtil.wrapErrorNotificationMessage(errorMessage, error), 'error');\n }\n },\n onMutate: async ({ previousItem, variables }) => {\n if (!previousItem) {\n throw new Error('previousItem is not set');\n }\n const notificationKey = container.resolve(NotificationService).showNotification({\n isLoading: true,\n message: getProgressNotificationMessage(previousItem, variables),\n severity: 'info',\n });\n if (resourceQueryKey) {\n await queryClient.cancelQueries({ queryKey: resourceQueryKey });\n const previousData = queryClient.getQueryData<TData[]>(resourceQueryKey);\n\n if (Array.isArray(previousData) && !Array.isArray(variables)) {\n const intermediateItem = getIntermediateItem ? getIntermediateItem(variables, previousItem) : {\n ...variables,\n id: (previousItem as GenericData).id,\n } as GenericData;\n queryClient.setQueryData<GenericData[]>(resourceQueryKey, (oldItems) => {\n return oldItems.map(x => x.id === (previousItem as GenericData).id ? intermediateItem : x) as GenericData[];\n });\n return { item: previousItem, notificationKey, previousData };\n }\n }\n return { item: previousItem, notificationKey };\n },\n onSuccess: async (item, mutationVariables, context) => {\n if (resourceQueryKey && Array.isArray(context?.previousData) && isSingleGenericData(item)) {\n const previousItemId = (context.item as GenericData)?.id;\n queryClient.setQueryData<GenericData[]>(resourceQueryKey, (oldItems) => {\n if (!Array.isArray(oldItems)) {\n return oldItems;\n }\n return oldItems.map(oldItem => oldItem.id === previousItemId ? item : oldItem);\n });\n }\n await container.resolve(QueryClientService).invalidateQueryKeys(associationQueryKeys);\n if (onSuccess) {\n await onSuccess(item, mutationVariables.variables, context);\n }\n container.resolve(NotificationService).fulfillNotification(context.notificationKey, getSuccessNotificationMessage(item, context), 'success');\n },\n });\n\n // Note: must be done in useMemo to avoid render loops (useMutation returns a new object every time)\n const editMutate = editMutation.mutate;\n const mutate = useMemo(() => (variables: TVariables, previousItem: TData) => {\n editMutate({ previousItem, variables });\n }, [editMutate]);\n const isMutating = useMemo(() => editMutation.isPending, [editMutation.isPending]);\n return useMemo(() => ({ isMutating, mutate }), [isMutating, mutate]);\n};\n"],"mappings":";;;;;;;;AAqCA,IAAME,KAAuB,MAA2D,CAAC,MAAM,QAAQC,CAAI,GAE9FC,KAAkF,EAC7F,yBACA,gCACA,wBACA,mCACA,kCACA,YACA,cACA,YACA,0BAC6C;CAC7C,IAAMC,IAAcC,EAAU,QAAQL,CAAkB,CAAC,CAAC,aAEpDM,IAAaC,EAAY,OAAO,EAAE,iBAAc,mBAA0D;EAC9G,IAAI,CAACC,GACH,MAAU,MAAM,mCAAmC;EAErD,OAAOA,EAAQC,EAAW,wBAAwBC,CAAS,GAAGC,CAAY;CAC5E,GAAG,CAACH,CAAO,CAAC,GAENI,IAAeb,EAAgG;EACnH;EACA,SAAS,OAAO,GAAO,GAAmB,MAAY;GACpD,IAAMc,IAA0CC,KAAW,CAAC;GAK5D,AAJIC,KAAoB,MAAM,QAAQF,EAAY,YAAY,KAC5DT,EAAY,aAAsBW,GAAkBF,EAAY,YAAY,GAE9E,MAAMR,EAAU,QAAQL,CAAkB,CAAC,CAAC,oBAAoBgB,CAAoB,GAChFC,KACF,MAAMA,EAAQC,GAAOC,EAAkB,WAAWN,CAAW;GAE/D,IAAMO,IAAeP,EAAY,OAC7BQ,EAA4BR,EAAY,MAAMM,EAAkB,WAAWD,CAAK,IAChF,OAAOA,CAAK;GAChB,AAAIL,EAAY,mBACdR,EAAU,QAAQiB,CAAmB,CAAC,CAAC,oBAAoBT,EAAY,iBAAiBU,EAAiB,6BAA6BH,GAAcF,CAAK,GAAG,OAAO;EAEvK;EACA,UAAU,OAAO,EAAE,iBAAc,mBAAgB;GAC/C,IAAI,CAACP,GACH,MAAU,MAAM,yBAAyB;GAE3C,IAAMa,IAAkBnB,EAAU,QAAQiB,CAAmB,CAAC,CAAC,iBAAiB;IAC9E,WAAW;IACX,SAASG,EAA+Bd,GAAcD,CAAS;IAC/D,UAAU;GACZ,CAAC;GACD,IAAIK,GAAkB;IACpB,MAAMX,EAAY,cAAc,EAAE,UAAUW,EAAiB,CAAC;IAC9D,IAAMW,IAAetB,EAAY,aAAsBW,CAAgB;IAEvE,IAAI,MAAM,QAAQW,CAAY,KAAK,CAAC,MAAM,QAAQhB,CAAS,GAAG;KAC5D,IAAMiB,IAAmBC,IAAsBA,EAAoBlB,GAAWC,CAAY,IAAI;MAC5F,GAAGD;MACH,IAAKC,EAA6B;KACpC;KAIA,OAHAP,EAAY,aAA4BW,IAAmB,MAClDc,EAAS,KAAI,MAAKC,EAAE,OAAQnB,EAA6B,KAAKgB,IAAmBG,CAAC,CAC1F,GACM;MAAE,MAAMnB;MAAc;MAAiB;KAAa;IAC7D;GACF;GACA,OAAO;IAAE,MAAMA;IAAc;GAAgB;EAC/C;EACA,WAAW,OAAO,GAAM,GAAmB,MAAY;GACrD,IAAII,KAAoB,MAAM,QAAQD,GAAS,YAAY,KAAKb,EAAoBC,CAAI,GAAG;IACzF,IAAM6B,IAAkBjB,EAAQ,MAAsB;IACtD,EAAY,aAA4BC,IAAmB,MACpD,MAAM,QAAQc,CAAQ,IAGpBA,EAAS,KAAI,MAAWG,EAAQ,OAAOD,IAAiB7B,IAAO8B,CAAO,IAFpEH,CAGV;GACH;GAKA,AAJA,MAAMxB,EAAU,QAAQL,CAAkB,CAAC,CAAC,oBAAoBgB,CAAoB,GAChFiB,KACF,MAAMA,EAAU/B,GAAMiB,EAAkB,WAAWL,CAAO,GAE5DT,EAAU,QAAQiB,CAAmB,CAAC,CAAC,oBAAoBR,EAAQ,iBAAiBoB,EAA8BhC,GAAMY,CAAO,GAAG,SAAS;EAC7I;CACF,CAAC,GAGKqB,IAAavB,EAAa,QAC1BwB,IAASC,SAAe,GAAuB,MAAwB;EAC3E,EAAW;GAAE;GAAc;EAAU,CAAC;CACxC,GAAG,CAACF,CAAU,CAAC,GACTG,IAAaD,QAAczB,EAAa,WAAW,CAACA,EAAa,SAAS,CAAC;CACjF,OAAOyB,SAAe;EAAE;EAAY;CAAO,IAAI,CAACC,GAAYF,CAAM,CAAC;AACrE"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { t as e } from "../../_chunks/
|
|
1
|
+
import { t as e } from "../../_chunks/react.js";
|
|
2
2
|
import { DEFAULT_FILTER_GROUP as t } from "../../classes/abstracts/FilterAbstract/index.js";
|
|
3
|
-
import { t as n } from "../../_chunks/
|
|
3
|
+
import { t as n } from "../../_chunks/TableUtil.js";
|
|
4
4
|
import { useEffect as r } from "react";
|
|
5
5
|
// src/hooks/useInitializeTableStore/useInitializeTableStore.ts
|
|
6
6
|
var i = ({ columns: i, context: a, createFiltersFromColumns: o, rows: s, store: c }) => {
|
|
7
|
-
let l =
|
|
7
|
+
let l = e(c, (e) => e.setColumns), u = e(c, (e) => e.setBaseData), d = e(c, (e) => e.setFilters), f = e(c, (e) => e.initialize);
|
|
8
8
|
r(() => {
|
|
9
9
|
if (!i || !s) return;
|
|
10
|
-
let
|
|
11
|
-
return l(i), u(s), o && d(
|
|
12
|
-
|
|
10
|
+
let e = new AbortController();
|
|
11
|
+
return l(i), u(s), o && d(n.createFiltersFromColumns(i, s, a), [], [t]), f(e.signal), () => {
|
|
12
|
+
e.abort();
|
|
13
13
|
};
|
|
14
14
|
}, [
|
|
15
15
|
i,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["
|
|
1
|
+
{"version":3,"file":"index.js","names":["useStore","TableUtil","useInitializeTableStore","setColumns","store","state","setBaseData","setFilters","initialize","columns","rows","abortController","createFiltersFromColumns","context","DEFAULT_FILTER_GROUP"],"sources":["../../../src/hooks/useInitializeTableStore/useInitializeTableStore.ts"],"sourcesContent":["import { useStore } from 'zustand';\nimport type { StoreApi } from 'zustand';\nimport { useEffect } from 'react';\n\nimport { DEFAULT_FILTER_GROUP } from '../../classes/abstracts/FilterAbstract';\nimport type { TableColumn } from '../../models/table.models';\nimport type { TableStore } from '../../stores/tableStore';\nimport { TableUtil } from '../../utils/TableUtil';\n\nexport type UseInitializeTableStoreKWArgs<TData, TDataContext = null> = {\n readonly columns: TableColumn<TData, TDataContext>[];\n readonly context?: TDataContext;\n readonly createFiltersFromColumns?: boolean;\n readonly rows: TData[];\n readonly store: StoreApi<TableStore<TData, TDataContext>>;\n};\n\n\nexport const useInitializeTableStore = <TData, TDataContext = null>({ columns, context, createFiltersFromColumns, rows, store }: UseInitializeTableStoreKWArgs<TData, TDataContext>) => {\n const setColumns = useStore(store, (state) => state.setColumns);\n const setBaseData = useStore(store, (state) => state.setBaseData);\n const setFilters = useStore(store, (state) => state.setFilters);\n const initialize = useStore(store, (state) => state.initialize);\n\n useEffect(() => {\n if (!columns || !rows) {\n return;\n }\n const abortController = new AbortController();\n setColumns(columns);\n setBaseData(rows);\n if (createFiltersFromColumns) {\n setFilters(TableUtil.createFiltersFromColumns(columns, rows, context), [], [DEFAULT_FILTER_GROUP]);\n }\n\n void initialize(abortController.signal);\n return () => {\n abortController.abort();\n };\n }, [columns, initialize, setColumns, setFilters, setBaseData, createFiltersFromColumns, rows, context]);\n};\n"],"mappings":";;;;;AAkBA,IAAaE,KAAuD,EAAE,YAAS,YAAS,6BAA0B,SAAM,eAAgE;CACtL,IAAMC,IAAaH,EAASI,IAAQ,MAAUC,EAAM,UAAU,GACxDC,IAAcN,EAASI,IAAQ,MAAUC,EAAM,WAAW,GAC1DE,IAAaP,EAASI,IAAQ,MAAUC,EAAM,UAAU,GACxDG,IAAaR,EAASI,IAAQ,MAAUC,EAAM,UAAU;CAE9D,QAAgB;EACd,IAAI,CAACI,KAAW,CAACC,GACf;EAEF,IAAMC,IAAkB,IAAI,gBAAgB;EAQ5C,OAPAR,EAAWM,CAAO,GAClBH,EAAYI,CAAI,GACZE,KACFL,EAAWN,EAAU,yBAAyBQ,GAASC,GAAMG,CAAO,GAAG,CAAC,GAAG,CAACC,CAAoB,CAAC,GAGnGN,EAAgBG,EAAgB,MAAM,SACzB;GACX,EAAgB,MAAM;EACxB;CACF,GAAG;EAACF;EAASD;EAAYL;EAAYI;EAAYD;EAAaM;EAA0BF;EAAMG;CAAO,CAAC;AACxG"}
|
package/dist/locale/en.json
CHANGED
|
@@ -21,6 +21,9 @@
|
|
|
21
21
|
"{{itemName}} is being saved...": "{{itemName}} is being saved...",
|
|
22
22
|
"{{items}} ({{count}} of {{totalCount}})": "{{items}} ({{count}} of {{totalCount}})",
|
|
23
23
|
"{{items}} ({{count}})": "{{items}} ({{count}})",
|
|
24
|
+
"{{label}} dropped at position {{position}} of {{count}}.": "{{label}} dropped at position {{position}} of {{count}}.",
|
|
25
|
+
"{{label}} moved to position {{position}} of {{count}}.": "{{label}} moved to position {{position}} of {{count}}.",
|
|
26
|
+
"{{label}} returned to position {{position}} of {{count}}.": "{{label}} returned to position {{position}} of {{count}}.",
|
|
24
27
|
"{{message}} - Bad request. The input data was not correct.": "{{message}} - Bad request. The input data was not correct.",
|
|
25
28
|
"{{message}} - Conflict. The request could not be completed due to a conflict with the current state of the resource.": "{{message}} - Conflict. The request could not be completed due to a conflict with the current state of the resource.",
|
|
26
29
|
"{{message}} - Internal Server Error. Please try again later.": "{{message}} - Internal Server Error. Please try again later.",
|
|
@@ -58,7 +61,6 @@
|
|
|
58
61
|
"Change": "Change",
|
|
59
62
|
"Change column order and visibility": "Change column order and visibility",
|
|
60
63
|
"Change language": "Change language",
|
|
61
|
-
"Change order / visibility": "Change order / visibility",
|
|
62
64
|
"Change organization": "Change organization",
|
|
63
65
|
"Changing language": "Changing language",
|
|
64
66
|
"Changing language will reload the application. Do you want to continue?": "Changing language will reload the application. Do you want to continue?",
|
|
@@ -77,6 +79,8 @@
|
|
|
77
79
|
"Close notifications drawer": "Close notifications drawer",
|
|
78
80
|
"Code": "Code",
|
|
79
81
|
"Code information": "Code information",
|
|
82
|
+
"Column": "Column",
|
|
83
|
+
"Column editor": "Column editor",
|
|
80
84
|
"Columns": "Columns",
|
|
81
85
|
"Complete registration": "Complete registration",
|
|
82
86
|
"Condensed": "Condensed",
|
|
@@ -102,16 +106,12 @@
|
|
|
102
106
|
"Delete item: {{itemName}}": "Delete item: {{itemName}}",
|
|
103
107
|
"Description": "Description",
|
|
104
108
|
"Details for our technicians": "Details for our technicians",
|
|
105
|
-
"Disable all": "Disable all",
|
|
106
|
-
"Disable all without data": "Disable all without data",
|
|
107
109
|
"Drag handle for {{label}}": "Drag handle for {{label}}",
|
|
108
110
|
"E-Mail": "E-Mail",
|
|
109
111
|
"Edit": "Edit",
|
|
110
112
|
"Email": "Email",
|
|
111
113
|
"Email address: unknown": "Email address: unknown",
|
|
112
114
|
"Email invitation link": "Email invitation link",
|
|
113
|
-
"Enable all": "Enable all",
|
|
114
|
-
"Enable all with data": "Enable all with data",
|
|
115
115
|
"Error": "Error",
|
|
116
116
|
"Error anonymizing user: {{userName}}": "Error anonymizing user: {{userName}}",
|
|
117
117
|
"Error loading organization admins": "Error loading organization admins",
|
|
@@ -128,6 +128,7 @@
|
|
|
128
128
|
"Go back to homepage": "Go back to homepage",
|
|
129
129
|
"Helpers": "Helpers",
|
|
130
130
|
"Hide all": "Hide all",
|
|
131
|
+
"Hide all without data": "Hide all without data",
|
|
131
132
|
"Hide columns without data": "Hide columns without data",
|
|
132
133
|
"Home": "Home",
|
|
133
134
|
"Id": "Id",
|
|
@@ -200,6 +201,7 @@
|
|
|
200
201
|
"Permission": "Permission",
|
|
201
202
|
"Phone": "Phone",
|
|
202
203
|
"Phone number: unknown": "Phone number: unknown",
|
|
204
|
+
"Picked up {{label}}. Position {{position}} of {{count}}.": "Picked up {{label}}. Position {{position}} of {{count}}.",
|
|
203
205
|
"Planned outage": "Planned outage",
|
|
204
206
|
"Please help make {{applicationName}} better by sharing your feedback with us. You may use this form as many times as you like.": "Please help make {{applicationName}} better by sharing your feedback with us. You may use this form as many times as you like.",
|
|
205
207
|
"Please login with one of the following identity providers:": "Please login with one of the following identity providers:",
|
|
@@ -212,6 +214,8 @@
|
|
|
212
214
|
"Refresh page": "Refresh page",
|
|
213
215
|
"Remove filter": "Remove filter",
|
|
214
216
|
"Remove filter with label {{filterLabel}} and value {{filterValue}}": "Remove filter with label {{filterLabel}} and value {{filterValue}}",
|
|
217
|
+
"Reorder": "Reorder",
|
|
218
|
+
"Reordering {{label}} cancelled. {{label}} returned to position {{position}} of {{count}}.": "Reordering {{label}} cancelled. {{label}} returned to position {{position}} of {{count}}.",
|
|
215
219
|
"Reset": "Reset",
|
|
216
220
|
"Reset to default": "Reset to default",
|
|
217
221
|
"Resize column {{name}}, use arrow keys to adjust the size.": "Resize column {{name}}, use arrow keys to adjust the size.",
|
|
@@ -225,6 +229,7 @@
|
|
|
225
229
|
"Send invitation": "Send invitation",
|
|
226
230
|
"Show": "Show",
|
|
227
231
|
"Show all": "Show all",
|
|
232
|
+
"Show all with data": "Show all with data",
|
|
228
233
|
"Show filter for {{name}}": "Show filter for {{name}}",
|
|
229
234
|
"Show license": "Show license",
|
|
230
235
|
"Show license information": "Show license information",
|
|
@@ -246,6 +251,7 @@
|
|
|
246
251
|
"There no current or scheduled outages.": "There no current or scheduled outages.",
|
|
247
252
|
"This application uses the following open source libraries:": "This application uses the following open source libraries:",
|
|
248
253
|
"This identity provider is currently unavailable. Please try again later.": "This identity provider is currently unavailable. Please try again later.",
|
|
254
|
+
"To reorder an item, focus its drag handle and press Space. Use arrow keys to move it. Press Space to drop, or Escape to cancel.": "To reorder an item, focus its drag handle and press Space. Use arrow keys to move it. Press Space to drop, or Escape to cancel.",
|
|
249
255
|
"Toggle footer menu": "Toggle footer menu",
|
|
250
256
|
"Toggle menu": "Toggle menu",
|
|
251
257
|
"Toggle navigation menu": "Toggle navigation menu",
|
|
@@ -264,6 +270,8 @@
|
|
|
264
270
|
"User invitations": "User invitations",
|
|
265
271
|
"Users": "Users",
|
|
266
272
|
"Users and organizations": "Users and organizations",
|
|
273
|
+
"Visibility for {{label}}": "Visibility for {{label}}",
|
|
274
|
+
"Visible": "Visible",
|
|
267
275
|
"Visible from": "Visible from",
|
|
268
276
|
"Visible to": "Visible to",
|
|
269
277
|
"We could not log you in, or your session has expired.": "We could not log you in, or your session has expired.",
|
package/dist/locale/nl.json
CHANGED
|
@@ -21,6 +21,9 @@
|
|
|
21
21
|
"{{itemName}} is being saved...": "{{itemName}} wordt opgeslagen...",
|
|
22
22
|
"{{items}} ({{count}} of {{totalCount}})": "{{items}} ({{count}} van {{totalCount}})",
|
|
23
23
|
"{{items}} ({{count}})": "{{items}} ({{count}})",
|
|
24
|
+
"{{label}} dropped at position {{position}} of {{count}}.": "{{label}} geplaatst op positie {{position}} van {{count}}.",
|
|
25
|
+
"{{label}} moved to position {{position}} of {{count}}.": "{{label}} verplaatst naar positie {{position}} van {{count}}.",
|
|
26
|
+
"{{label}} returned to position {{position}} of {{count}}.": "{{label}} teruggezet naar positie {{position}} van {{count}}.",
|
|
24
27
|
"{{message}} - Bad request. The input data was not correct.": "{{message}} - Ongeldig verzoek. De invoergegevens waren niet correct.",
|
|
25
28
|
"{{message}} - Conflict. The request could not be completed due to a conflict with the current state of the resource.": "{{message}} - Conflict. Het verzoek kon niet worden voltooid vanwege een conflict met de huidige status van de resource.",
|
|
26
29
|
"{{message}} - Internal Server Error. Please try again later.": "{{message}} - Interne serverfout. Probeer het later opnieuw.",
|
|
@@ -58,7 +61,6 @@
|
|
|
58
61
|
"Change": "Wijzigen",
|
|
59
62
|
"Change column order and visibility": "Wijzig kolomvolgorde en zichtbaarheid",
|
|
60
63
|
"Change language": "Taal wijzigen",
|
|
61
|
-
"Change order / visibility": "Wijzig volgorde / zichtbaarheid",
|
|
62
64
|
"Change organization": "Organisatie wijzigen",
|
|
63
65
|
"Changing language": "Taal wijzigen",
|
|
64
66
|
"Changing language will reload the application. Do you want to continue?": "Het wijzigen van de taal herlaadt de applicatie. Wilt u doorgaan?",
|
|
@@ -77,6 +79,8 @@
|
|
|
77
79
|
"Close notifications drawer": "Meldingenpaneel sluiten",
|
|
78
80
|
"Code": "Code",
|
|
79
81
|
"Code information": "Code informatie",
|
|
82
|
+
"Column": "Kolom",
|
|
83
|
+
"Column editor": "Kolomeditor",
|
|
80
84
|
"Columns": "Kolommen",
|
|
81
85
|
"Complete registration": "Registratie voltooien",
|
|
82
86
|
"Condensed": "Ingekort",
|
|
@@ -102,16 +106,12 @@
|
|
|
102
106
|
"Delete item: {{itemName}}": "Verwijder item: {{itemName}}",
|
|
103
107
|
"Description": "Omschrijving",
|
|
104
108
|
"Details for our technicians": "Details voor onze technici",
|
|
105
|
-
"Disable all": "Alles uitschakelen",
|
|
106
|
-
"Disable all without data": "Alles zonder data uitschakelen",
|
|
107
109
|
"Drag handle for {{label}}": "Sleep handvat voor {{label}}",
|
|
108
110
|
"E-Mail": "E-mail",
|
|
109
111
|
"Edit": "Bewerken",
|
|
110
112
|
"Email": "E-mail",
|
|
111
113
|
"Email address: unknown": "E-mailadres: onbekend",
|
|
112
114
|
"Email invitation link": "E-mail uitnodigingslink",
|
|
113
|
-
"Enable all": "Alles inschakelen",
|
|
114
|
-
"Enable all with data": "Alles met data inschakelen",
|
|
115
115
|
"Error": "Fout",
|
|
116
116
|
"Error anonymizing user: {{userName}}": "Fout bij anonimiseren van gebruiker: {{userName}}",
|
|
117
117
|
"Error loading organization admins": "Fout bij het laden van de organisatiebeheerders",
|
|
@@ -128,6 +128,7 @@
|
|
|
128
128
|
"Go back to homepage": "Terug naar startpagina",
|
|
129
129
|
"Helpers": "Hulpmiddelen",
|
|
130
130
|
"Hide all": "Verberg alle",
|
|
131
|
+
"Hide all without data": "Verberg alle kolommen zonder gegevens",
|
|
131
132
|
"Hide columns without data": "Verberg kolommen zonder data",
|
|
132
133
|
"Home": "Home",
|
|
133
134
|
"Id": "Id",
|
|
@@ -200,6 +201,7 @@
|
|
|
200
201
|
"Permission": "Toestemming",
|
|
201
202
|
"Phone": "Telefoon",
|
|
202
203
|
"Phone number: unknown": "Telefoonnummer: onbekend",
|
|
204
|
+
"Picked up {{label}}. Position {{position}} of {{count}}.": "{{label}} opgepakt. Positie {{position}} van {{count}}.",
|
|
203
205
|
"Planned outage": "Geplande storing",
|
|
204
206
|
"Please help make {{applicationName}} better by sharing your feedback with us. You may use this form as many times as you like.": "Help {{applicationName}} te verbeteren door uw feedback met ons te delen. U mag dit formulier zo vaak gebruiken als u wilt.",
|
|
205
207
|
"Please login with one of the following identity providers:": "Log in met een van de volgende identiteitsproviders:",
|
|
@@ -212,6 +214,8 @@
|
|
|
212
214
|
"Refresh page": "Pagina vernieuwen",
|
|
213
215
|
"Remove filter": "Filter verwijderen",
|
|
214
216
|
"Remove filter with label {{filterLabel}} and value {{filterValue}}": "Filter met label {{filterLabel}} en waarde {{filterValue}} verwijderen",
|
|
217
|
+
"Reorder": "Volgorde aanpassen",
|
|
218
|
+
"Reordering {{label}} cancelled. {{label}} returned to position {{position}} of {{count}}.": "Sorteren van {{label}} geannuleerd. {{label}} teruggezet naar positie {{position}} van {{count}}.",
|
|
215
219
|
"Reset": "Resetten",
|
|
216
220
|
"Reset to default": "Herstellen naar standaard",
|
|
217
221
|
"Resize column {{name}}, use arrow keys to adjust the size.": "Kolom {{name}} formaat aanpassen, gebruik pijltoetsen om het formaat aan te passen.",
|
|
@@ -225,6 +229,7 @@
|
|
|
225
229
|
"Send invitation": "Stuur uitnodiging",
|
|
226
230
|
"Show": "Tonen",
|
|
227
231
|
"Show all": "Toon alle",
|
|
232
|
+
"Show all with data": "Toon alle kolommen met gegevens",
|
|
228
233
|
"Show filter for {{name}}": "Toon filter voor {{name}}",
|
|
229
234
|
"Show license": "Toon licentie",
|
|
230
235
|
"Show license information": "Toon licentie informatie",
|
|
@@ -246,6 +251,7 @@
|
|
|
246
251
|
"There no current or scheduled outages.": "Er zijn geen huidige of geplande storingen.",
|
|
247
252
|
"This application uses the following open source libraries:": "Deze applicatie gebruikt de volgende open source bibliotheken:",
|
|
248
253
|
"This identity provider is currently unavailable. Please try again later.": "Deze identiteitsprovider is momenteel niet beschikbaar. Probeer het later opnieuw.",
|
|
254
|
+
"To reorder an item, focus its drag handle and press Space. Use arrow keys to move it. Press Space to drop, or Escape to cancel.": "Om een item te sorteren, focus je de sleepknop en druk je op Spatie. Gebruik de pijltjestoetsen om het item te verplaatsen. Druk op Spatie om neer te zetten of op Escape om te annuleren.",
|
|
249
255
|
"Toggle footer menu": "Voettekst menu omschakelen",
|
|
250
256
|
"Toggle menu": "Menu omschakelen",
|
|
251
257
|
"Toggle navigation menu": "Navigatiemenu omschakelen",
|
|
@@ -264,6 +270,8 @@
|
|
|
264
270
|
"User invitations": "Gebruiker uitnodigingen",
|
|
265
271
|
"Users": "Gebruikers",
|
|
266
272
|
"Users and organizations": "Gebruikers en organisaties",
|
|
273
|
+
"Visibility for {{label}}": "Zichtbaarheid van {{label}}",
|
|
274
|
+
"Visible": "Zichtbaar",
|
|
267
275
|
"Visible from": "Zichtbaar vanaf",
|
|
268
276
|
"Visible to": "Zichtbaar tot",
|
|
269
277
|
"We could not log you in, or your session has expired.": "We konden u niet inloggen, of uw sessie is verlopen.",
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { API_ORGANIZATION_TOKEN as e } from "../../constants/api.constants.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { t as i } from "../../_chunks/
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
2
|
+
import { PageContainer as t } from "../../components/ui/PageContainer/index.js";
|
|
3
|
+
import { ResponseHandler as n } from "../../components/ui/ResponseHandler/index.js";
|
|
4
|
+
import { t as r } from "../../_chunks/useQueryMemo.js";
|
|
5
|
+
import { t as i } from "../../_chunks/QueryClientService.js";
|
|
6
|
+
import { COMMON_QUERY_KEY as a } from "../../constants/query.constants.js";
|
|
7
|
+
import { useConfig as o } from "../../hooks/useConfig/index.js";
|
|
8
8
|
import { container as s } from "tsyringe";
|
|
9
9
|
import { WindowService as c } from "@gen-epix/ui-core/classes/services/WindowService";
|
|
10
10
|
import { Box as l, Button as u, Typography as d } from "@mui/material";
|
|
@@ -15,22 +15,22 @@ import { TestIdUtil as v } from "@gen-epix/ui-core/utils/TestIdUtil";
|
|
|
15
15
|
import { useParams as y } from "react-router-dom";
|
|
16
16
|
// src/pages/AcceptInvitationPage/AcceptInvitationPage.tsx
|
|
17
17
|
var b = () => {
|
|
18
|
-
let { token: b } = y(), x =
|
|
18
|
+
let { token: b } = y(), x = o(), [S, C] = p(!1), { data: w, error: T, isLoading: E } = r({
|
|
19
19
|
enabled: S,
|
|
20
20
|
gcTime: 0,
|
|
21
21
|
queryFn: async ({ signal: t }) => (await s.resolve(e).userRegistrationsPostOne(b, { signal: t })).data,
|
|
22
|
-
queryKey: s.resolve(
|
|
22
|
+
queryKey: s.resolve(i).getGenericKey(a.USER_INVITATIONS, b),
|
|
23
23
|
staleTime: 0
|
|
24
24
|
}), { t: D } = _(), O = f(() => {
|
|
25
25
|
s.resolve(c).window.location.href = "/";
|
|
26
26
|
}, []), k = f(() => {
|
|
27
27
|
C(!0);
|
|
28
28
|
}, []);
|
|
29
|
-
return /* @__PURE__ */ h(
|
|
29
|
+
return /* @__PURE__ */ h(t, {
|
|
30
30
|
singleAction: !0,
|
|
31
31
|
testIdAttributes: v.createAttributes("AcceptInvitationPage"),
|
|
32
32
|
title: D`Invitation`,
|
|
33
|
-
children: /* @__PURE__ */ g(
|
|
33
|
+
children: /* @__PURE__ */ g(n, {
|
|
34
34
|
enabled: S,
|
|
35
35
|
error: T,
|
|
36
36
|
isLoading: E,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { AuthorizationService as e } from "../../classes/services/AuthorizationService/index.js";
|
|
2
|
+
import { RouterService as t } from "../../classes/services/RouterService/index.js";
|
|
3
|
+
import { PageContainer as n } from "../../components/ui/PageContainer/index.js";
|
|
4
|
+
import { ADMIN_PAGE_CATEGORY as r } from "../../models/admin.models.js";
|
|
5
5
|
import { container as i } from "tsyringe";
|
|
6
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
7
|
import { useCallback as p, useMemo as m } from "react";
|
|
@@ -11,29 +11,29 @@ 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
|
// src/pages/AdminPage/AdminPage.tsx
|
|
13
13
|
var x = () => {
|
|
14
|
-
let { t: x } = _(), S = b(), C = f(), w = m(() => i.resolve(
|
|
15
|
-
let n = i.resolve(
|
|
16
|
-
return !
|
|
14
|
+
let { t: x } = _(), S = b(), C = f(), w = m(() => i.resolve(t).adminRoutes.map((e) => e.children?.length ? e.children.find((e) => e.index) : e).filter((t) => {
|
|
15
|
+
let n = i.resolve(e).doesUserHavePermission(t.handle.requiredPermissions);
|
|
16
|
+
return !t.handle?.hidden && n;
|
|
17
17
|
}), []), T = m(() => ({
|
|
18
|
-
[
|
|
19
|
-
[
|
|
20
|
-
[
|
|
21
|
-
[
|
|
22
|
-
[
|
|
18
|
+
[r.ACCESS_RIGHTS]: x`Access rights`,
|
|
19
|
+
[r.HELPERS]: x`Helpers`,
|
|
20
|
+
[r.REFERENCE_DATA]: x`Reference data`,
|
|
21
|
+
[r.SYSTEM]: x`System`,
|
|
22
|
+
[r.USERS_AND_ORGANIZATIONS]: x`Users and organizations`
|
|
23
23
|
}), [x]), E = m(() => [
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
24
|
+
r.USERS_AND_ORGANIZATIONS,
|
|
25
|
+
r.ACCESS_RIGHTS,
|
|
26
|
+
r.SYSTEM,
|
|
27
|
+
r.REFERENCE_DATA,
|
|
28
|
+
r.HELPERS
|
|
29
29
|
].map((e) => ({
|
|
30
30
|
items: w.filter((t) => t.handle.category === e),
|
|
31
31
|
label: T[e],
|
|
32
32
|
name: e
|
|
33
33
|
})).filter((e) => e.items.length), [T, w]), D = p(async (e) => {
|
|
34
|
-
await i.resolve(
|
|
34
|
+
await i.resolve(t).router.navigate(e);
|
|
35
35
|
}, []);
|
|
36
|
-
return S?.pathname === "/management" ? /* @__PURE__ */ h(
|
|
36
|
+
return S?.pathname === "/management" ? /* @__PURE__ */ h(n, {
|
|
37
37
|
showBreadcrumbs: !0,
|
|
38
38
|
testIdAttributes: v.createAttributes("AdminPage"),
|
|
39
39
|
title: x`Management`,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AuthenticationService as e } from "../../classes/services/AuthenticationService/index.js";
|
|
2
2
|
import { PageContainer as t } from "../../components/ui/PageContainer/index.js";
|
|
3
|
-
import {
|
|
3
|
+
import { useConfig as n } from "../../hooks/useConfig/index.js";
|
|
4
4
|
import { container as r } from "tsyringe";
|
|
5
5
|
import { Alert as i, AlertTitle as a, Box as o, Button as s, Tooltip as c, Typography as l } from "@mui/material";
|
|
6
6
|
import { useCallback as u, useMemo as d } from "react";
|
|
@@ -9,9 +9,9 @@ import { useTranslation as m } from "react-i18next";
|
|
|
9
9
|
import { TestIdUtil as h } from "@gen-epix/ui-core/utils/TestIdUtil";
|
|
10
10
|
// src/pages/ChooseIdentityProviderPage/ChooseIdentityProviderPage.tsx
|
|
11
11
|
var g = ({ identityProvidersWithAvailability: g }) => {
|
|
12
|
-
let { t: _ } = m(), v =
|
|
13
|
-
let
|
|
14
|
-
r.resolve(
|
|
12
|
+
let { t: _ } = m(), v = n(), y = v.login?.AfterIdentityProviderSelection, b = u((t) => {
|
|
13
|
+
let n = t.target.getAttribute("data-name");
|
|
14
|
+
r.resolve(e).next(g.find((e) => e.provider.name === n).provider);
|
|
15
15
|
}, [g]), x = d(() => g?.filter((e) => e.isAvailable) ?? [], [g]), S = u(() => {
|
|
16
16
|
window.location.reload();
|
|
17
17
|
}, []), C = d(() => /* @__PURE__ */ f(s, {
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { GenericErrorMessage as e } from "../../components/ui/GenericErrorMessage/index.js";
|
|
2
|
+
import { PageContainer as t } from "../../components/ui/PageContainer/index.js";
|
|
3
3
|
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
|
// src/pages/ErrorPage/ErrorPage.tsx
|
|
7
7
|
var a = ({ error: a }) => {
|
|
8
8
|
let { t: o } = r();
|
|
9
|
-
return /* @__PURE__ */ n(
|
|
9
|
+
return /* @__PURE__ */ n(t, {
|
|
10
10
|
singleAction: !0,
|
|
11
11
|
testIdAttributes: i.createAttributes("ErrorPage"),
|
|
12
12
|
title: o`Error`,
|
|
13
|
-
children: /* @__PURE__ */ n(
|
|
13
|
+
children: /* @__PURE__ */ n(e, { error: a })
|
|
14
14
|
});
|
|
15
15
|
};
|
|
16
16
|
export { a as ErrorPage };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { API_ORGANIZATION_TOKEN as e } from "../../constants/api.constants.js";
|
|
2
|
+
import { t } from "../../_chunks/TableUtil.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
5
|
import { container as i } from "tsyringe";
|
|
@@ -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
|
// src/pages/IdentifierIssuersAdminPage/IdentifierIssuersAdminPage.tsx
|
|
15
15
|
var m = () => {
|
|
16
|
-
let { t: m } = l(), h = o(async (
|
|
16
|
+
let { t: m } = l(), h = o(async (t) => (await i.resolve(e).identifierIssuersGetAll(null, null, { signal: t }))?.data, []), g = o(async (t) => await i.resolve(e).identifierIssuersDeleteOne(t.id), []), _ = o(async (t, n) => (await i.resolve(e).identifierIssuersPutOne(n.id, {
|
|
17
17
|
id: n.id,
|
|
18
|
-
...
|
|
19
|
-
})).data, []), v = o(async (
|
|
18
|
+
...t
|
|
19
|
+
})).data, []), v = o(async (t) => (await i.resolve(e).identifierIssuersPostOne(t)).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
|
|
@@ -38,10 +38,10 @@ var m = () => {
|
|
|
38
38
|
label: m`Code`,
|
|
39
39
|
name: "code"
|
|
40
40
|
}
|
|
41
|
-
], [m]), S = s(() => [
|
|
41
|
+
], [m]), S = s(() => [t.createTextColumn({
|
|
42
42
|
id: "code",
|
|
43
43
|
name: m`Code`
|
|
44
|
-
}),
|
|
44
|
+
}), t.createTextColumn({
|
|
45
45
|
id: "name",
|
|
46
46
|
name: m`Name`
|
|
47
47
|
})], [m]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["
|
|
1
|
+
{"version":3,"file":"index.js","names":["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","TableUtil","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,IAAaC,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,CACLO,EAAU,iBAA2C;EAAE,IAAI;EAAQ,MAAM,CAAC;CAAO,CAAC,GAClFA,EAAU,iBAA2C;EAAE,IAAI;EAAQ,MAAM,CAAC;CAAO,CAAC,CACpF,GACC,CAACF,CAAC,CAAC;CAEN,OACE,kBAACnB,GAAD;EACE,uBAAuB,CAAC;EACb;EACX,iBAAiBsB,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"}
|