@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,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { t as n } from "../../../_chunks/
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { CONFIG_TOKEN as e } from "../../../constants/config.constants.js";
|
|
2
|
+
import { t } from "../../../_chunks/decorateParam.js";
|
|
3
|
+
import { t as n } from "../../../_chunks/decorate.js";
|
|
4
|
+
import { inject as r, singleton as i } from "tsyringe";
|
|
5
|
+
import { StringUtil as a } from "@gen-epix/ui-core/utils/StringUtil";
|
|
6
6
|
import { Subject as o } from "@gen-epix/ui-core/classes/Subject";
|
|
7
7
|
import { SubscribableAbstract as s } from "@gen-epix/ui-core/classes/abstracts/SubscribableAbstract";
|
|
8
|
-
|
|
8
|
+
// src/classes/services/NotificationService/NotificationService.ts
|
|
9
9
|
var c = class extends s {
|
|
10
10
|
config;
|
|
11
11
|
notificationTimeouts;
|
|
@@ -41,7 +41,7 @@ var c = class extends s {
|
|
|
41
41
|
} : t)), clearTimeout(this.notificationTimeouts[e]), delete this.notificationTimeouts[e];
|
|
42
42
|
}
|
|
43
43
|
showNotification(e) {
|
|
44
|
-
let t =
|
|
44
|
+
let t = a.createUuid(), n = e.autoHideAfterMs ?? this.config.notifications.autoHideAfterMs;
|
|
45
45
|
return this.subject.next([{
|
|
46
46
|
...e,
|
|
47
47
|
autoHideAfterMs: n,
|
|
@@ -49,15 +49,14 @@ var c = class extends s {
|
|
|
49
49
|
timestamp: (/* @__PURE__ */ new Date()).getTime(),
|
|
50
50
|
visible: !0
|
|
51
51
|
}, ...this.subject.data]), isFinite(n) && (this.notificationTimeouts[t] = setTimeout(() => {
|
|
52
|
-
this.subject.next(this.subject.data.map((e) => e.key === t ? {
|
|
52
|
+
delete this.notificationTimeouts[t], this.subject.next(this.subject.data.map((e) => e.key === t ? {
|
|
53
53
|
...e,
|
|
54
54
|
visible: !1
|
|
55
55
|
} : e));
|
|
56
56
|
}, n)), t;
|
|
57
57
|
}
|
|
58
58
|
};
|
|
59
|
-
c =
|
|
60
|
-
//#endregion
|
|
59
|
+
c = n([i(), t(0, r(e))], c);
|
|
61
60
|
export { c as NotificationService };
|
|
62
61
|
|
|
63
62
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_decorate","_decorateParam","__decorate","
|
|
1
|
+
{"version":3,"file":"index.js","names":["_decorate","_decorateParam","__decorate","NotificationService","SubscribableAbstract","Subject","config","x","key","StringUtil","autoHideAfterMs","notification","singleton","__decorateParam","inject","CONFIG_TOKEN"],"sources":["../../../../src/classes/services/NotificationService/NotificationService.ts"],"sourcesContent":["import { StringUtil } from '@gen-epix/ui-core/utils/StringUtil';\nimport { SubscribableAbstract } from '@gen-epix/ui-core/classes/abstracts/SubscribableAbstract';\nimport { Subject } from '@gen-epix/ui-core/classes/Subject';\nimport {\n inject,\n singleton,\n} from 'tsyringe';\n\nimport type { Notification } from '../../../models/notification.models';\nimport { CONFIG_TOKEN } from '../../../constants/config.constants';\nimport type { ConfigBase } from '../../../models/config.models';\n\n@singleton()\nexport class NotificationService extends SubscribableAbstract<Notification[]> {\n private readonly config: Pick<ConfigBase, 'notifications'>;\n private readonly notificationTimeouts: Record<string, ReturnType<typeof setTimeout>>;\n\n public constructor(@inject(CONFIG_TOKEN) config: ConfigBase) {\n super(new Subject<Notification[]>([]));\n this.config = config;\n this.notificationTimeouts = {};\n }\n\n\n public clearNotification(key: string): void {\n this.subject.next(this.subject.data.filter(x => x.key !== key));\n if (this.notificationTimeouts[key]) {\n clearTimeout(this.notificationTimeouts[key]);\n delete this.notificationTimeouts[key];\n }\n }\n\n public clearNotifications(): void {\n this.subject.next([]);\n Object.keys(this.notificationTimeouts).forEach(key => {\n clearTimeout(this.notificationTimeouts[key]);\n delete this.notificationTimeouts[key];\n });\n }\n\n public fulfillNotification(key: string, message: Notification['message'], severity: Notification['severity']): void {\n this.subject.next(this.subject.data.map(x => {\n if (x.key === key) {\n return {\n ...x,\n isLoading: false,\n message,\n severity,\n };\n }\n return x;\n }));\n }\n\n public hideAllNotifications(): void {\n this.subject.next(this.subject.data.map(x => ({\n ...x,\n visible: false,\n })));\n }\n\n public hideNotification(key: string): void {\n this.subject.next(this.subject.data.map(x => {\n if (x.key === key) {\n return {\n ...x,\n visible: false,\n };\n }\n return x;\n }));\n clearTimeout(this.notificationTimeouts[key]);\n delete this.notificationTimeouts[key];\n }\n\n public showNotification(notification: Omit<Notification, 'key' | 'timestamp' | 'visible'>): string {\n const key = StringUtil.createUuid();\n const autoHideAfterMs = notification.autoHideAfterMs ?? this.config.notifications.autoHideAfterMs;\n\n this.subject.next([\n {\n ...notification,\n autoHideAfterMs,\n key,\n timestamp: new Date().getTime(),\n visible: true,\n },\n ...this.subject.data,\n ]);\n\n if (isFinite(autoHideAfterMs)) {\n this.notificationTimeouts[key] = setTimeout(() => {\n delete this.notificationTimeouts[key];\n this.subject.next(this.subject.data.map(x => {\n if (x.key === key) {\n return {\n ...x,\n visible: false,\n };\n }\n return x;\n }));\n }, autoHideAfterMs);\n }\n return key;\n }\n}\n"],"mappings":";;;;;;;;AAaO,IAAMG,IAAN,cAAkCC,EAAqC;CAC5E;CACA;CAEA,YAAmB,GAA0C;EAG3D,AAFA,MAAM,IAAIC,EAAwB,CAAC,CAAC,CAAC,GACrC,KAAK,SAASC,GACd,KAAK,uBAAuB,CAAC;CAC/B;CAGA,kBAAyB,GAAmB;EAE1C,AADA,KAAK,QAAQ,KAAK,KAAK,Q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AK,QAAQ,KAAK,KAAI,MAClCD,EAAE,QAAQC,IACL;IACL,GAAGD;IACH,SAAS;GACX,IAEKA,CACR,CAAC;EACJ,GAAGG,CAAe,IAEbF;CACT;AACF;AA9FC,IAAAR,EAAA,CAAAY,EAAU,GAAAX,EAAA,GAKWa,EAAOC,CAAY,CAAA,CAAA,GAAAZ,CAAA"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { t as
|
|
4
|
-
import { inject as
|
|
1
|
+
import { CONFIG_TOKEN as e } from "../../../constants/config.constants.js";
|
|
2
|
+
import { t } from "../../../_chunks/decorateParam.js";
|
|
3
|
+
import { t as n } from "../../../_chunks/decorate.js";
|
|
4
|
+
import { inject as r, singleton as i } from "tsyringe";
|
|
5
|
+
import { WindowService as a } from "@gen-epix/ui-core/classes/services/WindowService";
|
|
5
6
|
import { EventBusAbstract as o } from "@gen-epix/ui-core/classes/abstracts/EventBusAbstract";
|
|
6
|
-
|
|
7
|
+
// src/classes/services/PageEventBusService/PageEventBusService.ts
|
|
7
8
|
var s = class extends o {
|
|
8
9
|
lastPageEventPayload = null;
|
|
9
10
|
windowService;
|
|
@@ -54,16 +55,18 @@ var s = class extends o {
|
|
|
54
55
|
}
|
|
55
56
|
traverseDom(e, t) {
|
|
56
57
|
if (t(e)) return e;
|
|
57
|
-
for (let n of Array.from(e.childNodes))
|
|
58
|
+
for (let n of Array.from(e.childNodes)) {
|
|
59
|
+
let e = this.traverseDom(n, t);
|
|
60
|
+
if (e) return e;
|
|
61
|
+
}
|
|
58
62
|
return null;
|
|
59
63
|
}
|
|
60
64
|
};
|
|
61
|
-
s =
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
+
s = n([
|
|
66
|
+
i(),
|
|
67
|
+
t(0, r(e)),
|
|
68
|
+
t(1, r(a))
|
|
65
69
|
], s);
|
|
66
|
-
//#endregion
|
|
67
70
|
export { s as PageEventBusService };
|
|
68
71
|
|
|
69
72
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_decorate","_decorateParam","__decorate","
|
|
1
|
+
{"version":3,"file":"index.js","names":["_decorate","_decorateParam","__decorate","PageEventBusService","EventBusAbstract","windowService","config","eventName","payload","enablePageEvents","closestButton","event","closestLink","closestElement","context","buttonTitle","childTextNode","el","nodeWithText","predicate","element","child","found","singleton","__decorateParam","inject","CONFIG_TOKEN","WindowService"],"sources":["../../../../src/classes/services/PageEventBusService/PageEventBusService.ts"],"sourcesContent":["import type { CommonDbUser } from '@gen-epix/api-commondb';\nimport { EventBusAbstract } from '@gen-epix/ui-core/classes/abstracts/EventBusAbstract';\nimport { WindowService } from '@gen-epix/ui-core/classes/services/WindowService';\nimport {\n inject,\n singleton,\n} from 'tsyringe';\n\nimport { CONFIG_TOKEN } from '../../../constants/config.constants';\nimport type { ConfigBase } from '../../../models/config.models';\n\ntype EpiEvent = {\n changePage: Page;\n changeUser: CommonDbUser;\n click: {\n context?: string;\n label: string;\n page?: Page;\n type: 'button' | 'link' | 'table-row-index' | 'table-row';\n };\n error: Error;\n};\n\ntype Page = {\n location: Location;\n pageName: string;\n};\n\n@singleton()\nexport class PageEventBusService extends EventBusAbstract<EpiEvent> {\n private lastPageEventPayload: string = null;\n private readonly windowService: WindowService;\n\n public constructor(\n @inject(CONFIG_TOKEN) config: ConfigBase,\n @inject(WindowService) windowService: WindowService,\n ) {\n super();\n this.windowService = windowService;\n this.setupClickEventListener(config.enablePageEvents);\n }\n\n\n public emit<TEventName extends keyof EpiEvent>(eventName: TEventName, payload?: EpiEvent[TEventName]): void {\n if (eventName === 'changePage') {\n if (this.lastPageEventPayload === (payload as EpiEvent['changePage']).pageName) {\n return;\n }\n this.lastPageEventPayload = (payload as EpiEvent['changePage']).pageName;\n }\n\n if (eventName === 'click' && !(payload as EpiEvent['click']).page) {\n (payload as EpiEvent['click']).page = this.getPage();\n }\n\n super.emit(eventName, payload);\n }\n\n public getPage(): Page {\n return {\n location: this.windowService.window.location,\n pageName: document.querySelector('[data-page-container]')?.getAttribute('data-testid'),\n };\n }\n\n private setupClickEventListener(enablePageEvents: boolean): void {\n if (!enablePageEvents) {\n return;\n }\n this.windowService.window.addEventListener('click', (event: Event): void => {\n\n const closestButton = (event.target as HTMLElement).closest('button');\n const closestLink = (event.target as HTMLElement).closest('a');\n const closestElement = closestButton || closestLink;\n\n if (closestElement) {\n const context = closestElement?.closest('[data-testid]')?.getAttribute('data-testid') ?? '';\n\n const buttonTitle = closestElement.getAttribute('aria-label') ?? closestElement.getAttribute('title');\n if (buttonTitle) {\n this.emit('click', {\n context,\n label: buttonTitle,\n type: closestButton ? 'button' : 'link',\n });\n } else {\n const childTextNode = this.traverseDom(closestElement, (el) => el.nodeType === Node.TEXT_NODE);\n if (childTextNode?.nodeValue) {\n this.emit('click', {\n context,\n label: childTextNode?.nodeValue,\n type: closestButton ? 'button' : 'link',\n });\n } else {\n const nodeWithText = this.traverseDom(closestElement, (el) => !!el.innerText);\n if (nodeWithText?.innerText) {\n this.emit('click', {\n context,\n label: nodeWithText?.innerText.split('\\n')[0],\n type: closestButton ? 'button' : 'link',\n });\n }\n }\n }\n }\n });\n }\n\n private traverseDom(element: HTMLElement, predicate: (element: HTMLElement) => boolean): HTMLElement {\n if (predicate(element)) {\n return element;\n }\n for (const child of Array.from(element.childNodes)) {\n const found = this.traverseDom(child as HTMLElement, predicate);\n if (found) {\n return found;\n }\n }\n return null;\n }\n}\n"],"mappings":";;;;;;;AA6BO,IAAMG,IAAN,cAAkCC,EAA2B;CAClE,uBAAuC;CACvC;CAEA,YACE,GACA,GACA;EAGA,AAFA,MAAM,GACN,KAAK,gBAAgBC,GACrB,KAAK,wBAAwBC,EAAO,gBAAgB;CACtD;CAGA,KAA+C,GAAuB,GAAsC;EAC1G,IAAIC,MAAc,cAAc;GAC9B,IAAI,KAAK,yBAA0BC,EAAmC,UACpE;GAEF,KAAK,uBAAwBA,EAAmC;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ClD,IAAME,IAAQ,KAAK,YAAYD,GAAsBF,CAAS;GAC9D,IAAIG,GACF,OAAOA;EAEX;EACA,OAAO;CACT;AACF;;CA5FCC,EAAU;CAMNtB,EAAA,GAAAwB,EAAOC,CAAY,CAAA;CACnBzB,EAAA,GAAAwB,EAAOE,CAAa,CAAA"}
|
|
@@ -1,29 +1,26 @@
|
|
|
1
1
|
import { t as e } from "../../../_chunks/decorate.js";
|
|
2
2
|
import { singleton as t } from "tsyringe";
|
|
3
3
|
import { createBrowserRouter as n } from "react-router-dom";
|
|
4
|
-
|
|
4
|
+
// src/classes/services/RouterService/RouterService.ts
|
|
5
5
|
var r = class {
|
|
6
6
|
get adminRoutes() {
|
|
7
|
-
if (!this.__adminRoutesFactory) throw Error("RouterService not initialized");
|
|
8
7
|
return this.__adminRoutes ??= this.__adminRoutesFactory(), this.__adminRoutes;
|
|
9
8
|
}
|
|
10
9
|
get homePageComponent() {
|
|
11
|
-
if (!this.__homePageComponent) throw Error("RouterService not initialized");
|
|
12
10
|
return this.__homePageComponent;
|
|
13
11
|
}
|
|
14
12
|
get router() {
|
|
15
13
|
return this.__router ||= n(this.routes), this.__router;
|
|
16
14
|
}
|
|
17
15
|
get routes() {
|
|
18
|
-
if (!this.__routesFactory) throw Error("RouterService not initialized");
|
|
19
16
|
return this.__routes ??= this.__routesFactory(), this.__routes;
|
|
20
17
|
}
|
|
21
18
|
__adminRoutes = null;
|
|
22
|
-
__adminRoutesFactory
|
|
23
|
-
__homePageComponent
|
|
19
|
+
__adminRoutesFactory;
|
|
20
|
+
__homePageComponent;
|
|
24
21
|
__router = null;
|
|
25
22
|
__routes = null;
|
|
26
|
-
__routesFactory
|
|
23
|
+
__routesFactory;
|
|
27
24
|
constructor(e) {
|
|
28
25
|
this.__homePageComponent = e.homePageComponent, this.__adminRoutesFactory = this.createRoutesFactory(e.adminRoutes), this.__routesFactory = this.createRoutesFactory(e.routes);
|
|
29
26
|
}
|
|
@@ -32,7 +29,6 @@ var r = class {
|
|
|
32
29
|
}
|
|
33
30
|
};
|
|
34
31
|
r = e([t()], r);
|
|
35
|
-
//#endregion
|
|
36
32
|
export { r as RouterService };
|
|
37
33
|
|
|
38
34
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_decorate","__decorate","RouterService","createBrowserRouter","kwArgs","routes","singleton"],"sources":["../../../../src/classes/services/RouterService/RouterService.ts"],"sourcesContent":["import type { ReactElement } from 'react';\nimport { createBrowserRouter } from 'react-router-dom';\nimport { singleton } from 'tsyringe';\n\nimport type { MyNonIndexRouteObject } from '../../../models/react-router.models';\n\ntype HomePage = () => ReactElement;\ntype RoutesFactory = () => MyNonIndexRouteObject[];\ntype RoutesInput = MyNonIndexRouteObject[] | RoutesFactory;\n\n@singleton()\nexport class RouterService {\n public get adminRoutes(): MyNonIndexRouteObject[] {\n
|
|
1
|
+
{"version":3,"file":"index.js","names":["_decorate","__decorate","RouterService","createBrowserRouter","kwArgs","routes","singleton"],"sources":["../../../../src/classes/services/RouterService/RouterService.ts"],"sourcesContent":["import type { ReactElement } from 'react';\nimport { createBrowserRouter } from 'react-router-dom';\nimport { singleton } from 'tsyringe';\n\nimport type { MyNonIndexRouteObject } from '../../../models/react-router.models';\n\ntype HomePage = () => ReactElement;\ntype RoutesFactory = () => MyNonIndexRouteObject[];\ntype RoutesInput = MyNonIndexRouteObject[] | RoutesFactory;\n\n@singleton()\nexport class RouterService {\n public get adminRoutes(): MyNonIndexRouteObject[] {\n this.__adminRoutes ??= this.__adminRoutesFactory();\n return this.__adminRoutes;\n }\n public get homePageComponent(): HomePage {\n return this.__homePageComponent;\n }\n public get router(): ReturnType<typeof createBrowserRouter> {\n if (!this.__router) {\n this.__router = createBrowserRouter(this.routes);\n }\n return this.__router;\n }\n public get routes(): MyNonIndexRouteObject[] {\n this.__routes ??= this.__routesFactory();\n return this.__routes;\n }\n private __adminRoutes: MyNonIndexRouteObject[] | null = null;\n private readonly __adminRoutesFactory: RoutesFactory;\n\n private readonly __homePageComponent: HomePage;\n\n private __router: null | ReturnType<typeof createBrowserRouter> = null;\n\n private __routes: MyNonIndexRouteObject[] | null = null;\n\n private readonly __routesFactory: RoutesFactory;\n\n public constructor(kwArgs: {\n adminRoutes: RoutesInput;\n homePageComponent: HomePage;\n routes: RoutesInput;\n }) {\n this.__homePageComponent = kwArgs.homePageComponent;\n this.__adminRoutesFactory = this.createRoutesFactory(kwArgs.adminRoutes);\n this.__routesFactory = this.createRoutesFactory(kwArgs.routes);\n }\n\n\n private createRoutesFactory(routes: RoutesInput): RoutesFactory {\n if (typeof routes === 'function') {\n return routes;\n }\n return () => routes;\n }\n}\n"],"mappings":";;;;AAWO,IAAME,IAAN,MAAoB;CACzB,IAAW,cAAuC;EAEhD,OADA,KAAK,kBAAkB,KAAK,qBAAqB,GAC1C,KAAK;CACd;CACA,IAAW,oBAA8B;EACvC,OAAO,KAAK;CACd;CACA,IAAW,SAAiD;EAI1D,OAHA,AACE,KAAK,aAAWC,EAAoB,KAAK,MAAM,GAE1C,KAAK;CACd;CACA,IAAW,SAAkC;EAE3C,OADA,KAAK,aAAa,KAAK,gBAAgB,GAChC,KAAK;CACd;CACA,gBAAwD;CACxD;CAEA;CAEA,WAAkE;CAElE,WAAmD;CAEnD;CAEA,YAAmB,GAIhB;EAGD,AAFA,KAAK,sBAAsBC,EAAO,mBAClC,KAAK,uBAAuB,KAAK,oBAAoBA,EAAO,WAAW,GACvE,KAAK,kBAAkB,KAAK,oBAAoBA,EAAO,MAAM;CAC/D;CAGA,oBAA4B,GAAoC;EAI9D,OAHI,OAAOC,KAAW,aACbA,UAEIA;CACf;AACF;AA/CC,IAAAL,EAAA,CAAAM,EAAU,CAAA,GAAAJ,CAAA"}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { t as e } from "../../../_chunks/decorate.js";
|
|
2
2
|
import { singleton as t } from "tsyringe";
|
|
3
|
-
|
|
3
|
+
// src/classes/services/UserSettingsService/UserSettingsService.ts
|
|
4
4
|
var n = class {
|
|
5
5
|
showShowUserFeedbackTooltip = !0;
|
|
6
6
|
};
|
|
7
7
|
n = e([t()], n);
|
|
8
|
-
//#endregion
|
|
9
8
|
export { n as UserSettingsService };
|
|
10
9
|
|
|
11
10
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,46 +1,41 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t } from "../../../
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import { jsx as
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
S
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
FallbackComponent: c,
|
|
36
|
-
children: /* @__PURE__ */ p(u, { children: /* @__PURE__ */ p(b, {}) })
|
|
37
|
-
})]
|
|
38
|
-
})
|
|
1
|
+
import { API_BASE_TOKEN as e } from "../../../constants/api.constants.js";
|
|
2
|
+
import { RouterService as t } from "../../../classes/services/RouterService/index.js";
|
|
3
|
+
import { useConfig as n } from "../../../hooks/useConfig/index.js";
|
|
4
|
+
import { AuthenticationService as r } from "../../../classes/services/AuthenticationService/index.js";
|
|
5
|
+
import { LogService as i } from "../../../classes/services/LogService/index.js";
|
|
6
|
+
import { t as a } from "../../../_chunks/QueryClientProvider.js";
|
|
7
|
+
import { t as o } from "../../../_chunks/QueryClientService.js";
|
|
8
|
+
import { ErrorPage as s } from "../../../pages/ErrorPage/index.js";
|
|
9
|
+
import { BackendVersionService as c } from "../../../classes/services/BackendVersionService/index.js";
|
|
10
|
+
import { ApplicationBootstrapWithoutAuthorization as l } from "../ApplicationBootstrapWithoutAuthorization/index.js";
|
|
11
|
+
import { EmotionCacheService as u } from "../../../classes/services/EmotionCacheService/index.js";
|
|
12
|
+
import { container as d } from "tsyringe";
|
|
13
|
+
import { CssBaseline as f, ThemeProvider as p } from "@mui/material";
|
|
14
|
+
import { jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
15
|
+
import { RouterProvider as g } from "react-router-dom";
|
|
16
|
+
import { CacheProvider as _ } from "@emotion/react";
|
|
17
|
+
import { ErrorBoundary as v } from "react-error-boundary";
|
|
18
|
+
// src/components/app/AppRouterProvider/AppRouterProvider.tsx
|
|
19
|
+
var y = () => /* @__PURE__ */ m(g, { router: d.resolve(t).router }), b = () => {
|
|
20
|
+
let t = n(), g = d.resolve(r), b = d.resolve(i), x = t.getTouchIconUrl();
|
|
21
|
+
x && document.querySelector("link[rel=\"icon\"]")?.setAttribute("href", x);
|
|
22
|
+
let S = d.resolve(e);
|
|
23
|
+
S.baseUrl = t.getAPIBaseUrl(), S.defaultRequestTimeout = t.defaultRequestTimeout, S.onRequest = [g.onRequest.bind(g), b.onRequest.bind(b)], S.onResponseFulfilled = [b.onResponseFulfilled.bind(b), d.resolve(c).onResponseFulfilled.bind(d.resolve(c))], S.onResponseRejected = [b.onResponseRejected.bind(b), g.onResponseRejected.bind(g)];
|
|
24
|
+
let C = d.resolve(o), w = d.resolve(u).emotionCache;
|
|
25
|
+
return /* @__PURE__ */ m(a, {
|
|
26
|
+
client: C.queryClient,
|
|
27
|
+
children: /* @__PURE__ */ m(_, {
|
|
28
|
+
value: w,
|
|
29
|
+
children: /* @__PURE__ */ h(p, {
|
|
30
|
+
theme: t.theme,
|
|
31
|
+
children: [/* @__PURE__ */ m(f, {}), /* @__PURE__ */ m(v, {
|
|
32
|
+
FallbackComponent: s,
|
|
33
|
+
children: /* @__PURE__ */ m(l, { children: /* @__PURE__ */ m(y, {}) })
|
|
34
|
+
})]
|
|
39
35
|
})
|
|
40
36
|
})
|
|
41
37
|
});
|
|
42
38
|
};
|
|
43
|
-
|
|
44
|
-
export { x as App };
|
|
39
|
+
export { b as App };
|
|
45
40
|
|
|
46
41
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["QueryClientService","AppRouterProvider","RouterProvider","container","RouterService","App","config","
|
|
1
|
+
{"version":3,"file":"index.js","names":["QueryClientProvider","QueryClientService","AppRouterProvider","RouterProvider","container","RouterService","App","config","useConfig","authenticationService","AuthenticationService","logService","LogService","touchIconUrl","api","API_BASE_TOKEN","BackendVersionService","queryClientService","emotionCache","EmotionCacheService","CacheProvider","ThemeProvider","CssBaseline","ErrorBoundary","ErrorPage","ApplicationBootstrapWithoutAuthorization"],"sources":["../../../../src/components/app/AppRouterProvider/AppRouterProvider.tsx","../../../../src/components/app/App/App.tsx"],"sourcesContent":["import { container } from 'tsyringe';\nimport { RouterProvider } from 'react-router-dom';\n\nimport { RouterService } from '../../../classes/services/RouterService';\n\nexport const AppRouterProvider = () => <RouterProvider router={container.resolve(RouterService).router} />;\n","import { container } from 'tsyringe';\nimport type { DependencyContainer } from 'tsyringe';\nimport { CacheProvider } from '@emotion/react';\nimport {\n CssBaseline,\n ThemeProvider,\n} from '@mui/material';\nimport { QueryClientProvider } from '@tanstack/react-query';\nimport { ErrorBoundary } from 'react-error-boundary';\n\nimport { API_BASE_TOKEN } from '../../../constants/api.constants';\nimport { BackendVersionService } from '../../../classes/services/BackendVersionService';\nimport { QueryClientService } from '../../../classes/services/QueryClientService';\nimport { ErrorPage } from '../../../pages/ErrorPage';\nimport { EmotionCacheService } from '../../../classes/services/EmotionCacheService';\nimport { AuthenticationService } from '../../../classes/services/AuthenticationService';\nimport { LogService } from '../../../classes/services/LogService';\nimport { ApplicationBootstrapWithoutAuthorization } from '../ApplicationBootstrapWithoutAuthorization';\nimport { AppRouterProvider } from '../AppRouterProvider/AppRouterProvider';\nimport { useConfig } from '../../../hooks/useConfig';\n\nexport type AppProps = {\n readonly container: DependencyContainer;\n};\n\nexport const App = () => {\n const config = useConfig();\n\n const authenticationService = container.resolve(AuthenticationService);\n const logService = container.resolve(LogService);\n const touchIconUrl = config.getTouchIconUrl();\n if (touchIconUrl) {\n document.querySelector('link[rel=\"icon\"]')?.setAttribute('href', touchIconUrl);\n }\n const api = container.resolve(API_BASE_TOKEN);\n api.baseUrl = config.getAPIBaseUrl();\n api.defaultRequestTimeout = config.defaultRequestTimeout;\n api.onRequest = [\n authenticationService.onRequest.bind(authenticationService),\n logService.onRequest.bind(logService),\n ];\n api.onResponseFulfilled = [\n logService.onResponseFulfilled.bind(logService),\n container.resolve(BackendVersionService).onResponseFulfilled.bind(container.resolve(BackendVersionService)),\n ];\n api.onResponseRejected = [\n logService.onResponseRejected.bind(logService),\n authenticationService.onResponseRejected.bind(authenticationService),\n ];\n\n const queryClientService = container.resolve(QueryClientService);\n const emotionCache = container.resolve(EmotionCacheService).emotionCache;\n\n return (\n <QueryClientProvider client={queryClientService.queryClient}>\n <CacheProvider value={emotionCache}>\n <ThemeProvider theme={config.theme}>\n <CssBaseline />\n <ErrorBoundary FallbackComponent={ErrorPage}>\n <ApplicationBootstrapWithoutAuthorization>\n <AppRouterProvider />\n </ApplicationBootstrapWithoutAuthorization>\n </ErrorBoundary>\n </ThemeProvider>\n </CacheProvider>\n </QueryClientProvider>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAKA,IAAaE,UAA0B,kBAACC,GAAD,EAAgB,QAAQC,EAAU,QAAQC,CAAa,CAAC,CAAC,OAAS,CAAA,GCoB5FC,UAAY;CACvB,IAAMC,IAASC,EAAU,GAEnBC,IAAwBL,EAAU,QAAQM,CAAqB,GAC/DC,IAAaP,EAAU,QAAQQ,CAAU,GACzCC,IAAeN,EAAO,gBAAgB;CAC5C,AAAIM,KACF,SAAS,cAAc,oBAAkB,CAAC,EAAE,aAAa,QAAQA,CAAY;CAE/E,IAAMC,IAAMV,EAAU,QAAQW,CAAc;CAW5C,AAVA,EAAI,UAAUR,EAAO,cAAc,GACnC,EAAI,wBAAwBA,EAAO,uBACnC,EAAI,YAAY,CACdE,EAAsB,UAAU,KAAKA,CAAqB,GAC1DE,EAAW,UAAU,KAAKA,CAAU,CACtC,GACA,EAAI,sBAAsB,CACxBA,EAAW,oBAAoB,KAAKA,CAAU,GAC9CP,EAAU,QAAQY,CAAqB,CAAC,CAAC,oBAAoB,KAAKZ,EAAU,QAAQY,CAAqB,CAAC,CAC5G,GACA,EAAI,qBAAqB,CACvBL,EAAW,mBAAmB,KAAKA,CAAU,GAC7CF,EAAsB,mBAAmB,KAAKA,CAAqB,CACrE;CAEA,IAAMQ,IAAqBb,EAAU,QAAQH,CAAkB,GACzDiB,IAAed,EAAU,QAAQe,CAAmB,CAAC,CAAC;CAE5D,OACE,kBAACnB,GAAD;EAAqB,QAAQiB,EAAmB;EAC9C,UAAA,kBAACG,GAAD;GAAe,OAAOF;GACpB,UAAA,kBAACG,GAAD;IAAe,OAAOd,EAAO;IAA7B,UAAA,CACE,kBAACe,GAAD,CAAc,CAAA,GACd,kBAACC,GAAD;KAAe,mBAAmBC;KAChC,UAAA,kBAACC,GAAD,EAAA,UACE,kBAACvB,GAAD,CAAoB,CAAA,EACoB,CAAA;IAC7B,CAAA,CACF;;EACF,CAAA;CACI,CAAA;AAEzB"}
|
|
@@ -1,82 +1,81 @@
|
|
|
1
1
|
import { t as e } from "../../../_chunks/OutageUtil.js";
|
|
2
|
-
import { t } from "../../../_chunks/
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
2
|
+
import { t } from "../../../_chunks/react.js";
|
|
3
|
+
import { outagesStore as n } from "../../../stores/outagesStore/index.js";
|
|
4
|
+
import { API_SYSTEM_TOKEN as r } from "../../../constants/api.constants.js";
|
|
5
|
+
import { PageContainer as i } from "../../ui/PageContainer/index.js";
|
|
6
|
+
import { ResponseHandler as a } from "../../ui/ResponseHandler/index.js";
|
|
7
|
+
import { t as o } from "../../../_chunks/useQueryMemo.js";
|
|
8
|
+
import { t as s } from "../../../_chunks/QueryClientService.js";
|
|
9
9
|
import { COMMON_QUERY_KEY as c } from "../../../constants/query.constants.js";
|
|
10
10
|
import { t as l } from "../../../_chunks/OutageList.js";
|
|
11
11
|
import "../../ui/OutageList/index.js";
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
12
|
+
import { container as u } from "tsyringe";
|
|
13
|
+
import { WindowService as d } from "@gen-epix/ui-core/classes/services/WindowService";
|
|
14
|
+
import { Box as f, Button as p } from "@mui/material";
|
|
15
|
+
import { useCallback as m, useEffect as h, useMemo as g, useState as _ } from "react";
|
|
16
|
+
import { jsx as v, jsxs as y } from "react/jsx-runtime";
|
|
17
17
|
import { useTranslation as b } from "react-i18next";
|
|
18
18
|
import { TestIdUtil as x } from "@gen-epix/ui-core/utils/TestIdUtil";
|
|
19
19
|
import { useArray as S } from "@gen-epix/ui-core/hooks/useArray";
|
|
20
|
-
|
|
20
|
+
// src/components/app/ApplicationBootstrapWithAuthentication/ApplicationBootstrapWithAuthentication.tsx
|
|
21
21
|
var C = ({ children: C }) => {
|
|
22
|
-
let { t: w } = b(), T =
|
|
22
|
+
let { t: w } = b(), T = t(n, (e) => e.setCategorizedOutages), [E, D] = _(!1), [O, k] = _(!1), A = o({
|
|
23
23
|
gcTime: Infinity,
|
|
24
|
-
queryFn: async ({ signal: e }) => (await
|
|
25
|
-
queryKey:
|
|
24
|
+
queryFn: async ({ signal: e }) => (await u.resolve(r).retrieveOutages({ signal: e })).data,
|
|
25
|
+
queryKey: u.resolve(s).getGenericKey(c.OUTAGES),
|
|
26
26
|
refetchInterval: 3e5,
|
|
27
27
|
staleTime: Infinity
|
|
28
|
-
}), j = S([A]), M =
|
|
29
|
-
u.
|
|
30
|
-
}, []), P =
|
|
28
|
+
}), j = S([A]), M = g(() => e.getCategorizedOutages(A.data ?? []), [A.data]), N = m(() => {
|
|
29
|
+
u.resolve(d).window.location.reload();
|
|
30
|
+
}, []), P = m(() => {
|
|
31
31
|
D(!0);
|
|
32
32
|
}, []);
|
|
33
|
-
return
|
|
33
|
+
return h(() => {
|
|
34
34
|
M && T(M);
|
|
35
|
-
let e = u.
|
|
35
|
+
let e = u.resolve(d), t = e.window.setTimeout(() => {
|
|
36
36
|
k(!0);
|
|
37
37
|
}, 5e3);
|
|
38
38
|
return () => {
|
|
39
|
-
|
|
39
|
+
e.window.clearTimeout(t);
|
|
40
40
|
};
|
|
41
|
-
}, [M, T]), !E && !A.isLoading && !A.error && M.activeOutages?.length > 0 ? /* @__PURE__ */
|
|
41
|
+
}, [M, T]), !E && !A.isLoading && !A.error && M.activeOutages?.length > 0 ? /* @__PURE__ */ y(i, {
|
|
42
42
|
singleAction: !0,
|
|
43
43
|
testIdAttributes: x.createAttributes("OutagePage"),
|
|
44
44
|
title: w`Outages`,
|
|
45
|
-
children: [/* @__PURE__ */
|
|
45
|
+
children: [/* @__PURE__ */ v(l, {
|
|
46
46
|
activeOutages: M.activeOutages,
|
|
47
47
|
soonActiveOutages: M.soonActiveOutages,
|
|
48
48
|
visibleOutages: M.visibleOutages
|
|
49
|
-
}), /* @__PURE__ */
|
|
49
|
+
}), /* @__PURE__ */ y(f, {
|
|
50
50
|
sx: {
|
|
51
51
|
display: "flex",
|
|
52
52
|
gap: 1,
|
|
53
53
|
justifyContent: "flex-end"
|
|
54
54
|
},
|
|
55
|
-
children: [/* @__PURE__ */
|
|
55
|
+
children: [/* @__PURE__ */ v(p, {
|
|
56
56
|
disabled: !O,
|
|
57
57
|
onClick: P,
|
|
58
58
|
variant: "outlined",
|
|
59
59
|
children: w`Continue anyway`
|
|
60
|
-
}), /* @__PURE__ */
|
|
60
|
+
}), /* @__PURE__ */ v(p, {
|
|
61
61
|
disabled: !O,
|
|
62
62
|
onClick: N,
|
|
63
63
|
variant: "contained",
|
|
64
64
|
children: w`Retry`
|
|
65
65
|
})]
|
|
66
66
|
})]
|
|
67
|
-
}) : A.error || A.isLoading ? /* @__PURE__ */
|
|
67
|
+
}) : A.error || A.isLoading ? /* @__PURE__ */ v(i, {
|
|
68
68
|
ignorePageEvent: !0,
|
|
69
69
|
singleAction: !0,
|
|
70
70
|
testIdAttributes: x.createAttributes("OutagesLoadingPage"),
|
|
71
71
|
title: w`Outages`,
|
|
72
|
-
children: /* @__PURE__ */
|
|
72
|
+
children: /* @__PURE__ */ v(a, {
|
|
73
73
|
loadables: j,
|
|
74
74
|
loadingMessage: w`Loading`,
|
|
75
75
|
children: C
|
|
76
76
|
})
|
|
77
77
|
}) : C;
|
|
78
78
|
};
|
|
79
|
-
//#endregion
|
|
80
79
|
export { C as ApplicationBootstrapWithAuthentication };
|
|
81
80
|
|
|
82
81
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["OutageUtil","useQueryMemo","
|
|
1
|
+
{"version":3,"file":"index.js","names":["OutageUtil","useQueryMemo","QueryClientService","OutageList","ApplicationBootstrapWithAuthentication","useTranslation","setCategorizedOutages","useStore","outagesStore","state","shouldContinue","setShouldContinue","useState","buttonsEnabled","setButtonsEnabled","outagesQuery","container","API_SYSTEM_TOKEN","COMMON_QUERY_KEY","outagesLoadables","useArray","categorizedOutages","useMemo","onRetryButtonClick","useCallback","WindowService","onContinuButtonClick","useEffect","windowService","timeout","PageContainer","TestIdUtil","Box","Button","ResponseHandler","children"],"sources":["../../../../src/components/app/ApplicationBootstrapWithAuthentication/ApplicationBootstrapWithAuthentication.tsx"],"sourcesContent":["import { container } from 'tsyringe';\nimport {\n useCallback,\n useEffect,\n useMemo,\n useState,\n} from 'react';\nimport type {\n PropsWithChildren,\n ReactNode,\n} from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { useStore } from 'zustand';\nimport {\n Box,\n Button,\n} from '@mui/material';\nimport { TestIdUtil } from '@gen-epix/ui-core/utils/TestIdUtil';\nimport { useArray } from '@gen-epix/ui-core/hooks/useArray';\nimport { WindowService } from '@gen-epix/ui-core/classes/services/WindowService';\n\nimport { API_SYSTEM_TOKEN } from '../../../constants/api.constants';\nimport { useQueryMemo } from '../../../hooks/useQueryMemo';\nimport { outagesStore } from '../../../stores/outagesStore';\nimport { OutageUtil } from '../../../utils/OutageUtil';\nimport { QueryClientService } from '../../../classes/services/QueryClientService';\nimport { OutageList } from '../../ui/OutageList';\nimport { PageContainer } from '../../ui/PageContainer';\nimport { ResponseHandler } from '../../ui/ResponseHandler';\nimport { COMMON_QUERY_KEY } from '../../../constants/query.constants';\n\n\nexport const ApplicationBootstrapWithAuthentication = ({ children }: PropsWithChildren): ReactNode => {\n const { t } = useTranslation();\n\n const setCategorizedOutages = useStore(outagesStore, (state) => state.setCategorizedOutages);\n const [shouldContinue, setShouldContinue] = useState(false);\n const [buttonsEnabled, setButtonsEnabled] = useState(false);\n\n const outagesQuery = useQueryMemo({\n gcTime: Infinity,\n queryFn: async ({ signal }) => (await container.resolve(API_SYSTEM_TOKEN).retrieveOutages({ signal })).data,\n queryKey: container.resolve(QueryClientService).getGenericKey(COMMON_QUERY_KEY.OUTAGES),\n refetchInterval: 5 * 60 * 1000,\n staleTime: Infinity,\n });\n\n const outagesLoadables = useArray([outagesQuery]);\n\n const categorizedOutages = useMemo(() => {\n return OutageUtil.getCategorizedOutages(outagesQuery.data ?? []);\n }, [outagesQuery.data]);\n\n const onRetryButtonClick = useCallback(() => {\n container.resolve(WindowService).window.location.reload();\n }, []);\n\n const onContinuButtonClick = useCallback(() => {\n setShouldContinue(true);\n }, []);\n\n useEffect(() => {\n if (categorizedOutages) {\n setCategorizedOutages(categorizedOutages);\n }\n\n const windowService = container.resolve(WindowService);\n const timeout = windowService.window.setTimeout(() => {\n setButtonsEnabled(true);\n }, 5000);\n\n return () => {\n windowService.window.clearTimeout(timeout);\n };\n }, [categorizedOutages, setCategorizedOutages]);\n\n const shouldShowOutagePage = !shouldContinue && !outagesQuery.isLoading && !outagesQuery.error && categorizedOutages.activeOutages?.length > 0;\n\n if (shouldShowOutagePage) {\n return (\n <PageContainer\n singleAction\n testIdAttributes={TestIdUtil.createAttributes('OutagePage')}\n title={t`Outages`}\n >\n <OutageList\n activeOutages={categorizedOutages.activeOutages}\n soonActiveOutages={categorizedOutages.soonActiveOutages}\n visibleOutages={categorizedOutages.visibleOutages}\n />\n <Box\n sx={{\n display: 'flex',\n gap: 1,\n justifyContent: 'flex-end',\n }}\n >\n <Button\n disabled={!buttonsEnabled}\n onClick={onContinuButtonClick}\n variant={'outlined'}\n >\n {t`Continue anyway`}\n </Button>\n <Button\n disabled={!buttonsEnabled}\n onClick={onRetryButtonClick}\n variant={'contained'}\n >\n {t`Retry`}\n </Button>\n </Box>\n </PageContainer>\n );\n }\n if (outagesQuery.error || outagesQuery.isLoading) {\n return (\n <PageContainer\n ignorePageEvent\n singleAction\n testIdAttributes={TestIdUtil.createAttributes('OutagesLoadingPage')}\n title={t`Outages`}\n >\n <ResponseHandler\n loadables={outagesLoadables}\n loadingMessage={t`Loading`}\n >\n {children}\n </ResponseHandler>\n </PageContainer>\n );\n\n }\n\n return children;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAgCA,IAAaI,KAA0C,EAAE,kBAA6C;CACpG,IAAM,EAAE,SAAMC,EAAe,GAEvBC,IAAwBC,EAASC,IAAe,MAAUC,EAAM,qBAAqB,GACrF,CAACC,GAAgBC,KAAqBC,EAAS,EAAK,GACpD,CAACC,GAAgBC,KAAqBF,EAAS,EAAK,GAEpDG,IAAed,EAAa;EAChC,QAAQ;EACR,SAAS,OAAO,EAAE,iBAAc,MAAMe,EAAU,QAAQC,CAAgB,CAAC,CAAC,gBAAgB,EAAE,UAAO,CAAC,EAAA,CAAG;EACvG,UAAUD,EAAU,QAAQd,CAAkB,CAAC,CAAC,cAAcgB,EAAiB,OAAO;EACtF,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