@burdenoff/microfe-notification 2026.1124.1 → 2026.1127.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AdminNotificationRoutes.js +59 -51
- package/dist/AdminNotificationRoutes.js.map +1 -1
- package/dist/NotificationRoutes.js +76 -68
- package/dist/NotificationRoutes.js.map +1 -1
- package/dist/UserNotificationRoutes.js +39 -31
- package/dist/UserNotificationRoutes.js.map +1 -1
- package/dist/components/NotificationListFooter.js +1 -1
- package/dist/components/NotificationListFooter.js.map +1 -1
- package/dist/components/NotificationPanel.js +0 -1
- package/dist/components/NotificationPanel.js.map +1 -1
- package/dist/components/loadingSystem.d.ts +64 -0
- package/dist/components/loadingSystem.js +34 -0
- package/dist/components/loadingSystem.js.map +1 -0
- package/dist/graphql/global-client.js +34 -34
- package/dist/index.js +9 -11
- package/dist/navigation-v2/AdminPageV2.js +23 -16
- package/dist/navigation-v2/AdminPageV2.js.map +1 -1
- package/dist/navigation-v2/NotificationArchivedV2.js +104 -98
- package/dist/navigation-v2/NotificationArchivedV2.js.map +1 -1
- package/dist/navigation-v2/NotificationInboxV2.js +133 -127
- package/dist/navigation-v2/NotificationInboxV2.js.map +1 -1
- package/dist/navigation-v2/NotificationSettingsV2.js +91 -85
- package/dist/navigation-v2/NotificationSettingsV2.js.map +1 -1
- package/dist/navigation-v2/NotificationsV2Landing.js +31 -23
- package/dist/navigation-v2/NotificationsV2Landing.js.map +1 -1
- package/dist/pages/CreateNotificationPage.js +442 -432
- package/dist/pages/CreateNotificationPage.js.map +1 -1
- package/dist/pages/NotificationCenterPage.js +93 -87
- package/dist/pages/NotificationCenterPage.js.map +1 -1
- package/dist/pages/NotificationHistoryAdminPage.js +231 -225
- package/dist/pages/NotificationHistoryAdminPage.js.map +1 -1
- package/dist/pages/NotificationHistoryPage.js +72 -66
- package/dist/pages/NotificationHistoryPage.js.map +1 -1
- package/dist/pages/NotificationLandingPage.js +42 -34
- package/dist/pages/NotificationLandingPage.js.map +1 -1
- package/dist/pages/NotificationPreferencesPage.js +80 -71
- package/dist/pages/NotificationPreferencesPage.js.map +1 -1
- package/dist/pages/NotificationTemplatesPage.js +192 -181
- package/dist/pages/NotificationTemplatesPage.js.map +1 -1
- package/dist/pages/NotificationTopicsPage.js +124 -118
- package/dist/pages/NotificationTopicsPage.js.map +1 -1
- package/dist/pages/TemplateEditorPage.js +248 -233
- package/dist/pages/TemplateEditorPage.js.map +1 -1
- package/package.json +5 -2
- package/dist/components/index.js +0 -4
- package/dist/hooks/index.js +0 -8
- package/dist/node_modules/@apollo/client/errors/CombinedGraphQLErrors.js +0 -23
- package/dist/node_modules/@apollo/client/errors/CombinedGraphQLErrors.js.map +0 -1
- package/dist/node_modules/@apollo/client/errors/utils.js +0 -15
- package/dist/node_modules/@apollo/client/errors/utils.js.map +0 -1
- package/dist/node_modules/@apollo/client/link/core/ApolloLink.js +0 -51
- package/dist/node_modules/@apollo/client/link/core/ApolloLink.js.map +0 -1
- package/dist/node_modules/@apollo/client/link/subscriptions/index.js +0 -40
- package/dist/node_modules/@apollo/client/link/subscriptions/index.js.map +0 -1
- package/dist/node_modules/@apollo/client/link/utils/createOperation.js +0 -33
- package/dist/node_modules/@apollo/client/link/utils/createOperation.js.map +0 -1
- package/dist/node_modules/@apollo/client/utilities/caching/sizes.js +0 -5
- package/dist/node_modules/@apollo/client/utilities/caching/sizes.js.map +0 -1
- package/dist/node_modules/@apollo/client/utilities/graphql/print.js +0 -15
- package/dist/node_modules/@apollo/client/utilities/graphql/print.js.map +0 -1
- package/dist/node_modules/@apollo/client/utilities/internal/caches.js +0 -18
- package/dist/node_modules/@apollo/client/utilities/internal/caches.js.map +0 -1
- package/dist/node_modules/@apollo/client/utilities/internal/checkDocument.js +0 -20
- package/dist/node_modules/@apollo/client/utilities/internal/checkDocument.js.map +0 -1
- package/dist/node_modules/@apollo/client/utilities/internal/getMainDefinition.js +0 -16
- package/dist/node_modules/@apollo/client/utilities/internal/getMainDefinition.js.map +0 -1
- package/dist/node_modules/@apollo/client/utilities/internal/getMemoryInternals.js +0 -8
- package/dist/node_modules/@apollo/client/utilities/internal/getMemoryInternals.js.map +0 -1
- package/dist/node_modules/@apollo/client/utilities/internal/getOperationDefinition.js +0 -8
- package/dist/node_modules/@apollo/client/utilities/internal/getOperationDefinition.js.map +0 -1
- package/dist/node_modules/@apollo/client/utilities/internal/getOperationName.js +0 -7
- package/dist/node_modules/@apollo/client/utilities/internal/getOperationName.js.map +0 -1
- package/dist/node_modules/@apollo/client/utilities/internal/globals/global.js +0 -8
- package/dist/node_modules/@apollo/client/utilities/internal/globals/global.js.map +0 -1
- package/dist/node_modules/@apollo/client/utilities/internal/globals/maybe.js +0 -9
- package/dist/node_modules/@apollo/client/utilities/internal/globals/maybe.js.map +0 -1
- package/dist/node_modules/@apollo/client/utilities/internal/isNonNullObject.js +0 -7
- package/dist/node_modules/@apollo/client/utilities/internal/isNonNullObject.js.map +0 -1
- package/dist/node_modules/@apollo/client/utilities/internal/makeUniqueId.js +0 -9
- package/dist/node_modules/@apollo/client/utilities/internal/makeUniqueId.js.map +0 -1
- package/dist/node_modules/@apollo/client/utilities/internal/memoize.js +0 -22
- package/dist/node_modules/@apollo/client/utilities/internal/memoize.js.map +0 -1
- package/dist/node_modules/@apollo/client/utilities/internal/stringifyForDisplay.js +0 -9
- package/dist/node_modules/@apollo/client/utilities/internal/stringifyForDisplay.js.map +0 -1
- package/dist/node_modules/@apollo/client/utilities/invariant/index.js +0 -56
- package/dist/node_modules/@apollo/client/utilities/invariant/index.js.map +0 -1
- package/dist/node_modules/@apollo/client/version.js +0 -5
- package/dist/node_modules/@apollo/client/version.js.map +0 -1
- package/dist/node_modules/@wry/caches/lib/weak.js +0 -66
- package/dist/node_modules/@wry/caches/lib/weak.js.map +0 -1
- package/dist/node_modules/@wry/trie/lib/index.js +0 -52
- package/dist/node_modules/@wry/trie/lib/index.js.map +0 -1
- package/dist/node_modules/graphql-ws/dist/client.js +0 -279
- package/dist/node_modules/graphql-ws/dist/client.js.map +0 -1
- package/dist/node_modules/graphql-ws/dist/common-CGW11Fyb.js +0 -61
- package/dist/node_modules/graphql-ws/dist/common-CGW11Fyb.js.map +0 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/NotificationFactories.js +0 -20
- package/dist/node_modules/rxjs/dist/esm5/internal/NotificationFactories.js.map +0 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/Observable.js +0 -77
- package/dist/node_modules/rxjs/dist/esm5/internal/Observable.js.map +0 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/Subscriber.js +0 -116
- package/dist/node_modules/rxjs/dist/esm5/internal/Subscriber.js.map +0 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/Subscription.js +0 -96
- package/dist/node_modules/rxjs/dist/esm5/internal/Subscription.js.map +0 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/config.js +0 -11
- package/dist/node_modules/rxjs/dist/esm5/internal/config.js.map +0 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/observable/empty.js +0 -8
- package/dist/node_modules/rxjs/dist/esm5/internal/observable/empty.js.map +0 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/scheduler/timeoutProvider.js +0 -15
- package/dist/node_modules/rxjs/dist/esm5/internal/scheduler/timeoutProvider.js.map +0 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/symbol/observable.js +0 -7
- package/dist/node_modules/rxjs/dist/esm5/internal/symbol/observable.js.map +0 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/util/UnsubscriptionError.js +0 -12
- package/dist/node_modules/rxjs/dist/esm5/internal/util/UnsubscriptionError.js.map +0 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/util/arrRemove.js +0 -10
- package/dist/node_modules/rxjs/dist/esm5/internal/util/arrRemove.js.map +0 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/util/createErrorClass.js +0 -10
- package/dist/node_modules/rxjs/dist/esm5/internal/util/createErrorClass.js.map +0 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/util/errorContext.js +0 -21
- package/dist/node_modules/rxjs/dist/esm5/internal/util/errorContext.js.map +0 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/util/identity.js +0 -7
- package/dist/node_modules/rxjs/dist/esm5/internal/util/identity.js.map +0 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/util/isFunction.js +0 -7
- package/dist/node_modules/rxjs/dist/esm5/internal/util/isFunction.js.map +0 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/util/noop.js +0 -5
- package/dist/node_modules/rxjs/dist/esm5/internal/util/noop.js.map +0 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/util/pipe.js +0 -12
- package/dist/node_modules/rxjs/dist/esm5/internal/util/pipe.js.map +0 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/util/reportUnhandledError.js +0 -13
- package/dist/node_modules/rxjs/dist/esm5/internal/util/reportUnhandledError.js.map +0 -1
- package/dist/node_modules/tslib/tslib.es6.js +0 -51
- package/dist/node_modules/tslib/tslib.es6.js.map +0 -1
|
@@ -4,105 +4,113 @@ import { useNotification as n } from "./providers/NotificationProvider.js";
|
|
|
4
4
|
import { useTr as r } from "./shared/hooks/useTr.js";
|
|
5
5
|
import { NotificationCenterPage as i } from "./pages/NotificationCenterPage.js";
|
|
6
6
|
import { NotificationLandingPage as a } from "./pages/NotificationLandingPage.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
7
|
+
import { CompactMarkOr as o, SectionLoaderOr as s } from "./components/loadingSystem.js";
|
|
8
|
+
import { Suspense as c, lazy as l, useEffect as u } from "react";
|
|
9
|
+
import { PermissionGate as d } from "@burdenoff/fe-libs/shared/components";
|
|
10
|
+
import { useFeatureFlagDetails as f } from "@burdenoff/fe-libs/shared/feature-flags";
|
|
11
|
+
import { useGlobalUi as p } from "@burdenoff/fe-libs/shared/providers/shell";
|
|
12
|
+
import { Navigate as m, Route as h, Routes as g, useNavigate as _ } from "react-router";
|
|
13
|
+
import { jsx as v, jsxs as y } from "react/jsx-runtime";
|
|
13
14
|
// src/AdminNotificationRoutes.tsx
|
|
14
|
-
var
|
|
15
|
-
function
|
|
16
|
-
return /* @__PURE__ */
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
var b = l(() => import("./pages/NotificationHistoryAdminPage.js").then((e) => ({ default: e.NotificationHistoryAdminPage }))), x = l(() => import("./pages/NotificationTemplatesPage.js").then((e) => ({ default: e.NotificationTemplatesPage }))), S = l(() => import("./pages/TemplateEditorPage.js").then((e) => ({ default: e.TemplateEditorPage }))), C = l(() => import("./pages/CreateNotificationPage.js").then((e) => ({ default: e.CreateNotificationPage }))), w = l(() => import("./pages/NotificationTopicsPage.js").then((e) => ({ default: e.NotificationTopicsPage })));
|
|
16
|
+
function T() {
|
|
17
|
+
return /* @__PURE__ */ v(s, {
|
|
18
|
+
route: !0,
|
|
19
|
+
minHeight: "16rem",
|
|
20
|
+
today: /* @__PURE__ */ v("div", {
|
|
21
|
+
className: "flex h-64 items-center justify-center",
|
|
22
|
+
children: /* @__PURE__ */ v(o, {
|
|
23
|
+
className: "h-8 w-8",
|
|
24
|
+
today: /* @__PURE__ */ v("div", { className: "h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent" })
|
|
25
|
+
})
|
|
26
|
+
})
|
|
19
27
|
});
|
|
20
28
|
}
|
|
21
|
-
function
|
|
22
|
-
let { showToast: e } =
|
|
23
|
-
return
|
|
29
|
+
function E() {
|
|
30
|
+
let { showToast: e } = p(), t = _(), { basePath: i } = n(), a = r();
|
|
31
|
+
return u(() => {
|
|
24
32
|
e(a("notification.error.accessDeniedRedirect", "You do not have permission to access that notification page."), "warning"), t(`${i}/center`, { replace: !0 });
|
|
25
33
|
}, []), null;
|
|
26
34
|
}
|
|
27
|
-
function
|
|
35
|
+
function D(e) {
|
|
28
36
|
let { children: t, ...n } = e;
|
|
29
|
-
return /* @__PURE__ */
|
|
37
|
+
return /* @__PURE__ */ v(d, {
|
|
30
38
|
permission: n.permission,
|
|
31
39
|
permissions: n.permissions,
|
|
32
40
|
requireAll: n.requireAll,
|
|
33
|
-
loading: /* @__PURE__ */
|
|
34
|
-
fallback: /* @__PURE__ */
|
|
41
|
+
loading: /* @__PURE__ */ v(T, {}),
|
|
42
|
+
fallback: /* @__PURE__ */ v(E, {}),
|
|
35
43
|
children: t
|
|
36
44
|
});
|
|
37
45
|
}
|
|
38
|
-
function
|
|
39
|
-
let { basePath:
|
|
40
|
-
return /* @__PURE__ */
|
|
41
|
-
fallback: /* @__PURE__ */
|
|
42
|
-
children: /* @__PURE__ */
|
|
43
|
-
/* @__PURE__ */
|
|
46
|
+
function O() {
|
|
47
|
+
let { basePath: o = "/" } = n(), s = r(), l = `${o.endsWith("/") ? o.slice(0, -1) : o}/center`, u = f("notification.templates"), d = f("notification.create"), p = f("notification.history"), _ = u ? !!u.value : !1, E = d ? !!d.value : !1, O = p ? !!p.value : !1;
|
|
48
|
+
return /* @__PURE__ */ v(c, {
|
|
49
|
+
fallback: /* @__PURE__ */ v(T, {}),
|
|
50
|
+
children: /* @__PURE__ */ y(g, { children: [
|
|
51
|
+
/* @__PURE__ */ v(h, {
|
|
44
52
|
index: !0,
|
|
45
|
-
element: /* @__PURE__ */
|
|
53
|
+
element: /* @__PURE__ */ v(a, {})
|
|
46
54
|
}),
|
|
47
|
-
/* @__PURE__ */
|
|
55
|
+
/* @__PURE__ */ v(h, {
|
|
48
56
|
path: "list",
|
|
49
|
-
element: /* @__PURE__ */
|
|
57
|
+
element: /* @__PURE__ */ v(i, {})
|
|
50
58
|
}),
|
|
51
|
-
/* @__PURE__ */
|
|
59
|
+
/* @__PURE__ */ v(h, {
|
|
52
60
|
path: "center",
|
|
53
|
-
element: /* @__PURE__ */
|
|
61
|
+
element: /* @__PURE__ */ v(i, {})
|
|
54
62
|
}),
|
|
55
|
-
/* @__PURE__ */
|
|
63
|
+
/* @__PURE__ */ v(h, {
|
|
56
64
|
path: "history",
|
|
57
|
-
element: O ? /* @__PURE__ */
|
|
58
|
-
title:
|
|
59
|
-
description:
|
|
65
|
+
element: O ? /* @__PURE__ */ v(b, {}) : /* @__PURE__ */ v(e, {
|
|
66
|
+
title: s("notification.featureDisabled.historyTitle", "Notification history is not enabled"),
|
|
67
|
+
description: s("notification.featureDisabled.historyAdminDescription", "This admin page is controlled by the notification.history feature flag. Enable the flag before validating delivery history.")
|
|
60
68
|
})
|
|
61
69
|
}),
|
|
62
|
-
|
|
70
|
+
_ && /* @__PURE__ */ v(h, {
|
|
63
71
|
path: "templates",
|
|
64
|
-
element: /* @__PURE__ */
|
|
72
|
+
element: /* @__PURE__ */ v(D, {
|
|
65
73
|
permissions: [
|
|
66
74
|
t.TEMPLATE_LIST,
|
|
67
75
|
t.TEMPLATE_CREATE,
|
|
68
76
|
t.TEMPLATE_UPDATE,
|
|
69
77
|
t.TEMPLATE_DELETE
|
|
70
78
|
],
|
|
71
|
-
children: /* @__PURE__ */
|
|
79
|
+
children: /* @__PURE__ */ v(x, {})
|
|
72
80
|
})
|
|
73
81
|
}),
|
|
74
|
-
|
|
82
|
+
_ && /* @__PURE__ */ v(h, {
|
|
75
83
|
path: "templates/new",
|
|
76
|
-
element: /* @__PURE__ */
|
|
84
|
+
element: /* @__PURE__ */ v(D, {
|
|
77
85
|
permission: t.TEMPLATE_CREATE,
|
|
78
|
-
children: /* @__PURE__ */
|
|
86
|
+
children: /* @__PURE__ */ v(S, {})
|
|
79
87
|
})
|
|
80
88
|
}),
|
|
81
|
-
|
|
89
|
+
_ && /* @__PURE__ */ v(h, {
|
|
82
90
|
path: "templates/:templateId",
|
|
83
|
-
element: /* @__PURE__ */
|
|
91
|
+
element: /* @__PURE__ */ v(D, {
|
|
84
92
|
permission: t.TEMPLATE_UPDATE,
|
|
85
|
-
children: /* @__PURE__ */
|
|
93
|
+
children: /* @__PURE__ */ v(S, {})
|
|
86
94
|
})
|
|
87
95
|
}),
|
|
88
|
-
|
|
96
|
+
E && /* @__PURE__ */ v(h, {
|
|
89
97
|
path: "create",
|
|
90
|
-
element: /* @__PURE__ */
|
|
98
|
+
element: /* @__PURE__ */ v(D, {
|
|
91
99
|
permissions: [t.NOTIFICATION_CREATE, t.NOTIFICATION_SEND],
|
|
92
100
|
requireAll: !0,
|
|
93
|
-
children: /* @__PURE__ */
|
|
101
|
+
children: /* @__PURE__ */ v(C, {})
|
|
94
102
|
})
|
|
95
103
|
}),
|
|
96
|
-
|
|
104
|
+
E && /* @__PURE__ */ v(h, {
|
|
97
105
|
path: "topics",
|
|
98
|
-
element: /* @__PURE__ */
|
|
106
|
+
element: /* @__PURE__ */ v(D, {
|
|
99
107
|
permission: t.NOTIFICATION_CREATE,
|
|
100
|
-
children: /* @__PURE__ */
|
|
108
|
+
children: /* @__PURE__ */ v(w, {})
|
|
101
109
|
})
|
|
102
110
|
}),
|
|
103
|
-
/* @__PURE__ */
|
|
111
|
+
/* @__PURE__ */ v(h, {
|
|
104
112
|
path: "*",
|
|
105
|
-
element: /* @__PURE__ */
|
|
113
|
+
element: /* @__PURE__ */ v(m, {
|
|
106
114
|
to: l,
|
|
107
115
|
replace: !0
|
|
108
116
|
})
|
|
@@ -110,6 +118,6 @@ function E() {
|
|
|
110
118
|
] })
|
|
111
119
|
});
|
|
112
120
|
}
|
|
113
|
-
export {
|
|
121
|
+
export { O as AdminNotificationRoutes };
|
|
114
122
|
|
|
115
123
|
//# sourceMappingURL=AdminNotificationRoutes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AdminNotificationRoutes.js","names":["NotificationHistoryAdminPage","lazy","m","NotificationTemplatesPage","TemplateEditorPage","CreateNotificationPage","NotificationTopicsPage","PageLoader","AccessDeniedRedirect","useGlobalUi","navigate","useNavigate","useNotification","tr","useTr","useEffect","showToast","basePath","AdminRouteGate","gateProps","props","PermissionGate","AdminNotificationRoutes","centerPath","templatesDetails","useFeatureFlagDetails","createDetails","historyDetails","templatesEnabled","createEnabled","historyEnabled","Suspense","Routes","Route","NotificationLandingPage","NotificationCenterPage","FeatureDisabledPage","NOTIFICATION_PERMISSIONS","Navigate"],"sources":["../src/AdminNotificationRoutes.tsx"],"sourcesContent":["import { lazy, Suspense, useEffect, type ReactNode } from 'react';\nimport { Navigate, Route, Routes, useNavigate } from 'react-router';\nimport { useFeatureFlagDetails } from '@burdenoff/fe-libs/shared/feature-flags';\nimport { PermissionGate } from '@burdenoff/fe-libs/shared/components';\nimport { useGlobalUi } from '@burdenoff/fe-libs/shared/providers/shell';\nimport { FeatureDisabledPage } from './components/FeatureDisabledPage';\nimport { NOTIFICATION_PERMISSIONS, type NotificationPermission } from './constants/permissions';\nimport { useNotification } from './providers/NotificationProvider';\nimport { useTr } from './shared/hooks/useTr';\n\n// Eager load - Primary landing page\nimport { NotificationCenterPage } from './pages/NotificationCenterPage';\nimport { NotificationLandingPage } from './pages/NotificationLandingPage';\n\n// Lazy load - Secondary pages\nconst NotificationHistoryAdminPage = lazy(() =>\n import('./pages/NotificationHistoryAdminPage').then((m) => ({\n default: m.NotificationHistoryAdminPage,\n }))\n);\nconst NotificationTemplatesPage = lazy(() =>\n import('./pages/NotificationTemplatesPage').then((m) => ({\n default: m.NotificationTemplatesPage,\n }))\n);\nconst TemplateEditorPage = lazy(() =>\n import('./pages/TemplateEditorPage').then((m) => ({ default: m.TemplateEditorPage }))\n);\nconst CreateNotificationPage = lazy(() =>\n import('./pages/CreateNotificationPage').then((m) => ({ default: m.CreateNotificationPage }))\n);\nconst NotificationTopicsPage = lazy(() =>\n import('./pages/NotificationTopicsPage').then((m) => ({ default: m.NotificationTopicsPage }))\n);\n\n// Loading fallback component\nfunction PageLoader() {\n return (\n <div className=\"flex h-64 items-center justify-center\">\n <div className=\"h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent\" />\n </div>\n );\n}\n\n// Pair toast + programmatic navigation in one effect to avoid <Navigate> unmounting before the toast fires.\n// Uses absolute `${basePath}/center` because relative `../center` resolves wrong from nested paths like `/templates/new`.\nfunction AccessDeniedRedirect() {\n const { showToast } = useGlobalUi();\n const navigate = useNavigate();\n const { basePath } = useNotification();\n const tr = useTr();\n useEffect(() => {\n showToast(\n tr(\n 'notification.error.accessDeniedRedirect',\n 'You do not have permission to access that notification page.'\n ),\n 'warning'\n );\n navigate(`${basePath}/center`, { replace: true });\n // Run once per access-denied mount; re-running on hook identity changes would duplicate the toast.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n return null;\n}\n\n// Discriminated union: callers must pass exactly one of `permission` / `permissions`.\ntype AdminRouteGateProps = {\n children: ReactNode;\n} & (\n | { permission: NotificationPermission; permissions?: never; requireAll?: never }\n | {\n permission?: never;\n permissions: NotificationPermission[];\n requireAll?: boolean;\n }\n);\n\nfunction AdminRouteGate(props: AdminRouteGateProps) {\n const { children, ...gateProps } = props;\n return (\n <PermissionGate\n permission={gateProps.permission}\n permissions={gateProps.permissions}\n requireAll={gateProps.requireAll}\n loading={<PageLoader />}\n fallback={<AccessDeniedRedirect />}\n >\n {children}\n </PermissionGate>\n );\n}\n\n// Admin-app router for the notification MFE. Admin routes are wrapped in PermissionGate.\nexport function AdminNotificationRoutes() {\n const { basePath = '/' } = useNotification();\n const tr = useTr();\n const centerPath = `${basePath.endsWith('/') ? basePath.slice(0, -1) : basePath}/center`;\n\n // Explicit `false` fallback prevents provider's default-allow from leaking unseeded flags.\n const templatesDetails = useFeatureFlagDetails('notification.templates');\n const createDetails = useFeatureFlagDetails('notification.create');\n const historyDetails = useFeatureFlagDetails('notification.history');\n const templatesEnabled = templatesDetails ? Boolean(templatesDetails.value) : false;\n const createEnabled = createDetails ? Boolean(createDetails.value) : false;\n const historyEnabled = historyDetails ? Boolean(historyDetails.value) : false;\n\n return (\n <Suspense fallback={<PageLoader />}>\n <Routes>\n {/* Tabbed landing - default route */}\n <Route index element={<NotificationLandingPage />} />\n\n {/* Canonical list alias used by product-shell nav homePath */}\n <Route path=\"list\" element={<NotificationCenterPage />} />\n\n {/* User-facing routes (all users) */}\n <Route path=\"center\" element={<NotificationCenterPage />} />\n <Route\n path=\"history\"\n element={\n historyEnabled ? (\n <NotificationHistoryAdminPage />\n ) : (\n <FeatureDisabledPage\n title={tr(\n 'notification.featureDisabled.historyTitle',\n 'Notification history is not enabled'\n )}\n description={tr(\n 'notification.featureDisabled.historyAdminDescription',\n 'This admin page is controlled by the notification.history feature flag. Enable the flag before validating delivery history.'\n )}\n />\n )\n }\n />\n\n {/* Gate admits any actor with read or any write permission; page disables write actions for read-only. */}\n {templatesEnabled && (\n <Route\n path=\"templates\"\n element={\n <AdminRouteGate\n permissions={[\n NOTIFICATION_PERMISSIONS.TEMPLATE_LIST,\n NOTIFICATION_PERMISSIONS.TEMPLATE_CREATE,\n NOTIFICATION_PERMISSIONS.TEMPLATE_UPDATE,\n NOTIFICATION_PERMISSIONS.TEMPLATE_DELETE,\n ]}\n >\n <NotificationTemplatesPage />\n </AdminRouteGate>\n }\n />\n )}\n {templatesEnabled && (\n <Route\n path=\"templates/new\"\n element={\n <AdminRouteGate permission={NOTIFICATION_PERMISSIONS.TEMPLATE_CREATE}>\n <TemplateEditorPage />\n </AdminRouteGate>\n }\n />\n )}\n {templatesEnabled && (\n <Route\n path=\"templates/:templateId\"\n element={\n <AdminRouteGate permission={NOTIFICATION_PERMISSIONS.TEMPLATE_UPDATE}>\n <TemplateEditorPage />\n </AdminRouteGate>\n }\n />\n )}\n\n {/* Admin routes - Create/Send Notification (wrapped in PermissionGate) */}\n {createEnabled && (\n <Route\n path=\"create\"\n element={\n <AdminRouteGate\n permissions={[\n NOTIFICATION_PERMISSIONS.NOTIFICATION_CREATE,\n NOTIFICATION_PERMISSIONS.NOTIFICATION_SEND,\n ]}\n requireAll\n >\n <CreateNotificationPage />\n </AdminRouteGate>\n }\n />\n )}\n {/* Topics CRUD maps to `notification:create` per backend @rbac — tracked in BOFF-2386. */}\n {createEnabled && (\n <Route\n path=\"topics\"\n element={\n <AdminRouteGate permission={NOTIFICATION_PERMISSIONS.NOTIFICATION_CREATE}>\n <NotificationTopicsPage />\n </AdminRouteGate>\n }\n />\n )}\n\n {/* Catch-all route - absolute redirect so an unmatched path like /list\n cannot recursively append /center (e.g. /list/center/center/...) */}\n <Route path=\"*\" element={<Navigate to={centerPath} replace />} />\n </Routes>\n </Suspense>\n );\n}\n"],"mappings":";;;;;;;;;;;;;AAeA,IAAMA,IAA+BC,QACnC,OAAO,0CAAuC,CAAC,MAAM,OAAO,EAC1D,SAASC,EAAE,6BACb,EAAE,CACJ,GACMC,IAA4BF,QAChC,OAAO,uCAAoC,CAAC,MAAM,OAAO,EACvD,SAASC,EAAE,0BACb,EAAE,CACJ,GACME,IAAqBH,QACzB,OAAO,gCAA6B,CAAC,MAAM,OAAO,EAAE,SAASC,EAAE,mBAAmB,EAAE,CACtF,GACMG,IAAyBJ,QAC7B,OAAO,oCAAiC,CAAC,MAAM,OAAO,EAAE,SAASC,EAAE,uBAAuB,EAAE,CAC9F,GACMI,IAAyBL,QAC7B,OAAO,oCAAiC,CAAC,MAAM,OAAO,EAAE,SAASC,EAAE,uBAAuB,EAAE,CAC9F;AAGA,SAASK,IAAa;CACpB,OACE,kBAAC,OAAD;EAAK,WAAU;EACb,UAAA,kBAAC,OAAD,EAAK,WAAU,iFAAkF,CAAA;CAC9F,CAAA;AAET;AAIA,SAASC,IAAuB;CAC9B,IAAM,EAAE,iBAAcC,EAAY,GAC5BC,IAAWC,EAAY,GACvB,EAAE,gBAAaC,EAAgB,GAC/BC,IAAKC,EAAM;CAajB,OAZAC,QAAgB;EAQd,AAPAC,EACEH,EACE,2CACA,8DACF,GACA,SACF,GACAH,EAAS,GAAGO,EAAS,UAAU,EAAE,SAAS,GAAK,CAAC;CAGlD,GAAG,CAAC,CAAC,GACE;AACT;AAcA,SAASC,EAAe,GAA4B;CAClD,IAAM,EAAE,aAAU,GAAGC,MAAcC;CACnC,OACE,kBAACC,GAAD;EACE,YAAYF,EAAU;EACtB,aAA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AA;GAEnB,CAAA;GAEFyB,KACC,kBAACK,GAAD;IACE,MAAK;IACL,SACE,kBAACf,GAAD;KAAgB,YAAYmB,EAAyB;KACnD,UAAA,kBAACjC,GAAD,CAAqB,CAAA;IACP,CAAA;GAEnB,CAAA;GAEFwB,KACC,kBAACK,GAAD;IACE,MAAK;IACL,SACE,kBAACf,GAAD;KAAgB,YAAYmB,EAAyB;KACnD,UAAA,kBAACjC,GAAD,CAAqB,CAAA;IACP,CAAA;GAEnB,CAAA;GAIFyB,KACC,kBAACI,GAAD;IACE,MAAK;IACL,SACE,kBAACf,GAAD;KACE,aAAa,CACXmB,EAAyB,qBACzBA,EAAyB,iBAC3B;KACA,YAAA;KAEA,UAAA,kBAAChC,GAAD,CAAyB,CAAA;IACX,CAAA;GAEnB,CAAA;GAGFwB,KACC,kBAACI,GAAD;IACE,MAAK;IACL,SACE,kBAACf,GAAD;KAAgB,YAAYmB,EAAyB;KACnD,UAAA,kBAAC/B,GAAD,CAAyB,CAAA;IACX,CAAA;GAEnB,CAAA;GAKH,kBAAC2B,GAAD;IAAO,MAAK;IAAI,SAAS,kBAACK,GAAD;KAAU,IAAIf;KAAY,SAAA;IAAS,CAAA;GAAI,CAAA;EAC1D,EAAA,CAAA;CACA,CAAA;AAEd"}
|
|
1
|
+
{"version":3,"file":"AdminNotificationRoutes.js","names":["NotificationHistoryAdminPage","lazy","m","NotificationTemplatesPage","TemplateEditorPage","CreateNotificationPage","NotificationTopicsPage","PageLoader","SectionLoaderOr","CompactMarkOr","AccessDeniedRedirect","useGlobalUi","navigate","useNavigate","useNotification","tr","useTr","useEffect","showToast","basePath","AdminRouteGate","gateProps","props","PermissionGate","AdminNotificationRoutes","centerPath","templatesDetails","useFeatureFlagDetails","createDetails","historyDetails","templatesEnabled","createEnabled","historyEnabled","Suspense","Routes","Route","NotificationLandingPage","NotificationCenterPage","FeatureDisabledPage","NOTIFICATION_PERMISSIONS","Navigate"],"sources":["../src/AdminNotificationRoutes.tsx"],"sourcesContent":["import { lazy, Suspense, useEffect, type ReactNode } from 'react';\nimport { Navigate, Route, Routes, useNavigate } from 'react-router';\nimport { useFeatureFlagDetails } from '@burdenoff/fe-libs/shared/feature-flags';\nimport { PermissionGate } from '@burdenoff/fe-libs/shared/components';\nimport { useGlobalUi } from '@burdenoff/fe-libs/shared/providers/shell';\nimport { FeatureDisabledPage } from './components/FeatureDisabledPage';\nimport { NOTIFICATION_PERMISSIONS, type NotificationPermission } from './constants/permissions';\nimport { useNotification } from './providers/NotificationProvider';\nimport { useTr } from './shared/hooks/useTr';\n\n// Eager load - Primary landing page\nimport { NotificationCenterPage } from './pages/NotificationCenterPage';\nimport { NotificationLandingPage } from './pages/NotificationLandingPage';\nimport { CompactMarkOr, SectionLoaderOr } from './components/loadingSystem';\n\n// Lazy load - Secondary pages\nconst NotificationHistoryAdminPage = lazy(() =>\n import('./pages/NotificationHistoryAdminPage').then((m) => ({\n default: m.NotificationHistoryAdminPage,\n }))\n);\nconst NotificationTemplatesPage = lazy(() =>\n import('./pages/NotificationTemplatesPage').then((m) => ({\n default: m.NotificationTemplatesPage,\n }))\n);\nconst TemplateEditorPage = lazy(() =>\n import('./pages/TemplateEditorPage').then((m) => ({ default: m.TemplateEditorPage }))\n);\nconst CreateNotificationPage = lazy(() =>\n import('./pages/CreateNotificationPage').then((m) => ({ default: m.CreateNotificationPage }))\n);\nconst NotificationTopicsPage = lazy(() =>\n import('./pages/NotificationTopicsPage').then((m) => ({ default: m.NotificationTopicsPage }))\n);\n\n// Loading fallback component\nfunction PageLoader() {\n return (\n <SectionLoaderOr\n route\n minHeight=\"16rem\"\n today={\n <div className=\"flex h-64 items-center justify-center\">\n <CompactMarkOr\n className=\"h-8 w-8\"\n today={\n <div className=\"h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent\" />\n }\n />\n </div>\n }\n />\n );\n}\n\n// Pair toast + programmatic navigation in one effect to avoid <Navigate> unmounting before the toast fires.\n// Uses absolute `${basePath}/center` because relative `../center` resolves wrong from nested paths like `/templates/new`.\nfunction AccessDeniedRedirect() {\n const { showToast } = useGlobalUi();\n const navigate = useNavigate();\n const { basePath } = useNotification();\n const tr = useTr();\n useEffect(() => {\n showToast(\n tr(\n 'notification.error.accessDeniedRedirect',\n 'You do not have permission to access that notification page.'\n ),\n 'warning'\n );\n navigate(`${basePath}/center`, { replace: true });\n // Run once per access-denied mount; re-running on hook identity changes would duplicate the toast.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n return null;\n}\n\n// Discriminated union: callers must pass exactly one of `permission` / `permissions`.\ntype AdminRouteGateProps = {\n children: ReactNode;\n} & (\n | { permission: NotificationPermission; permissions?: never; requireAll?: never }\n | {\n permission?: never;\n permissions: NotificationPermission[];\n requireAll?: boolean;\n }\n);\n\nfunction AdminRouteGate(props: AdminRouteGateProps) {\n const { children, ...gateProps } = props;\n return (\n <PermissionGate\n permission={gateProps.permission}\n permissions={gateProps.permissions}\n requireAll={gateProps.requireAll}\n loading={<PageLoader />}\n fallback={<AccessDeniedRedirect />}\n >\n {children}\n </PermissionGate>\n );\n}\n\n// Admin-app router for the notification MFE. Admin routes are wrapped in PermissionGate.\nexport function AdminNotificationRoutes() {\n const { basePath = '/' } = useNotification();\n const tr = useTr();\n const centerPath = `${basePath.endsWith('/') ? basePath.slice(0, -1) : basePath}/center`;\n\n // Explicit `false` fallback prevents provider's default-allow from leaking unseeded flags.\n const templatesDetails = useFeatureFlagDetails('notification.templates');\n const createDetails = useFeatureFlagDetails('notification.create');\n const historyDetails = useFeatureFlagDetails('notification.history');\n const templatesEnabled = templatesDetails ? Boolean(templatesDetails.value) : false;\n const createEnabled = createDetails ? Boolean(createDetails.value) : false;\n const historyEnabled = historyDetails ? Boolean(historyDetails.value) : false;\n\n return (\n <Suspense fallback={<PageLoader />}>\n <Routes>\n {/* Tabbed landing - default route */}\n <Route index element={<NotificationLandingPage />} />\n\n {/* Canonical list alias used by product-shell nav homePath */}\n <Route path=\"list\" element={<NotificationCenterPage />} />\n\n {/* User-facing routes (all users) */}\n <Route path=\"center\" element={<NotificationCenterPage />} />\n <Route\n path=\"history\"\n element={\n historyEnabled ? (\n <NotificationHistoryAdminPage />\n ) : (\n <FeatureDisabledPage\n title={tr(\n 'notification.featureDisabled.historyTitle',\n 'Notification history is not enabled'\n )}\n description={tr(\n 'notification.featureDisabled.historyAdminDescription',\n 'This admin page is controlled by the notification.history feature flag. Enable the flag before validating delivery history.'\n )}\n />\n )\n }\n />\n\n {/* Gate admits any actor with read or any write permission; page disables write actions for read-only. */}\n {templatesEnabled && (\n <Route\n path=\"templates\"\n element={\n <AdminRouteGate\n permissions={[\n NOTIFICATION_PERMISSIONS.TEMPLATE_LIST,\n NOTIFICATION_PERMISSIONS.TEMPLATE_CREATE,\n NOTIFICATION_PERMISSIONS.TEMPLATE_UPDATE,\n NOTIFICATION_PERMISSIONS.TEMPLATE_DELETE,\n ]}\n >\n <NotificationTemplatesPage />\n </AdminRouteGate>\n }\n />\n )}\n {templatesEnabled && (\n <Route\n path=\"templates/new\"\n element={\n <AdminRouteGate permission={NOTIFICATION_PERMISSIONS.TEMPLATE_CREATE}>\n <TemplateEditorPage />\n </AdminRouteGate>\n }\n />\n )}\n {templatesEnabled && (\n <Route\n path=\"templates/:templateId\"\n element={\n <AdminRouteGate permission={NOTIFICATION_PERMISSIONS.TEMPLATE_UPDATE}>\n <TemplateEditorPage />\n </AdminRouteGate>\n }\n />\n )}\n\n {/* Admin routes - Create/Send Notification (wrapped in PermissionGate) */}\n {createEnabled && (\n <Route\n path=\"create\"\n element={\n <AdminRouteGate\n permissions={[\n NOTIFICATION_PERMISSIONS.NOTIFICATION_CREATE,\n NOTIFICATION_PERMISSIONS.NOTIFICATION_SEND,\n ]}\n requireAll\n >\n <CreateNotificationPage />\n </AdminRouteGate>\n }\n />\n )}\n {/* Topics CRUD maps to `notification:create` per backend @rbac — tracked in BOFF-2386. */}\n {createEnabled && (\n <Route\n path=\"topics\"\n element={\n <AdminRouteGate permission={NOTIFICATION_PERMISSIONS.NOTIFICATION_CREATE}>\n <NotificationTopicsPage />\n </AdminRouteGate>\n }\n />\n )}\n\n {/* Catch-all route - absolute redirect so an unmatched path like /list\n cannot recursively append /center (e.g. /list/center/center/...) */}\n <Route path=\"*\" element={<Navigate to={centerPath} replace />} />\n </Routes>\n </Suspense>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;AAgBA,IAAMA,IAA+BC,QACnC,OAAO,0CAAuC,CAAC,MAAM,OAAO,EAC1D,SAASC,EAAE,6BACb,EAAE,CACJ,GACMC,IAA4BF,QAChC,OAAO,uCAAoC,CAAC,MAAM,OAAO,EACvD,SAASC,EAAE,0BACb,EAAE,CACJ,GACME,IAAqBH,QACzB,OAAO,gCAA6B,CAAC,MAAM,OAAO,EAAE,SAASC,EAAE,mBAAmB,EAAE,CACtF,GACMG,IAAyBJ,QAC7B,OAAO,oCAAiC,CAAC,MAAM,OAAO,EAAE,SAASC,EAAE,uBAAuB,EAAE,CAC9F,GACMI,IAAyBL,QAC7B,OAAO,oCAAiC,CAAC,MAAM,OAAO,EAAE,SAASC,EAAE,uBAAuB,EAAE,CAC9F;AAGA,SAASK,IAAa;CACpB,OACE,kBAACC,GAAD;EACE,OAAA;EACA,WAAU;EACV,OACE,kBAAC,OAAD;GAAK,WAAU;GACb,UAAA,kBAACC,GAAD;IACE,WAAU;IACV,OACE,kBAAC,OAAD,EAAK,WAAU,iFAAkF,CAAA;GAEpG,CAAA;EACE,CAAA;CAER,CAAA;AAEL;AAIA,SAASC,IAAuB;CAC9B,IAAM,EAAE,iBAAcC,EAAY,GAC5BC,IAAWC,EAAY,GACvB,EAAE,gBAAaC,EAAgB,GAC/BC,IAAKC,EAAM;CAajB,OAZAC,QAAgB;EAQd,AAPAC,EACEH,EACE,2CACA,8DACF,GACA,SACF,GACAH,EAAS,GAAGO,EAAS,UAAU,EAAE,SAAS,GAAK,CAAC;CAGlD,GAAG,CAAC,CAAC,GACE;AACT;AAcA,SAASC,EAAe,GAA4B;CA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AyB;MACzBA,EAAyB;MACzBA,EAAyB;KAC3B;KAEA,UAAA,kBAACpC,GAAD,CAA4B,CAAA;IACd,CAAA;GAEnB,CAAA;GAEF2B,KACC,kBAACK,GAAD;IACE,MAAK;IACL,SACE,kBAACf,GAAD;KAAgB,YAAYmB,EAAyB;KACnD,UAAA,kBAACnC,GAAD,CAAqB,CAAA;IACP,CAAA;GAEnB,CAAA;GAEF0B,KACC,kBAACK,GAAD;IACE,MAAK;IACL,SACE,kBAACf,GAAD;KAAgB,YAAYmB,EAAyB;KACnD,UAAA,kBAACnC,GAAD,CAAqB,CAAA;IACP,CAAA;GAEnB,CAAA;GAIF2B,KACC,kBAACI,GAAD;IACE,MAAK;IACL,SACE,kBAACf,GAAD;KACE,aAAa,CACXmB,EAAyB,qBACzBA,EAAyB,iBAC3B;KACA,YAAA;KAEA,UAAA,kBAAClC,GAAD,CAAyB,CAAA;IACX,CAAA;GAEnB,CAAA;GAGF0B,KACC,kBAACI,GAAD;IACE,MAAK;IACL,SACE,kBAACf,GAAD;KAAgB,YAAYmB,EAAyB;KACnD,UAAA,kBAACjC,GAAD,CAAyB,CAAA;IACX,CAAA;GAEnB,CAAA;GAKH,kBAAC6B,GAAD;IAAO,MAAK;IAAI,SAAS,kBAACK,GAAD;KAAU,IAAIf;KAAY,SAAA;IAAS,CAAA;GAAI,CAAA;EAC1D,EAAA,CAAA;CACA,CAAA;AAEd"}
|
|
@@ -3,65 +3,73 @@ import { NotificationCenterPage as t } from "./pages/NotificationCenterPage.js";
|
|
|
3
3
|
import { NotificationLandingPage as n } from "./pages/NotificationLandingPage.js";
|
|
4
4
|
import { AdminPageV2 as r } from "./navigation-v2/AdminPageV2.js";
|
|
5
5
|
import { DeliveryLogV2 as i, NotificationsV2Landing as a } from "./navigation-v2/NotificationsV2Landing.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
6
|
+
import { CompactMarkOr as o, SectionLoaderOr as s } from "./components/loadingSystem.js";
|
|
7
|
+
import { Suspense as c, lazy as l } from "react";
|
|
8
|
+
import { Navigate as u, Route as d, Routes as f } from "react-router";
|
|
9
|
+
import { jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
9
10
|
// src/NotificationRoutes.tsx
|
|
10
|
-
var
|
|
11
|
-
function
|
|
12
|
-
return /* @__PURE__ */
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
var h = l(() => import("./pages/NotificationHistoryPage.js").then((e) => ({ default: e.NotificationHistoryPage }))), g = l(() => import("./pages/NotificationTemplatesPage.js").then((e) => ({ default: e.NotificationTemplatesPage }))), _ = l(() => import("./pages/TemplateEditorPage.js").then((e) => ({ default: e.TemplateEditorPage }))), v = l(() => import("./pages/CreateNotificationPage.js").then((e) => ({ default: e.CreateNotificationPage }))), y = l(() => import("./pages/NotificationTopicsPage.js").then((e) => ({ default: e.NotificationTopicsPage }))), b = l(() => import("./pages/NotificationPreferencesPage.js").then((e) => ({ default: e.NotificationPreferencesPage })));
|
|
12
|
+
function x() {
|
|
13
|
+
return /* @__PURE__ */ p(s, {
|
|
14
|
+
route: !0,
|
|
15
|
+
minHeight: "16rem",
|
|
16
|
+
today: /* @__PURE__ */ p("div", {
|
|
17
|
+
className: "flex h-64 items-center justify-center",
|
|
18
|
+
children: /* @__PURE__ */ p(o, {
|
|
19
|
+
className: "h-8 w-8",
|
|
20
|
+
today: /* @__PURE__ */ p("div", { className: "h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent" })
|
|
21
|
+
})
|
|
22
|
+
})
|
|
15
23
|
});
|
|
16
24
|
}
|
|
17
|
-
function
|
|
25
|
+
function S() {
|
|
18
26
|
let { basePath: r = "/", navigationV2: i } = e(), a = `${r.endsWith("/") ? r.slice(0, -1) : r}/center`;
|
|
19
|
-
return i ? /* @__PURE__ */
|
|
20
|
-
fallback: /* @__PURE__ */
|
|
21
|
-
children: /* @__PURE__ */ f
|
|
22
|
-
/* @__PURE__ */ d
|
|
27
|
+
return i ? /* @__PURE__ */ p(C, { centerPath: a }) : /* @__PURE__ */ p(c, {
|
|
28
|
+
fallback: /* @__PURE__ */ p(x, {}),
|
|
29
|
+
children: /* @__PURE__ */ m(f, { children: [
|
|
30
|
+
/* @__PURE__ */ p(d, {
|
|
23
31
|
index: !0,
|
|
24
|
-
element: /* @__PURE__ */
|
|
32
|
+
element: /* @__PURE__ */ p(n, {})
|
|
25
33
|
}),
|
|
26
|
-
/* @__PURE__ */ d
|
|
34
|
+
/* @__PURE__ */ p(d, {
|
|
27
35
|
path: "list",
|
|
28
|
-
element: /* @__PURE__ */
|
|
36
|
+
element: /* @__PURE__ */ p(t, {})
|
|
29
37
|
}),
|
|
30
|
-
/* @__PURE__ */ d
|
|
38
|
+
/* @__PURE__ */ p(d, {
|
|
31
39
|
path: "center",
|
|
32
|
-
element: /* @__PURE__ */
|
|
40
|
+
element: /* @__PURE__ */ p(t, {})
|
|
33
41
|
}),
|
|
34
|
-
/* @__PURE__ */ d
|
|
42
|
+
/* @__PURE__ */ p(d, {
|
|
35
43
|
path: "history",
|
|
36
|
-
element: /* @__PURE__ */
|
|
44
|
+
element: /* @__PURE__ */ p(h, {})
|
|
37
45
|
}),
|
|
38
|
-
/* @__PURE__ */ d
|
|
46
|
+
/* @__PURE__ */ p(d, {
|
|
39
47
|
path: "templates",
|
|
40
|
-
element: /* @__PURE__ */
|
|
48
|
+
element: /* @__PURE__ */ p(g, {})
|
|
41
49
|
}),
|
|
42
|
-
/* @__PURE__ */ d
|
|
50
|
+
/* @__PURE__ */ p(d, {
|
|
43
51
|
path: "templates/new",
|
|
44
|
-
element: /* @__PURE__ */
|
|
52
|
+
element: /* @__PURE__ */ p(_, {})
|
|
45
53
|
}),
|
|
46
|
-
/* @__PURE__ */ d
|
|
54
|
+
/* @__PURE__ */ p(d, {
|
|
47
55
|
path: "templates/:templateId",
|
|
48
|
-
element: /* @__PURE__ */
|
|
56
|
+
element: /* @__PURE__ */ p(_, {})
|
|
49
57
|
}),
|
|
50
|
-
/* @__PURE__ */ d
|
|
58
|
+
/* @__PURE__ */ p(d, {
|
|
51
59
|
path: "create",
|
|
52
|
-
element: /* @__PURE__ */
|
|
60
|
+
element: /* @__PURE__ */ p(v, {})
|
|
53
61
|
}),
|
|
54
|
-
/* @__PURE__ */ d
|
|
62
|
+
/* @__PURE__ */ p(d, {
|
|
55
63
|
path: "topics",
|
|
56
|
-
element: /* @__PURE__ */
|
|
64
|
+
element: /* @__PURE__ */ p(y, {})
|
|
57
65
|
}),
|
|
58
|
-
/* @__PURE__ */ d
|
|
66
|
+
/* @__PURE__ */ p(d, {
|
|
59
67
|
path: "preferences",
|
|
60
|
-
element: /* @__PURE__ */
|
|
68
|
+
element: /* @__PURE__ */ p(b, {})
|
|
61
69
|
}),
|
|
62
|
-
/* @__PURE__ */ d
|
|
70
|
+
/* @__PURE__ */ p(d, {
|
|
63
71
|
path: "*",
|
|
64
|
-
element: /* @__PURE__ */
|
|
72
|
+
element: /* @__PURE__ */ p(u, {
|
|
65
73
|
to: a,
|
|
66
74
|
replace: !0
|
|
67
75
|
})
|
|
@@ -69,73 +77,73 @@ function b() {
|
|
|
69
77
|
] })
|
|
70
78
|
});
|
|
71
79
|
}
|
|
72
|
-
function
|
|
73
|
-
return /* @__PURE__ */
|
|
74
|
-
fallback: /* @__PURE__ */
|
|
75
|
-
children: /* @__PURE__ */ f
|
|
76
|
-
/* @__PURE__ */ d
|
|
80
|
+
function C({ centerPath: e }) {
|
|
81
|
+
return /* @__PURE__ */ p(c, {
|
|
82
|
+
fallback: /* @__PURE__ */ p(x, {}),
|
|
83
|
+
children: /* @__PURE__ */ m(f, { children: [
|
|
84
|
+
/* @__PURE__ */ p(d, {
|
|
77
85
|
index: !0,
|
|
78
|
-
element: /* @__PURE__ */
|
|
86
|
+
element: /* @__PURE__ */ p(a, {})
|
|
79
87
|
}),
|
|
80
|
-
/* @__PURE__ */ d
|
|
88
|
+
/* @__PURE__ */ p(d, {
|
|
81
89
|
path: "list",
|
|
82
|
-
element: /* @__PURE__ */
|
|
90
|
+
element: /* @__PURE__ */ p(t, {})
|
|
83
91
|
}),
|
|
84
|
-
/* @__PURE__ */ d
|
|
92
|
+
/* @__PURE__ */ p(d, {
|
|
85
93
|
path: "center",
|
|
86
|
-
element: /* @__PURE__ */
|
|
94
|
+
element: /* @__PURE__ */ p(t, {})
|
|
87
95
|
}),
|
|
88
|
-
/* @__PURE__ */ d
|
|
96
|
+
/* @__PURE__ */ p(d, {
|
|
89
97
|
path: "history",
|
|
90
|
-
element: /* @__PURE__ */
|
|
98
|
+
element: /* @__PURE__ */ p(h, {})
|
|
91
99
|
}),
|
|
92
|
-
/* @__PURE__ */ d
|
|
100
|
+
/* @__PURE__ */ p(d, {
|
|
93
101
|
path: "preferences",
|
|
94
|
-
element: /* @__PURE__ */
|
|
102
|
+
element: /* @__PURE__ */ p(b, {})
|
|
95
103
|
}),
|
|
96
|
-
/* @__PURE__ */ d
|
|
104
|
+
/* @__PURE__ */ p(d, {
|
|
97
105
|
path: "templates",
|
|
98
|
-
element: /* @__PURE__ */
|
|
106
|
+
element: /* @__PURE__ */ p(r, {
|
|
99
107
|
tool: "templates",
|
|
100
|
-
children: /* @__PURE__ */
|
|
108
|
+
children: /* @__PURE__ */ p(g, {})
|
|
101
109
|
})
|
|
102
110
|
}),
|
|
103
|
-
/* @__PURE__ */ d
|
|
111
|
+
/* @__PURE__ */ p(d, {
|
|
104
112
|
path: "templates/new",
|
|
105
|
-
element: /* @__PURE__ */
|
|
113
|
+
element: /* @__PURE__ */ p(r, {
|
|
106
114
|
tool: "templates",
|
|
107
|
-
children: /* @__PURE__ */
|
|
115
|
+
children: /* @__PURE__ */ p(_, {})
|
|
108
116
|
})
|
|
109
117
|
}),
|
|
110
|
-
/* @__PURE__ */ d
|
|
118
|
+
/* @__PURE__ */ p(d, {
|
|
111
119
|
path: "templates/:templateId",
|
|
112
|
-
element: /* @__PURE__ */
|
|
120
|
+
element: /* @__PURE__ */ p(r, {
|
|
113
121
|
tool: "templates",
|
|
114
|
-
children: /* @__PURE__ */
|
|
122
|
+
children: /* @__PURE__ */ p(_, {})
|
|
115
123
|
})
|
|
116
124
|
}),
|
|
117
|
-
/* @__PURE__ */ d
|
|
125
|
+
/* @__PURE__ */ p(d, {
|
|
118
126
|
path: "create",
|
|
119
|
-
element: /* @__PURE__ */
|
|
127
|
+
element: /* @__PURE__ */ p(r, {
|
|
120
128
|
tool: "send",
|
|
121
129
|
back: !1,
|
|
122
|
-
children: /* @__PURE__ */
|
|
130
|
+
children: /* @__PURE__ */ p(v, {})
|
|
123
131
|
})
|
|
124
132
|
}),
|
|
125
|
-
/* @__PURE__ */ d
|
|
133
|
+
/* @__PURE__ */ p(d, {
|
|
126
134
|
path: "topics",
|
|
127
|
-
element: /* @__PURE__ */
|
|
135
|
+
element: /* @__PURE__ */ p(r, {
|
|
128
136
|
tool: "topics",
|
|
129
|
-
children: /* @__PURE__ */
|
|
137
|
+
children: /* @__PURE__ */ p(y, {})
|
|
130
138
|
})
|
|
131
139
|
}),
|
|
132
|
-
/* @__PURE__ */ d
|
|
140
|
+
/* @__PURE__ */ p(d, {
|
|
133
141
|
path: "delivery-log",
|
|
134
|
-
element: /* @__PURE__ */
|
|
142
|
+
element: /* @__PURE__ */ p(i, {})
|
|
135
143
|
}),
|
|
136
|
-
/* @__PURE__ */ d
|
|
144
|
+
/* @__PURE__ */ p(d, {
|
|
137
145
|
path: "*",
|
|
138
|
-
element: /* @__PURE__ */
|
|
146
|
+
element: /* @__PURE__ */ p(u, {
|
|
139
147
|
to: e,
|
|
140
148
|
replace: !0
|
|
141
149
|
})
|
|
@@ -143,6 +151,6 @@ function x({ centerPath: e }) {
|
|
|
143
151
|
] })
|
|
144
152
|
});
|
|
145
153
|
}
|
|
146
|
-
export {
|
|
154
|
+
export { S as NotificationRoutes };
|
|
147
155
|
|
|
148
156
|
//# sourceMappingURL=NotificationRoutes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NotificationRoutes.js","names":["NotificationHistoryPage","lazy","m","NotificationTemplatesPage","TemplateEditorPage","CreateNotificationPage","NotificationTopicsPage","NotificationPreferencesPage","PageLoader","NotificationRoutes","useNotification","centerPath","basePath","navigationV2","NavigationV2Routes","Suspense","Routes","Route","NotificationLandingPage","NotificationCenterPage","Navigate","NotificationsV2Landing","AdminPageV2","DeliveryLogV2"],"sources":["../src/NotificationRoutes.tsx"],"sourcesContent":["import { lazy, Suspense } from 'react';\nimport { Navigate, Route, Routes } from 'react-router';\nimport { useNotification } from './providers/NotificationProvider';\n\n// Eager load - Primary landing page\nimport { NotificationCenterPage } from './pages/NotificationCenterPage';\nimport { NotificationLandingPage } from './pages/NotificationLandingPage';\nimport { AdminPageV2 } from './navigation-v2/AdminPageV2';\nimport { DeliveryLogV2, NotificationsV2Landing } from './navigation-v2/NotificationsV2Landing';\n\n// Lazy load - Secondary pages\nconst NotificationHistoryPage = lazy(() =>\n import('./pages/NotificationHistoryPage').then((m) => ({\n default: m.NotificationHistoryPage,\n }))\n);\nconst NotificationTemplatesPage = lazy(() =>\n import('./pages/NotificationTemplatesPage').then((m) => ({\n default: m.NotificationTemplatesPage,\n }))\n);\nconst TemplateEditorPage = lazy(() =>\n import('./pages/TemplateEditorPage').then((m) => ({ default: m.TemplateEditorPage }))\n);\nconst CreateNotificationPage = lazy(() =>\n import('./pages/CreateNotificationPage').then((m) => ({ default: m.CreateNotificationPage }))\n);\nconst NotificationTopicsPage = lazy(() =>\n import('./pages/NotificationTopicsPage').then((m) => ({ default: m.NotificationTopicsPage }))\n);\nconst NotificationPreferencesPage = lazy(() =>\n import('./pages/NotificationPreferencesPage').then((m) => ({\n default: m.NotificationPreferencesPage,\n }))\n);\n\n// Loading fallback component\nfunction PageLoader() {\n return (\n <div className=\"flex h-64 items-center justify-center\">\n <div className=\"h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent\" />\n </div>\n );\n}\n\n/**\n * Internal router for the Notification microfrontend.\n * This component handles routing within the microfrontend using React Router v7.\n *\n * Routes:\n * - / → Notification landing page\n * - /list → Notification center (canonical list alias used by shell nav homePath)\n * - /center → Notification center (in-app notifications)\n * - /history → Notification history and archive\n * - /templates → Notification templates list (admin)\n * - /templates/new → Create new template (admin)\n * - /templates/:templateId → Edit template (admin)\n * - /create → Create and send notification (admin)\n * - /topics → Manage topics (admin)\n * - /preferences → User topic preferences\n * - unmatched → Absolute redirect to /{basePath}/center (avoids relative redirect loops)\n */\nexport function NotificationRoutes() {\n const { basePath = '/', navigationV2 } = useNotification();\n const centerPath = `${basePath.endsWith('/') ? basePath.slice(0, -1) : basePath}/center`;\n\n if (navigationV2) return <NavigationV2Routes centerPath={centerPath} />;\n\n return (\n <Suspense fallback={<PageLoader />}>\n <Routes>\n {/* Tabbed landing - default route */}\n <Route index element={<NotificationLandingPage />} />\n\n {/* Canonical list alias used by product-shell nav homePath */}\n <Route path=\"list\" element={<NotificationCenterPage />} />\n\n {/* User-facing routes (all users) */}\n <Route path=\"center\" element={<NotificationCenterPage />} />\n <Route path=\"history\" element={<NotificationHistoryPage />} />\n\n {/* Admin routes - Templates */}\n <Route path=\"templates\" element={<NotificationTemplatesPage />} />\n <Route path=\"templates/new\" element={<TemplateEditorPage />} />\n <Route path=\"templates/:templateId\" element={<TemplateEditorPage />} />\n\n {/* Admin routes - Create/Send Notification */}\n <Route path=\"create\" element={<CreateNotificationPage />} />\n <Route path=\"topics\" element={<NotificationTopicsPage />} />\n <Route path=\"preferences\" element={<NotificationPreferencesPage />} />\n\n {/* Catch-all route - absolute redirect so an unmatched path like /list\n cannot recursively append /center (e.g. /list/center/center/...) */}\n <Route path=\"*\" element={<Navigate to={centerPath} replace />} />\n </Routes>\n </Suspense>\n );\n}\n\n/**\n * FluidGrids' Navigation v2 routes (BOFF-11872). Every URL of the classic\n * routes keeps working: `/` opens straight on the inbox (old `?tab=` values\n * still open their page), and the admin pages get a route-level permission\n * gate and a way back to the inbox.\n */\nfunction NavigationV2Routes({ centerPath }: { centerPath: string }) {\n return (\n <Suspense fallback={<PageLoader />}>\n <Routes>\n <Route index element={<NotificationsV2Landing />} />\n <Route path=\"list\" element={<NotificationCenterPage />} />\n <Route path=\"center\" element={<NotificationCenterPage />} />\n <Route path=\"history\" element={<NotificationHistoryPage />} />\n <Route path=\"preferences\" element={<NotificationPreferencesPage />} />\n <Route\n path=\"templates\"\n element={\n <AdminPageV2 tool=\"templates\">\n <NotificationTemplatesPage />\n </AdminPageV2>\n }\n />\n <Route\n path=\"templates/new\"\n element={\n <AdminPageV2 tool=\"templates\">\n <TemplateEditorPage />\n </AdminPageV2>\n }\n />\n <Route\n path=\"templates/:templateId\"\n element={\n <AdminPageV2 tool=\"templates\">\n <TemplateEditorPage />\n </AdminPageV2>\n }\n />\n <Route\n path=\"create\"\n element={\n <AdminPageV2 tool=\"send\" back={false}>\n <CreateNotificationPage />\n </AdminPageV2>\n }\n />\n <Route\n path=\"topics\"\n element={\n <AdminPageV2 tool=\"topics\">\n <NotificationTopicsPage />\n </AdminPageV2>\n }\n />\n <Route path=\"delivery-log\" element={<DeliveryLogV2 />} />\n <Route path=\"*\" element={<Navigate to={centerPath} replace />} />\n </Routes>\n </Suspense>\n );\n}\n"],"mappings":";;;;;;;;;AAWA,IAAMA,IAA0BC,QAC9B,OAAO,qCAAkC,CAAC,MAAM,OAAO,EACrD,SAASC,EAAE,wBACb,EAAE,CACJ,GACMC,IAA4BF,QAChC,OAAO,uCAAoC,CAAC,MAAM,OAAO,EACvD,SAASC,EAAE,0BACb,EAAE,CACJ,GACME,IAAqBH,QACzB,OAAO,gCAA6B,CAAC,MAAM,OAAO,EAAE,SAASC,EAAE,mBAAmB,EAAE,CACtF,GACMG,IAAyBJ,QAC7B,OAAO,oCAAiC,CAAC,MAAM,OAAO,EAAE,SAASC,EAAE,uBAAuB,EAAE,CAC9F,GACMI,IAAyBL,QAC7B,OAAO,oCAAiC,CAAC,MAAM,OAAO,EAAE,SAASC,EAAE,uBAAuB,EAAE,CAC9F,GACMK,IAA8BN,QAClC,OAA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K;KAAO,MAAM;KAC7B,UAAA,kBAACjB,GAAD,CAAyB,CAAA;IACd,CAAA;GAEhB,CAAA;GACD,kBAACY,GAAD;IACE,MAAK;IACL,SACE,kBAACK,GAAD;KAAa,MAAK;KAChB,UAAA,kBAAChB,GAAD,CAAyB,CAAA;IACd,CAAA;GAEhB,CAAA;GACD,kBAACW,GAAD;IAAO,MAAK;IAAe,SAAS,kBAACM,GAAD,CAAgB,CAAA;GAAI,CAAA;GACxD,kBAACN,GAAD;IAAO,MAAK;IAAI,SAAS,kBAACG,GAAD;KAAU,IAAIT;KAAY,SAAA;IAAS,CAAA;GAAI,CAAA;EAC1D,EAAA,CAAA;CACA,CAAA;AAEd"}
|
|
1
|
+
{"version":3,"file":"NotificationRoutes.js","names":["NotificationHistoryPage","lazy","m","NotificationTemplatesPage","TemplateEditorPage","CreateNotificationPage","NotificationTopicsPage","NotificationPreferencesPage","PageLoader","SectionLoaderOr","CompactMarkOr","NotificationRoutes","useNotification","centerPath","basePath","navigationV2","NavigationV2Routes","Suspense","Routes","Route","NotificationLandingPage","NotificationCenterPage","Navigate","NotificationsV2Landing","AdminPageV2","DeliveryLogV2"],"sources":["../src/NotificationRoutes.tsx"],"sourcesContent":["import { lazy, Suspense } from 'react';\nimport { Navigate, Route, Routes } from 'react-router';\nimport { useNotification } from './providers/NotificationProvider';\n\n// Eager load - Primary landing page\nimport { NotificationCenterPage } from './pages/NotificationCenterPage';\nimport { NotificationLandingPage } from './pages/NotificationLandingPage';\nimport { AdminPageV2 } from './navigation-v2/AdminPageV2';\nimport { DeliveryLogV2, NotificationsV2Landing } from './navigation-v2/NotificationsV2Landing';\nimport { CompactMarkOr, SectionLoaderOr } from './components/loadingSystem';\n\n// Lazy load - Secondary pages\nconst NotificationHistoryPage = lazy(() =>\n import('./pages/NotificationHistoryPage').then((m) => ({\n default: m.NotificationHistoryPage,\n }))\n);\nconst NotificationTemplatesPage = lazy(() =>\n import('./pages/NotificationTemplatesPage').then((m) => ({\n default: m.NotificationTemplatesPage,\n }))\n);\nconst TemplateEditorPage = lazy(() =>\n import('./pages/TemplateEditorPage').then((m) => ({ default: m.TemplateEditorPage }))\n);\nconst CreateNotificationPage = lazy(() =>\n import('./pages/CreateNotificationPage').then((m) => ({ default: m.CreateNotificationPage }))\n);\nconst NotificationTopicsPage = lazy(() =>\n import('./pages/NotificationTopicsPage').then((m) => ({ default: m.NotificationTopicsPage }))\n);\nconst NotificationPreferencesPage = lazy(() =>\n import('./pages/NotificationPreferencesPage').then((m) => ({\n default: m.NotificationPreferencesPage,\n }))\n);\n\n// Loading fallback component\nfunction PageLoader() {\n return (\n <SectionLoaderOr\n route\n minHeight=\"16rem\"\n today={\n <div className=\"flex h-64 items-center justify-center\">\n <CompactMarkOr\n className=\"h-8 w-8\"\n today={\n <div className=\"h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent\" />\n }\n />\n </div>\n }\n />\n );\n}\n\n/**\n * Internal router for the Notification microfrontend.\n * This component handles routing within the microfrontend using React Router v7.\n *\n * Routes:\n * - / → Notification landing page\n * - /list → Notification center (canonical list alias used by shell nav homePath)\n * - /center → Notification center (in-app notifications)\n * - /history → Notification history and archive\n * - /templates → Notification templates list (admin)\n * - /templates/new → Create new template (admin)\n * - /templates/:templateId → Edit template (admin)\n * - /create → Create and send notification (admin)\n * - /topics → Manage topics (admin)\n * - /preferences → User topic preferences\n * - unmatched → Absolute redirect to /{basePath}/center (avoids relative redirect loops)\n */\nexport function NotificationRoutes() {\n const { basePath = '/', navigationV2 } = useNotification();\n const centerPath = `${basePath.endsWith('/') ? basePath.slice(0, -1) : basePath}/center`;\n\n if (navigationV2) return <NavigationV2Routes centerPath={centerPath} />;\n\n return (\n <Suspense fallback={<PageLoader />}>\n <Routes>\n {/* Tabbed landing - default route */}\n <Route index element={<NotificationLandingPage />} />\n\n {/* Canonical list alias used by product-shell nav homePath */}\n <Route path=\"list\" element={<NotificationCenterPage />} />\n\n {/* User-facing routes (all users) */}\n <Route path=\"center\" element={<NotificationCenterPage />} />\n <Route path=\"history\" element={<NotificationHistoryPage />} />\n\n {/* Admin routes - Templates */}\n <Route path=\"templates\" element={<NotificationTemplatesPage />} />\n <Route path=\"templates/new\" element={<TemplateEditorPage />} />\n <Route path=\"templates/:templateId\" element={<TemplateEditorPage />} />\n\n {/* Admin routes - Create/Send Notification */}\n <Route path=\"create\" element={<CreateNotificationPage />} />\n <Route path=\"topics\" element={<NotificationTopicsPage />} />\n <Route path=\"preferences\" element={<NotificationPreferencesPage />} />\n\n {/* Catch-all route - absolute redirect so an unmatched path like /list\n cannot recursively append /center (e.g. /list/center/center/...) */}\n <Route path=\"*\" element={<Navigate to={centerPath} replace />} />\n </Routes>\n </Suspense>\n );\n}\n\n/**\n * FluidGrids' Navigation v2 routes (BOFF-11872). Every URL of the classic\n * routes keeps working: `/` opens straight on the inbox (old `?tab=` values\n * still open their page), and the admin pages get a route-level permission\n * gate and a way back to the inbox.\n */\nfunction NavigationV2Routes({ centerPath }: { centerPath: string }) {\n return (\n <Suspense fallback={<PageLoader />}>\n <Routes>\n <Route index element={<NotificationsV2Landing />} />\n <Route path=\"list\" element={<NotificationCenterPage />} />\n <Route path=\"center\" element={<NotificationCenterPage />} />\n <Route path=\"history\" element={<NotificationHistoryPage />} />\n <Route path=\"preferences\" element={<NotificationPreferencesPage />} />\n <Route\n path=\"templates\"\n element={\n <AdminPageV2 tool=\"templates\">\n <NotificationTemplatesPage />\n </AdminPageV2>\n }\n />\n <Route\n path=\"templates/new\"\n element={\n <AdminPageV2 tool=\"templates\">\n <TemplateEditorPage />\n </AdminPageV2>\n }\n />\n <Route\n path=\"templates/:templateId\"\n element={\n <AdminPageV2 tool=\"templates\">\n <TemplateEditorPage />\n </AdminPageV2>\n }\n />\n <Route\n path=\"create\"\n element={\n <AdminPageV2 tool=\"send\" back={false}>\n <CreateNotificationPage />\n </AdminPageV2>\n }\n />\n <Route\n path=\"topics\"\n element={\n <AdminPageV2 tool=\"topics\">\n <NotificationTopicsPage />\n </AdminPageV2>\n }\n />\n <Route path=\"delivery-log\" element={<DeliveryLogV2 />} />\n <Route path=\"*\" element={<Navigate to={centerPath} replace />} />\n </Routes>\n </Suspense>\n );\n}\n"],"mappings":";;;;;;;;;;AAYA,IAAMA,IAA0BC,QAC9B,OAAO,qCAAkC,CAAC,MAAM,OAAO,EACrD,SAASC,EAAE,wBACb,EAAE,CACJ,GACMC,IAA4BF,QAChC,OAAO,uCAAoC,CAAC,MAAM,OAAO,EACvD,SAASC,EAAE,0BACb,EAAE,CACJ,GACME,IAAqBH,QACzB,OAAO,gCAA6B,CAAC,MAAM,OAAO,EAAE,SAASC,EAAE,mBAAmB,EAAE,CACtF,GACMG,IAAyBJ,QAC7B,OAAO,oCAAiC,CAAC,MAAM,OAAO,EAAE,SAASC,EAAE,uBAAuB,EAAE,CAC9F,GACMI,IAAyBL,QAC7B,OAAO,oCAAiC,CAAC,MAAM,OAAO,EAAE,SAASC,EAAE,uBAAuB,EAAE,CAC9F,GACMK,IAA8BN,QAClC,OAAO,yCAAsC,CAAC,MAAM,OAAO,EACzD,SAASC,EAAE,4BACb,EAAE,CACJ;AAGA,SAASM,IAAa;CACpB,OACE,kBAACC,GAAD;EACE,OAAA;EACA,WAAU;EACV,OACE,kBAAC,OAAD;GAAK,WAAU;GACb,UAAA,kBAACC,GAAD;IACE,WAAU;IACV,OACE,kBAAC,OAAD,EAAK,WAAU,iFAAkF,CAAA;GAEpG,CAAA;EACE,CAAA;CAER,CAAA;AAEL;AAmBA,SAAgBC,IAAqB;CACnC,IAAM,EAAE,cAAW,KAAK,oBAAiBC,EAAgB,GACnDC,IAAa,GAAGC,EAAS,SAAS,GAAG,IAAIA,EAAS,MAAM,GAAG,EAAE,IAAIA,EAAS;CAIhF,OAFIC,IAAqB,kBAACC,GAAD,EAAgC,cAAa,CAAA,IAGpE,kBAACC,GAAD;EAAU,UAAU,kBAACT,GAAD,CAAa,CAAA;EAC/B,UAAA,kBAACU,GAAD,EAAA,UAAA;GAEE,kB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AACE,GAAD,CAAyB,CAAA;GAAI,CAAA;GACzD,kBAACF,GAAD;IAAO,MAAK;IAAS,SAAS,kBAACE,GAAD,CAAyB,CAAA;GAAI,CAAA;GAC3D,kBAACF,GAAD;IAAO,MAAK;IAAU,SAAS,kBAACnB,GAAD,CAA0B,CAAA;GAAI,CAAA;GAC7D,kBAACmB,GAAD;IAAO,MAAK;IAAc,SAAS,kBAACZ,GAAD,CAA8B,CAAA;GAAI,CAAA;GACrE,kBAACY,GAAD;IACE,MAAK;IACL,SACE,kBAACK,GAAD;KAAa,MAAK;KAChB,UAAA,kBAACrB,GAAD,CAA4B,CAAA;IACjB,CAAA;GAEhB,CAAA;GACD,kBAACgB,GAAD;IACE,MAAK;IACL,SACE,kBAACK,GAAD;KAAa,MAAK;KAChB,UAAA,kBAACpB,GAAD,CAAqB,CAAA;IACV,CAAA;GAEhB,CAAA;GACD,kBAACe,GAAD;IACE,MAAK;IACL,SACE,kBAACK,GAAD;KAAa,MAAK;KAChB,UAAA,kBAACpB,GAAD,CAAqB,CAAA;IACV,CAAA;GAEhB,CAAA;GACD,kBAACe,GAAD;IACE,MAAK;IACL,SACE,kBAACK,GAAD;KAAa,MAAK;KAAO,MAAM;KAC7B,UAAA,kBAACnB,GAAD,CAAyB,CAAA;IACd,CAAA;GAEhB,CAAA;GACD,kBAACc,GAAD;IACE,MAAK;IACL,SACE,kBAACK,GAAD;KAAa,MAAK;KAChB,UAAA,kBAAClB,GAAD,CAAyB,CAAA;IACd,CAAA;GAEhB,CAAA;GACD,kBAACa,GAAD;IAAO,MAAK;IAAe,SAAS,kBAACM,GAAD,CAAgB,CAAA;GAAI,CAAA;GACxD,kBAACN,GAAD;IAAO,MAAK;IAAI,SAAS,kBAACG,GAAD;KAAU,IAAIT;KAAY,SAAA;IAAS,CAAA;GAAI,CAAA;EAC1D,EAAA,CAAA;CACA,CAAA;AAEd"}
|
|
@@ -2,59 +2,67 @@ import { FeatureDisabledPage as e } from "./components/FeatureDisabledPage.js";
|
|
|
2
2
|
import { useNotification as t } from "./providers/NotificationProvider.js";
|
|
3
3
|
import { useTr as n } from "./shared/hooks/useTr.js";
|
|
4
4
|
import { NotificationCenterPage as r } from "./pages/NotificationCenterPage.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
5
|
+
import { CompactMarkOr as i, SectionLoaderOr as a } from "./components/loadingSystem.js";
|
|
6
|
+
import { Suspense as o, lazy as s } from "react";
|
|
7
|
+
import { useFeatureFlagDetails as c } from "@burdenoff/fe-libs/shared/feature-flags";
|
|
8
|
+
import { Navigate as l, Route as u, Routes as d } from "react-router";
|
|
9
|
+
import { jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
9
10
|
// src/UserNotificationRoutes.tsx
|
|
10
|
-
var
|
|
11
|
-
function
|
|
12
|
-
return /* @__PURE__ */
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
var m = s(() => import("./pages/NotificationHistoryPage.js").then((e) => ({ default: e.NotificationHistoryPage }))), h = s(() => import("./pages/NotificationPreferencesPage.js").then((e) => ({ default: e.NotificationPreferencesPage })));
|
|
12
|
+
function g() {
|
|
13
|
+
return /* @__PURE__ */ f(a, {
|
|
14
|
+
route: !0,
|
|
15
|
+
minHeight: "16rem",
|
|
16
|
+
today: /* @__PURE__ */ f("div", {
|
|
17
|
+
className: "flex h-64 items-center justify-center",
|
|
18
|
+
children: /* @__PURE__ */ f(i, {
|
|
19
|
+
className: "h-8 w-8",
|
|
20
|
+
today: /* @__PURE__ */ f("div", { className: "h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent" })
|
|
21
|
+
})
|
|
22
|
+
})
|
|
15
23
|
});
|
|
16
24
|
}
|
|
17
|
-
function
|
|
18
|
-
let { basePath:
|
|
19
|
-
return /* @__PURE__ */
|
|
20
|
-
fallback: /* @__PURE__ */
|
|
21
|
-
children: /* @__PURE__ */ d
|
|
22
|
-
/* @__PURE__ */ u
|
|
25
|
+
function _() {
|
|
26
|
+
let { basePath: i = "/" } = t(), a = n(), s = `${i.endsWith("/") ? i.slice(0, -1) : i}/center`, _ = c("notification.history"), v = _ ? !!_.value : !1;
|
|
27
|
+
return /* @__PURE__ */ f(o, {
|
|
28
|
+
fallback: /* @__PURE__ */ f(g, {}),
|
|
29
|
+
children: /* @__PURE__ */ p(d, { children: [
|
|
30
|
+
/* @__PURE__ */ f(u, {
|
|
23
31
|
index: !0,
|
|
24
|
-
element: /* @__PURE__ */
|
|
25
|
-
to:
|
|
32
|
+
element: /* @__PURE__ */ f(l, {
|
|
33
|
+
to: s,
|
|
26
34
|
replace: !0
|
|
27
35
|
})
|
|
28
36
|
}),
|
|
29
|
-
/* @__PURE__ */ u
|
|
37
|
+
/* @__PURE__ */ f(u, {
|
|
30
38
|
path: "list",
|
|
31
|
-
element: /* @__PURE__ */
|
|
39
|
+
element: /* @__PURE__ */ f(r, {})
|
|
32
40
|
}),
|
|
33
|
-
/* @__PURE__ */ u
|
|
41
|
+
/* @__PURE__ */ f(u, {
|
|
34
42
|
path: "center",
|
|
35
|
-
element: /* @__PURE__ */
|
|
43
|
+
element: /* @__PURE__ */ f(r, {})
|
|
36
44
|
}),
|
|
37
|
-
/* @__PURE__ */ u
|
|
45
|
+
/* @__PURE__ */ f(u, {
|
|
38
46
|
path: "history",
|
|
39
|
-
element: v ? /* @__PURE__ */
|
|
40
|
-
title:
|
|
41
|
-
description:
|
|
47
|
+
element: v ? /* @__PURE__ */ f(m, {}) : /* @__PURE__ */ f(e, {
|
|
48
|
+
title: a("notification.featureDisabled.historyTitle", "Notification history is not enabled"),
|
|
49
|
+
description: a("notification.featureDisabled.historyUserDescription", "This page is controlled by the notification.history feature flag. Ask an administrator to enable it for this tenant if history should be available.")
|
|
42
50
|
})
|
|
43
51
|
}),
|
|
44
|
-
/* @__PURE__ */ u
|
|
52
|
+
/* @__PURE__ */ f(u, {
|
|
45
53
|
path: "preferences",
|
|
46
|
-
element: /* @__PURE__ */
|
|
54
|
+
element: /* @__PURE__ */ f(h, {})
|
|
47
55
|
}),
|
|
48
|
-
/* @__PURE__ */ u
|
|
56
|
+
/* @__PURE__ */ f(u, {
|
|
49
57
|
path: "*",
|
|
50
|
-
element: /* @__PURE__ */
|
|
51
|
-
to:
|
|
58
|
+
element: /* @__PURE__ */ f(l, {
|
|
59
|
+
to: s,
|
|
52
60
|
replace: !0
|
|
53
61
|
})
|
|
54
62
|
})
|
|
55
63
|
] })
|
|
56
64
|
});
|
|
57
65
|
}
|
|
58
|
-
export {
|
|
66
|
+
export { _ as UserNotificationRoutes };
|
|
59
67
|
|
|
60
68
|
//# sourceMappingURL=UserNotificationRoutes.js.map
|