@burdenoff/microfe-notification 2026.1109.1 → 2026.1114.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/NotificationRoutes.js +108 -36
- package/dist/NotificationRoutes.js.map +1 -1
- package/dist/components/ConfirmDeleteDialog.d.ts +17 -0
- package/dist/components/ConfirmDeleteDialog.js +22 -0
- package/dist/components/ConfirmDeleteDialog.js.map +1 -0
- package/dist/components/NotificationCard.d.ts +10 -1
- package/dist/components/NotificationCard.js +103 -72
- package/dist/components/NotificationCard.js.map +1 -1
- package/dist/hooks/index.js +5 -5
- package/dist/hooks/usePreferenceToggles.d.ts +27 -0
- package/dist/hooks/usePreferenceToggles.js +84 -0
- package/dist/hooks/usePreferenceToggles.js.map +1 -0
- package/dist/navigation-v2/AdminPageV2.d.ts +14 -0
- package/dist/navigation-v2/AdminPageV2.js +51 -0
- package/dist/navigation-v2/AdminPageV2.js.map +1 -0
- package/dist/navigation-v2/AdminToolsMenu.d.ts +6 -0
- package/dist/navigation-v2/AdminToolsMenu.js +32 -0
- package/dist/navigation-v2/AdminToolsMenu.js.map +1 -0
- package/dist/navigation-v2/BackToNotifications.d.ts +2 -0
- package/dist/navigation-v2/BackToNotifications.js +20 -0
- package/dist/navigation-v2/BackToNotifications.js.map +1 -0
- package/dist/navigation-v2/FilterControls.d.ts +25 -0
- package/dist/navigation-v2/FilterControls.js +64 -0
- package/dist/navigation-v2/FilterControls.js.map +1 -0
- package/dist/navigation-v2/NotificationArchivedV2.d.ts +9 -0
- package/dist/navigation-v2/NotificationArchivedV2.js +174 -0
- package/dist/navigation-v2/NotificationArchivedV2.js.map +1 -0
- package/dist/navigation-v2/NotificationInboxV2.d.ts +9 -0
- package/dist/navigation-v2/NotificationInboxV2.js +309 -0
- package/dist/navigation-v2/NotificationInboxV2.js.map +1 -0
- package/dist/navigation-v2/NotificationSettingsV2.d.ts +9 -0
- package/dist/navigation-v2/NotificationSettingsV2.js +203 -0
- package/dist/navigation-v2/NotificationSettingsV2.js.map +1 -0
- package/dist/navigation-v2/NotificationsV2Landing.d.ts +9 -0
- package/dist/navigation-v2/NotificationsV2Landing.js +37 -0
- package/dist/navigation-v2/NotificationsV2Landing.js.map +1 -0
- package/dist/navigation-v2/__tests__/uiMocks.d.ts +71 -0
- package/dist/navigation-v2/inboxFilters.d.ts +8 -0
- package/dist/navigation-v2/inboxFilters.js +10 -0
- package/dist/navigation-v2/inboxFilters.js.map +1 -0
- package/dist/navigation-v2/paths.d.ts +24 -0
- package/dist/navigation-v2/paths.js +31 -0
- package/dist/navigation-v2/paths.js.map +1 -0
- package/dist/navigation-v2/settingsOptions.d.ts +12 -0
- package/dist/navigation-v2/settingsOptions.js +58 -0
- package/dist/navigation-v2/settingsOptions.js.map +1 -0
- package/dist/navigation-v2/useAdminTools.d.ts +22 -0
- package/dist/navigation-v2/useAdminTools.js +76 -0
- package/dist/navigation-v2/useAdminTools.js.map +1 -0
- package/dist/pages/CreateNotificationPage.js +577 -558
- package/dist/pages/CreateNotificationPage.js.map +1 -1
- package/dist/pages/NotificationCenterPage.d.ts +3 -1
- package/dist/pages/NotificationCenterPage.js +79 -74
- package/dist/pages/NotificationCenterPage.js.map +1 -1
- package/dist/pages/NotificationHistoryPage.d.ts +5 -1
- package/dist/pages/NotificationHistoryPage.js +52 -47
- package/dist/pages/NotificationHistoryPage.js.map +1 -1
- package/dist/pages/NotificationPreferencesPage.d.ts +4 -0
- package/dist/pages/NotificationPreferencesPage.js +97 -158
- package/dist/pages/NotificationPreferencesPage.js.map +1 -1
- package/dist/pages/NotificationTemplatesPage.js +184 -166
- package/dist/pages/NotificationTemplatesPage.js.map +1 -1
- package/dist/pages/NotificationTopicsPage.js +123 -108
- package/dist/pages/NotificationTopicsPage.js.map +1 -1
- package/dist/pages/TemplateEditorPage.js +339 -308
- package/dist/pages/TemplateEditorPage.js.map +1 -1
- package/dist/providers/NotificationProvider.js +6 -5
- package/dist/providers/NotificationProvider.js.map +1 -1
- package/dist/types/index.d.ts +8 -0
- package/package.json +2 -2
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { NotificationChannel, NotificationPreferenceScope, NotificationType } from '../types';
|
|
2
|
+
export interface PreferenceTarget {
|
|
3
|
+
scope: NotificationPreferenceScope;
|
|
4
|
+
channel?: NotificationChannel;
|
|
5
|
+
type?: NotificationType;
|
|
6
|
+
topicId?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface PreferenceFeedback {
|
|
9
|
+
key: string;
|
|
10
|
+
type: 'success' | 'error';
|
|
11
|
+
message: string;
|
|
12
|
+
}
|
|
13
|
+
/** The key a preference is stored under: the same as the backend's `preferenceKey`. */
|
|
14
|
+
export declare function preferenceKey(input: PreferenceTarget): string;
|
|
15
|
+
/**
|
|
16
|
+
* Toggling and resetting one notification preference, with the saved/failed
|
|
17
|
+
* status line. Shared by the classic Preferences page and FluidGrids'
|
|
18
|
+
* Notification settings (BOFF-11872) so both make exactly the same calls.
|
|
19
|
+
*/
|
|
20
|
+
export declare function usePreferenceToggles(): {
|
|
21
|
+
preferencesByKey: Map<string, import('../types').NotificationPreference>;
|
|
22
|
+
preferencesLoading: boolean;
|
|
23
|
+
savingKey: string | null;
|
|
24
|
+
saveFeedback: PreferenceFeedback | null;
|
|
25
|
+
togglePreference: (input: PreferenceTarget) => Promise<void>;
|
|
26
|
+
resetPreference: (key: string) => Promise<void>;
|
|
27
|
+
};
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { useNotificationPreferences as e } from "./useNotificationPreferences.js";
|
|
2
|
+
import { useNotificationAnalytics as t } from "./useNotificationAnalytics.js";
|
|
3
|
+
import { useTr as n } from "../shared/hooks/useTr.js";
|
|
4
|
+
import { nativeImpact as r, nativeNotify as i } from "../utils/nativeBridge.js";
|
|
5
|
+
import { useEffect as a, useRef as o, useState as s } from "react";
|
|
6
|
+
// src/hooks/usePreferenceToggles.ts
|
|
7
|
+
function c(e) {
|
|
8
|
+
return e.scope === "CHANNEL" ? `CHANNEL:${e.channel || ""}` : e.scope === "TYPE" ? `TYPE:${e.type || ""}` : e.scope === "TOPIC" ? `TOPIC:${e.topicId || ""}` : "GLOBAL";
|
|
9
|
+
}
|
|
10
|
+
function l() {
|
|
11
|
+
let l = n(), { preferencesByKey: u, isLoading: d, setPreference: f, deletePreference: p } = e(), { trackPreferenceUpdated: m } = t(), [h, g] = s(null), [_, v] = s(null), y = o(null);
|
|
12
|
+
a(() => () => {
|
|
13
|
+
y.current && clearTimeout(y.current);
|
|
14
|
+
}, []);
|
|
15
|
+
let b = (e) => {
|
|
16
|
+
y.current && clearTimeout(y.current), v(e), y.current = setTimeout(() => {
|
|
17
|
+
v((t) => t?.key === e.key ? null : t), y.current = null;
|
|
18
|
+
}, 2500);
|
|
19
|
+
};
|
|
20
|
+
return {
|
|
21
|
+
preferencesByKey: u,
|
|
22
|
+
preferencesLoading: d,
|
|
23
|
+
savingKey: h,
|
|
24
|
+
saveFeedback: _,
|
|
25
|
+
togglePreference: async (e) => {
|
|
26
|
+
let t = c(e), n = u.get(t), a = !(n?.enabled ?? !0);
|
|
27
|
+
g(t), r("medium");
|
|
28
|
+
try {
|
|
29
|
+
await f({
|
|
30
|
+
...e,
|
|
31
|
+
enabled: a,
|
|
32
|
+
frequency: n?.frequency || "IMMEDIATE"
|
|
33
|
+
}), m({
|
|
34
|
+
action: "set",
|
|
35
|
+
scope: e.scope,
|
|
36
|
+
channel: e.channel,
|
|
37
|
+
type: e.type,
|
|
38
|
+
enabled: a
|
|
39
|
+
}), b({
|
|
40
|
+
key: t,
|
|
41
|
+
type: "success",
|
|
42
|
+
message: l("notifications.preferenceSaved", "Preference saved.")
|
|
43
|
+
}), i("success");
|
|
44
|
+
} catch {
|
|
45
|
+
b({
|
|
46
|
+
key: t,
|
|
47
|
+
type: "error",
|
|
48
|
+
message: l("notifications.preferenceSaveFailed", "Could not save preference.")
|
|
49
|
+
}), i("error");
|
|
50
|
+
} finally {
|
|
51
|
+
g(null);
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
resetPreference: async (e) => {
|
|
55
|
+
let t = u.get(e);
|
|
56
|
+
if (t) {
|
|
57
|
+
g(e);
|
|
58
|
+
try {
|
|
59
|
+
await p(t.id), m({
|
|
60
|
+
action: "reset",
|
|
61
|
+
scope: t.scope,
|
|
62
|
+
channel: t.channel,
|
|
63
|
+
type: t.type
|
|
64
|
+
}), b({
|
|
65
|
+
key: e,
|
|
66
|
+
type: "success",
|
|
67
|
+
message: l("notifications.preferenceReset", "Preference reset.")
|
|
68
|
+
});
|
|
69
|
+
} catch {
|
|
70
|
+
b({
|
|
71
|
+
key: e,
|
|
72
|
+
type: "error",
|
|
73
|
+
message: l("notifications.preferenceResetFailed", "Could not reset preference.")
|
|
74
|
+
});
|
|
75
|
+
} finally {
|
|
76
|
+
g(null);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
export { c as preferenceKey, l as usePreferenceToggles };
|
|
83
|
+
|
|
84
|
+
//# sourceMappingURL=usePreferenceToggles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePreferenceToggles.js","names":["preferenceKey","input","usePreferenceToggles","tr","useTr","preferencesLoading","useNotificationPreferences","useNotificationAnalytics","savingKey","setSavingKey","useState","saveFeedback","setSaveFeedback","feedbackTimerRef","useRef","showSaveFeedback","feedback","current","key","existing","preferencesByKey","nextEnabled","nativeImpact","setPreference","trackPreferenceUpdated","nativeNotify","deletePreference"],"sources":["../../src/hooks/usePreferenceToggles.ts"],"sourcesContent":["import { useEffect, useRef, useState } from 'react';\nimport { useNotificationPreferences } from './useNotificationPreferences';\nimport { useNotificationAnalytics } from './useNotificationAnalytics';\nimport { useTr } from '../shared/hooks/useTr';\nimport type { NotificationChannel, NotificationPreferenceScope, NotificationType } from '../types';\nimport { nativeImpact, nativeNotify } from '../utils/nativeBridge';\n\nexport interface PreferenceTarget {\n scope: NotificationPreferenceScope;\n channel?: NotificationChannel;\n type?: NotificationType;\n topicId?: string;\n}\n\nexport interface PreferenceFeedback {\n key: string;\n type: 'success' | 'error';\n message: string;\n}\n\n/** The key a preference is stored under: the same as the backend's `preferenceKey`. */\nexport function preferenceKey(input: PreferenceTarget): string {\n if (input.scope === 'CHANNEL') return `CHANNEL:${input.channel || ''}`;\n if (input.scope === 'TYPE') return `TYPE:${input.type || ''}`;\n if (input.scope === 'TOPIC') return `TOPIC:${input.topicId || ''}`;\n return 'GLOBAL';\n}\n\n/**\n * Toggling and resetting one notification preference, with the saved/failed\n * status line. Shared by the classic Preferences page and FluidGrids'\n * Notification settings (BOFF-11872) so both make exactly the same calls.\n */\nexport function usePreferenceToggles() {\n const tr = useTr();\n const {\n preferencesByKey,\n isLoading: preferencesLoading,\n setPreference,\n deletePreference,\n } = useNotificationPreferences();\n const { trackPreferenceUpdated } = useNotificationAnalytics();\n const [savingKey, setSavingKey] = useState<string | null>(null);\n const [saveFeedback, setSaveFeedback] = useState<PreferenceFeedback | null>(null);\n const feedbackTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n\n useEffect(() => {\n return () => {\n if (feedbackTimerRef.current) {\n clearTimeout(feedbackTimerRef.current);\n }\n };\n }, []);\n\n const showSaveFeedback = (feedback: PreferenceFeedback) => {\n if (feedbackTimerRef.current) {\n clearTimeout(feedbackTimerRef.current);\n }\n\n setSaveFeedback(feedback);\n feedbackTimerRef.current = setTimeout(() => {\n setSaveFeedback((current) => (current?.key === feedback.key ? null : current));\n feedbackTimerRef.current = null;\n }, 2500);\n };\n\n const togglePreference = async (input: PreferenceTarget) => {\n const key = preferenceKey(input);\n const existing = preferencesByKey.get(key);\n const nextEnabled = !(existing?.enabled ?? true);\n setSavingKey(key);\n nativeImpact('medium');\n try {\n await setPreference({\n ...input,\n enabled: nextEnabled,\n frequency: existing?.frequency || 'IMMEDIATE',\n });\n trackPreferenceUpdated({\n action: 'set',\n scope: input.scope,\n channel: input.channel,\n type: input.type,\n enabled: nextEnabled,\n });\n showSaveFeedback({\n key,\n type: 'success',\n message: tr('notifications.preferenceSaved', 'Preference saved.'),\n });\n void nativeNotify('success');\n } catch {\n showSaveFeedback({\n key,\n type: 'error',\n message: tr('notifications.preferenceSaveFailed', 'Could not save preference.'),\n });\n void nativeNotify('error');\n } finally {\n setSavingKey(null);\n }\n };\n\n const resetPreference = async (key: string) => {\n const existing = preferencesByKey.get(key);\n if (!existing) return;\n setSavingKey(key);\n try {\n await deletePreference(existing.id);\n trackPreferenceUpdated({\n action: 'reset',\n scope: existing.scope,\n channel: existing.channel,\n type: existing.type,\n });\n showSaveFeedback({\n key,\n type: 'success',\n message: tr('notifications.preferenceReset', 'Preference reset.'),\n });\n } catch {\n showSaveFeedback({\n key,\n type: 'error',\n message: tr('notifications.preferenceResetFailed', 'Could not reset preference.'),\n });\n } finally {\n setSavingKey(null);\n }\n };\n\n return {\n preferencesByKey,\n preferencesLoading,\n savingKey,\n saveFeedback,\n togglePreference,\n resetPreference,\n };\n}\n"],"mappings":";;;;;;AAqBA,SAAgBA,EAAc,GAAiC;CAI7D,OAHIC,EAAM,UAAU,YAAkB,WAAWA,EAAM,WAAW,OAC9DA,EAAM,UAAU,SAAe,QAAQA,EAAM,QAAQ,OACrDA,EAAM,UAAU,UAAgB,SAASA,EAAM,WAAW,OACvD;AACT;AAOA,SAAgBC,IAAuB;CACrC,IAAMC,IAAKC,EAAM,GACX,EACJ,qBACA,WAAWC,GACX,kBACA,wBACEC,EAA2B,GACzB,EAAE,8BAA2BC,EAAyB,GACtD,CAACC,GAAWC,KAAgBC,EAAwB,IAAI,GACxD,CAACC,GAAcC,KAAmBF,EAAoC,IAAI,GAC1EG,IAAmBC,EAA6C,IAAI;CAE1E,cACe;EACX,AAAID,EAAiB,WACnB,aAAaA,EAAiB,OAAO;CAEzC,GACC,CAAC,CAAC;CAEL,IAAME,KAAoB,MAAiC;EAMzD,AALIF,EAAiB,WACnB,aAAaA,EAAiB,OAAO,GAGvC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;IACH,UAAU;KACR,EAAa,IAAI;IACnB;GAtBgB;EAuBlB;CASA;AACF"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { AdminToolId } from './useAdminTools';
|
|
3
|
+
/**
|
|
4
|
+
* A Navigation v2 admin page (BOFF-11872): "‹ Notifications" above it, and a
|
|
5
|
+
* route-level gate (§8 item 1). Someone without the permission sees "You need
|
|
6
|
+
* access" instead of loading a page they cannot use; the page's own in-page
|
|
7
|
+
* checks stay as they are.
|
|
8
|
+
*/
|
|
9
|
+
export declare function AdminPageV2({ tool, children, back, }: {
|
|
10
|
+
tool: AdminToolId;
|
|
11
|
+
children: ReactNode;
|
|
12
|
+
/** False for a page with its own back button (Send). */
|
|
13
|
+
back?: boolean;
|
|
14
|
+
}): import('react').JSX.Element;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { useTr as e } from "../shared/hooks/useTr.js";
|
|
2
|
+
import { BackToNotifications as t } from "./BackToNotifications.js";
|
|
3
|
+
import { holdsAdminToolPermission as n } from "./useAdminTools.js";
|
|
4
|
+
import { usePermissions as r } from "@burdenoff/fe-libs/shared/providers/shell";
|
|
5
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
6
|
+
import { AccessGate as o } from "@burdenoff/fe-libs/ui";
|
|
7
|
+
// src/navigation-v2/AdminPageV2.tsx
|
|
8
|
+
function s() {
|
|
9
|
+
return /* @__PURE__ */ i("div", {
|
|
10
|
+
className: "flex h-64 items-center justify-center",
|
|
11
|
+
children: /* @__PURE__ */ i("div", { className: "h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent" })
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
var c = {
|
|
15
|
+
send: {
|
|
16
|
+
key: "notifications.v2.admin.send",
|
|
17
|
+
fallback: "Send"
|
|
18
|
+
},
|
|
19
|
+
deliveryLog: {
|
|
20
|
+
key: "notifications.v2.admin.deliveryLog",
|
|
21
|
+
fallback: "Delivery log"
|
|
22
|
+
},
|
|
23
|
+
templates: {
|
|
24
|
+
key: "notifications.v2.admin.templates",
|
|
25
|
+
fallback: "Templates"
|
|
26
|
+
},
|
|
27
|
+
topics: {
|
|
28
|
+
key: "notifications.v2.admin.topics",
|
|
29
|
+
fallback: "Topics"
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
function l({ tool: l, children: u, back: d = !0 }) {
|
|
33
|
+
let f = e(), { hasPermission: p, isLoading: m } = r(), h = f(c[l].key, c[l].fallback), g = u;
|
|
34
|
+
return m ? g = /* @__PURE__ */ i(s, {}) : n(l, p) || (g = /* @__PURE__ */ i(o, {
|
|
35
|
+
className: "py-16",
|
|
36
|
+
message: f("notifications.v2.needAccess", "You need access to {{page}}", { page: h }),
|
|
37
|
+
granterHint: f("notifications.v2.needAccessHint", "Ask a workspace admin to give your role this permission.")
|
|
38
|
+
})), /* @__PURE__ */ a("div", {
|
|
39
|
+
className: "flex h-full flex-col",
|
|
40
|
+
children: [d && /* @__PURE__ */ i("div", {
|
|
41
|
+
className: "px-3 pt-2 sm:px-4",
|
|
42
|
+
children: /* @__PURE__ */ i(t, {})
|
|
43
|
+
}), /* @__PURE__ */ i("div", {
|
|
44
|
+
className: "min-h-0 flex-1",
|
|
45
|
+
children: g
|
|
46
|
+
})]
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
export { l as AdminPageV2 };
|
|
50
|
+
|
|
51
|
+
//# sourceMappingURL=AdminPageV2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AdminPageV2.js","names":["PageLoader","PAGE_NAMES","AdminPageV2","tr","useTr","usePermissions","name","tool","body","children","isLoading","holdsAdminToolPermission","hasPermission","AccessGate","back","BackToNotifications"],"sources":["../../src/navigation-v2/AdminPageV2.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport { usePermissions } from '@burdenoff/fe-libs/shared/providers/shell';\nimport { AccessGate } from '@burdenoff/fe-libs/ui';\nimport { useTr } from '../shared/hooks/useTr';\nimport { BackToNotifications } from './BackToNotifications';\nimport { holdsAdminToolPermission, type AdminToolId } from './useAdminTools';\n\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\nconst PAGE_NAMES: Record<AdminToolId, { key: string; fallback: string }> = {\n send: { key: 'notifications.v2.admin.send', fallback: 'Send' },\n deliveryLog: { key: 'notifications.v2.admin.deliveryLog', fallback: 'Delivery log' },\n templates: { key: 'notifications.v2.admin.templates', fallback: 'Templates' },\n topics: { key: 'notifications.v2.admin.topics', fallback: 'Topics' },\n};\n\n/**\n * A Navigation v2 admin page (BOFF-11872): \"‹ Notifications\" above it, and a\n * route-level gate (§8 item 1). Someone without the permission sees \"You need\n * access\" instead of loading a page they cannot use; the page's own in-page\n * checks stay as they are.\n */\nexport function AdminPageV2({\n tool,\n children,\n back = true,\n}: {\n tool: AdminToolId;\n children: ReactNode;\n /** False for a page with its own back button (Send). */\n back?: boolean;\n}) {\n const tr = useTr();\n const { hasPermission, isLoading } = usePermissions();\n const name = tr(PAGE_NAMES[tool].key, PAGE_NAMES[tool].fallback);\n let body: ReactNode = children;\n if (isLoading) body = <PageLoader />;\n else if (!holdsAdminToolPermission(tool, hasPermission)) {\n body = (\n <AccessGate\n className=\"py-16\"\n message={tr('notifications.v2.needAccess', 'You need access to {{page}}', { page: name })}\n granterHint={tr(\n 'notifications.v2.needAccessHint',\n 'Ask a workspace admin to give your role this permission.'\n )}\n />\n );\n }\n return (\n <div className=\"flex h-full flex-col\">\n {back && (\n <div className=\"px-3 pt-2 sm:px-4\">\n <BackToNotifications />\n </div>\n )}\n <div className=\"min-h-0 flex-1\">{body}</div>\n </div>\n );\n}\n"],"mappings":";;;;;;;AAOA,SAASA,IAAa;CACpB,OACE,kBAAC,OAAD;EAAK,WAAU;EACb,UAAA,kBAAC,OAAD,EAAK,WAAU,iFAAkF,CAAA;CAC9F,CAAA;AAET;AAEA,IAAMC,IAAqE;CACzE,MAAM;EAAE,KAAK;EAA+B,UAAU;CAAO;CAC7D,aAAa;EAAE,KAAK;EAAsC,UAAU;CAAe;CACnF,WAAW;EAAE,KAAK;EAAoC,UAAU;CAAY;CAC5E,QAAQ;EAAE,KAAK;EAAiC,UAAU;CAAS;AACrE;AAQA,SAAgBC,EAAY,EAC1B,SACA,aACA,UAAO,MAMN;CACD,IAAMC,IAAKC,EAAM,GACX,EAAE,kBAAe,iBAAcC,EAAe,GAC9CC,IAAOH,EAAGF,EAAWM,EAAK,CAAC,KAAKN,EAAWM,EAAK,CAAC,QAAQ,GAC3DC,IAAkBC;CActB,OAbIC,IAAW,IAAO,kBAACV,GAAD,CAAa,CAAA,IACzBW,EAAyBJ,GAAMK,CAAa,MACpD,IACE,kBAACC,GAAD;EACE,WAAU;EACV,SAASV,EAAG,+BAA+B,+BAA+B,EAAE,MAAMG,EAAK,CAAC;EACxF,aAAaH,EACX,mCACA,0DACF;CACD,CAAA,IAIH,kBAAC,OAAD;EAAK,WAAU;EAAf,UAAA,CACGW,KACC,kBAAC,OAAD;GAAK,WAAU;GACb,UAAA,kBAACC,GAAD,CAAsB,CAAA;EACnB,CAAA,GAEP,kBAAC,OAAD;GAAK,WAAU;GAAkB,UAAAP;EAAU,CAAA,CACxC;;AAET"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Notifications › More ▾ (BOFF-11872): Send, Delivery log, Templates and
|
|
3
|
+
* Topics, one click away. Renders nothing for someone who holds none of them,
|
|
4
|
+
* so a regular person never sees an admin tool they cannot use.
|
|
5
|
+
*/
|
|
6
|
+
export declare function AdminToolsMenu(): import('react').JSX.Element | null;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { useTr as e } from "../shared/hooks/useTr.js";
|
|
2
|
+
import { useAdminTools as t } from "./useAdminTools.js";
|
|
3
|
+
import { ChevronDown as n } from "lucide-react";
|
|
4
|
+
import { useNavigate as r } from "react-router";
|
|
5
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
6
|
+
import { Button as o, DropdownMenu as s, DropdownMenuContent as c, DropdownMenuItem as l, DropdownMenuTrigger as u } from "@burdenoff/fe-libs/ui";
|
|
7
|
+
// src/navigation-v2/AdminToolsMenu.tsx
|
|
8
|
+
function d() {
|
|
9
|
+
let d = e(), f = r(), { tools: p } = t();
|
|
10
|
+
return p.length === 0 ? null : /* @__PURE__ */ a(s, { children: [/* @__PURE__ */ i(u, {
|
|
11
|
+
asChild: !0,
|
|
12
|
+
children: /* @__PURE__ */ a(o, {
|
|
13
|
+
variant: "outline",
|
|
14
|
+
className: "gap-1",
|
|
15
|
+
"data-testid": "notifications-admin-more",
|
|
16
|
+
children: [d("notifications.v2.more", "More"), /* @__PURE__ */ i(n, {
|
|
17
|
+
size: 16,
|
|
18
|
+
"aria-hidden": "true"
|
|
19
|
+
})]
|
|
20
|
+
})
|
|
21
|
+
}), /* @__PURE__ */ i(c, {
|
|
22
|
+
align: "end",
|
|
23
|
+
children: p.map((e) => /* @__PURE__ */ i(l, {
|
|
24
|
+
"data-testid": `notifications-admin-${e.id}`,
|
|
25
|
+
onSelect: () => void f(e.href),
|
|
26
|
+
children: e.label
|
|
27
|
+
}, e.id))
|
|
28
|
+
})] });
|
|
29
|
+
}
|
|
30
|
+
export { d as AdminToolsMenu };
|
|
31
|
+
|
|
32
|
+
//# sourceMappingURL=AdminToolsMenu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AdminToolsMenu.js","names":["AdminToolsMenu","tr","useTr","navigate","useNavigate","useAdminTools","tools","DropdownMenu","DropdownMenuTrigger","Button","ChevronDown","DropdownMenuContent","DropdownMenuItem","tool"],"sources":["../../src/navigation-v2/AdminToolsMenu.tsx"],"sourcesContent":["import { ChevronDown } from 'lucide-react';\nimport { useNavigate } from 'react-router';\nimport {\n Button,\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuTrigger,\n} from '@burdenoff/fe-libs/ui';\nimport { useTr } from '../shared/hooks/useTr';\nimport { useAdminTools } from './useAdminTools';\n\n/**\n * Notifications › More ▾ (BOFF-11872): Send, Delivery log, Templates and\n * Topics, one click away. Renders nothing for someone who holds none of them,\n * so a regular person never sees an admin tool they cannot use.\n */\nexport function AdminToolsMenu() {\n const tr = useTr();\n const navigate = useNavigate();\n const { tools } = useAdminTools();\n if (tools.length === 0) return null;\n return (\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <Button variant=\"outline\" className=\"gap-1\" data-testid=\"notifications-admin-more\">\n {tr('notifications.v2.more', 'More')}\n <ChevronDown size={16} aria-hidden=\"true\" />\n </Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"end\">\n {tools.map((tool) => (\n <DropdownMenuItem\n key={tool.id}\n data-testid={`notifications-admin-${tool.id}`}\n onSelect={() => void navigate(tool.href)}\n >\n {tool.label}\n </DropdownMenuItem>\n ))}\n </DropdownMenuContent>\n </DropdownMenu>\n );\n}\n"],"mappings":";;;;;;;AAiBA,SAAgBA,IAAiB;CAC/B,IAAMC,IAAKC,EAAM,GACXC,IAAWC,EAAY,GACvB,EAAE,aAAUC,EAAc;CAEhC,OADIC,EAAM,WAAW,IAAU,OAE7B,kBAACC,GAAD,EAAA,UAAA,CACE,kBAACC,GAAD;EAAqB,SAAA;EACnB,UAAA,kBAACC,GAAD;GAAQ,SAAQ;GAAU,WAAU;GAAQ,eAAY;GAAxD,UAAA,CACGR,EAAG,yBAAyB,MAAM,GACnC,kBAACS,GAAD;IAAa,MAAM;IAAI,eAAY;GAAQ,CAAA,CACrC;;CACW,CAAA,GACrB,kBAACC,GAAD;EAAqB,OAAM;EACxB,UAAAL,EAAM,KAAK,MACV,kBAACM,GAAD;GAEE,eAAa,uBAAuBC,EAAK;GACzC,gBAAgB,KAAKV,EAASU,EAAK,IAAI;GAEtC,UAAAA,EAAK;EACU,GALXA,EAAK,EAKM,CACnB;CACkB,CAAA,CACT,EAAA,CAAA;AAElB"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { useTr as e } from "../shared/hooks/useTr.js";
|
|
2
|
+
import { useNotificationPaths as t } from "./paths.js";
|
|
3
|
+
import { ArrowLeft as n } from "lucide-react";
|
|
4
|
+
import { Link as r } from "react-router";
|
|
5
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
6
|
+
// src/navigation-v2/BackToNotifications.tsx
|
|
7
|
+
function o() {
|
|
8
|
+
let o = e(), { inbox: s } = t();
|
|
9
|
+
return /* @__PURE__ */ a(r, {
|
|
10
|
+
to: s,
|
|
11
|
+
className: "inline-flex min-h-11 items-center gap-1.5 rounded-md px-2 text-sm text-text-secondary hover:text-text-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]",
|
|
12
|
+
children: [/* @__PURE__ */ i(n, {
|
|
13
|
+
size: 16,
|
|
14
|
+
"aria-hidden": "true"
|
|
15
|
+
}), o("notifications.v2.backToNotifications", "Notifications")]
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
export { o as BackToNotifications };
|
|
19
|
+
|
|
20
|
+
//# sourceMappingURL=BackToNotifications.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BackToNotifications.js","names":["BackToNotifications","tr","useTr","useNotificationPaths","Link","inbox","ArrowLeft"],"sources":["../../src/navigation-v2/BackToNotifications.tsx"],"sourcesContent":["import { ArrowLeft } from 'lucide-react';\nimport { Link } from 'react-router';\nimport { useTr } from '../shared/hooks/useTr';\nimport { useNotificationPaths } from './paths';\n\n/** \"‹ Notifications\": how a level-2 page leads back to the inbox. */\nexport function BackToNotifications() {\n const tr = useTr();\n const { inbox } = useNotificationPaths();\n return (\n <Link\n to={inbox}\n className=\"inline-flex min-h-11 items-center gap-1.5 rounded-md px-2 text-sm text-text-secondary hover:text-text-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]\"\n >\n <ArrowLeft size={16} aria-hidden=\"true\" />\n {tr('notifications.v2.backToNotifications', 'Notifications')}\n </Link>\n );\n}\n"],"mappings":";;;;;;AAMA,SAAgBA,IAAsB;CACpC,IAAMC,IAAKC,EAAM,GACX,EAAE,aAAUC,EAAqB;CACvC,OACE,kBAACC,GAAD;EACE,IAAIC;EACJ,WAAU;EAFZ,UAAA,CAIE,kBAACC,GAAD;GAAW,MAAM;GAAI,eAAY;EAAQ,CAAA,GACxCL,EAAG,wCAAwC,eAAe,CACvD;;AAEV"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/** The search box that leads a Navigation v2 list. */
|
|
2
|
+
export declare function SearchField({ value, label, onChange, tour, }: {
|
|
3
|
+
value: string;
|
|
4
|
+
/** Already translated; also the placeholder. */
|
|
5
|
+
label: string;
|
|
6
|
+
onChange: (value: string) => void;
|
|
7
|
+
tour?: string;
|
|
8
|
+
}): import('react').JSX.Element;
|
|
9
|
+
/** A level-1 chip group ("All · Unread · Needs action"). */
|
|
10
|
+
export declare function ViewChips<T extends string>({ chips, value, onChange, testIdPrefix, }: {
|
|
11
|
+
chips: Array<{
|
|
12
|
+
id: T;
|
|
13
|
+
label: string;
|
|
14
|
+
}>;
|
|
15
|
+
value: T | null;
|
|
16
|
+
onChange: (id: T) => void;
|
|
17
|
+
testIdPrefix: string;
|
|
18
|
+
}): import('react').JSX.Element;
|
|
19
|
+
/** "More filters": opens the level-2 filter panel; a dot shows when any of them is set. */
|
|
20
|
+
export declare function MoreFiltersButton({ open, active, controls, onToggle, }: {
|
|
21
|
+
open: boolean;
|
|
22
|
+
active: boolean;
|
|
23
|
+
controls: string;
|
|
24
|
+
onToggle: () => void;
|
|
25
|
+
}): import('react').JSX.Element;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { useTr as e } from "../shared/hooks/useTr.js";
|
|
2
|
+
import { Search as t, SlidersHorizontal as n } from "lucide-react";
|
|
3
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
4
|
+
import { Button as a, Input as o } from "@burdenoff/fe-libs/ui";
|
|
5
|
+
// src/navigation-v2/FilterControls.tsx
|
|
6
|
+
function s({ value: e, label: n, onChange: a, tour: s }) {
|
|
7
|
+
return /* @__PURE__ */ i("div", {
|
|
8
|
+
className: "relative flex-1",
|
|
9
|
+
children: [/* @__PURE__ */ r(t, {
|
|
10
|
+
size: 16,
|
|
11
|
+
className: "pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-text-tertiary",
|
|
12
|
+
"aria-hidden": "true"
|
|
13
|
+
}), /* @__PURE__ */ r(o, {
|
|
14
|
+
"data-tour": s,
|
|
15
|
+
type: "search",
|
|
16
|
+
"aria-label": n,
|
|
17
|
+
placeholder: n,
|
|
18
|
+
value: e,
|
|
19
|
+
onChange: (e) => a(e.target.value),
|
|
20
|
+
className: "pl-9"
|
|
21
|
+
})]
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
function c({ chips: t, value: n, onChange: i, testIdPrefix: a }) {
|
|
25
|
+
let o = e();
|
|
26
|
+
return /* @__PURE__ */ r("div", {
|
|
27
|
+
role: "group",
|
|
28
|
+
"aria-label": o("notifications.v2.show", "Show"),
|
|
29
|
+
className: "inline-flex rounded-lg border border-border-default p-0.5",
|
|
30
|
+
children: t.map((e) => /* @__PURE__ */ r("button", {
|
|
31
|
+
type: "button",
|
|
32
|
+
"aria-pressed": n === e.id,
|
|
33
|
+
"data-testid": `${a}-${e.id}`,
|
|
34
|
+
onClick: () => i(e.id),
|
|
35
|
+
className: `min-h-9 rounded-md px-3 text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)] ${n === e.id ? "bg-action-primary-bg text-text-inverse" : "text-text-secondary hover:bg-bg-sunken hover:text-text-primary"}`,
|
|
36
|
+
children: e.label
|
|
37
|
+
}, e.id))
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
function l({ open: t, active: o, controls: s, onToggle: c }) {
|
|
41
|
+
let l = e();
|
|
42
|
+
return /* @__PURE__ */ i(a, {
|
|
43
|
+
type: "button",
|
|
44
|
+
variant: "ghost",
|
|
45
|
+
"aria-expanded": t,
|
|
46
|
+
"aria-controls": s,
|
|
47
|
+
onClick: c,
|
|
48
|
+
className: "gap-2",
|
|
49
|
+
children: [
|
|
50
|
+
/* @__PURE__ */ r(n, {
|
|
51
|
+
size: 16,
|
|
52
|
+
"aria-hidden": "true"
|
|
53
|
+
}),
|
|
54
|
+
l("notifications.v2.moreFilters", "More filters"),
|
|
55
|
+
o && /* @__PURE__ */ r("span", {
|
|
56
|
+
className: "h-2 w-2 rounded-full bg-accent-primary",
|
|
57
|
+
"aria-hidden": "true"
|
|
58
|
+
})
|
|
59
|
+
]
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
export { l as MoreFiltersButton, s as SearchField, c as ViewChips };
|
|
63
|
+
|
|
64
|
+
//# sourceMappingURL=FilterControls.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FilterControls.js","names":["SearchField","Search","Input","tour","label","onChange","ViewChips","tr","useTr","chips","value","chip","testIdPrefix","MoreFiltersButton","Button","open","controls","onToggle","SlidersHorizontal","active"],"sources":["../../src/navigation-v2/FilterControls.tsx"],"sourcesContent":["import { Search, SlidersHorizontal } from 'lucide-react';\nimport { Button, Input } from '@burdenoff/fe-libs/ui';\nimport { useTr } from '../shared/hooks/useTr';\n\n/** The search box that leads a Navigation v2 list. */\nexport function SearchField({\n value,\n label,\n onChange,\n tour,\n}: {\n value: string;\n /** Already translated; also the placeholder. */\n label: string;\n onChange: (value: string) => void;\n tour?: string;\n}) {\n return (\n <div className=\"relative flex-1\">\n <Search\n size={16}\n className=\"pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-text-tertiary\"\n aria-hidden=\"true\"\n />\n <Input\n data-tour={tour}\n type=\"search\"\n aria-label={label}\n placeholder={label}\n value={value}\n onChange={(e) => onChange(e.target.value)}\n className=\"pl-9\"\n />\n </div>\n );\n}\n\n/** A level-1 chip group (\"All · Unread · Needs action\"). */\nexport function ViewChips<T extends string>({\n chips,\n value,\n onChange,\n testIdPrefix,\n}: {\n chips: Array<{ id: T; label: string }>;\n value: T | null;\n onChange: (id: T) => void;\n testIdPrefix: string;\n}) {\n const tr = useTr();\n return (\n <div\n role=\"group\"\n aria-label={tr('notifications.v2.show', 'Show')}\n className=\"inline-flex rounded-lg border border-border-default p-0.5\"\n >\n {chips.map((chip) => (\n <button\n key={chip.id}\n type=\"button\"\n aria-pressed={value === chip.id}\n data-testid={`${testIdPrefix}-${chip.id}`}\n onClick={() => onChange(chip.id)}\n className={`min-h-9 rounded-md px-3 text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)] ${\n value === chip.id\n ? 'bg-action-primary-bg text-text-inverse'\n : 'text-text-secondary hover:bg-bg-sunken hover:text-text-primary'\n }`}\n >\n {chip.label}\n </button>\n ))}\n </div>\n );\n}\n\n/** \"More filters\": opens the level-2 filter panel; a dot shows when any of them is set. */\nexport function MoreFiltersButton({\n open,\n active,\n controls,\n onToggle,\n}: {\n open: boolean;\n active: boolean;\n controls: string;\n onToggle: () => void;\n}) {\n const tr = useTr();\n return (\n <Button\n type=\"button\"\n variant=\"ghost\"\n aria-expanded={open}\n aria-controls={controls}\n onClick={onToggle}\n className=\"gap-2\"\n >\n <SlidersHorizontal size={16} aria-hidden=\"true\" />\n {tr('notifications.v2.moreFilters', 'More filters')}\n {active && <span className=\"h-2 w-2 rounded-full bg-accent-primary\" aria-hidden=\"true\" />}\n </Button>\n );\n}\n"],"mappings":";;;;;AAKA,SAAgBA,EAAY,EAC1B,UACA,UACA,aACA,WAOC;CACD,OACE,kBAAC,OAAD;EAAK,WAAU;EAAf,UAAA,CACE,kBAACC,GAAD;GACE,MAAM;GACN,WAAU;GACV,eAAY;EACb,CAAA,GACD,kBAACC,GAAD;GACE,aAAWC;GACX,MAAK;GACL,cAAYC;GACZ,aAAaA;GACN;GACP,WAAW,MAAMC,EAAS,EAAE,OAAO,KAAK;GACxC,WAAU;EACX,CAAA,CACE;;AAET;AAGA,SAAgBC,EAA4B,EAC1C,UACA,UACA,aACA,mBAMC;CACD,IAAMC,IAAKC,EAAM;CACjB,OACE,kBAAC,OAAD;EACE,MAAK;EACL,cAAYD,EAAG,yBAAyB,MAAM;EAC9C,WAAU;EAET,UAAAE,EAAM,KAAK,MACV,kBAAC,UAAD;GAEE,MAAK;GACL,gBAAcC,MAAUC,EAAK;GAC7B,eAAa,GAAGC,EAAa,GAAGD,EAAK;GACrC,eAAeN,EAASM,EAAK,EAAE;GAC/B,WAAW,8JACTD,MAAUC,EAAK,KACX,2CACA;GAGL,UAAAA,EAAK;EACA,GAZDA,EAAK,EAYJ,CACT;CACE,CAAA;AAET;AAGA,SAAgBE,EAAkB,EAChC,SACA,WACA,aACA,eAMC;CACD,IAAMN,IAAKC,EAAM;CACjB,OACE,kBAACM,GAAD;EACE,MAAK;EACL,SAAQ;EACR,iBAAeC;EACf,iBAAeC;EACf,SAASC;EACT,WAAU;EANZ,UAAA;GAQE,kBAACC,GAAD;IAAmB,MAAM;IAAI,eAAY;GAAQ,CAAA;GAChDX,EAAG,gCAAgC,cAAc;GACjDY,KAAU,kBAAC,QAAD;IAAM,WAAU;IAAyC,eAAY;GAAQ,CAAA;EAClF;;AAEZ"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Archived, Navigation v2 (BOFF-11872; today's personal Notification
|
|
3
|
+
* History). Same query as the classic page (every channel, archived or
|
|
4
|
+
* not); the "Archived" chip, on by default, shows what you archived and
|
|
5
|
+
* "Everything" shows the full history. Restore on each archived row, search
|
|
6
|
+
* at level 1, topic and dates under "More filters", and "Download as
|
|
7
|
+
* spreadsheet" in "⋯".
|
|
8
|
+
*/
|
|
9
|
+
export declare function NotificationArchivedV2(): import('react').JSX.Element;
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import { NotificationCard as e } from "../components/NotificationCard.js";
|
|
2
|
+
import { useNotifications as t } from "../hooks/useNotifications.js";
|
|
3
|
+
import { useNotificationTopics as n } from "../hooks/useNotificationTopics.js";
|
|
4
|
+
import { NOTIFICATION_PERMISSIONS as r } from "../constants/permissions.js";
|
|
5
|
+
import "../hooks/index.js";
|
|
6
|
+
import { useNotification as i } from "../providers/NotificationProvider.js";
|
|
7
|
+
import { useTr as a } from "../shared/hooks/useTr.js";
|
|
8
|
+
import { inArchivedView as o } from "./inboxFilters.js";
|
|
9
|
+
import { exportNotificationsAsCsv as s } from "../utils/notificationHistoryExport.js";
|
|
10
|
+
import { BackToNotifications as c } from "./BackToNotifications.js";
|
|
11
|
+
import { MoreFiltersButton as l, SearchField as u, ViewChips as d } from "./FilterControls.js";
|
|
12
|
+
import { useMemo as f, useState as p } from "react";
|
|
13
|
+
import { usePermissions as m } from "@burdenoff/fe-libs/shared/providers/shell";
|
|
14
|
+
import { Download as h, MoreHorizontal as g } from "lucide-react";
|
|
15
|
+
import { jsx as _, jsxs as v } from "react/jsx-runtime";
|
|
16
|
+
import { Button as y, DropdownMenu as b, DropdownMenuContent as x, DropdownMenuItem as S, DropdownMenuTrigger as C, IllustratedEmptyState as w, Input as T, NativeSelect as E, useRememberedOpen as D } from "@burdenoff/fe-libs/ui";
|
|
17
|
+
// src/navigation-v2/NotificationArchivedV2.tsx
|
|
18
|
+
var O = {
|
|
19
|
+
archived: null,
|
|
20
|
+
channel: "ALL"
|
|
21
|
+
}, k = "ALL";
|
|
22
|
+
function A(e) {
|
|
23
|
+
return e ? e.toISOString().split("T")[0] : "";
|
|
24
|
+
}
|
|
25
|
+
function j() {
|
|
26
|
+
let j = a(), { hasPermission: M, isLoading: N } = m(), { currentUser: P } = i(), { topics: F } = n({ isActive: !0 }), { notifications: I, notificationFilter: L, updateFilter: R, archiveNotification: z, unarchiveNotification: B, recordAction: V } = t({ baseFilter: O }), [H, U] = p("archived"), [W, G] = D("notifications.archived.moreFilters", !1), K = f(() => I.filter((e) => o(e, H)), [I, H]), q = !!(L.topicId || L.dateRange.start || L.dateRange.end), J = !!L.search || q;
|
|
27
|
+
if (N) return /* @__PURE__ */ _("div", {
|
|
28
|
+
className: "flex h-64 items-center justify-center",
|
|
29
|
+
children: /* @__PURE__ */ _("div", { className: "h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent" })
|
|
30
|
+
});
|
|
31
|
+
if (!M(r.NOTIFICATION_LIST) && !P?.id) return /* @__PURE__ */ _("div", {
|
|
32
|
+
className: "p-8 text-center text-text-secondary",
|
|
33
|
+
children: j("notifications.noPermissionHistory", "You don't have permission to view notification history.")
|
|
34
|
+
});
|
|
35
|
+
let Y = [{
|
|
36
|
+
id: "archived",
|
|
37
|
+
label: j("notifications.v2.archived", "Archived")
|
|
38
|
+
}, {
|
|
39
|
+
id: "everything",
|
|
40
|
+
label: j("notifications.v2.everything", "Everything")
|
|
41
|
+
}], X = [{
|
|
42
|
+
value: k,
|
|
43
|
+
label: j("notifications.allTopics", "All Topics")
|
|
44
|
+
}, ...F.map((e) => ({
|
|
45
|
+
value: e.id,
|
|
46
|
+
label: e.name
|
|
47
|
+
}))];
|
|
48
|
+
return /* @__PURE__ */ v("div", {
|
|
49
|
+
className: "mx-auto w-full max-w-5xl space-y-4 p-3 animate-in fade-in duration-200 sm:space-y-5 sm:p-6",
|
|
50
|
+
children: [
|
|
51
|
+
/* @__PURE__ */ _(c, {}),
|
|
52
|
+
/* @__PURE__ */ v("header", {
|
|
53
|
+
"data-tour": "notification-history-header",
|
|
54
|
+
className: "flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",
|
|
55
|
+
children: [/* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("h1", {
|
|
56
|
+
className: "text-xl font-semibold text-text-primary sm:text-2xl",
|
|
57
|
+
children: j("notifications.v2.archivedTitle", "Archived")
|
|
58
|
+
}), /* @__PURE__ */ _("p", {
|
|
59
|
+
className: "mt-1 text-sm text-text-secondary",
|
|
60
|
+
children: j("notifications.v2.archivedSubtitle", "Notifications you archived. Restore one to put it back in your inbox.")
|
|
61
|
+
})] }), /* @__PURE__ */ v(b, { children: [/* @__PURE__ */ _(C, {
|
|
62
|
+
asChild: !0,
|
|
63
|
+
children: /* @__PURE__ */ _(y, {
|
|
64
|
+
variant: "ghost",
|
|
65
|
+
size: "icon",
|
|
66
|
+
"aria-label": j("notifications.v2.moreActions", "More actions"),
|
|
67
|
+
"data-testid": "notifications-archived-overflow",
|
|
68
|
+
children: /* @__PURE__ */ _(g, {
|
|
69
|
+
size: 18,
|
|
70
|
+
"aria-hidden": "true"
|
|
71
|
+
})
|
|
72
|
+
})
|
|
73
|
+
}), /* @__PURE__ */ _(x, {
|
|
74
|
+
align: "end",
|
|
75
|
+
children: /* @__PURE__ */ v(S, {
|
|
76
|
+
"data-tour": "notification-history-export",
|
|
77
|
+
disabled: I.length === 0,
|
|
78
|
+
onSelect: () => s(j, I),
|
|
79
|
+
children: [/* @__PURE__ */ _(h, {
|
|
80
|
+
size: 16,
|
|
81
|
+
"aria-hidden": "true"
|
|
82
|
+
}), j("notifications.v2.downloadSpreadsheet", "Download as spreadsheet")]
|
|
83
|
+
})
|
|
84
|
+
})] })]
|
|
85
|
+
}),
|
|
86
|
+
/* @__PURE__ */ v("section", {
|
|
87
|
+
"aria-label": j("notifications.v2.filters", "Filters"),
|
|
88
|
+
className: "space-y-3",
|
|
89
|
+
children: [/* @__PURE__ */ v("div", {
|
|
90
|
+
className: "flex flex-col gap-3 sm:flex-row sm:items-center",
|
|
91
|
+
children: [/* @__PURE__ */ _(u, {
|
|
92
|
+
label: j("notifications.searchByTitleOrContent", "Search by title or content..."),
|
|
93
|
+
value: L.search,
|
|
94
|
+
onChange: (e) => R({ search: e })
|
|
95
|
+
}), /* @__PURE__ */ v("div", {
|
|
96
|
+
className: "flex flex-wrap items-center gap-2",
|
|
97
|
+
children: [/* @__PURE__ */ _(d, {
|
|
98
|
+
chips: Y,
|
|
99
|
+
value: H,
|
|
100
|
+
onChange: U,
|
|
101
|
+
testIdPrefix: "notifications-archived-view"
|
|
102
|
+
}), /* @__PURE__ */ _(l, {
|
|
103
|
+
open: W,
|
|
104
|
+
active: q,
|
|
105
|
+
controls: "notifications-archived-more-filters",
|
|
106
|
+
onToggle: () => G(!W)
|
|
107
|
+
})]
|
|
108
|
+
})]
|
|
109
|
+
}), /* @__PURE__ */ v("div", {
|
|
110
|
+
id: "notifications-archived-more-filters",
|
|
111
|
+
hidden: !W,
|
|
112
|
+
className: "grid gap-3 rounded-lg border border-border-seam bg-bg-surface p-3 sm:grid-cols-3",
|
|
113
|
+
children: [
|
|
114
|
+
/* @__PURE__ */ _(E, {
|
|
115
|
+
"aria-label": j("notifications.v2.topicFilter", "Topic"),
|
|
116
|
+
options: X,
|
|
117
|
+
value: L.topicId || k,
|
|
118
|
+
onValueChange: (e) => R({ topicId: e === k ? void 0 : e })
|
|
119
|
+
}),
|
|
120
|
+
/* @__PURE__ */ _(T, {
|
|
121
|
+
type: "date",
|
|
122
|
+
"aria-label": j("notifications.startDate", "Start date"),
|
|
123
|
+
value: A(L.dateRange.start),
|
|
124
|
+
onChange: (e) => R({ dateRange: {
|
|
125
|
+
...L.dateRange,
|
|
126
|
+
start: e.target.value ? new Date(e.target.value) : null
|
|
127
|
+
} })
|
|
128
|
+
}),
|
|
129
|
+
/* @__PURE__ */ _(T, {
|
|
130
|
+
type: "date",
|
|
131
|
+
"aria-label": j("notifications.endDate", "End date"),
|
|
132
|
+
value: A(L.dateRange.end),
|
|
133
|
+
onChange: (e) => R({ dateRange: {
|
|
134
|
+
...L.dateRange,
|
|
135
|
+
end: e.target.value ? new Date(e.target.value) : null
|
|
136
|
+
} })
|
|
137
|
+
})
|
|
138
|
+
]
|
|
139
|
+
})]
|
|
140
|
+
}),
|
|
141
|
+
/* @__PURE__ */ _("div", {
|
|
142
|
+
className: "space-y-2",
|
|
143
|
+
children: K.length > 0 ? K.map((t) => /* @__PURE__ */ v("div", {
|
|
144
|
+
className: "space-y-2",
|
|
145
|
+
children: [/* @__PURE__ */ _(e, {
|
|
146
|
+
notification: t,
|
|
147
|
+
onArchive: t.archivedAt ? void 0 : z,
|
|
148
|
+
onAction: V,
|
|
149
|
+
showArchivedState: !0,
|
|
150
|
+
analyticsSource: "history",
|
|
151
|
+
navigationV2: !0,
|
|
152
|
+
showTopic: W
|
|
153
|
+
}), t.archivedAt && /* @__PURE__ */ _("div", {
|
|
154
|
+
className: "flex justify-end",
|
|
155
|
+
children: /* @__PURE__ */ _(y, {
|
|
156
|
+
type: "button",
|
|
157
|
+
variant: "outline",
|
|
158
|
+
size: "sm",
|
|
159
|
+
onClick: () => B(t.id),
|
|
160
|
+
children: j("notifications.restore", "Restore")
|
|
161
|
+
})
|
|
162
|
+
})]
|
|
163
|
+
}, t.id)) : /* @__PURE__ */ _(w, {
|
|
164
|
+
illustration: J ? "empty-search" : "empty-notifications",
|
|
165
|
+
title: J ? j("notifications.noNotificationsFound", "No notifications found") : H === "archived" ? j("notifications.v2.archivedEmptyTitle", "Nothing archived") : j("notifications.historyEmptyTitle", "No history yet"),
|
|
166
|
+
description: J ? j("notifications.adjustSearchOrDateRange", "Try adjusting your filters") : H === "archived" ? j("notifications.v2.archivedEmptyDescription", "Archive a notification from your inbox and it moves here.") : j("notifications.historyEmptyDescription", "Notifications you receive will be archived here so you can always find them again.")
|
|
167
|
+
})
|
|
168
|
+
})
|
|
169
|
+
]
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
export { j as NotificationArchivedV2 };
|
|
173
|
+
|
|
174
|
+
//# sourceMappingURL=NotificationArchivedV2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NotificationArchivedV2.js","names":["HISTORY_FILTER","ALL","toDateInput","value","NotificationArchivedV2","tr","useTr","permissionsLoading","usePermissions","useNotification","useNotificationTopics","useNotifications","view","setView","useState","moreFiltersOpen","setMoreFiltersOpen","useRememberedOpen","visible","useMemo","notifications","inArchivedView","notification","moreFiltersActive","notificationFilter","hasActiveFilters","hasPermission","NOTIFICATION_PERMISSIONS","currentUser","chips","topicOptions","topics","topic","BackToNotifications","DropdownMenu","DropdownMenuTrigger","Button","MoreHorizontal","DropdownMenuContent","DropdownMenuItem","exportNotificationsAsCsv","Download","SearchField","updateFilter","ViewChips","MoreFiltersButton","NativeSelect","Input","NotificationCard","archiveNotification","recordAction","unarchiveNotification","IllustratedEmptyState"],"sources":["../../src/navigation-v2/NotificationArchivedV2.tsx"],"sourcesContent":["import { useMemo, useState } from 'react';\nimport { Download, MoreHorizontal } from 'lucide-react';\nimport { usePermissions } from '@burdenoff/fe-libs/shared/providers/shell';\nimport {\n Button,\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuTrigger,\n IllustratedEmptyState,\n Input,\n NativeSelect,\n useRememberedOpen,\n} from '@burdenoff/fe-libs/ui';\nimport { NotificationCard } from '../components/NotificationCard';\nimport { NOTIFICATION_PERMISSIONS } from '../constants/permissions';\nimport { useNotifications, useNotificationTopics } from '../hooks';\nimport { useNotification } from '../providers/NotificationProvider';\nimport { useTr } from '../shared/hooks/useTr';\nimport { inArchivedView, type ArchivedView } from './inboxFilters';\nimport { exportNotificationsAsCsv } from '../utils/notificationHistoryExport';\nimport { BackToNotifications } from './BackToNotifications';\nimport { MoreFiltersButton, SearchField, ViewChips } from './FilterControls';\n\nconst HISTORY_FILTER = { archived: null, channel: 'ALL' as const };\nconst ALL = 'ALL';\n\nfunction toDateInput(value: Date | null): string {\n return value ? value.toISOString().split('T')[0] : '';\n}\n\n/**\n * Archived, Navigation v2 (BOFF-11872; today's personal Notification\n * History). Same query as the classic page (every channel, archived or\n * not); the \"Archived\" chip, on by default, shows what you archived and\n * \"Everything\" shows the full history. Restore on each archived row, search\n * at level 1, topic and dates under \"More filters\", and \"Download as\n * spreadsheet\" in \"⋯\".\n */\nexport function NotificationArchivedV2() {\n const tr = useTr();\n const { hasPermission, isLoading: permissionsLoading } = usePermissions();\n const { currentUser } = useNotification();\n const { topics } = useNotificationTopics({ isActive: true });\n const {\n notifications,\n notificationFilter,\n updateFilter,\n archiveNotification,\n unarchiveNotification,\n recordAction,\n } = useNotifications({ baseFilter: HISTORY_FILTER });\n const [view, setView] = useState<ArchivedView>('archived');\n const [moreFiltersOpen, setMoreFiltersOpen] = useRememberedOpen(\n 'notifications.archived.moreFilters',\n false\n );\n\n const visible = useMemo(\n () => notifications.filter((notification) => inArchivedView(notification, view)),\n [notifications, view]\n );\n\n const moreFiltersActive = Boolean(\n notificationFilter.topicId ||\n notificationFilter.dateRange.start ||\n notificationFilter.dateRange.end\n );\n const hasActiveFilters = Boolean(notificationFilter.search) || moreFiltersActive;\n\n if (permissionsLoading) {\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 if (!hasPermission(NOTIFICATION_PERMISSIONS.NOTIFICATION_LIST) && !currentUser?.id) {\n return (\n <div className=\"p-8 text-center text-text-secondary\">\n {tr(\n 'notifications.noPermissionHistory',\n \"You don't have permission to view notification history.\"\n )}\n </div>\n );\n }\n\n const chips: Array<{ id: ArchivedView; label: string }> = [\n { id: 'archived', label: tr('notifications.v2.archived', 'Archived') },\n { id: 'everything', label: tr('notifications.v2.everything', 'Everything') },\n ];\n const topicOptions = [\n { value: ALL, label: tr('notifications.allTopics', 'All Topics') },\n ...topics.map((topic) => ({ value: topic.id, label: topic.name })),\n ];\n\n return (\n <div className=\"mx-auto w-full max-w-5xl space-y-4 p-3 animate-in fade-in duration-200 sm:space-y-5 sm:p-6\">\n <BackToNotifications />\n <header\n data-tour=\"notification-history-header\"\n className=\"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between\"\n >\n <div>\n <h1 className=\"text-xl font-semibold text-text-primary sm:text-2xl\">\n {tr('notifications.v2.archivedTitle', 'Archived')}\n </h1>\n <p className=\"mt-1 text-sm text-text-secondary\">\n {tr(\n 'notifications.v2.archivedSubtitle',\n 'Notifications you archived. Restore one to put it back in your inbox.'\n )}\n </p>\n </div>\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <Button\n variant=\"ghost\"\n size=\"icon\"\n aria-label={tr('notifications.v2.moreActions', 'More actions')}\n data-testid=\"notifications-archived-overflow\"\n >\n <MoreHorizontal size={18} aria-hidden=\"true\" />\n </Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"end\">\n <DropdownMenuItem\n data-tour=\"notification-history-export\"\n disabled={notifications.length === 0}\n onSelect={() => exportNotificationsAsCsv(tr, notifications)}\n >\n <Download size={16} aria-hidden=\"true\" />\n {tr('notifications.v2.downloadSpreadsheet', 'Download as spreadsheet')}\n </DropdownMenuItem>\n </DropdownMenuContent>\n </DropdownMenu>\n </header>\n\n <section aria-label={tr('notifications.v2.filters', 'Filters')} className=\"space-y-3\">\n <div className=\"flex flex-col gap-3 sm:flex-row sm:items-center\">\n <SearchField\n label={tr('notifications.searchByTitleOrContent', 'Search by title or content...')}\n value={notificationFilter.search}\n onChange={(search) => updateFilter({ search })}\n />\n <div className=\"flex flex-wrap items-center gap-2\">\n <ViewChips\n chips={chips}\n value={view}\n onChange={setView}\n testIdPrefix=\"notifications-archived-view\"\n />\n <MoreFiltersButton\n open={moreFiltersOpen}\n active={moreFiltersActive}\n controls=\"notifications-archived-more-filters\"\n onToggle={() => setMoreFiltersOpen(!moreFiltersOpen)}\n />\n </div>\n </div>\n <div\n id=\"notifications-archived-more-filters\"\n hidden={!moreFiltersOpen}\n className=\"grid gap-3 rounded-lg border border-border-seam bg-bg-surface p-3 sm:grid-cols-3\"\n >\n <NativeSelect\n aria-label={tr('notifications.v2.topicFilter', 'Topic')}\n options={topicOptions}\n value={notificationFilter.topicId || ALL}\n onValueChange={(value) => updateFilter({ topicId: value === ALL ? undefined : value })}\n />\n <Input\n type=\"date\"\n aria-label={tr('notifications.startDate', 'Start date')}\n value={toDateInput(notificationFilter.dateRange.start)}\n onChange={(e) =>\n updateFilter({\n dateRange: {\n ...notificationFilter.dateRange,\n start: e.target.value ? new Date(e.target.value) : null,\n },\n })\n }\n />\n <Input\n type=\"date\"\n aria-label={tr('notifications.endDate', 'End date')}\n value={toDateInput(notificationFilter.dateRange.end)}\n onChange={(e) =>\n updateFilter({\n dateRange: {\n ...notificationFilter.dateRange,\n end: e.target.value ? new Date(e.target.value) : null,\n },\n })\n }\n />\n </div>\n </section>\n\n <div className=\"space-y-2\">\n {visible.length > 0 ? (\n visible.map((notification) => (\n <div key={notification.id} className=\"space-y-2\">\n <NotificationCard\n notification={notification}\n onArchive={notification.archivedAt ? undefined : archiveNotification}\n onAction={recordAction}\n showArchivedState\n analyticsSource=\"history\"\n navigationV2\n showTopic={moreFiltersOpen}\n />\n {notification.archivedAt && (\n <div className=\"flex justify-end\">\n <Button\n type=\"button\"\n variant=\"outline\"\n size=\"sm\"\n onClick={() => unarchiveNotification(notification.id)}\n >\n {tr('notifications.restore', 'Restore')}\n </Button>\n </div>\n )}\n </div>\n ))\n ) : (\n <IllustratedEmptyState\n illustration={hasActiveFilters ? 'empty-search' : 'empty-notifications'}\n title={\n hasActiveFilters\n ? tr('notifications.noNotificationsFound', 'No notifications found')\n : view === 'archived'\n ? tr('notifications.v2.archivedEmptyTitle', 'Nothing archived')\n : tr('notifications.historyEmptyTitle', 'No history yet')\n }\n description={\n hasActiveFilters\n ? tr('notifications.adjustSearchOrDateRange', 'Try adjusting your filters')\n : view === 'archived'\n ? tr(\n 'notifications.v2.archivedEmptyDescription',\n 'Archive a notification from your inbox and it moves here.'\n )\n : tr(\n 'notifications.historyEmptyDescription',\n 'Notifications you receive will be archived here so you can always find them again.'\n )\n }\n />\n )}\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAwBA,IAAMA,IAAiB;CAAE,UAAU;CAAM,SAAS;AAAe,GAC3DC,IAAM;AAEZ,SAASC,EAAY,GAA4B;CAC/C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ACR,MAAK;OACL,eAAee,EAAsB7B,EAAa,EAAE;OAEnD,UAAAjB,EAAG,yBAAyB,SAAS;MAChC,CAAA;KACL,CAAA,CAEJ;IAtBK,GAAAiB,EAAa,EAsBlB,CACN,IAED,kBAAC8B,GAAD;KACE,cAAc3B,IAAmB,iBAAiB;KAClD,OACEA,IACIpB,EAAG,sCAAsC,wBAAwB,IACjEO,MAAS,aACPP,EAAG,uCAAuC,kBAAkB,IAC5DA,EAAG,mCAAmC,gBAAgB;KAE9D,aACEoB,IACIpB,EAAG,yCAAyC,4BAA4B,IACxEO,MAAS,aACPP,EACE,6CACA,2DACF,IACAA,EACE,yCACA,oFACF;IAET,CAAA;GAEA,CAAA;EACF;;AAET"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Notifications, Navigation v2 (BOFF-11872, mockup 41). Level 1: the title
|
|
3
|
+
* with the unread count, "Mark all as read", "Notification settings",
|
|
4
|
+
* "Archived", search and the All · Unread · Needs action chips. Level 2: the
|
|
5
|
+
* admin tools under "More", and Type, Priority, Topic and the full read state
|
|
6
|
+
* under "More filters" (remembered per profile). Same queries as the classic
|
|
7
|
+
* Notification Center.
|
|
8
|
+
*/
|
|
9
|
+
export declare function NotificationInboxV2(): import('react').JSX.Element;
|