@gen-epix/ui-client-common 4.5.0 → 4.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -4
- package/dist/@types/mui.d.ts +13 -5
- package/dist/@types/ui-client-common.d.ts +1 -0
- package/dist/_chunks/ApplicationFooter.js +45 -46
- package/dist/_chunks/ApplicationFooter.js.map +1 -1
- package/dist/_chunks/Breadcrumbs.js +14 -15
- package/dist/_chunks/CrudPage.js +301 -302
- package/dist/_chunks/CrudPage.js.map +1 -1
- package/dist/_chunks/GeoFilter.js +1 -2
- package/dist/_chunks/GeoFilter.js.map +1 -1
- package/dist/_chunks/Notifications.js +52 -53
- package/dist/_chunks/OutageList.js +30 -31
- package/dist/_chunks/OutageList.js.map +1 -1
- package/dist/_chunks/OutageUtil.js +4 -8
- package/dist/_chunks/OutageUtil.js.map +1 -1
- package/dist/_chunks/QueryClientProvider.js +1 -2
- package/dist/_chunks/QueryClientProvider.js.map +1 -1
- package/dist/_chunks/QueryClientService.js +101 -395
- package/dist/_chunks/QueryClientService.js.map +1 -1
- package/dist/_chunks/Reflect.js +1 -2
- package/dist/_chunks/Table.js +523 -522
- package/dist/_chunks/Table.js.map +1 -1
- package/dist/_chunks/TableUtil.js +10 -20
- package/dist/_chunks/TableUtil.js.map +1 -1
- package/dist/_chunks/TextFilter.js +18 -20
- package/dist/_chunks/TextFilter.js.map +1 -1
- package/dist/_chunks/UserInvitationsAdminPage.js +78 -79
- package/dist/_chunks/UserInvitationsAdminPage.js.map +1 -1
- package/dist/_chunks/UserManagerUtil.js +212 -213
- package/dist/_chunks/UserManagerUtil.js.map +1 -1
- package/dist/_chunks/_baseAssignValue.js +1 -2
- package/dist/_chunks/_baseFlatten.js +9 -10
- package/dist/_chunks/_baseFlatten.js.map +1 -1
- package/dist/_chunks/_baseGet.js +279 -0
- package/dist/_chunks/_baseGet.js.map +1 -0
- package/dist/_chunks/_baseIteratee.js +273 -0
- package/dist/_chunks/_baseIteratee.js.map +1 -0
- package/dist/_chunks/_baseUnset.js +22 -300
- package/dist/_chunks/_baseUnset.js.map +1 -1
- package/dist/_chunks/_cacheHas.js +1 -2
- package/dist/_chunks/_setToString.js +1 -2
- package/dist/_chunks/decorate.js +1 -2
- package/dist/_chunks/decorateParam.js +1 -2
- package/dist/_chunks/format.js +27 -54
- package/dist/_chunks/format.js.map +1 -1
- package/dist/_chunks/isArrayLike.js +1 -2
- package/dist/_chunks/isObject.js +1 -2
- package/dist/_chunks/isSymbol.js +1 -2
- package/dist/_chunks/last.js +12 -0
- package/dist/_chunks/last.js.map +1 -0
- package/dist/_chunks/middleware.js +2 -3
- package/dist/_chunks/middleware.js.map +1 -1
- package/dist/_chunks/omit.js +42 -42
- package/dist/_chunks/omit.js.map +1 -1
- package/dist/_chunks/query.js +8 -15
- package/dist/_chunks/query.js.map +1 -1
- package/dist/_chunks/react.js +2 -3
- package/dist/_chunks/react.js.map +1 -1
- package/dist/_chunks/rolldown-runtime.js +2 -3
- package/dist/_chunks/tableStore.js +231 -224
- package/dist/_chunks/tableStore.js.map +1 -1
- package/dist/_chunks/toDate.js +8 -14
- package/dist/_chunks/toDate.js.map +1 -1
- package/dist/_chunks/uniq.js +43 -0
- package/dist/_chunks/uniq.js.map +1 -0
- package/dist/_chunks/useColumnsMenu.js +3 -6
- package/dist/_chunks/useColumnsMenu.js.map +1 -1
- package/dist/_chunks/useMutation.js +24 -26
- package/dist/_chunks/useMutation.js.map +1 -1
- package/dist/_chunks/useQueryMemo.js +33 -22
- package/dist/_chunks/useQueryMemo.js.map +1 -1
- package/dist/_chunks/vanilla.js +1 -2
- package/dist/_chunks/vanilla.js.map +1 -1
- package/dist/_chunks/yup.js +2 -4
- package/dist/_chunks/yup.js.map +1 -1
- package/dist/classes/TableEventBus/index.js +1 -2
- package/dist/classes/abstracts/FilterAbstract/index.js +4 -3
- package/dist/classes/abstracts/FilterAbstract/index.js.map +1 -1
- package/dist/classes/filters/MultiSelectFilter.d.ts +1 -1
- package/dist/classes/services/AuthenticationService/AuthenticationService.d.ts +1 -1
- package/dist/classes/services/AuthenticationService/index.js +15 -16
- package/dist/classes/services/AuthenticationService/index.js.map +1 -1
- package/dist/classes/services/AuthorizationService/index.js +5 -6
- package/dist/classes/services/AuthorizationService/index.js.map +1 -1
- package/dist/classes/services/BackendVersionService/index.js +4 -4
- package/dist/classes/services/BackendVersionService/index.js.map +1 -1
- package/dist/classes/services/BreadcrumbService/index.js +16 -39
- package/dist/classes/services/BreadcrumbService/index.js.map +1 -1
- package/dist/classes/services/EmotionCacheService/index.js +10 -10
- package/dist/classes/services/EmotionCacheService/index.js.map +1 -1
- package/dist/classes/services/FeatureFlagsService/index.js +1 -2
- package/dist/classes/services/I18nService/index.js +12 -12
- package/dist/classes/services/I18nService/index.js.map +1 -1
- package/dist/classes/services/InactivityService/index.js +13 -14
- package/dist/classes/services/InactivityService/index.js.map +1 -1
- package/dist/classes/services/LogService/index.js +40 -35
- package/dist/classes/services/LogService/index.js.map +1 -1
- package/dist/classes/services/NavigationHistoryService/index.js +1 -2
- package/dist/classes/services/NotificationService/index.js +9 -10
- package/dist/classes/services/NotificationService/index.js.map +1 -1
- package/dist/classes/services/PageEventBusService/index.js +14 -11
- package/dist/classes/services/PageEventBusService/index.js.map +1 -1
- package/dist/classes/services/RouterService/index.js +4 -8
- package/dist/classes/services/RouterService/index.js.map +1 -1
- package/dist/classes/services/UserSettingsService/index.js +1 -2
- package/dist/components/app/App/App.d.ts +1 -1
- package/dist/components/app/App/index.js +35 -40
- package/dist/components/app/App/index.js.map +1 -1
- package/dist/components/app/ApplicationBootstrapWithAuthentication/index.js +29 -30
- package/dist/components/app/ApplicationBootstrapWithAuthentication/index.js.map +1 -1
- package/dist/components/app/ApplicationBootstrapWithoutAuthorization/index.js +48 -47
- package/dist/components/app/ApplicationBootstrapWithoutAuthorization/index.js.map +1 -1
- package/dist/components/app/AuthenticationWrapper/index.js +36 -37
- package/dist/components/app/AuthenticationWrapper/index.js.map +1 -1
- package/dist/components/app/AuthorizationWrapper/index.js +20 -21
- package/dist/components/app/AuthorizationWrapper/index.js.map +1 -1
- package/dist/components/app/RouterRoot/index.js +53 -52
- package/dist/components/app/RouterRoot/index.js.map +1 -1
- package/dist/components/epi/EpiContactDetailsDialog/index.js +22 -23
- package/dist/components/filters/BooleanFilterField/index.js +6 -7
- package/dist/components/filters/DateFilterField/index.js +4 -5
- package/dist/components/filters/GeoFilterField/index.js +5 -6
- package/dist/components/filters/MultiSelectFilterField/index.js +5 -6
- package/dist/components/filters/NumberRangeFilterField/index.js +4 -5
- package/dist/components/filters/TextFilterField/index.js +4 -5
- package/dist/components/ui/ApplicationBar/index.js +189 -190
- package/dist/components/ui/ApplicationBar/index.js.map +1 -1
- package/dist/components/ui/ConsentDialog/index.js +1 -2
- package/dist/components/ui/GenericErrorMessage/index.js +30 -31
- package/dist/components/ui/LicensesDialog/index.js +39 -40
- package/dist/components/ui/LicensesDialog/index.js.map +1 -1
- package/dist/components/ui/MyPermissionsDialog/index.js +17 -18
- package/dist/components/ui/NavLink/index.js +7 -8
- package/dist/components/ui/OrganizationSwitcherDialog/index.js +22 -23
- package/dist/components/ui/OrganizationSwitcherDialog/index.js.map +1 -1
- package/dist/components/ui/OutagesDialog/index.js +1 -2
- package/dist/components/ui/PageContainer/index.js +25 -26
- package/dist/components/ui/PageContainer/index.js.map +1 -1
- package/dist/components/ui/ResponseHandler/index.js +1 -2
- package/dist/components/ui/Sidebar/index.js +31 -32
- package/dist/components/ui/UserFeedbackDialog/index.js +13 -14
- package/dist/components/ui/UserInactivityConfirmation/index.js +1 -2
- package/dist/constants/api.constants.js +1 -2
- package/dist/constants/config.constants.d.ts +0 -2
- package/dist/constants/config.constants.js +3 -4
- package/dist/constants/config.constants.js.map +1 -1
- package/dist/constants/query.constants.js +1 -2
- package/dist/dataHooks/useIdentifierIssuerOwnOrganizationQuery/index.js +13 -14
- package/dist/dataHooks/useIdentifierIssuerOwnOrganizationQuery/index.js.map +1 -1
- package/dist/dataHooks/useIdentifierIssuerQuery/index.js +15 -16
- package/dist/dataHooks/useIdentifierIssuerQuery/index.js.map +1 -1
- package/dist/dataHooks/useInviteUserConstraintsQuery/index.js +13 -14
- package/dist/dataHooks/useInviteUserConstraintsQuery/index.js.map +1 -1
- package/dist/dataHooks/useOrganizationAdminPoliciesQuery/index.js +14 -15
- package/dist/dataHooks/useOrganizationAdminPoliciesQuery/index.js.map +1 -1
- package/dist/dataHooks/useOrganizationIdentifierIssuerLinksQuery/index.js +5 -6
- package/dist/dataHooks/useOrganizationsQuery/index.js +14 -15
- package/dist/dataHooks/useOrganizationsQuery/index.js.map +1 -1
- package/dist/dataHooks/useUsersQuery/index.js +11 -12
- package/dist/dataHooks/useUsersQuery/index.js.map +1 -1
- package/dist/hoc/withPermissions/index.js +1 -2
- package/dist/hooks/useConfig/index.js +3 -4
- package/dist/hooks/useConfig/index.js.map +1 -1
- package/dist/hooks/useCreateMutation/index.js +13 -14
- package/dist/hooks/useCreateMutation/index.js.map +1 -1
- package/dist/hooks/useDeleteMutation/index.js +17 -11
- package/dist/hooks/useDeleteMutation/index.js.map +1 -1
- package/dist/hooks/useEditMutation/index.js +49 -35
- package/dist/hooks/useEditMutation/index.js.map +1 -1
- package/dist/hooks/useInitializeTableStore/index.js +1 -2
- package/dist/hooks/useItemQuery/index.js +5 -6
- package/dist/hooks/useItemQuery/index.js.map +1 -1
- package/dist/hooks/useUpdateBreadcrumb/index.js +1 -2
- package/dist/hooks/useUpdateDocumentTitle/index.js +1 -2
- package/dist/locale/en.json +1 -0
- package/dist/locale/nl.json +1 -0
- package/dist/models/admin.models.js +1 -2
- package/dist/models/admin.models.js.map +1 -1
- package/dist/models/config.models.d.ts +1 -5
- package/dist/models/table.models.js +1 -2
- package/dist/models/table.models.js.map +1 -1
- package/dist/models/theme.models.d.ts +19 -16
- package/dist/pages/AcceptInvitationPage/index.js +26 -27
- package/dist/pages/AcceptInvitationPage/index.js.map +1 -1
- package/dist/pages/AdminPage/index.js +17 -18
- package/dist/pages/ChooseIdentityProviderPage/index.js +22 -23
- package/dist/pages/ErrorPage/index.js +1 -2
- package/dist/pages/IdentifierIssuersAdminPage/index.js +6 -7
- package/dist/pages/OrganizationAdminPoliciesAdminPage/index.js +6 -7
- package/dist/pages/OrganizationContactsAdminPage/index.js +7 -8
- package/dist/pages/OrganizationSitesAdminPage/index.js +10 -11
- package/dist/pages/OrganizationsAdminPage/index.js +14 -15
- package/dist/pages/OrganizationsAdminPage/index.js.map +1 -1
- package/dist/pages/OutagesAdminPage/index.js +21 -22
- package/dist/pages/PostLoginPage/index.js +8 -9
- package/dist/pages/PostLoginPage/index.js.map +1 -1
- package/dist/pages/PostLogoutPage/index.js +9 -10
- package/dist/pages/RouterErrorPage/index.js +1 -2
- package/dist/pages/UsersAdminPage/index.js +40 -41
- package/dist/pages/UsersAdminPage/index.js.map +1 -1
- package/dist/routes/index.js +1 -2
- package/dist/setup/setup.js +12 -6
- package/dist/setup/setup.js.map +1 -1
- package/dist/stores/oidcStore/index.js +1 -2
- package/dist/stores/outagesStore/index.js +1 -2
- package/dist/theme/demoTheme/index.js +18 -17
- package/dist/theme/demoTheme/index.js.map +1 -1
- package/dist/utils/AxiosUtil/index.js +1 -2
- package/dist/utils/DataHookUtil/index.js +2 -3
- package/dist/utils/DataHookUtil/index.js.map +1 -1
- package/dist/utils/DependencyContainerUtil/DependencyContainerUtil.d.ts +2 -3
- package/dist/utils/DependencyContainerUtil/index.js +10 -16
- package/dist/utils/DependencyContainerUtil/index.js.map +1 -1
- package/dist/utils/LoadableUtil/index.js +1 -2
- package/dist/utils/MenuDataUtil/index.js +2 -3
- package/dist/utils/MenuDataUtil/index.js.map +1 -1
- package/dist/utils/NotificationUtil/index.js +1 -2
- package/dist/utils/StandardConfigUtil/index.js +1 -6
- package/dist/utils/StandardConfigUtil/index.js.map +1 -1
- package/dist/utils/TimeUtil/index.js +2 -3
- package/dist/utils/TimeUtil/index.js.map +1 -1
- package/dist/utils/UserUtil/index.js +1 -2
- package/package.json +26 -29
- package/dist/context/ClientCommonConfigContext/ClientCommonConfigContext.d.ts +0 -9
- package/dist/context/ClientCommonConfigContext/ClientCommonConfigContextProvider.d.ts +0 -6
- package/dist/context/ClientCommonConfigContext/index.d.ts +0 -3
- package/dist/context/ClientCommonConfigContext/index.js +0 -34
- package/dist/context/ClientCommonConfigContext/index.js.map +0 -1
- package/dist/context/ClientCommonConfigContext/useClientCommonConfigContext.d.ts +0 -3
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { n as e, t } from "../../../_chunks/UserManagerUtil.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
2
|
+
import { API_AUTH_TOKEN as n } from "../../../constants/api.constants.js";
|
|
3
|
+
import { RouterService as r } from "../../../classes/services/RouterService/index.js";
|
|
4
|
+
import { useConfig as i } from "../../../hooks/useConfig/index.js";
|
|
5
|
+
import { PageContainer as a } from "../../ui/PageContainer/index.js";
|
|
6
|
+
import { AuthenticationService as o } from "../../../classes/services/AuthenticationService/index.js";
|
|
7
|
+
import { LogService as s } from "../../../classes/services/LogService/index.js";
|
|
8
|
+
import { t as c } from "../../../_chunks/useQueryMemo.js";
|
|
9
|
+
import { t as l } from "../../../_chunks/QueryClientService.js";
|
|
10
10
|
import { COMMON_QUERY_KEY as u } from "../../../constants/query.constants.js";
|
|
11
11
|
import { NavigationHistoryService as d } from "../../../classes/services/NavigationHistoryService/index.js";
|
|
12
12
|
import { ChooseIdentityProviderPage as f } from "../../../pages/ChooseIdentityProviderPage/index.js";
|
|
@@ -15,84 +15,86 @@ import { UserInactivityConfirmation as m } from "../../ui/UserInactivityConfirma
|
|
|
15
15
|
import { ApplicationBootstrapWithAuthentication as h } from "../ApplicationBootstrapWithAuthentication/index.js";
|
|
16
16
|
import { AuthenticationWrapper as g } from "../AuthenticationWrapper/index.js";
|
|
17
17
|
import { AuthorizationWrapper as _ } from "../AuthorizationWrapper/index.js";
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import
|
|
22
|
-
import {
|
|
23
|
-
import D from "
|
|
24
|
-
import {
|
|
18
|
+
import { container as v } from "tsyringe";
|
|
19
|
+
import { WindowService as y } from "@gen-epix/ui-core/classes/services/WindowService";
|
|
20
|
+
import { CommonDbLogLevel as b } from "@gen-epix/api-commondb";
|
|
21
|
+
import x from "axios";
|
|
22
|
+
import { Box as S, Button as C, Typography as w } from "@mui/material";
|
|
23
|
+
import { StrictMode as T, useCallback as E, useEffect as D, useMemo as O } from "react";
|
|
24
|
+
import { jsx as k, jsxs as A } from "react/jsx-runtime";
|
|
25
25
|
import { useTranslation as j } from "react-i18next";
|
|
26
26
|
import { TestIdUtil as M } from "@gen-epix/ui-core/utils/TestIdUtil";
|
|
27
27
|
import { Outlet as N, useLocation as P } from "react-router-dom";
|
|
28
28
|
import { useSubscribable as F } from "@gen-epix/ui-core/hooks/useSubscribable";
|
|
29
29
|
import { Spinner as I } from "@gen-epix/ui-core-components/components/Spinner";
|
|
30
30
|
import { AuthProvider as L } from "react-oidc-context";
|
|
31
|
-
|
|
31
|
+
// src/components/app/RouterRoot/RouterRoot.tsx
|
|
32
32
|
var R = () => {
|
|
33
|
-
let { t: R } = j(), z = P(), B =
|
|
33
|
+
let { t: R } = j(), z = P(), B = i(), V = F(v.resolve(o)), { data: H, error: U, isLoading: W } = c({
|
|
34
34
|
gcTime: Infinity,
|
|
35
35
|
queryFn: async ({ signal: e }) => {
|
|
36
|
-
let t = (await
|
|
36
|
+
let t = (await v.resolve(n).identityProvidersGetAll({ signal: e })).data;
|
|
37
37
|
if (!Array.isArray(t)) throw Error("Invalid response for identity providers. Backend is most likely misconfigured.");
|
|
38
|
-
let
|
|
39
|
-
for (let
|
|
40
|
-
await
|
|
38
|
+
let r = [];
|
|
39
|
+
for (let n of t) try {
|
|
40
|
+
await x.get(n.discovery_url, {
|
|
41
41
|
signal: e,
|
|
42
42
|
timeout: 3e3
|
|
43
|
-
}),
|
|
43
|
+
}), r.push({
|
|
44
44
|
isAvailable: !0,
|
|
45
|
-
provider:
|
|
45
|
+
provider: n
|
|
46
46
|
});
|
|
47
47
|
} catch (e) {
|
|
48
|
-
console.error(`Identity provider ${
|
|
48
|
+
console.error(`Identity provider ${n.name} is not available`, e), V?.name === n.name && v.resolve(o).next(void 0), r.push({
|
|
49
49
|
isAvailable: !1,
|
|
50
|
-
provider:
|
|
50
|
+
provider: n
|
|
51
51
|
});
|
|
52
52
|
}
|
|
53
|
-
return
|
|
53
|
+
return r;
|
|
54
54
|
},
|
|
55
|
-
queryKey:
|
|
55
|
+
queryKey: v.resolve(l).getGenericKey(u.IDENTITY_PROVIDERS),
|
|
56
56
|
staleTime: Infinity
|
|
57
|
-
}), G =
|
|
58
|
-
|
|
59
|
-
|
|
57
|
+
}), G = O(() => H?.filter((e) => e.isAvailable) ?? [], [H]);
|
|
58
|
+
D(() => {
|
|
59
|
+
v.resolve(d).navigationHistory.push(z.pathname), v.resolve(s).log([{
|
|
60
60
|
detail: { pathname: z.pathname },
|
|
61
|
-
level:
|
|
61
|
+
level: b.INFO,
|
|
62
62
|
topic: "USER_NAVIGATION"
|
|
63
63
|
}]);
|
|
64
|
-
}, [z.pathname]),
|
|
65
|
-
H?.length === 1 && G.length === 1 &&
|
|
64
|
+
}, [z.pathname]), D(() => {
|
|
65
|
+
H?.length === 1 && G.length === 1 && v.resolve(o).next(H[0].provider);
|
|
66
66
|
}, [G.length, H]);
|
|
67
|
-
let K =
|
|
67
|
+
let K = O(() => {
|
|
68
68
|
if (!V || !G?.length) return null;
|
|
69
69
|
let n = H.find((e) => e.provider.name === V.name)?.provider;
|
|
70
|
-
|
|
70
|
+
if (!n || JSON.stringify(V) !== JSON.stringify(n)) return v.resolve(o).next(void 0), null;
|
|
71
|
+
let r = v.resolve(y);
|
|
72
|
+
return r.window.userManager = new e(t.getSettings(V)), r.window.userManager;
|
|
71
73
|
}, [
|
|
72
74
|
G,
|
|
73
75
|
H,
|
|
74
76
|
V
|
|
75
|
-
]), q =
|
|
76
|
-
|
|
77
|
-
level:
|
|
77
|
+
]), q = E(() => {
|
|
78
|
+
v.resolve(s).log([{
|
|
79
|
+
level: b.INFO,
|
|
78
80
|
topic: "USER_LOGIN"
|
|
79
81
|
}]);
|
|
80
|
-
}, []), J =
|
|
82
|
+
}, []), J = E(() => {
|
|
81
83
|
window.location.reload();
|
|
82
84
|
}, []);
|
|
83
|
-
if (W) return /* @__PURE__ */
|
|
84
|
-
if (U) return /* @__PURE__ */
|
|
85
|
+
if (W) return /* @__PURE__ */ k(I, {});
|
|
86
|
+
if (U) return /* @__PURE__ */ k(a, {
|
|
85
87
|
singleAction: !0,
|
|
86
88
|
testIdAttributes: M.createAttributes("ErrorPage"),
|
|
87
89
|
title: R("Error"),
|
|
88
|
-
children: /* @__PURE__ */
|
|
90
|
+
children: /* @__PURE__ */ A(S, {
|
|
89
91
|
sx: {
|
|
90
92
|
marginY: 2,
|
|
91
93
|
textAlign: "center"
|
|
92
94
|
},
|
|
93
|
-
children: [/* @__PURE__ */
|
|
95
|
+
children: [/* @__PURE__ */ k(w, { children: R("{{applicationName}} is currently unavailable. Please try again later.", { applicationName: B.applicationName }) }), /* @__PURE__ */ k(S, {
|
|
94
96
|
sx: { marginTop: 2 },
|
|
95
|
-
children: /* @__PURE__ */
|
|
97
|
+
children: /* @__PURE__ */ k(C, {
|
|
96
98
|
onClick: J,
|
|
97
99
|
variant: "outlined",
|
|
98
100
|
children: R`Try again`
|
|
@@ -100,19 +102,18 @@ var R = () => {
|
|
|
100
102
|
})]
|
|
101
103
|
})
|
|
102
104
|
});
|
|
103
|
-
if (!V) return /* @__PURE__ */
|
|
104
|
-
let Y =
|
|
105
|
-
return /* @__PURE__ */
|
|
105
|
+
if (!V) return /* @__PURE__ */ k(f, { identityProvidersWithAvailability: H });
|
|
106
|
+
let Y = v.resolve(r).homePageComponent;
|
|
107
|
+
return /* @__PURE__ */ k(L, {
|
|
106
108
|
onSigninCallback: q,
|
|
107
109
|
userManager: K,
|
|
108
|
-
children: /* @__PURE__ */
|
|
109
|
-
/* @__PURE__ */
|
|
110
|
-
/* @__PURE__ */
|
|
111
|
-
/* @__PURE__ */ T
|
|
110
|
+
children: /* @__PURE__ */ k(g, { children: /* @__PURE__ */ k(h, { children: /* @__PURE__ */ A(_, { children: [
|
|
111
|
+
/* @__PURE__ */ k(m, {}),
|
|
112
|
+
/* @__PURE__ */ k(p, {}),
|
|
113
|
+
/* @__PURE__ */ k(T, { children: z?.pathname === "/" ? /* @__PURE__ */ k(Y, {}) : /* @__PURE__ */ k(N, {}) })
|
|
112
114
|
] }) }) })
|
|
113
115
|
});
|
|
114
116
|
};
|
|
115
|
-
//#endregion
|
|
116
117
|
export { R as RouterRoot };
|
|
117
118
|
|
|
118
119
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["UserManager","QueryClientService","useQueryMemo","NotificationsStack","axios","RouterRoot","useTranslation","location","useLocation","config","useConfig","oidcConfiguration","useSubscribable","container","AuthenticationService","identityProvidersWithAvailability","identityProvidersError","isIdentityProvidersLoading","providers","API_AUTH_TOKEN","providersWithAvailability","provider","error","COMMON_QUERY_KEY","availableIdentityProviders","useMemo","x","useEffect","NavigationHistoryService","LogService","CommonDbLogLevel","userManager","identityProvider","UserManagerUtil","WindowService","onSignin","useCallback","onTryAgainButtonClick","Spinner","PageContainer","TestIdUtil","t","Box","Typography","Button","ChooseIdentityProviderPage","HomePage","RouterService","AuthProvider","AuthenticationWrapper","ApplicationBootstrapWithAuthentication","AuthorizationWrapper","UserInactivityConfirmation","StrictMode","Outlet"],"sources":["../../../../src/components/app/RouterRoot/RouterRoot.tsx"],"sourcesContent":["import { container } from 'tsyringe';\nimport {\n StrictMode,\n useCallback,\n useEffect,\n useMemo,\n} from 'react';\nimport {\n Outlet,\n useLocation,\n} from 'react-router-dom';\nimport { AuthProvider } from 'react-oidc-context';\nimport { UserManager } from 'oidc-client-ts';\nimport axios from 'axios';\nimport {\n Box,\n Button,\n Typography,\n} from '@mui/material';\nimport { CommonDbLogLevel } from '@gen-epix/api-commondb';\nimport { useTranslation } from 'react-i18next';\nimport { TestIdUtil } from '@gen-epix/ui-core/utils/TestIdUtil';\nimport { WindowService } from '@gen-epix/ui-core/classes/services/WindowService';\nimport { useSubscribable } from '@gen-epix/ui-core/hooks/useSubscribable';\nimport { Spinner } from '@gen-epix/ui-core-components/components/Spinner';\n\nimport { API_AUTH_TOKEN } from '../../../constants/api.constants';\nimport { AuthenticationService } from '../../../classes/services/AuthenticationService';\nimport { LogService } from '../../../classes/services/LogService';\nimport { NavigationHistoryService } from '../../../classes/services/NavigationHistoryService';\nimport { ChooseIdentityProviderPage } from '../../../pages/ChooseIdentityProviderPage';\nimport { UserManagerUtil } from '../../../utils/UserManagerUtil';\nimport { NotificationsStack } from '../../ui/Notifications';\nimport { UserInactivityConfirmation } from '../../ui/UserInactivityConfirmation';\nimport type { IdentityProviderWithAvailability } from '../../../models/auth.models';\nimport { useConfig } from '../../../hooks/useConfig';\nimport { PageContainer } from '../../ui/PageContainer';\nimport { useQueryMemo } from '../../../hooks/useQueryMemo';\nimport { ApplicationBootstrapWithAuthentication } from '../ApplicationBootstrapWithAuthentication';\nimport { AuthenticationWrapper } from '../AuthenticationWrapper';\nimport { AuthorizationWrapper } from '../AuthorizationWrapper';\nimport { QueryClientService } from '../../../classes/services/QueryClientService';\nimport { COMMON_QUERY_KEY } from '../../../constants/query.constants';\nimport { RouterService } from '../../../classes/services/RouterService';\n\n\nexport const RouterRoot = () => {\n const { t } = useTranslation();\n const location = useLocation();\n const config = useConfig();\n\n const oidcConfiguration = useSubscribable(container.resolve(AuthenticationService));\n\n const { data: identityProvidersWithAvailability, error: identityProvidersError, isLoading: isIdentityProvidersLoading } = useQueryMemo<IdentityProviderWithAvailability[], Error, IdentityProviderWithAvailability[]>({\n gcTime: Infinity,\n queryFn: async ({ signal }) => {\n const providers = (await container.resolve(API_AUTH_TOKEN).identityProvidersGetAll({ signal })).data;\n if (!Array.isArray(providers)) {\n throw new Error('Invalid response for identity providers. Backend is most likely misconfigured.');\n }\n\n const providersWithAvailability: IdentityProviderWithAvailability[] = [];\n for (const provider of providers) {\n try {\n await axios.get(provider.discovery_url, {\n signal,\n timeout: 3000,\n });\n providersWithAvailability.push({\n isAvailable: true,\n provider,\n });\n } catch (error: unknown) {\n console.error(`Identity provider ${provider.name} is not available`, error);\n if (oidcConfiguration?.name === provider.name) {\n container.resolve(AuthenticationService).next(undefined);\n }\n providersWithAvailability.push({\n isAvailable: false,\n provider,\n });\n }\n }\n return providersWithAvailability;\n },\n queryKey: container.resolve(QueryClientService).getGenericKey(COMMON_QUERY_KEY.IDENTITY_PROVIDERS),\n staleTime: Infinity,\n });\n\n const availableIdentityProviders = useMemo<IdentityProviderWithAvailability[]>(() => {\n return identityProvidersWithAvailability?.filter(x => x.isAvailable) ?? [];\n }, [identityProvidersWithAvailability]);\n\n useEffect(() => {\n container.resolve(NavigationHistoryService).navigationHistory.push(location.pathname);\n container.resolve(LogService).log([{\n detail: {\n pathname: location.pathname,\n },\n level: CommonDbLogLevel.INFO,\n topic: 'USER_NAVIGATION',\n }]);\n }, [location.pathname]);\n\n useEffect(() => {\n if (identityProvidersWithAvailability?.length === 1 && availableIdentityProviders.length === 1) {\n container.resolve(AuthenticationService).next(identityProvidersWithAvailability[0].provider);\n }\n }, [availableIdentityProviders.length, identityProvidersWithAvailability]);\n\n const userManager = useMemo<UserManager>(() => {\n if (!oidcConfiguration || !availableIdentityProviders?.length) {\n return null;\n }\n\n // Validate the storage\n const identityProvider = identityProvidersWithAvailability.find(x => x.provider.name === oidcConfiguration.name)?.provider;\n if (!identityProvider || JSON.stringify(oidcConfiguration) !== JSON.stringify(identityProvider)) {\n container.resolve(AuthenticationService).next(undefined);\n return null;\n }\n WindowService.getInstance().window.userManager = new UserManager(UserManagerUtil.getSettings(oidcConfiguration));\n return WindowService.getInstance().window.userManager;\n }, [availableIdentityProviders, identityProvidersWithAvailability, oidcConfiguration]);\n\n const onSignin = useCallback(() => {\n container.resolve(LogService).log([{\n level: CommonDbLogLevel.INFO,\n topic: 'USER_LOGIN',\n }]);\n }, []);\n\n const onTryAgainButtonClick = useCallback(() => {\n window.location.reload();\n }, []);\n\n if (isIdentityProvidersLoading) {\n return <Spinner />;\n }\n\n if (identityProvidersError) {\n return (\n <PageContainer\n singleAction\n testIdAttributes={TestIdUtil.createAttributes('ErrorPage')}\n title={t('Error')}\n >\n <Box\n sx={{\n marginY: 2,\n textAlign: 'center',\n }}\n >\n <Typography>\n {t('{{applicationName}} is currently unavailable. Please try again later.', { applicationName: config.applicationName })}\n </Typography>\n <Box sx={{ marginTop: 2 }}>\n <Button\n onClick={onTryAgainButtonClick}\n variant={'outlined'}\n >\n {t`Try again`}\n </Button>\n </Box>\n </Box>\n </PageContainer>\n );\n }\n\n if (!oidcConfiguration) {\n return (\n <ChooseIdentityProviderPage identityProvidersWithAvailability={identityProvidersWithAvailability} />\n );\n }\n\n const HomePage = container.resolve(RouterService).homePageComponent;\n\n return (\n <AuthProvider\n onSigninCallback={onSignin}\n userManager={userManager}\n >\n <AuthenticationWrapper>\n <ApplicationBootstrapWithAuthentication>\n <AuthorizationWrapper>\n <UserInactivityConfirmation />\n <NotificationsStack />\n <StrictMode>\n {location?.pathname === '/' ? <HomePage /> : <Outlet />}\n </StrictMode>\n </AuthorizationWrapper>\n </ApplicationBootstrapWithAuthentication>\n </AuthenticationWrapper>\n </AuthProvider>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8CA,IAAaK,UAAmB;CAC9B,IAAM,EAAE,SAAMC,EAAe,GACvBC,IAAWC,EAAY,GACvBC,IAASC,EAAU,GAEnBC,IAAoBC,EAAgBC,EAAU,QAAQC,CAAqB,CAAC,GAE5E,EAAE,MA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AAA,CAAC;IACI,CAAA;GACL,CAAA,CACF;;CACQ,CAAA;CAInB,IAAI,CAAC1B,GACH,OACE,kBAACkC,GAAD,EAA+D,qCAAoC,CAAA;CAIvG,IAAMC,IAAWjC,EAAU,QAAQkC,CAAa,CAAC,CAAC;CAElD,OACE,kBAACC,GAAD;EACE,kBAAkBb;EACL;EAEb,UAAA,kBAACc,GAAD,EAAA,UACE,kBAACC,GAAD,EAAA,UACE,kBAACC,GAAD,EAAA,UAAA;GACE,kBAACC,GAAD,CAA6B,CAAA;GAC7B,kBAACjD,GAAD,CAAqB,CAAA;GACrB,kBAACkD,GAAD,EAAA,UACG9C,GAAU,aAAa,MAAM,kBAACuC,GAAD,CAAW,CAAA,IAAI,kBAACQ,GAAD,CAAS,CAAA,EAC5C,CAAA;EACQ,EAAA,CAAA,EACgB,CAAA,EACnB,CAAA;CACX,CAAA;AAElB"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["UserManager","useQueryMemo","QueryClientService","NotificationsStack","axios","RouterRoot","useTranslation","location","useLocation","config","useConfig","oidcConfiguration","useSubscribable","container","AuthenticationService","identityProvidersWithAvailability","identityProvidersError","isIdentityProvidersLoading","providers","API_AUTH_TOKEN","providersWithAvailability","provider","error","COMMON_QUERY_KEY","availableIdentityProviders","useMemo","x","useEffect","NavigationHistoryService","LogService","CommonDbLogLevel","userManager","identityProvider","windowService","WindowService","UserManagerUtil","onSignin","useCallback","onTryAgainButtonClick","Spinner","PageContainer","TestIdUtil","t","Box","Typography","Button","ChooseIdentityProviderPage","HomePage","RouterService","AuthProvider","AuthenticationWrapper","ApplicationBootstrapWithAuthentication","AuthorizationWrapper","UserInactivityConfirmation","StrictMode","Outlet"],"sources":["../../../../src/components/app/RouterRoot/RouterRoot.tsx"],"sourcesContent":["import { container } from 'tsyringe';\nimport {\n StrictMode,\n useCallback,\n useEffect,\n useMemo,\n} from 'react';\nimport {\n Outlet,\n useLocation,\n} from 'react-router-dom';\nimport { AuthProvider } from 'react-oidc-context';\nimport { UserManager } from 'oidc-client-ts';\nimport axios from 'axios';\nimport {\n Box,\n Button,\n Typography,\n} from '@mui/material';\nimport { CommonDbLogLevel } from '@gen-epix/api-commondb';\nimport { useTranslation } from 'react-i18next';\nimport { TestIdUtil } from '@gen-epix/ui-core/utils/TestIdUtil';\nimport { useSubscribable } from '@gen-epix/ui-core/hooks/useSubscribable';\nimport { Spinner } from '@gen-epix/ui-core-components/components/Spinner';\nimport { WindowService } from '@gen-epix/ui-core/classes/services/WindowService';\n\nimport { API_AUTH_TOKEN } from '../../../constants/api.constants';\nimport { AuthenticationService } from '../../../classes/services/AuthenticationService';\nimport { LogService } from '../../../classes/services/LogService';\nimport { NavigationHistoryService } from '../../../classes/services/NavigationHistoryService';\nimport { ChooseIdentityProviderPage } from '../../../pages/ChooseIdentityProviderPage';\nimport { UserManagerUtil } from '../../../utils/UserManagerUtil';\nimport { NotificationsStack } from '../../ui/Notifications';\nimport { UserInactivityConfirmation } from '../../ui/UserInactivityConfirmation';\nimport type { IdentityProviderWithAvailability } from '../../../models/auth.models';\nimport { useConfig } from '../../../hooks/useConfig';\nimport { PageContainer } from '../../ui/PageContainer';\nimport { useQueryMemo } from '../../../hooks/useQueryMemo';\nimport { ApplicationBootstrapWithAuthentication } from '../ApplicationBootstrapWithAuthentication';\nimport { AuthenticationWrapper } from '../AuthenticationWrapper';\nimport { AuthorizationWrapper } from '../AuthorizationWrapper';\nimport { QueryClientService } from '../../../classes/services/QueryClientService';\nimport { COMMON_QUERY_KEY } from '../../../constants/query.constants';\nimport { RouterService } from '../../../classes/services/RouterService';\n\n\nexport const RouterRoot = () => {\n const { t } = useTranslation();\n const location = useLocation();\n const config = useConfig();\n\n const oidcConfiguration = useSubscribable(container.resolve(AuthenticationService));\n\n const { data: identityProvidersWithAvailability, error: identityProvidersError, isLoading: isIdentityProvidersLoading } = useQueryMemo<IdentityProviderWithAvailability[], Error, IdentityProviderWithAvailability[]>({\n gcTime: Infinity,\n queryFn: async ({ signal }) => {\n const providers = (await container.resolve(API_AUTH_TOKEN).identityProvidersGetAll({ signal })).data;\n if (!Array.isArray(providers)) {\n throw new Error('Invalid response for identity providers. Backend is most likely misconfigured.');\n }\n\n const providersWithAvailability: IdentityProviderWithAvailability[] = [];\n for (const provider of providers) {\n try {\n await axios.get(provider.discovery_url, {\n signal,\n timeout: 3000,\n });\n providersWithAvailability.push({\n isAvailable: true,\n provider,\n });\n } catch (error: unknown) {\n console.error(`Identity provider ${provider.name} is not available`, error);\n if (oidcConfiguration?.name === provider.name) {\n container.resolve(AuthenticationService).next(undefined);\n }\n providersWithAvailability.push({\n isAvailable: false,\n provider,\n });\n }\n }\n return providersWithAvailability;\n },\n queryKey: container.resolve(QueryClientService).getGenericKey(COMMON_QUERY_KEY.IDENTITY_PROVIDERS),\n staleTime: Infinity,\n });\n\n const availableIdentityProviders = useMemo<IdentityProviderWithAvailability[]>(() => {\n return identityProvidersWithAvailability?.filter(x => x.isAvailable) ?? [];\n }, [identityProvidersWithAvailability]);\n\n useEffect(() => {\n container.resolve(NavigationHistoryService).navigationHistory.push(location.pathname);\n container.resolve(LogService).log([{\n detail: {\n pathname: location.pathname,\n },\n level: CommonDbLogLevel.INFO,\n topic: 'USER_NAVIGATION',\n }]);\n }, [location.pathname]);\n\n useEffect(() => {\n if (identityProvidersWithAvailability?.length === 1 && availableIdentityProviders.length === 1) {\n container.resolve(AuthenticationService).next(identityProvidersWithAvailability[0].provider);\n }\n }, [availableIdentityProviders.length, identityProvidersWithAvailability]);\n\n const userManager = useMemo<UserManager>(() => {\n if (!oidcConfiguration || !availableIdentityProviders?.length) {\n return null;\n }\n\n // Validate the storage\n const identityProvider = identityProvidersWithAvailability.find(x => x.provider.name === oidcConfiguration.name)?.provider;\n if (!identityProvider || JSON.stringify(oidcConfiguration) !== JSON.stringify(identityProvider)) {\n container.resolve(AuthenticationService).next(undefined);\n return null;\n }\n const windowService = container.resolve(WindowService);\n windowService.window.userManager = new UserManager(UserManagerUtil.getSettings(oidcConfiguration));\n return windowService.window.userManager;\n }, [availableIdentityProviders, identityProvidersWithAvailability, oidcConfiguration]);\n\n const onSignin = useCallback(() => {\n container.resolve(LogService).log([{\n level: CommonDbLogLevel.INFO,\n topic: 'USER_LOGIN',\n }]);\n }, []);\n\n const onTryAgainButtonClick = useCallback(() => {\n window.location.reload();\n }, []);\n\n if (isIdentityProvidersLoading) {\n return <Spinner />;\n }\n\n if (identityProvidersError) {\n return (\n <PageContainer\n singleAction\n testIdAttributes={TestIdUtil.createAttributes('ErrorPage')}\n title={t('Error')}\n >\n <Box\n sx={{\n marginY: 2,\n textAlign: 'center',\n }}\n >\n <Typography>\n {t('{{applicationName}} is currently unavailable. Please try again later.', { applicationName: config.applicationName })}\n </Typography>\n <Box sx={{ marginTop: 2 }}>\n <Button\n onClick={onTryAgainButtonClick}\n variant={'outlined'}\n >\n {t`Try again`}\n </Button>\n </Box>\n </Box>\n </PageContainer>\n );\n }\n\n if (!oidcConfiguration) {\n return (\n <ChooseIdentityProviderPage identityProvidersWithAvailability={identityProvidersWithAvailability} />\n );\n }\n\n const HomePage = container.resolve(RouterService).homePageComponent;\n\n return (\n <AuthProvider\n onSigninCallback={onSignin}\n userManager={userManager}\n >\n <AuthenticationWrapper>\n <ApplicationBootstrapWithAuthentication>\n <AuthorizationWrapper>\n <UserInactivityConfirmation />\n <NotificationsStack />\n <StrictMode>\n {location?.pathname === '/' ? <HomePage /> : <Outlet />}\n </StrictMode>\n </AuthorizationWrapper>\n </ApplicationBootstrapWithAuthentication>\n </AuthenticationWrapper>\n </AuthProvider>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8CA,IAAaK,UAAmB;CAC9B,IAAM,EAAE,SAAMC,EAAe,GACvBC,IAAWC,EAAY,GACvBC,IAASC,EAAU,GAEnBC,IAAoBC,EAAgBC,EAAU,QAAQC,CAAqB,CAAC,GAE5E,EAAE,MAAMC,GAAmC,OAAOC,GAAwB,WAAWC,MAA+BhB,EAA4F;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CAAA,CACF;;CACQ,CAAA;CAInB,IAAI,CAAC3B,GACH,OACE,kBAACmC,GAAD,EAA+D,qCAAoC,CAAA;CAIvG,IAAMC,IAAWlC,EAAU,QAAQmC,CAAa,CAAC,CAAC;CAElD,OACE,kBAACC,GAAD;EACE,kBAAkBb;EACL;EAEb,UAAA,kBAACc,GAAD,EAAA,UACE,kBAACC,GAAD,EAAA,UACE,kBAACC,GAAD,EAAA,UAAA;GACE,kBAACC,GAAD,CAA6B,CAAA;GAC7B,kBAAClD,GAAD,CAAqB,CAAA;GACrB,kBAACmD,GAAD,EAAA,UACG/C,GAAU,aAAa,MAAM,kBAACwC,GAAD,CAAW,CAAA,IAAI,kBAACQ,GAAD,CAAS,CAAA,EAC5C,CAAA;EACQ,EAAA,CAAA,EACgB,CAAA,EACnB,CAAA;CACX,CAAA;AAElB"}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { API_ORGANIZATION_TOKEN as e } from "../../../constants/api.constants.js";
|
|
2
|
+
import { ResponseHandler as t } from "../../ui/ResponseHandler/index.js";
|
|
3
|
+
import { t as n } from "../../../_chunks/useQueryMemo.js";
|
|
4
4
|
import { container as r } from "tsyringe";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
5
|
+
import { Box as i, Card as a, CardContent as o, Link as s, Typography as c } from "@mui/material";
|
|
6
|
+
import { useEffect as l, useMemo as u } from "react";
|
|
7
|
+
import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
8
8
|
import { useTranslation as p } from "react-i18next";
|
|
9
9
|
import { withDialog as m } from "@gen-epix/ui-core-components/hoc/withDialog";
|
|
10
10
|
import { useArray as h } from "@gen-epix/ui-core/hooks/useArray";
|
|
11
|
-
|
|
11
|
+
// src/components/epi/EpiContactDetailsDialog/EpiContactDetailsDialog.tsx
|
|
12
12
|
var g = m(({ onTitleChange: m, openProps: g }) => {
|
|
13
|
-
let { t: _ } = p(), v =
|
|
14
|
-
queryFn: async ({ signal:
|
|
13
|
+
let { t: _ } = p(), v = u(() => ["contacts", g.organizationId], [g.organizationId]), y = n({
|
|
14
|
+
queryFn: async ({ signal: t }) => (await r.resolve(e).retrieveOrganizationContacts({ organization_id: g.organizationId }, { signal: t })).data,
|
|
15
15
|
queryKey: v
|
|
16
16
|
});
|
|
17
|
-
|
|
17
|
+
l(() => {
|
|
18
18
|
m(_("{{organizationName}} contact details", { organizationName: g.organizationName }));
|
|
19
19
|
}, [
|
|
20
20
|
g.organizationName,
|
|
@@ -22,45 +22,45 @@ var g = m(({ onTitleChange: m, openProps: g }) => {
|
|
|
22
22
|
_
|
|
23
23
|
]);
|
|
24
24
|
let b = h([y]);
|
|
25
|
-
return /* @__PURE__ */
|
|
25
|
+
return /* @__PURE__ */ d(i, { children: /* @__PURE__ */ f(t, {
|
|
26
26
|
loadables: b,
|
|
27
|
-
children: [!y.data?.contacts?.length && /* @__PURE__ */
|
|
27
|
+
children: [!y.data?.contacts?.length && /* @__PURE__ */ d(i, { children: _`No contact details found for this organization` }), y?.data?.sites?.map((e) => {
|
|
28
28
|
let t = y.data?.contacts?.filter((t) => t.site_id === e.id);
|
|
29
|
-
return /* @__PURE__ */
|
|
29
|
+
return /* @__PURE__ */ f(i, {
|
|
30
30
|
sx: { marginBottom: 2 },
|
|
31
31
|
children: [
|
|
32
|
-
/* @__PURE__ */
|
|
32
|
+
/* @__PURE__ */ d(c, {
|
|
33
33
|
variant: "h5",
|
|
34
34
|
children: e.name
|
|
35
35
|
}),
|
|
36
|
-
t.length === 0 && /* @__PURE__ */
|
|
36
|
+
t.length === 0 && /* @__PURE__ */ d(c, {
|
|
37
37
|
component: "div",
|
|
38
38
|
children: _`No contact details found for this site`
|
|
39
39
|
}),
|
|
40
|
-
t.length > 0 && /* @__PURE__ */
|
|
40
|
+
t.length > 0 && /* @__PURE__ */ d(i, {
|
|
41
41
|
sx: {
|
|
42
42
|
display: "grid",
|
|
43
43
|
gap: 2,
|
|
44
44
|
gridTemplateColumns: "1fr 1fr"
|
|
45
45
|
},
|
|
46
|
-
children: t.map((e) => /* @__PURE__ */
|
|
46
|
+
children: t.map((e) => /* @__PURE__ */ d(a, {
|
|
47
47
|
elevation: 2,
|
|
48
48
|
square: !0,
|
|
49
|
-
children: /* @__PURE__ */
|
|
50
|
-
/* @__PURE__ */
|
|
49
|
+
children: /* @__PURE__ */ f(o, { children: [
|
|
50
|
+
/* @__PURE__ */ d(c, {
|
|
51
51
|
component: "div",
|
|
52
52
|
variant: "h6",
|
|
53
53
|
children: e.name
|
|
54
54
|
}),
|
|
55
|
-
/* @__PURE__ */
|
|
55
|
+
/* @__PURE__ */ f(i, { children: [e.email && /* @__PURE__ */ d(s, {
|
|
56
56
|
href: `mailto:${e.email}`,
|
|
57
57
|
children: e.email
|
|
58
|
-
}), !e.email && /* @__PURE__ */
|
|
58
|
+
}), !e.email && /* @__PURE__ */ d(c, {
|
|
59
59
|
component: "div",
|
|
60
60
|
variant: "body1",
|
|
61
61
|
children: _`Email address: unknown`
|
|
62
62
|
})] }),
|
|
63
|
-
/* @__PURE__ */
|
|
63
|
+
/* @__PURE__ */ d(c, {
|
|
64
64
|
component: "div",
|
|
65
65
|
variant: "body1",
|
|
66
66
|
children: e.phone ? e.phone : _`Phone number: unknown`
|
|
@@ -78,7 +78,6 @@ var g = m(({ onTitleChange: m, openProps: g }) => {
|
|
|
78
78
|
maxWidth: "md",
|
|
79
79
|
testId: "EpiContactDetailsDialog"
|
|
80
80
|
});
|
|
81
|
-
//#endregion
|
|
82
81
|
export { g as EpiContactDetailsDialog };
|
|
83
82
|
|
|
84
83
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,23 +1,22 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { Box as e } from "@mui/material";
|
|
2
|
+
import { useMemo as t } from "react";
|
|
3
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
4
4
|
import { Select as r } from "@gen-epix/ui-core-form/components/fields/Select";
|
|
5
|
-
|
|
5
|
+
// src/components/filters/BooleanFilterField/BooleanFilterField.tsx
|
|
6
6
|
var i = ({ filter: i }) => {
|
|
7
|
-
let a =
|
|
7
|
+
let a = t(() => [{
|
|
8
8
|
label: "Yes",
|
|
9
9
|
value: !0
|
|
10
10
|
}, {
|
|
11
11
|
label: "No",
|
|
12
12
|
value: !1
|
|
13
13
|
}], []);
|
|
14
|
-
return /* @__PURE__ */
|
|
14
|
+
return /* @__PURE__ */ n(e, { children: /* @__PURE__ */ n(r, {
|
|
15
15
|
label: i.label,
|
|
16
16
|
name: i.id,
|
|
17
17
|
options: a
|
|
18
18
|
}) });
|
|
19
19
|
};
|
|
20
|
-
//#endregion
|
|
21
20
|
export { i as BooleanFilterField };
|
|
22
21
|
|
|
23
22
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Box as e } from "@mui/material";
|
|
2
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
3
3
|
import { DateRangePicker as n } from "@gen-epix/ui-core-form/components/fields/DateRangePicker";
|
|
4
|
-
|
|
5
|
-
var r = ({ filter: r }) => /* @__PURE__ */ e
|
|
4
|
+
// src/components/filters/DateFilterField/DateFilterField.tsx
|
|
5
|
+
var r = ({ filter: r }) => /* @__PURE__ */ t(e, { children: /* @__PURE__ */ t(n, {
|
|
6
6
|
dateFormat: r.dateFormat,
|
|
7
7
|
label: r.label,
|
|
8
8
|
maxDate: r.maxDate,
|
|
9
9
|
minDate: r.minDate,
|
|
10
10
|
name: r.id
|
|
11
11
|
}) });
|
|
12
|
-
//#endregion
|
|
13
12
|
export { r as DateFilterField };
|
|
14
13
|
|
|
15
14
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,20 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Box as e } from "@mui/material";
|
|
2
|
+
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
3
3
|
import { CheckboxGroup as r } from "@gen-epix/ui-core-form/components/fields/CheckboxGroup";
|
|
4
4
|
import { Autocomplete as i } from "@gen-epix/ui-core-form/components/fields/Autocomplete";
|
|
5
|
-
|
|
6
|
-
var a = ({ filter: a }) => /* @__PURE__ */
|
|
5
|
+
// src/components/filters/GeoFilterField/GeoFilterField.tsx
|
|
6
|
+
var a = ({ filter: a }) => /* @__PURE__ */ n(e, { children: [a.options.length <= 5 && /* @__PURE__ */ t(r, {
|
|
7
7
|
label: a.label,
|
|
8
8
|
name: a.id,
|
|
9
9
|
options: a.options
|
|
10
|
-
}), a.options.length > 5 && /* @__PURE__ */
|
|
10
|
+
}), a.options.length > 5 && /* @__PURE__ */ t(i, {
|
|
11
11
|
label: a.label,
|
|
12
12
|
multiple: !0,
|
|
13
13
|
name: a.id,
|
|
14
14
|
options: a.options,
|
|
15
15
|
shouldSortOptions: !0
|
|
16
16
|
})] });
|
|
17
|
-
//#endregion
|
|
18
17
|
export { a as GeoFilterField };
|
|
19
18
|
|
|
20
19
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,19 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Box as e } from "@mui/material";
|
|
2
|
+
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
3
3
|
import { CheckboxGroup as r } from "@gen-epix/ui-core-form/components/fields/CheckboxGroup";
|
|
4
4
|
import { Autocomplete as i } from "@gen-epix/ui-core-form/components/fields/Autocomplete";
|
|
5
|
-
|
|
6
|
-
var a = ({ filter: a }) => /* @__PURE__ */
|
|
5
|
+
// src/components/filters/MultiSelectFilterField/MultiSelectFilterField.tsx
|
|
6
|
+
var a = ({ filter: a }) => /* @__PURE__ */ n(e, { children: [a.options.length <= a.maxNumOptionsExpanded && /* @__PURE__ */ t(r, {
|
|
7
7
|
label: a.label,
|
|
8
8
|
name: a.id,
|
|
9
9
|
options: a.options
|
|
10
|
-
}), a.options.length > a.maxNumOptionsExpanded && /* @__PURE__ */
|
|
10
|
+
}), a.options.length > a.maxNumOptionsExpanded && /* @__PURE__ */ t(i, {
|
|
11
11
|
label: a.label,
|
|
12
12
|
multiple: !0,
|
|
13
13
|
name: a.id,
|
|
14
14
|
options: a.options
|
|
15
15
|
})] });
|
|
16
|
-
//#endregion
|
|
17
16
|
export { a as MultiSelectFilterField };
|
|
18
17
|
|
|
19
18
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Box as e } from "@mui/material";
|
|
2
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
3
3
|
import { NumberRangeInput as n } from "@gen-epix/ui-core-form/components/fields/NumberRangeInput";
|
|
4
|
-
|
|
5
|
-
var r = ({ filter: r }) => /* @__PURE__ */ e
|
|
4
|
+
// src/components/filters/NumberRangeFilterField/NumberRangeFilterField.tsx
|
|
5
|
+
var r = ({ filter: r }) => /* @__PURE__ */ t(e, { children: /* @__PURE__ */ t(n, {
|
|
6
6
|
label: r.label,
|
|
7
7
|
max: r.max,
|
|
8
8
|
min: r.min,
|
|
9
9
|
name: r.id
|
|
10
10
|
}) });
|
|
11
|
-
//#endregion
|
|
12
11
|
export { r as NumberRangeFilterField };
|
|
13
12
|
|
|
14
13
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Box as e } from "@mui/material";
|
|
2
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
3
3
|
import { TextField as n } from "@gen-epix/ui-core-form/components/fields/TextField";
|
|
4
|
-
|
|
5
|
-
var r = ({ filter: r }) => /* @__PURE__ */ e
|
|
4
|
+
// src/components/filters/TextFilterField/TextFilterField.tsx
|
|
5
|
+
var r = ({ filter: r }) => /* @__PURE__ */ t(e, { children: /* @__PURE__ */ t(n, {
|
|
6
6
|
label: r.label,
|
|
7
7
|
name: r.id
|
|
8
8
|
}) });
|
|
9
|
-
//#endregion
|
|
10
9
|
export { r as TextFilterField };
|
|
11
10
|
|
|
12
11
|
//# sourceMappingURL=index.js.map
|