@burdenoff/microfe-notification 2026.1116.1 → 2026.1117.2
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/NotificationRoot.d.ts +16 -0
- package/dist/NotificationRoot.js +33 -26
- package/dist/NotificationRoot.js.map +1 -1
- package/dist/NotificationRoutes.js +72 -68
- package/dist/NotificationRoutes.js.map +1 -1
- package/dist/components/FeatureDisabledPage.js +2 -2
- package/dist/components/FeatureDisabledPage.js.map +1 -1
- package/dist/components/NotificationCard.js +6 -6
- package/dist/components/NotificationCard.js.map +1 -1
- package/dist/components/NotificationPanel.js +1 -1
- package/dist/components/NotificationPanel.js.map +1 -1
- package/dist/components/TemplatePreview.js +5 -5
- package/dist/components/TemplatePreview.js.map +1 -1
- package/dist/navigation-v2/NotificationsV2Landing.d.ts +9 -3
- package/dist/navigation-v2/NotificationsV2Landing.js +16 -12
- package/dist/navigation-v2/NotificationsV2Landing.js.map +1 -1
- package/dist/navigation-v2/paths.js +1 -1
- package/dist/navigation-v2/paths.js.map +1 -1
- package/dist/pages/CreateNotificationPage.js +1 -1
- package/dist/pages/CreateNotificationPage.js.map +1 -1
- package/dist/pages/NotificationCenterPage.js +1 -1
- package/dist/pages/NotificationCenterPage.js.map +1 -1
- package/dist/pages/NotificationHistoryAdminPage.js +13 -13
- package/dist/pages/NotificationHistoryAdminPage.js.map +1 -1
- package/dist/pages/NotificationHistoryPage.js +2 -2
- package/dist/pages/NotificationHistoryPage.js.map +1 -1
- package/dist/pages/NotificationPreferencesPage.js +6 -6
- package/dist/pages/NotificationPreferencesPage.js.map +1 -1
- package/dist/pages/NotificationTemplatesPage.js +6 -6
- package/dist/pages/NotificationTemplatesPage.js.map +1 -1
- package/dist/pages/NotificationTopicsPage.js +12 -12
- package/dist/pages/NotificationTopicsPage.js.map +1 -1
- package/dist/pages/TemplateEditorPage.js +2 -2
- package/dist/pages/TemplateEditorPage.js.map +1 -1
- package/package.json +8 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NotificationCenterPage.js","names":["_Fragment","CENTER_FILTER","CENTER_UNREAD_FILTER","TYPE_OPTIONS","PRIORITY_OPTIONS","NotificationCenterPage","useNotification","jsx","navigationV2","NotificationInboxV2","ClassicNotificationCenterPage","tr","useTr","permissionsLoading","usePermissions","useNotifications","useNotificationTopics","filteredNotifications","useMemo","filterNotifications","notifications","notificationFilter","groupedNotifications","groupNotificationsByDate","hasPermission","NOTIFICATION_PERMISSIONS","currentUser","PagePurpose","BellRing","AuroraBackground","EmphasisPanel","GradientText","unreadCount","Fragment","Button","markAllAsRead","CheckCheck","PushOptInToggle","GlassCard","Search","updateFilter","option","topics","topic","resetFilter","group","groupNotifications","NotificationCard","markAsRead","archiveNotification","recordAction","notification","IllustratedEmptyState"],"sources":["../../src/pages/NotificationCenterPage.tsx"],"sourcesContent":["import { useMemo } from 'react';\nimport { Search, CheckCheck, BellRing } from 'lucide-react';\nimport { PushOptInToggle } from '@burdenoff/fe-libs/chrome';\nimport { usePermissions } from '@burdenoff/fe-libs/shared/providers/shell';\nimport {\n AuroraBackground,\n Button,\n EmphasisPanel,\n GlassCard,\n GradientText,\n IllustratedEmptyState,\n PagePurpose,\n} from '@burdenoff/fe-libs/ui';\nimport { useNotifications, useNotificationTopics } from '../hooks';\nimport { NotificationCard } from '../components/NotificationCard';\nimport { filterNotifications, groupNotificationsByDate } from '../utils';\nimport { NOTIFICATION_PERMISSIONS } from '../constants/permissions';\nimport { useNotification } from '../providers/NotificationProvider';\nimport { useTr } from '../shared/hooks/useTr';\nimport type { NotificationPriority, NotificationType } from '../types';\nimport { NotificationInboxV2 } from '../navigation-v2/NotificationInboxV2';\n\nconst CENTER_FILTER = { archived: false, channel: 'IN_APP' as const };\nconst CENTER_UNREAD_FILTER = { channel: 'IN_APP' };\nconst TYPE_OPTIONS: Array<{ value: NotificationType; labelKey: string; label: string }> = [\n { value: 'SYSTEM', labelKey: 'notifications.typeSystem', label: 'System' },\n { value: 'ALERT', labelKey: 'notifications.typeAlert', label: 'Alert' },\n { value: 'TRANSACTIONAL', labelKey: 'notifications.typeTransactional', label: 'Transactional' },\n { value: 'MARKETING', labelKey: 'notifications.typeMarketing', label: 'Marketing' },\n];\nconst PRIORITY_OPTIONS: Array<{ value: NotificationPriority; labelKey: string; label: string }> = [\n { value: 'URGENT', labelKey: 'notifications.priorityUrgent', label: 'Urgent' },\n { value: 'HIGH', labelKey: 'notifications.priorityHigh', label: 'High' },\n { value: 'NORMAL', labelKey: 'notifications.priorityNormal', label: 'Normal' },\n { value: 'LOW', labelKey: 'notifications.priorityLow', label: 'Low' },\n];\n\n/**\n * Notification Center Page\n *\n * Main page for viewing and managing in-app notifications. Under FluidGrids'\n * Navigation v2 (BOFF-11872) it is the inbox layout instead; every other app\n * keeps the classic page.\n */\nexport function NotificationCenterPage() {\n const { navigationV2 } = useNotification();\n return navigationV2 ? <NotificationInboxV2 /> : <ClassicNotificationCenterPage />;\n}\n\nfunction ClassicNotificationCenterPage() {\n const tr = useTr();\n const { hasPermission, isLoading: permissionsLoading } = usePermissions();\n const { currentUser } = useNotification();\n const {\n notifications,\n unreadCount,\n notificationFilter,\n markAsRead,\n markAllAsRead,\n archiveNotification,\n recordAction,\n updateFilter,\n resetFilter,\n } = useNotifications({ baseFilter: CENTER_FILTER, unreadFilter: CENTER_UNREAD_FILTER });\n const { topics } = useNotificationTopics({ isActive: true });\n\n // Filter and group notifications\n const filteredNotifications = useMemo(\n () => filterNotifications(notifications, notificationFilter),\n [notifications, notificationFilter]\n );\n const groupedNotifications = useMemo(\n () => groupNotificationsByDate(filteredNotifications, tr),\n [filteredNotifications, tr]\n );\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('notifications.noPermissionView', \"You don't have permission to view notifications.\")}\n </div>\n );\n }\n\n return (\n <div className=\"space-y-4 sm:space-y-6 p-3 sm:p-6 animate-in fade-in duration-200\">\n <PagePurpose icon={<BellRing size={16} />}>\n {tr(\n 'notifications.centerPurpose',\n 'Your in-app inbox. Everything the platform needs you to see — task assignments, mentions, alerts and system updates — lands here. Filter by type, priority or topic, mark items as read, and archive what you no longer need.'\n )}\n </PagePurpose>\n\n {/* Header — the page's single emphasis zone (unread summary + the one CTA).\n Wrapped in a relative overflow-hidden container so the AuroraBackground\n can sit behind it (at -z-10) without ever moving content. This is the\n MFE's single aurora hero. */}\n <div className=\"relative overflow-hidden rounded-2xl\">\n <AuroraBackground intensity=\"subtle\" />\n <EmphasisPanel\n data-tour=\"notification-center-header\"\n className=\"flex flex-col gap-4 p-5 sm:flex-row sm:items-center sm:justify-between sm:p-6\"\n >\n <div>\n <h1 className=\"text-xl sm:text-2xl font-bold text-primary\">\n <GradientText>{tr('notifications.centerTitle', 'Notification Center')}</GradientText>\n </h1>\n <p className=\"text-sm text-secondary mt-1\">\n {unreadCount > 0 ? (\n <>\n {tr('notifications.youHave', 'You have')}{' '}\n <span\n className=\"inline-flex items-center gap-1.5 font-semibold text-primary\"\n data-tour=\"notification-center-unread-count\"\n >\n <span className=\"inline-block h-2 w-2 rounded-full bg-accent-primary motion-safe:animate-vc-glow-pulse\" />\n {unreadCount}\n </span>{' '}\n {tr(\n unreadCount === 1\n ? 'notifications.unreadNotification'\n : 'notifications.unreadNotifications',\n unreadCount === 1 ? 'unread notification' : 'unread notifications'\n )}\n </>\n ) : (\n tr('notifications.allCaughtUp', 'All caught up!')\n )}\n </p>\n </div>\n\n {unreadCount > 0 && (\n <Button\n data-tour=\"notification-center-mark-all-read\"\n variant=\"outline\"\n onClick={markAllAsRead}\n className=\"gap-2\"\n >\n <CheckCheck size={16} />\n {tr('notifications.markAllAsRead', 'Mark All as Read')}\n </Button>\n )}\n </EmphasisPanel>\n </div>\n\n {/* Push opt-in — renders nothing when the surface has no push support\n (web without a service worker, or a shell that never registered a\n controller), so no wrapper card here to avoid an empty box in that\n case. Placed here too since this page, not just the bell dropdown,\n can be the first notification surface a user reaches. */}\n <PushOptInToggle />\n\n {/* Filters */}\n <GlassCard\n treatment=\"plain\"\n data-tour=\"notification-center-filters\"\n className=\"flex flex-col gap-3 border-border-seam p-3 sm:flex-row sm:flex-wrap sm:items-center sm:gap-4 sm:p-4\"\n >\n {/* Search */}\n <div className=\"relative flex-1\">\n <Search size={16} className=\"absolute left-3 top-1/2 -translate-y-1/2 text-tertiary\" />\n <input\n data-tour=\"notification-center-search\"\n type=\"text\"\n placeholder={tr('notifications.searchPlaceholder', 'Search notifications...')}\n value={notificationFilter.search}\n onChange={(e) => updateFilter({ search: e.target.value })}\n className=\"w-full pl-9 pr-4 py-2 text-sm text-primary bg-surface border border-default rounded-lg focus:outline-none focus:ring-2 focus:ring-accent transition-shadow duration-150\"\n />\n </div>\n\n {/* Type filter */}\n <select\n value={notificationFilter.type}\n onChange={(e) => updateFilter({ type: e.target.value as NotificationType | 'ALL' })}\n className=\"px-3 py-2 text-sm text-primary bg-surface border border-default rounded-lg focus:outline-none focus:ring-2 focus:ring-accent transition-shadow duration-150 scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary\"\n >\n <option value=\"ALL\">{tr('notifications.allTypes', 'All Types')}</option>\n {TYPE_OPTIONS.map((option) => (\n <option key={option.value} value={option.value}>\n {tr(option.labelKey, option.label)}\n </option>\n ))}\n </select>\n\n {/* Priority filter */}\n <select\n value={notificationFilter.priority}\n onChange={(e) =>\n updateFilter({ priority: e.target.value as NotificationPriority | 'ALL' })\n }\n className=\"px-3 py-2 text-sm text-primary bg-surface border border-default rounded-lg focus:outline-none focus:ring-2 focus:ring-accent transition-shadow duration-150 scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary\"\n >\n <option value=\"ALL\">{tr('notifications.allPriorities', 'All Priorities')}</option>\n {PRIORITY_OPTIONS.map((option) => (\n <option key={option.value} value={option.value}>\n {tr(option.labelKey, option.label)}\n </option>\n ))}\n </select>\n\n <select\n value={notificationFilter.topicId || ''}\n onChange={(e) => updateFilter({ topicId: e.target.value || undefined })}\n className=\"px-3 py-2 text-sm text-primary bg-surface border border-default rounded-lg focus:outline-none focus:ring-2 focus:ring-accent transition-shadow duration-150 scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary\"\n >\n <option value=\"\">{tr('notifications.allTopics', 'All Topics')}</option>\n {topics.map((topic) => (\n <option key={topic.id} value={topic.id}>\n {topic.name}\n </option>\n ))}\n </select>\n\n {/* Read/Unread filter */}\n <select\n value={\n notificationFilter.isRead === null\n ? 'ALL'\n : notificationFilter.isRead\n ? 'READ'\n : 'UNREAD'\n }\n onChange={(e) =>\n updateFilter({\n isRead: e.target.value === 'ALL' ? null : e.target.value === 'READ',\n })\n }\n className=\"px-3 py-2 text-sm text-primary bg-surface border border-default rounded-lg focus:outline-none focus:ring-2 focus:ring-accent transition-shadow duration-150 scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary\"\n >\n <option value=\"ALL\">{tr('notifications.filterAll', 'All')}</option>\n <option value=\"UNREAD\">{tr('notifications.filterUnread', 'Unread')}</option>\n <option value=\"READ\">{tr('notifications.filterRead', 'Read')}</option>\n </select>\n\n {/* Reset filters */}\n {(notificationFilter.search ||\n notificationFilter.type !== 'ALL' ||\n notificationFilter.priority !== 'ALL' ||\n notificationFilter.isRead !== null ||\n Boolean(notificationFilter.topicId)) && (\n <button\n onClick={resetFilter}\n className=\"px-3 py-2 text-sm text-tertiary hover:text-primary transition-colors duration-150\"\n >\n {tr('notifications.resetFilters', 'Reset')}\n </button>\n )}\n </GlassCard>\n\n {/* Notifications list */}\n <div data-tour=\"notification-center-list\" className=\"space-y-6\">\n {filteredNotifications.length > 0 ? (\n Object.entries(groupedNotifications).map(([group, groupNotifications]) => (\n <div key={group} className=\"animate-in fade-in slide-in-from-bottom-2 duration-200\">\n <h2 className=\"text-sm font-semibold text-tertiary mb-3\">{group}</h2>\n <div className=\"space-y-2\">\n {groupNotifications.map((notification) => (\n <NotificationCard\n key={notification.id}\n notification={notification}\n onMarkAsRead={markAsRead}\n onArchive={archiveNotification}\n onAction={recordAction}\n analyticsSource=\"center\"\n />\n ))}\n </div>\n </div>\n ))\n ) : (\n <div className=\"animate-in fade-in duration-200\">\n <IllustratedEmptyState\n illustration={notifications.length === 0 ? 'empty-notifications' : 'empty-search'}\n title={tr('notifications.noNotificationsFound', 'No notifications found')}\n description={\n notifications.length === 0\n ? tr(\n 'notifications.noNotificationsYet',\n \"You don't have any notifications yet. We'll notify you when something important happens.\"\n )\n : tr(\n 'notifications.adjustFilters',\n 'Try adjusting your filters to see more notifications.'\n )\n }\n />\n </div>\n )}\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAsBA,IAAMC,IAAgB;CAAE,UAAU;CAAO,SAAS;AAAkB,GAC9DC,IAAuB,EAAE,SAAS,SAAS,GAC3CC,IAAoF;CACxF;EAAE,OAAO;EAAU,UAAU;EAA4B,OAAO;CAAS;CACzE;EAAE,OAAO;EAAS,UAAU;EAA2B,OAAO;CAAQ;CACtE;EAAE,OAAO;EAAiB,UAAU;EAAmC,OAAO;CAAgB;CAC9F;EAAE,OAAO;EAAa,UAAU;EAA+B,OAAO;CAAY;AACpF,GACMC,IAA4F;CAChG;EAAE,OAAO;EAAU,UAAU;EAAgC,OAAO;CAAS;CAC7E;EAAE,OAAO;EAAQ,UAAU;EAA8B,OAAO;CAAO;CACvE;EAAE,OAAO;EAAU,UAAU;EAAgC,OAAO;CAAS;CAC7E;EAAE,OAAO;EAAO,UAAU;EAA6B,OAAO;CAAM;AACtE;AASA,SAAgBC,IAAyB;CACvC,IAAM,EAAE,oBAAiBC,EAAgB;CACzC,OAAsBC,EAAfC,IAAgBC,IAA0BC,GAA3B,CAAs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WAAW,QAC9B,EAAQA,EAAmB,YAC3B,kBAAC,UAAD;MACE,SAASuB;MACT,WAAU;MAET,UAAAjC,EAAG,8BAA8B,OAAO;KACnC,CAAA;IAED;;GAGX,kBAAC,OAAD;IAAK,aAAU;IAA2B,WAAU;IACjD,UAAAM,EAAsB,SAAS,IAC9B,OAAO,QAAQK,CAAoB,CAAC,CAAC,KAAK,CAACuB,GAAOC,OAChD,kBAAC,OAAD;KAAiB,WAAU;KAA3B,UAAA,CACE,kBAAC,MAAD;MAAI,WAAU;MAA4C,UAAAD;KAAU,CAAA,GACpE,kBAAC,OAAD;MAAK,WAAU;MACZ,UAAAC,EAAmB,KAAK,MACvB,kBAACC,GAAD;OAEgB;OACd,cAAcC;OACd,WAAWC;OACX,UAAUC;OACV,iBAAgB;MACjB,GANMC,EAAa,EAMnB,CACF;KACE,CAAA,CACF;IAdK,GAAAN,CAcL,CACN,IAED,kBAAC,OAAD;KAAK,WAAU;KACb,UAAA,kBAACO,GAAD;MACE,cAAchC,EAAc,WAAW,IAAI,wBAAwB;MACnE,OAAOT,EAAG,sCAAsC,wBAAwB;MACxE,aACES,EAAc,WAAW,IACrBT,EACE,oCACA,0FACF,IACAA,EACE,+BACA,uDACF;KAEP,CAAA;IACE,CAAA;GAEJ,CAAA;EACF;;AAET"}
|
|
1
|
+
{"version":3,"file":"NotificationCenterPage.js","names":["_Fragment","CENTER_FILTER","CENTER_UNREAD_FILTER","TYPE_OPTIONS","PRIORITY_OPTIONS","NotificationCenterPage","useNotification","jsx","navigationV2","NotificationInboxV2","ClassicNotificationCenterPage","tr","useTr","permissionsLoading","usePermissions","useNotifications","useNotificationTopics","filteredNotifications","useMemo","filterNotifications","notifications","notificationFilter","groupedNotifications","groupNotificationsByDate","hasPermission","NOTIFICATION_PERMISSIONS","currentUser","PagePurpose","BellRing","AuroraBackground","EmphasisPanel","GradientText","unreadCount","Fragment","Button","markAllAsRead","CheckCheck","PushOptInToggle","GlassCard","Search","updateFilter","option","topics","topic","resetFilter","group","groupNotifications","NotificationCard","markAsRead","archiveNotification","recordAction","notification","IllustratedEmptyState"],"sources":["../../src/pages/NotificationCenterPage.tsx"],"sourcesContent":["import { useMemo } from 'react';\nimport { Search, CheckCheck, BellRing } from 'lucide-react';\nimport { PushOptInToggle } from '@burdenoff/fe-libs/chrome';\nimport { usePermissions } from '@burdenoff/fe-libs/shared/providers/shell';\nimport {\n AuroraBackground,\n Button,\n EmphasisPanel,\n GlassCard,\n GradientText,\n IllustratedEmptyState,\n PagePurpose,\n} from '@burdenoff/fe-libs/ui';\nimport { useNotifications, useNotificationTopics } from '../hooks';\nimport { NotificationCard } from '../components/NotificationCard';\nimport { filterNotifications, groupNotificationsByDate } from '../utils';\nimport { NOTIFICATION_PERMISSIONS } from '../constants/permissions';\nimport { useNotification } from '../providers/NotificationProvider';\nimport { useTr } from '../shared/hooks/useTr';\nimport type { NotificationPriority, NotificationType } from '../types';\nimport { NotificationInboxV2 } from '../navigation-v2/NotificationInboxV2';\n\nconst CENTER_FILTER = { archived: false, channel: 'IN_APP' as const };\nconst CENTER_UNREAD_FILTER = { channel: 'IN_APP' };\nconst TYPE_OPTIONS: Array<{ value: NotificationType; labelKey: string; label: string }> = [\n { value: 'SYSTEM', labelKey: 'notifications.typeSystem', label: 'System' },\n { value: 'ALERT', labelKey: 'notifications.typeAlert', label: 'Alert' },\n { value: 'TRANSACTIONAL', labelKey: 'notifications.typeTransactional', label: 'Transactional' },\n { value: 'MARKETING', labelKey: 'notifications.typeMarketing', label: 'Marketing' },\n];\nconst PRIORITY_OPTIONS: Array<{ value: NotificationPriority; labelKey: string; label: string }> = [\n { value: 'URGENT', labelKey: 'notifications.priorityUrgent', label: 'Urgent' },\n { value: 'HIGH', labelKey: 'notifications.priorityHigh', label: 'High' },\n { value: 'NORMAL', labelKey: 'notifications.priorityNormal', label: 'Normal' },\n { value: 'LOW', labelKey: 'notifications.priorityLow', label: 'Low' },\n];\n\n/**\n * Notification Center Page\n *\n * Main page for viewing and managing in-app notifications. Under FluidGrids'\n * Navigation v2 (BOFF-11872) it is the inbox layout instead; every other app\n * keeps the classic page.\n */\nexport function NotificationCenterPage() {\n const { navigationV2 } = useNotification();\n return navigationV2 ? <NotificationInboxV2 /> : <ClassicNotificationCenterPage />;\n}\n\nfunction ClassicNotificationCenterPage() {\n const tr = useTr();\n const { hasPermission, isLoading: permissionsLoading } = usePermissions();\n const { currentUser } = useNotification();\n const {\n notifications,\n unreadCount,\n notificationFilter,\n markAsRead,\n markAllAsRead,\n archiveNotification,\n recordAction,\n updateFilter,\n resetFilter,\n } = useNotifications({ baseFilter: CENTER_FILTER, unreadFilter: CENTER_UNREAD_FILTER });\n const { topics } = useNotificationTopics({ isActive: true });\n\n // Filter and group notifications\n const filteredNotifications = useMemo(\n () => filterNotifications(notifications, notificationFilter),\n [notifications, notificationFilter]\n );\n const groupedNotifications = useMemo(\n () => groupNotificationsByDate(filteredNotifications, tr),\n [filteredNotifications, tr]\n );\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('notifications.noPermissionView', \"You don't have permission to view notifications.\")}\n </div>\n );\n }\n\n return (\n <div className=\"space-y-4 sm:space-y-6 p-3 sm:p-6 animate-in fade-in duration-200\">\n <PagePurpose icon={<BellRing size={16} />}>\n {tr(\n 'notifications.centerPurpose',\n 'Your in-app inbox. Everything the platform needs you to see — task assignments, mentions, alerts and system updates — lands here. Filter by type, priority or topic, mark items as read, and archive what you no longer need.'\n )}\n </PagePurpose>\n\n {/* Header — the page's single emphasis zone (unread summary + the one CTA).\n Wrapped in a relative overflow-hidden container so the AuroraBackground\n can sit behind it (at -z-10) without ever moving content. This is the\n MFE's single aurora hero. */}\n <div className=\"relative overflow-hidden rounded-2xl\">\n <AuroraBackground intensity=\"subtle\" />\n <EmphasisPanel\n data-tour=\"notification-center-header\"\n className=\"flex flex-col gap-4 p-5 sm:flex-row sm:items-center sm:justify-between sm:p-6\"\n >\n <div>\n <h1 className=\"text-xl sm:text-2xl font-bold text-primary\">\n <GradientText>{tr('notifications.centerTitle', 'Notification Center')}</GradientText>\n </h1>\n <p className=\"text-sm text-text-secondary mt-1\">\n {unreadCount > 0 ? (\n <>\n {tr('notifications.youHave', 'You have')}{' '}\n <span\n className=\"inline-flex items-center gap-1.5 font-semibold text-primary\"\n data-tour=\"notification-center-unread-count\"\n >\n <span className=\"inline-block h-2 w-2 rounded-full bg-accent-primary motion-safe:animate-vc-glow-pulse\" />\n {unreadCount}\n </span>{' '}\n {tr(\n unreadCount === 1\n ? 'notifications.unreadNotification'\n : 'notifications.unreadNotifications',\n unreadCount === 1 ? 'unread notification' : 'unread notifications'\n )}\n </>\n ) : (\n tr('notifications.allCaughtUp', 'All caught up!')\n )}\n </p>\n </div>\n\n {unreadCount > 0 && (\n <Button\n data-tour=\"notification-center-mark-all-read\"\n variant=\"outline\"\n onClick={markAllAsRead}\n className=\"gap-2\"\n >\n <CheckCheck size={16} />\n {tr('notifications.markAllAsRead', 'Mark All as Read')}\n </Button>\n )}\n </EmphasisPanel>\n </div>\n\n {/* Push opt-in — renders nothing when the surface has no push support\n (web without a service worker, or a shell that never registered a\n controller), so no wrapper card here to avoid an empty box in that\n case. Placed here too since this page, not just the bell dropdown,\n can be the first notification surface a user reaches. */}\n <PushOptInToggle />\n\n {/* Filters */}\n <GlassCard\n treatment=\"plain\"\n data-tour=\"notification-center-filters\"\n className=\"flex flex-col gap-3 border-border-seam p-3 sm:flex-row sm:flex-wrap sm:items-center sm:gap-4 sm:p-4\"\n >\n {/* Search */}\n <div className=\"relative flex-1\">\n <Search size={16} className=\"absolute left-3 top-1/2 -translate-y-1/2 text-tertiary\" />\n <input\n data-tour=\"notification-center-search\"\n type=\"text\"\n placeholder={tr('notifications.searchPlaceholder', 'Search notifications...')}\n value={notificationFilter.search}\n onChange={(e) => updateFilter({ search: e.target.value })}\n className=\"w-full pl-9 pr-4 py-2 text-sm text-primary bg-surface border border-default rounded-lg focus:outline-none focus:ring-2 focus:ring-accent transition-shadow duration-150\"\n />\n </div>\n\n {/* Type filter */}\n <select\n value={notificationFilter.type}\n onChange={(e) => updateFilter({ type: e.target.value as NotificationType | 'ALL' })}\n className=\"px-3 py-2 text-sm text-primary bg-surface border border-default rounded-lg focus:outline-none focus:ring-2 focus:ring-accent transition-shadow duration-150 scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary\"\n >\n <option value=\"ALL\">{tr('notifications.allTypes', 'All Types')}</option>\n {TYPE_OPTIONS.map((option) => (\n <option key={option.value} value={option.value}>\n {tr(option.labelKey, option.label)}\n </option>\n ))}\n </select>\n\n {/* Priority filter */}\n <select\n value={notificationFilter.priority}\n onChange={(e) =>\n updateFilter({ priority: e.target.value as NotificationPriority | 'ALL' })\n }\n className=\"px-3 py-2 text-sm text-primary bg-surface border border-default rounded-lg focus:outline-none focus:ring-2 focus:ring-accent transition-shadow duration-150 scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary\"\n >\n <option value=\"ALL\">{tr('notifications.allPriorities', 'All Priorities')}</option>\n {PRIORITY_OPTIONS.map((option) => (\n <option key={option.value} value={option.value}>\n {tr(option.labelKey, option.label)}\n </option>\n ))}\n </select>\n\n <select\n value={notificationFilter.topicId || ''}\n onChange={(e) => updateFilter({ topicId: e.target.value || undefined })}\n className=\"px-3 py-2 text-sm text-primary bg-surface border border-default rounded-lg focus:outline-none focus:ring-2 focus:ring-accent transition-shadow duration-150 scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary\"\n >\n <option value=\"\">{tr('notifications.allTopics', 'All Topics')}</option>\n {topics.map((topic) => (\n <option key={topic.id} value={topic.id}>\n {topic.name}\n </option>\n ))}\n </select>\n\n {/* Read/Unread filter */}\n <select\n value={\n notificationFilter.isRead === null\n ? 'ALL'\n : notificationFilter.isRead\n ? 'READ'\n : 'UNREAD'\n }\n onChange={(e) =>\n updateFilter({\n isRead: e.target.value === 'ALL' ? null : e.target.value === 'READ',\n })\n }\n className=\"px-3 py-2 text-sm text-primary bg-surface border border-default rounded-lg focus:outline-none focus:ring-2 focus:ring-accent transition-shadow duration-150 scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary\"\n >\n <option value=\"ALL\">{tr('notifications.filterAll', 'All')}</option>\n <option value=\"UNREAD\">{tr('notifications.filterUnread', 'Unread')}</option>\n <option value=\"READ\">{tr('notifications.filterRead', 'Read')}</option>\n </select>\n\n {/* Reset filters */}\n {(notificationFilter.search ||\n notificationFilter.type !== 'ALL' ||\n notificationFilter.priority !== 'ALL' ||\n notificationFilter.isRead !== null ||\n Boolean(notificationFilter.topicId)) && (\n <button\n onClick={resetFilter}\n className=\"px-3 py-2 text-sm text-tertiary hover:text-primary transition-colors duration-150\"\n >\n {tr('notifications.resetFilters', 'Reset')}\n </button>\n )}\n </GlassCard>\n\n {/* Notifications list */}\n <div data-tour=\"notification-center-list\" className=\"space-y-6\">\n {filteredNotifications.length > 0 ? (\n Object.entries(groupedNotifications).map(([group, groupNotifications]) => (\n <div key={group} className=\"animate-in fade-in slide-in-from-bottom-2 duration-200\">\n <h2 className=\"text-sm font-semibold text-tertiary mb-3\">{group}</h2>\n <div className=\"space-y-2\">\n {groupNotifications.map((notification) => (\n <NotificationCard\n key={notification.id}\n notification={notification}\n onMarkAsRead={markAsRead}\n onArchive={archiveNotification}\n onAction={recordAction}\n analyticsSource=\"center\"\n />\n ))}\n </div>\n </div>\n ))\n ) : (\n <div className=\"animate-in fade-in duration-200\">\n <IllustratedEmptyState\n illustration={notifications.length === 0 ? 'empty-notifications' : 'empty-search'}\n title={tr('notifications.noNotificationsFound', 'No notifications found')}\n description={\n notifications.length === 0\n ? tr(\n 'notifications.noNotificationsYet',\n \"You don't have any notifications yet. We'll notify you when something important happens.\"\n )\n : tr(\n 'notifications.adjustFilters',\n 'Try adjusting your filters to see more notifications.'\n )\n }\n />\n </div>\n )}\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAsBA,IAAMC,IAAgB;CAAE,UAAU;CAAO,SAAS;AAAkB,GAC9DC,IAAuB,EAAE,SAAS,SAAS,GAC3CC,IAAoF;CACxF;EAAE,OAAO;EAAU,UAAU;EAA4B,OAAO;CAAS;CACzE;EAAE,OAAO;EAAS,UAAU;EAA2B,OAAO;CAAQ;CACtE;EAAE,OAAO;EAAiB,UAAU;EAAmC,OAAO;CAAgB;CAC9F;EAAE,OAAO;EAAa,UAAU;EAA+B,OAAO;CAAY;AACpF,GACMC,IAA4F;CAChG;EAAE,OAAO;EAAU,UAAU;EAAgC,OAAO;CAAS;CAC7E;EAAE,OAAO;EAAQ,UAAU;EAA8B,OAAO;CAAO;CACvE;EAAE,OAAO;EAAU,UAAU;EAAgC,OAAO;CAAS;CAC7E;EAAE,OAAO;EAAO,UAAU;EAA6B,OAAO;CAAM;AACtE;AASA,SAAgBC,IAAyB;CACvC,IAAM,EAAE,oBAAiBC,EAAgB;CACzC,OAAsBC,EAAfC,IAAgBC,IAA0BC,GAA3B,CAAsB,CAAoC;AAClF;AAEA,SAASA,IAAgC;CACvC,IAAMC,IAAKC,EAAM,GACX,EAAE,kBAAe,WAAWC,MAAuBC,EAAe,GAClE,EAAE,mBAAgBR,EAAgB,GAClC,EACJ,kBACA,gBACA,uBACA,eACA,kBACA,wBACA,iBACA,iBACA,mBACES,EAAiB;EAAE,YAAYd;EAAe,cAAcC;CAAqB,CAAC,GAChF,EAAE,cAAWc,EAAsB,EAAE,UAAU,GAAK,CAAC,GAGrDC,IAAwBC,QACtBC,EAAoBC,GAAeC,CAAkB,GAC3D,CAACD,GAAeC,CAAkB,CACpC,GACMC,IAAuBJ,QACrBK,EAAyBN,GAAuBN,CAAE,GACxD,CAACM,GAAuBN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B;OACd,cAAcC;OACd,WAAWC;OACX,UAAUC;OACV,iBAAgB;MACjB,GANMC,EAAa,EAMnB,CACF;KACE,CAAA,CACF;IAdK,GAAAN,CAcL,CACN,IAED,kBAAC,OAAD;KAAK,WAAU;KACb,UAAA,kBAACO,GAAD;MACE,cAAchC,EAAc,WAAW,IAAI,wBAAwB;MACnE,OAAOT,EAAG,sCAAsC,wBAAwB;MACxE,aACES,EAAc,WAAW,IACrBT,EACE,oCACA,0FACF,IACAA,EACE,+BACA,uDACF;KAEP,CAAA;IACE,CAAA;GAEJ,CAAA;EACF;;AAET"}
|
|
@@ -62,7 +62,7 @@ function C() {
|
|
|
62
62
|
className: "text-xl sm:text-2xl font-bold text-primary",
|
|
63
63
|
children: C("notifications.adminHistoryTitle", "Notification Operations")
|
|
64
64
|
}), /* @__PURE__ */ p("p", {
|
|
65
|
-
className: "text-sm text-secondary mt-1",
|
|
65
|
+
className: "text-sm text-text-secondary mt-1",
|
|
66
66
|
children: C("notifications.adminHistorySubtitle", "Review sent and scheduled notifications, delivery outcomes, opens, clicks, and user activity.")
|
|
67
67
|
})] }), /* @__PURE__ */ m(h, {
|
|
68
68
|
type: "button",
|
|
@@ -246,7 +246,7 @@ function C() {
|
|
|
246
246
|
className: "text-base font-semibold text-primary",
|
|
247
247
|
children: C("notifications.sentNotifications", "Notifications")
|
|
248
248
|
}), /* @__PURE__ */ m("p", {
|
|
249
|
-
className: "text-sm text-secondary",
|
|
249
|
+
className: "text-sm text-text-secondary",
|
|
250
250
|
children: [
|
|
251
251
|
k.length,
|
|
252
252
|
" ",
|
|
@@ -299,7 +299,7 @@ function C() {
|
|
|
299
299
|
className: "text-sm font-semibold text-primary",
|
|
300
300
|
children: e.notification.title
|
|
301
301
|
}), /* @__PURE__ */ m("p", {
|
|
302
|
-
className: "text-xs text-secondary",
|
|
302
|
+
className: "text-xs text-text-secondary",
|
|
303
303
|
children: [
|
|
304
304
|
e.notification.channel,
|
|
305
305
|
" • ",
|
|
@@ -313,7 +313,7 @@ function C() {
|
|
|
313
313
|
children: [/* @__PURE__ */ p("button", {
|
|
314
314
|
type: "button",
|
|
315
315
|
onClick: () => P(e.notification.id),
|
|
316
|
-
className: "rounded-md border border-default px-3 py-2 text-xs text-secondary hover:bg-bg-sunken",
|
|
316
|
+
className: "rounded-md border border-default px-3 py-2 text-xs text-text-secondary hover:bg-bg-sunken",
|
|
317
317
|
children: C("notifications.view", "View")
|
|
318
318
|
}), e.status === "PENDING" && /* @__PURE__ */ p("button", {
|
|
319
319
|
type: "button",
|
|
@@ -337,17 +337,17 @@ function C() {
|
|
|
337
337
|
className: "text-lg font-semibold text-primary",
|
|
338
338
|
children: j.title
|
|
339
339
|
}), /* @__PURE__ */ p("p", {
|
|
340
|
-
className: "text-sm text-secondary",
|
|
340
|
+
className: "text-sm text-text-secondary",
|
|
341
341
|
children: j.body
|
|
342
342
|
})] }), /* @__PURE__ */ p("button", {
|
|
343
343
|
type: "button",
|
|
344
344
|
onClick: z,
|
|
345
|
-
className: "rounded-md border border-default px-3 py-2 text-xs text-secondary hover:bg-bg-sunken",
|
|
345
|
+
className: "rounded-md border border-default px-3 py-2 text-xs text-text-secondary hover:bg-bg-sunken",
|
|
346
346
|
children: C("notifications.close", "Close")
|
|
347
347
|
})]
|
|
348
348
|
}),
|
|
349
349
|
/* @__PURE__ */ m("div", {
|
|
350
|
-
className: "grid gap-2 rounded-md border border-default bg-bg-canvas p-3 text-sm text-secondary",
|
|
350
|
+
className: "grid gap-2 rounded-md border border-default bg-bg-canvas p-3 text-sm text-text-secondary",
|
|
351
351
|
children: [
|
|
352
352
|
/* @__PURE__ */ m("div", { children: [
|
|
353
353
|
/* @__PURE__ */ m("strong", { children: [C("notifications.detail.status", "Status"), ":"] }),
|
|
@@ -425,7 +425,7 @@ function C() {
|
|
|
425
425
|
}), /* @__PURE__ */ p("div", {
|
|
426
426
|
className: "grid gap-2",
|
|
427
427
|
children: j.actions.map((e) => /* @__PURE__ */ m("div", {
|
|
428
|
-
className: "rounded-md border border-default bg-bg-canvas p-3 text-sm text-secondary",
|
|
428
|
+
className: "rounded-md border border-default bg-bg-canvas p-3 text-sm text-text-secondary",
|
|
429
429
|
children: [/* @__PURE__ */ p("div", {
|
|
430
430
|
className: "font-medium text-primary",
|
|
431
431
|
children: e.label
|
|
@@ -444,7 +444,7 @@ function C() {
|
|
|
444
444
|
children: C("notifications.scheduling", "Scheduling")
|
|
445
445
|
}),
|
|
446
446
|
/* @__PURE__ */ p("div", {
|
|
447
|
-
className: "text-sm text-secondary",
|
|
447
|
+
className: "text-sm text-text-secondary",
|
|
448
448
|
children: S(j.scheduledNotification.scheduledFor)
|
|
449
449
|
}),
|
|
450
450
|
j.scheduledNotification.status === "PENDING" && /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p("input", {
|
|
@@ -473,12 +473,12 @@ function C() {
|
|
|
473
473
|
children: j.archivedAt ? /* @__PURE__ */ p("button", {
|
|
474
474
|
type: "button",
|
|
475
475
|
onClick: () => I(j.id),
|
|
476
|
-
className: "rounded-md border border-default px-3 py-2 text-xs text-secondary hover:bg-bg-sunken",
|
|
476
|
+
className: "rounded-md border border-default px-3 py-2 text-xs text-text-secondary hover:bg-bg-sunken",
|
|
477
477
|
children: C("notifications.restore", "Restore")
|
|
478
478
|
}) : /* @__PURE__ */ p("button", {
|
|
479
479
|
type: "button",
|
|
480
480
|
onClick: () => F(j.id),
|
|
481
|
-
className: "rounded-md border border-default px-3 py-2 text-xs text-secondary hover:bg-bg-sunken",
|
|
481
|
+
className: "rounded-md border border-default px-3 py-2 text-xs text-text-secondary hover:bg-bg-sunken",
|
|
482
482
|
children: C("notifications.archive", "Archive")
|
|
483
483
|
})
|
|
484
484
|
}),
|
|
@@ -488,14 +488,14 @@ function C() {
|
|
|
488
488
|
className: "text-sm font-semibold text-primary",
|
|
489
489
|
children: C("notifications.eventTimeline", "Event Timeline")
|
|
490
490
|
}), M.length === 0 ? /* @__PURE__ */ p("div", {
|
|
491
|
-
className: "rounded-md border border-dashed border-border-seam p-4 text-sm text-secondary",
|
|
491
|
+
className: "rounded-md border border-dashed border-border-seam p-4 text-sm text-text-secondary",
|
|
492
492
|
children: C("notifications.noEvents", "No events recorded yet.")
|
|
493
493
|
}) : /* @__PURE__ */ p(x, {
|
|
494
494
|
collapsedHeight: 180,
|
|
495
495
|
children: /* @__PURE__ */ p("div", {
|
|
496
496
|
className: "space-y-2",
|
|
497
497
|
children: M.map((e) => /* @__PURE__ */ m("div", {
|
|
498
|
-
className: "rounded-md border border-border-seam bg-surface p-3 text-sm text-secondary",
|
|
498
|
+
className: "rounded-md border border-border-seam bg-surface p-3 text-sm text-text-secondary",
|
|
499
499
|
children: [
|
|
500
500
|
/* @__PURE__ */ p("div", {
|
|
501
501
|
className: "font-medium text-primary",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NotificationHistoryAdminPage.js","names":["_Fragment","formatDateTime","value","NotificationHistoryAdminPage","tr","useTr","permissionsLoading","usePermissions","useNotificationTopics","useNotificationAdmin","rescheduleAt","setRescheduleAt","useState","hasPermission","NOTIFICATION_PERMISSIONS","PagePurpose","CalendarClock","NextSteps","notifications","loadNotification","setFilters","prev","exportNotificationsAsCsv","Button","Download","GlassCard","Search","filters","event","topics","topic","EmphasisPanel","isLoading","RefreshCw","IllustratedEmptyState","notification","NotificationCard","scheduledNotifications","scheduled","cancelScheduledNotification","selectedNotification","clearSelection","item","action","Fragment","rescheduleNotification","unarchiveNotification","archiveNotification","events","ShowMore"],"sources":["../../src/pages/NotificationHistoryAdminPage.tsx"],"sourcesContent":["import { useState } from 'react';\nimport { CalendarClock, Download, RefreshCw, Search } from 'lucide-react';\nimport { usePermissions } from '@burdenoff/fe-libs/shared/providers/shell';\nimport {\n Button,\n EmphasisPanel,\n GlassCard,\n IllustratedEmptyState,\n NextSteps,\n PagePurpose,\n ShowMore,\n} from '@burdenoff/fe-libs/ui';\nimport { NotificationCard } from '../components/NotificationCard';\nimport { useNotificationAdmin, useNotificationTopics } from '../hooks';\nimport { NOTIFICATION_PERMISSIONS } from '../constants/permissions';\nimport { useTr } from '../shared/hooks/useTr';\nimport { exportNotificationsAsCsv } from '../utils/notificationHistoryExport';\n\nfunction formatDateTime(value?: string | null) {\n if (!value) return '—';\n return new Date(value).toLocaleString();\n}\n\n/** Admin Notification History — scheduled ops, delivery inspector, event timeline. */\nexport function NotificationHistoryAdminPage() {\n const tr = useTr();\n const { hasPermission, isLoading: permissionsLoading } = usePermissions();\n const { topics } = useNotificationTopics();\n const {\n filters,\n setFilters,\n notifications,\n scheduledNotifications,\n selectedNotification,\n events,\n isLoading,\n loadNotification,\n archiveNotification,\n unarchiveNotification,\n cancelScheduledNotification,\n rescheduleNotification,\n clearSelection,\n } = useNotificationAdmin();\n const [rescheduleAt, setRescheduleAt] = useState('');\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)) {\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 return (\n <div className=\"space-y-4 sm:space-y-6\">\n <PagePurpose icon={<CalendarClock size={16} />}>\n {tr(\n 'notifications.adminHistoryPurpose',\n 'The operations console for everything your team has sent. Audit delivery outcomes (delivered, opened, clicked, failed, unsubscribed), inspect a single notification’s full event timeline, and manage the schedule — reschedule or cancel anything still pending. Use it to debug a campaign or prove a notification went out.'\n )}\n </PagePurpose>\n\n <NextSteps\n storageKey=\"notification-admin-history\"\n steps={[\n {\n id: 'inspect',\n label: tr('notifications.nextInspectLabel', 'Inspect a delivery'),\n description: tr(\n 'notifications.nextInspectDesc',\n 'Click any notification to see its receipts, opens, clicks and full event timeline.'\n ),\n onClick: () => {\n if (notifications[0]) {\n loadNotification(notifications[0].id);\n }\n },\n },\n {\n id: 'failed',\n label: tr('notifications.nextFailedLabel', 'Find failed deliveries'),\n description: tr(\n 'notifications.nextFailedDesc',\n 'Filter by a FAILED delivery state to triage what did not reach recipients.'\n ),\n onClick: () => setFilters((prev) => ({ ...prev, deliveryStatus: 'FAILED' })),\n },\n {\n id: 'export',\n label: tr('notifications.nextExportLabel', 'Export the current view'),\n description: tr(\n 'notifications.nextExportDesc',\n 'Download the filtered results as CSV for reporting or an external audit.'\n ),\n onClick: () => {\n if (notifications.length > 0) {\n exportNotificationsAsCsv(tr, notifications);\n }\n },\n },\n ]}\n />\n\n <div className=\"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between\">\n <div>\n <h1 className=\"text-xl sm:text-2xl font-bold text-primary\">\n {tr('notifications.adminHistoryTitle', 'Notification Operations')}\n </h1>\n <p className=\"text-sm text-secondary mt-1\">\n {tr(\n 'notifications.adminHistorySubtitle',\n 'Review sent and scheduled notifications, delivery outcomes, opens, clicks, and user activity.'\n )}\n </p>\n </div>\n <Button\n type=\"button\"\n variant=\"outline\"\n onClick={() => exportNotificationsAsCsv(tr, notifications)}\n disabled={notifications.length === 0}\n className=\"gap-2\"\n >\n <Download size={16} />\n {tr('notifications.export', 'Export')}\n </Button>\n </div>\n\n <GlassCard treatment=\"plain\" className=\"grid gap-3 border-border-seam p-4 lg:grid-cols-6\">\n <label className=\"relative lg:col-span-2\">\n <Search size={16} className=\"absolute left-3 top-1/2 -translate-y-1/2 text-tertiary\" />\n <input\n type=\"text\"\n value={filters.search}\n onChange={(event) => setFilters((prev) => ({ ...prev, search: event.target.value }))}\n placeholder={tr(\n 'notifications.searchByTitleOrContent',\n 'Search by title or content...'\n )}\n className=\"w-full rounded-md border border-default bg-bg-canvas py-2 pl-9 pr-3 text-sm text-primary focus:outline-none focus:ring-2 focus:ring-accent\"\n />\n </label>\n\n <select\n value={filters.status}\n onChange={(event) => setFilters((prev) => ({ ...prev, status: event.target.value }))}\n className=\"rounded-md border border-default bg-bg-canvas px-3 py-2 text-sm text-primary scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary\"\n >\n <option value=\"all\">{tr('notifications.allStatuses', 'All Statuses')}</option>\n <option value=\"PENDING\">PENDING</option>\n <option value=\"TRIGGERED\">TRIGGERED</option>\n <option value=\"SENT\">SENT</option>\n <option value=\"FAILED\">FAILED</option>\n <option value=\"CANCELLED\">CANCELLED</option>\n </select>\n\n <select\n value={filters.channel}\n onChange={(event) => setFilters((prev) => ({ ...prev, channel: event.target.value }))}\n className=\"rounded-md border border-default bg-bg-canvas px-3 py-2 text-sm text-primary scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary\"\n >\n <option value=\"all\">{tr('notifications.allChannels', 'All Channels')}</option>\n <option value=\"EMAIL\">EMAIL</option>\n <option value=\"SMS\">SMS</option>\n <option value=\"PUSH\">PUSH</option>\n <option value=\"WHATSAPP\">WHATSAPP</option>\n <option value=\"IN_APP\">IN_APP</option>\n </select>\n\n <select\n value={filters.deliveryStatus}\n onChange={(event) =>\n setFilters((prev) => ({ ...prev, deliveryStatus: event.target.value }))\n }\n className=\"rounded-md border border-default bg-bg-canvas px-3 py-2 text-sm text-primary scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary\"\n >\n <option value=\"all\">{tr('notifications.allDeliveryStates', 'All Delivery')}</option>\n <option value=\"DELIVERED\">DELIVERED</option>\n <option value=\"OPENED\">OPENED</option>\n <option value=\"CLICKED\">CLICKED</option>\n <option value=\"FAILED\">FAILED</option>\n <option value=\"UNSUBSCRIBED\">UNSUBSCRIBED</option>\n </select>\n\n <select\n value={filters.topicId}\n onChange={(event) => setFilters((prev) => ({ ...prev, topicId: event.target.value }))}\n className=\"rounded-md border border-default bg-bg-canvas px-3 py-2 text-sm text-primary scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary\"\n >\n <option value=\"\">{tr('notifications.allTopics', 'All Topics')}</option>\n {topics.map((topic) => (\n <option key={topic.id} value={topic.id}>\n {topic.name}\n </option>\n ))}\n </select>\n\n <select\n value={filters.archived}\n onChange={(event) =>\n setFilters((prev) => ({\n ...prev,\n archived: event.target.value as typeof prev.archived,\n }))\n }\n className=\"rounded-md border border-default bg-bg-canvas px-3 py-2 text-sm text-primary scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary\"\n >\n <option value=\"all\">{tr('notifications.activeAndArchived', 'Active + Archived')}</option>\n <option value=\"active\">{tr('notifications.activeOnly', 'Active Only')}</option>\n <option value=\"archived\">{tr('notifications.archivedOnly', 'Archived Only')}</option>\n </select>\n </GlassCard>\n\n <div className=\"grid gap-6 xl:grid-cols-[minmax(0,1fr),420px]\">\n <div className=\"space-y-6\">\n {/* Single emphasis zone — the live results list is the heart of this console. */}\n <EmphasisPanel className=\"p-4\">\n <div className=\"mb-4 flex items-center justify-between\">\n <div>\n <h2 className=\"text-base font-semibold text-primary\">\n {tr('notifications.sentNotifications', 'Notifications')}\n </h2>\n <p className=\"text-sm text-secondary\">\n {notifications.length} {tr('notifications.resultsFoundShort', 'results')}\n </p>\n </div>\n {isLoading && <RefreshCw size={16} className=\"animate-spin text-tertiary\" />}\n </div>\n\n <div className=\"space-y-3\">\n {notifications.length === 0 ? (\n <IllustratedEmptyState\n illustration=\"empty-search\"\n title={tr('notifications.noNotificationsFound', 'No notifications found')}\n description={tr(\n 'notifications.adjustSearchOrDateRange',\n 'Try adjusting your filters'\n )}\n />\n ) : (\n notifications.map((notification) => (\n <button\n key={notification.id}\n type=\"button\"\n onClick={() => loadNotification(notification.id)}\n className=\"block w-full text-left\"\n >\n <NotificationCard\n notification={notification}\n compact\n showArchivedState\n analyticsSource=\"admin_history\"\n />\n </button>\n ))\n )}\n </div>\n </EmphasisPanel>\n\n <section className=\"rounded-lg border border-border-seam bg-gloss-card p-4\">\n <div className=\"mb-4 flex items-center gap-2\">\n <CalendarClock size={18} className=\"text-accent-primary\" />\n <h2 className=\"text-base font-semibold text-primary\">\n {tr('notifications.scheduledNotifications', 'Scheduled Notifications')}\n </h2>\n </div>\n\n <div className=\"space-y-3\">\n {scheduledNotifications.length === 0 ? (\n <IllustratedEmptyState\n illustration=\"empty-data\"\n title={tr('notifications.noScheduledNotifications', 'No scheduled notifications')}\n description={tr(\n 'notifications.noScheduledDescription',\n 'Notifications queued for a future send time will appear here, ready to reschedule or cancel.'\n )}\n />\n ) : (\n scheduledNotifications.map((scheduled) => (\n <div\n key={scheduled.id}\n className=\"rounded-md border border-default bg-bg-canvas p-4\"\n >\n <div className=\"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between\">\n <div>\n <h3 className=\"text-sm font-semibold text-primary\">\n {scheduled.notification.title}\n </h3>\n <p className=\"text-xs text-secondary\">\n {scheduled.notification.channel} • {scheduled.notification.type} •{' '}\n {formatDateTime(scheduled.scheduledFor)}\n </p>\n </div>\n <div className=\"flex items-center gap-2\">\n <button\n type=\"button\"\n onClick={() => loadNotification(scheduled.notification.id)}\n className=\"rounded-md border border-default px-3 py-2 text-xs text-secondary hover:bg-bg-sunken\"\n >\n {tr('notifications.view', 'View')}\n </button>\n {scheduled.status === 'PENDING' && (\n <button\n type=\"button\"\n onClick={() => cancelScheduledNotification(scheduled.id)}\n className=\"rounded-md border border-status-error-border px-3 py-2 text-xs text-status-error-text hover:bg-status-error-bg-subtle\"\n >\n {tr('notifications.cancel', 'Cancel')}\n </button>\n )}\n </div>\n </div>\n </div>\n ))\n )}\n </div>\n </section>\n </div>\n\n <aside className=\"rounded-lg border border-border-seam bg-gloss-card p-4 xl:sticky xl:top-4 xl:max-h-[calc(100vh-2rem)] xl:self-start xl:overflow-y-auto\">\n {selectedNotification ? (\n <div className=\"space-y-4\">\n <div className=\"flex items-start justify-between gap-3\">\n <div>\n <h2 className=\"text-lg font-semibold text-primary\">\n {selectedNotification.title}\n </h2>\n <p className=\"text-sm text-secondary\">{selectedNotification.body}</p>\n </div>\n <button\n type=\"button\"\n onClick={clearSelection}\n className=\"rounded-md border border-default px-3 py-2 text-xs text-secondary hover:bg-bg-sunken\"\n >\n {tr('notifications.close', 'Close')}\n </button>\n </div>\n\n <div className=\"grid gap-2 rounded-md border border-default bg-bg-canvas p-3 text-sm text-secondary\">\n <div>\n <strong>{tr('notifications.detail.status', 'Status')}:</strong>{' '}\n {selectedNotification.status}\n </div>\n <div>\n <strong>{tr('notifications.detail.delivery', 'Delivery')}:</strong>{' '}\n {selectedNotification.deliveryStatus || '—'}\n </div>\n <div>\n <strong>{tr('notifications.detail.topic', 'Topic')}:</strong>{' '}\n {selectedNotification.topic?.name || '—'}\n </div>\n <div>\n <strong>{tr('notifications.detail.created', 'Created')}:</strong>{' '}\n {formatDateTime(selectedNotification.createdAt)}\n </div>\n <div>\n <strong>{tr('notifications.detail.sent', 'Sent')}:</strong>{' '}\n {formatDateTime(selectedNotification.sentAt)}\n </div>\n <div>\n <strong>{tr('notifications.detail.delivered', 'Delivered')}:</strong>{' '}\n {formatDateTime(selectedNotification.deliveredAt)}\n </div>\n <div>\n <strong>{tr('notifications.detail.opened', 'Opened')}:</strong>{' '}\n {formatDateTime(selectedNotification.openedAt)}\n </div>\n <div>\n <strong>{tr('notifications.detail.clicked', 'Clicked')}:</strong>{' '}\n {formatDateTime(selectedNotification.clickedAt)}\n </div>\n <div>\n <strong>{tr('notifications.detail.read', 'Read')}:</strong>{' '}\n {formatDateTime(selectedNotification.readAt)}\n </div>\n <div>\n <strong>{tr('notifications.detail.recipient', 'Recipient')}:</strong>{' '}\n {selectedNotification.recipientEmail ||\n selectedNotification.recipientPhone ||\n selectedNotification.id}\n </div>\n </div>\n\n {selectedNotification.media.length > 0 && (\n <div className=\"space-y-2\">\n <h3 className=\"text-sm font-semibold text-primary\">\n {tr('notifications.media', 'Media')}\n </h3>\n <div className=\"grid gap-3\">\n {selectedNotification.media.map((item) => (\n <a\n key={item.url}\n href={item.url}\n target=\"_blank\"\n rel=\"noreferrer\"\n className=\"rounded-md border border-default bg-bg-canvas p-3 text-sm text-accent-primary hover:underline\"\n >\n {item.label || item.url}\n </a>\n ))}\n </div>\n </div>\n )}\n\n {selectedNotification.actions.length > 0 && (\n <div className=\"space-y-2\">\n <h3 className=\"text-sm font-semibold text-primary\">\n {tr('notifications.actions', 'Actions')}\n </h3>\n <div className=\"grid gap-2\">\n {selectedNotification.actions.map((action) => (\n <div\n key={action.id}\n className=\"rounded-md border border-default bg-bg-canvas p-3 text-sm text-secondary\"\n >\n <div className=\"font-medium text-primary\">{action.label}</div>\n <div className=\"truncate text-xs\">{action.url}</div>\n </div>\n ))}\n </div>\n </div>\n )}\n\n {selectedNotification.scheduledNotification && (\n <div className=\"space-y-3 rounded-md border border-default bg-bg-canvas p-3\">\n <div className=\"text-sm font-semibold text-primary\">\n {tr('notifications.scheduling', 'Scheduling')}\n </div>\n <div className=\"text-sm text-secondary\">\n {formatDateTime(selectedNotification.scheduledNotification.scheduledFor)}\n </div>\n {selectedNotification.scheduledNotification.status === 'PENDING' && (\n <>\n <input\n type=\"datetime-local\"\n value={rescheduleAt}\n onChange={(event) => setRescheduleAt(event.target.value)}\n className=\"w-full rounded-md border border-default bg-surface px-3 py-2 text-sm text-primary\"\n />\n <div className=\"flex items-center gap-2\">\n <button\n type=\"button\"\n onClick={() =>\n rescheduleAt &&\n rescheduleNotification(\n selectedNotification.scheduledNotification!.id,\n new Date(rescheduleAt).toISOString()\n )\n }\n className=\"rounded-md bg-accent-primary px-3 py-2 text-xs font-medium text-text-inverse hover:opacity-90\"\n >\n {tr('notifications.reschedule', 'Reschedule')}\n </button>\n <button\n type=\"button\"\n onClick={() =>\n cancelScheduledNotification(\n selectedNotification.scheduledNotification!.id\n )\n }\n className=\"rounded-md border border-status-error-border px-3 py-2 text-xs text-status-error-text hover:bg-status-error-bg-subtle\"\n >\n {tr('notifications.cancel', 'Cancel')}\n </button>\n </div>\n </>\n )}\n </div>\n )}\n\n <div className=\"flex items-center gap-2\">\n {selectedNotification.archivedAt ? (\n <button\n type=\"button\"\n onClick={() => unarchiveNotification(selectedNotification.id)}\n className=\"rounded-md border border-default px-3 py-2 text-xs text-secondary hover:bg-bg-sunken\"\n >\n {tr('notifications.restore', 'Restore')}\n </button>\n ) : (\n <button\n type=\"button\"\n onClick={() => archiveNotification(selectedNotification.id)}\n className=\"rounded-md border border-default px-3 py-2 text-xs text-secondary hover:bg-bg-sunken\"\n >\n {tr('notifications.archive', 'Archive')}\n </button>\n )}\n </div>\n\n <div className=\"space-y-2\">\n <h3 className=\"text-sm font-semibold text-primary\">\n {tr('notifications.eventTimeline', 'Event Timeline')}\n </h3>\n {events.length === 0 ? (\n <div className=\"rounded-md border border-dashed border-border-seam p-4 text-sm text-secondary\">\n {tr('notifications.noEvents', 'No events recorded yet.')}\n </div>\n ) : (\n <ShowMore collapsedHeight={180}>\n <div className=\"space-y-2\">\n {events.map((event) => (\n <div\n key={event.id}\n className=\"rounded-md border border-border-seam bg-surface p-3 text-sm text-secondary\"\n >\n <div className=\"font-medium text-primary\">{event.eventType}</div>\n <div>{formatDateTime(event.timestamp)}</div>\n {event.deliveryStatus && (\n <div>\n {tr('notifications.detail.delivery', 'Delivery')}:{' '}\n {event.deliveryStatus}\n </div>\n )}\n </div>\n ))}\n </div>\n </ShowMore>\n )}\n </div>\n </div>\n ) : (\n <div className=\"flex h-full min-h-[360px] items-center justify-center\">\n <IllustratedEmptyState\n illustration=\"empty-search\"\n title={tr('notifications.selectNotificationTitle', 'Nothing selected')}\n description={tr(\n 'notifications.selectNotificationForDetails',\n 'Select a notification to inspect details, delivery receipts, and activity.'\n )}\n />\n </div>\n )}\n </aside>\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;AAkBA,SAASC,EAAe,GAAuB;CAE7C,OADKC,IACE,IAAI,KAAKA,CAAK,CAAC,CAAC,eAAe,IADnB;AAErB;AAGA,SAAgBC,IAA+B;CAC7C,IAAMC,IAAKC,EAAM,GACX,EAAE,kBAAe,WAAWC,MAAuBC,EAAe,GAClE,EAAE,cAAWC,EAAsB,G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
1
|
+
{"version":3,"file":"NotificationHistoryAdminPage.js","names":["_Fragment","formatDateTime","value","NotificationHistoryAdminPage","tr","useTr","permissionsLoading","usePermissions","useNotificationTopics","useNotificationAdmin","rescheduleAt","setRescheduleAt","useState","hasPermission","NOTIFICATION_PERMISSIONS","PagePurpose","CalendarClock","NextSteps","notifications","loadNotification","setFilters","prev","exportNotificationsAsCsv","Button","Download","GlassCard","Search","filters","event","topics","topic","EmphasisPanel","isLoading","RefreshCw","IllustratedEmptyState","notification","NotificationCard","scheduledNotifications","scheduled","cancelScheduledNotification","selectedNotification","clearSelection","item","action","Fragment","rescheduleNotification","unarchiveNotification","archiveNotification","events","ShowMore"],"sources":["../../src/pages/NotificationHistoryAdminPage.tsx"],"sourcesContent":["import { useState } from 'react';\nimport { CalendarClock, Download, RefreshCw, Search } from 'lucide-react';\nimport { usePermissions } from '@burdenoff/fe-libs/shared/providers/shell';\nimport {\n Button,\n EmphasisPanel,\n GlassCard,\n IllustratedEmptyState,\n NextSteps,\n PagePurpose,\n ShowMore,\n} from '@burdenoff/fe-libs/ui';\nimport { NotificationCard } from '../components/NotificationCard';\nimport { useNotificationAdmin, useNotificationTopics } from '../hooks';\nimport { NOTIFICATION_PERMISSIONS } from '../constants/permissions';\nimport { useTr } from '../shared/hooks/useTr';\nimport { exportNotificationsAsCsv } from '../utils/notificationHistoryExport';\n\nfunction formatDateTime(value?: string | null) {\n if (!value) return '—';\n return new Date(value).toLocaleString();\n}\n\n/** Admin Notification History — scheduled ops, delivery inspector, event timeline. */\nexport function NotificationHistoryAdminPage() {\n const tr = useTr();\n const { hasPermission, isLoading: permissionsLoading } = usePermissions();\n const { topics } = useNotificationTopics();\n const {\n filters,\n setFilters,\n notifications,\n scheduledNotifications,\n selectedNotification,\n events,\n isLoading,\n loadNotification,\n archiveNotification,\n unarchiveNotification,\n cancelScheduledNotification,\n rescheduleNotification,\n clearSelection,\n } = useNotificationAdmin();\n const [rescheduleAt, setRescheduleAt] = useState('');\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)) {\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 return (\n <div className=\"space-y-4 sm:space-y-6\">\n <PagePurpose icon={<CalendarClock size={16} />}>\n {tr(\n 'notifications.adminHistoryPurpose',\n 'The operations console for everything your team has sent. Audit delivery outcomes (delivered, opened, clicked, failed, unsubscribed), inspect a single notification’s full event timeline, and manage the schedule — reschedule or cancel anything still pending. Use it to debug a campaign or prove a notification went out.'\n )}\n </PagePurpose>\n\n <NextSteps\n storageKey=\"notification-admin-history\"\n steps={[\n {\n id: 'inspect',\n label: tr('notifications.nextInspectLabel', 'Inspect a delivery'),\n description: tr(\n 'notifications.nextInspectDesc',\n 'Click any notification to see its receipts, opens, clicks and full event timeline.'\n ),\n onClick: () => {\n if (notifications[0]) {\n loadNotification(notifications[0].id);\n }\n },\n },\n {\n id: 'failed',\n label: tr('notifications.nextFailedLabel', 'Find failed deliveries'),\n description: tr(\n 'notifications.nextFailedDesc',\n 'Filter by a FAILED delivery state to triage what did not reach recipients.'\n ),\n onClick: () => setFilters((prev) => ({ ...prev, deliveryStatus: 'FAILED' })),\n },\n {\n id: 'export',\n label: tr('notifications.nextExportLabel', 'Export the current view'),\n description: tr(\n 'notifications.nextExportDesc',\n 'Download the filtered results as CSV for reporting or an external audit.'\n ),\n onClick: () => {\n if (notifications.length > 0) {\n exportNotificationsAsCsv(tr, notifications);\n }\n },\n },\n ]}\n />\n\n <div className=\"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between\">\n <div>\n <h1 className=\"text-xl sm:text-2xl font-bold text-primary\">\n {tr('notifications.adminHistoryTitle', 'Notification Operations')}\n </h1>\n <p className=\"text-sm text-text-secondary mt-1\">\n {tr(\n 'notifications.adminHistorySubtitle',\n 'Review sent and scheduled notifications, delivery outcomes, opens, clicks, and user activity.'\n )}\n </p>\n </div>\n <Button\n type=\"button\"\n variant=\"outline\"\n onClick={() => exportNotificationsAsCsv(tr, notifications)}\n disabled={notifications.length === 0}\n className=\"gap-2\"\n >\n <Download size={16} />\n {tr('notifications.export', 'Export')}\n </Button>\n </div>\n\n <GlassCard treatment=\"plain\" className=\"grid gap-3 border-border-seam p-4 lg:grid-cols-6\">\n <label className=\"relative lg:col-span-2\">\n <Search size={16} className=\"absolute left-3 top-1/2 -translate-y-1/2 text-tertiary\" />\n <input\n type=\"text\"\n value={filters.search}\n onChange={(event) => setFilters((prev) => ({ ...prev, search: event.target.value }))}\n placeholder={tr(\n 'notifications.searchByTitleOrContent',\n 'Search by title or content...'\n )}\n className=\"w-full rounded-md border border-default bg-bg-canvas py-2 pl-9 pr-3 text-sm text-primary focus:outline-none focus:ring-2 focus:ring-accent\"\n />\n </label>\n\n <select\n value={filters.status}\n onChange={(event) => setFilters((prev) => ({ ...prev, status: event.target.value }))}\n className=\"rounded-md border border-default bg-bg-canvas px-3 py-2 text-sm text-primary scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary\"\n >\n <option value=\"all\">{tr('notifications.allStatuses', 'All Statuses')}</option>\n <option value=\"PENDING\">PENDING</option>\n <option value=\"TRIGGERED\">TRIGGERED</option>\n <option value=\"SENT\">SENT</option>\n <option value=\"FAILED\">FAILED</option>\n <option value=\"CANCELLED\">CANCELLED</option>\n </select>\n\n <select\n value={filters.channel}\n onChange={(event) => setFilters((prev) => ({ ...prev, channel: event.target.value }))}\n className=\"rounded-md border border-default bg-bg-canvas px-3 py-2 text-sm text-primary scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary\"\n >\n <option value=\"all\">{tr('notifications.allChannels', 'All Channels')}</option>\n <option value=\"EMAIL\">EMAIL</option>\n <option value=\"SMS\">SMS</option>\n <option value=\"PUSH\">PUSH</option>\n <option value=\"WHATSAPP\">WHATSAPP</option>\n <option value=\"IN_APP\">IN_APP</option>\n </select>\n\n <select\n value={filters.deliveryStatus}\n onChange={(event) =>\n setFilters((prev) => ({ ...prev, deliveryStatus: event.target.value }))\n }\n className=\"rounded-md border border-default bg-bg-canvas px-3 py-2 text-sm text-primary scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary\"\n >\n <option value=\"all\">{tr('notifications.allDeliveryStates', 'All Delivery')}</option>\n <option value=\"DELIVERED\">DELIVERED</option>\n <option value=\"OPENED\">OPENED</option>\n <option value=\"CLICKED\">CLICKED</option>\n <option value=\"FAILED\">FAILED</option>\n <option value=\"UNSUBSCRIBED\">UNSUBSCRIBED</option>\n </select>\n\n <select\n value={filters.topicId}\n onChange={(event) => setFilters((prev) => ({ ...prev, topicId: event.target.value }))}\n className=\"rounded-md border border-default bg-bg-canvas px-3 py-2 text-sm text-primary scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary\"\n >\n <option value=\"\">{tr('notifications.allTopics', 'All Topics')}</option>\n {topics.map((topic) => (\n <option key={topic.id} value={topic.id}>\n {topic.name}\n </option>\n ))}\n </select>\n\n <select\n value={filters.archived}\n onChange={(event) =>\n setFilters((prev) => ({\n ...prev,\n archived: event.target.value as typeof prev.archived,\n }))\n }\n className=\"rounded-md border border-default bg-bg-canvas px-3 py-2 text-sm text-primary scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary\"\n >\n <option value=\"all\">{tr('notifications.activeAndArchived', 'Active + Archived')}</option>\n <option value=\"active\">{tr('notifications.activeOnly', 'Active Only')}</option>\n <option value=\"archived\">{tr('notifications.archivedOnly', 'Archived Only')}</option>\n </select>\n </GlassCard>\n\n <div className=\"grid gap-6 xl:grid-cols-[minmax(0,1fr),420px]\">\n <div className=\"space-y-6\">\n {/* Single emphasis zone — the live results list is the heart of this console. */}\n <EmphasisPanel className=\"p-4\">\n <div className=\"mb-4 flex items-center justify-between\">\n <div>\n <h2 className=\"text-base font-semibold text-primary\">\n {tr('notifications.sentNotifications', 'Notifications')}\n </h2>\n <p className=\"text-sm text-text-secondary\">\n {notifications.length} {tr('notifications.resultsFoundShort', 'results')}\n </p>\n </div>\n {isLoading && <RefreshCw size={16} className=\"animate-spin text-tertiary\" />}\n </div>\n\n <div className=\"space-y-3\">\n {notifications.length === 0 ? (\n <IllustratedEmptyState\n illustration=\"empty-search\"\n title={tr('notifications.noNotificationsFound', 'No notifications found')}\n description={tr(\n 'notifications.adjustSearchOrDateRange',\n 'Try adjusting your filters'\n )}\n />\n ) : (\n notifications.map((notification) => (\n <button\n key={notification.id}\n type=\"button\"\n onClick={() => loadNotification(notification.id)}\n className=\"block w-full text-left\"\n >\n <NotificationCard\n notification={notification}\n compact\n showArchivedState\n analyticsSource=\"admin_history\"\n />\n </button>\n ))\n )}\n </div>\n </EmphasisPanel>\n\n <section className=\"rounded-lg border border-border-seam bg-gloss-card p-4\">\n <div className=\"mb-4 flex items-center gap-2\">\n <CalendarClock size={18} className=\"text-accent-primary\" />\n <h2 className=\"text-base font-semibold text-primary\">\n {tr('notifications.scheduledNotifications', 'Scheduled Notifications')}\n </h2>\n </div>\n\n <div className=\"space-y-3\">\n {scheduledNotifications.length === 0 ? (\n <IllustratedEmptyState\n illustration=\"empty-data\"\n title={tr('notifications.noScheduledNotifications', 'No scheduled notifications')}\n description={tr(\n 'notifications.noScheduledDescription',\n 'Notifications queued for a future send time will appear here, ready to reschedule or cancel.'\n )}\n />\n ) : (\n scheduledNotifications.map((scheduled) => (\n <div\n key={scheduled.id}\n className=\"rounded-md border border-default bg-bg-canvas p-4\"\n >\n <div className=\"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between\">\n <div>\n <h3 className=\"text-sm font-semibold text-primary\">\n {scheduled.notification.title}\n </h3>\n <p className=\"text-xs text-text-secondary\">\n {scheduled.notification.channel} • {scheduled.notification.type} •{' '}\n {formatDateTime(scheduled.scheduledFor)}\n </p>\n </div>\n <div className=\"flex items-center gap-2\">\n <button\n type=\"button\"\n onClick={() => loadNotification(scheduled.notification.id)}\n className=\"rounded-md border border-default px-3 py-2 text-xs text-text-secondary hover:bg-bg-sunken\"\n >\n {tr('notifications.view', 'View')}\n </button>\n {scheduled.status === 'PENDING' && (\n <button\n type=\"button\"\n onClick={() => cancelScheduledNotification(scheduled.id)}\n className=\"rounded-md border border-status-error-border px-3 py-2 text-xs text-status-error-text hover:bg-status-error-bg-subtle\"\n >\n {tr('notifications.cancel', 'Cancel')}\n </button>\n )}\n </div>\n </div>\n </div>\n ))\n )}\n </div>\n </section>\n </div>\n\n <aside className=\"rounded-lg border border-border-seam bg-gloss-card p-4 xl:sticky xl:top-4 xl:max-h-[calc(100vh-2rem)] xl:self-start xl:overflow-y-auto\">\n {selectedNotification ? (\n <div className=\"space-y-4\">\n <div className=\"flex items-start justify-between gap-3\">\n <div>\n <h2 className=\"text-lg font-semibold text-primary\">\n {selectedNotification.title}\n </h2>\n <p className=\"text-sm text-text-secondary\">{selectedNotification.body}</p>\n </div>\n <button\n type=\"button\"\n onClick={clearSelection}\n className=\"rounded-md border border-default px-3 py-2 text-xs text-text-secondary hover:bg-bg-sunken\"\n >\n {tr('notifications.close', 'Close')}\n </button>\n </div>\n\n <div className=\"grid gap-2 rounded-md border border-default bg-bg-canvas p-3 text-sm text-text-secondary\">\n <div>\n <strong>{tr('notifications.detail.status', 'Status')}:</strong>{' '}\n {selectedNotification.status}\n </div>\n <div>\n <strong>{tr('notifications.detail.delivery', 'Delivery')}:</strong>{' '}\n {selectedNotification.deliveryStatus || '—'}\n </div>\n <div>\n <strong>{tr('notifications.detail.topic', 'Topic')}:</strong>{' '}\n {selectedNotification.topic?.name || '—'}\n </div>\n <div>\n <strong>{tr('notifications.detail.created', 'Created')}:</strong>{' '}\n {formatDateTime(selectedNotification.createdAt)}\n </div>\n <div>\n <strong>{tr('notifications.detail.sent', 'Sent')}:</strong>{' '}\n {formatDateTime(selectedNotification.sentAt)}\n </div>\n <div>\n <strong>{tr('notifications.detail.delivered', 'Delivered')}:</strong>{' '}\n {formatDateTime(selectedNotification.deliveredAt)}\n </div>\n <div>\n <strong>{tr('notifications.detail.opened', 'Opened')}:</strong>{' '}\n {formatDateTime(selectedNotification.openedAt)}\n </div>\n <div>\n <strong>{tr('notifications.detail.clicked', 'Clicked')}:</strong>{' '}\n {formatDateTime(selectedNotification.clickedAt)}\n </div>\n <div>\n <strong>{tr('notifications.detail.read', 'Read')}:</strong>{' '}\n {formatDateTime(selectedNotification.readAt)}\n </div>\n <div>\n <strong>{tr('notifications.detail.recipient', 'Recipient')}:</strong>{' '}\n {selectedNotification.recipientEmail ||\n selectedNotification.recipientPhone ||\n selectedNotification.id}\n </div>\n </div>\n\n {selectedNotification.media.length > 0 && (\n <div className=\"space-y-2\">\n <h3 className=\"text-sm font-semibold text-primary\">\n {tr('notifications.media', 'Media')}\n </h3>\n <div className=\"grid gap-3\">\n {selectedNotification.media.map((item) => (\n <a\n key={item.url}\n href={item.url}\n target=\"_blank\"\n rel=\"noreferrer\"\n className=\"rounded-md border border-default bg-bg-canvas p-3 text-sm text-accent-primary hover:underline\"\n >\n {item.label || item.url}\n </a>\n ))}\n </div>\n </div>\n )}\n\n {selectedNotification.actions.length > 0 && (\n <div className=\"space-y-2\">\n <h3 className=\"text-sm font-semibold text-primary\">\n {tr('notifications.actions', 'Actions')}\n </h3>\n <div className=\"grid gap-2\">\n {selectedNotification.actions.map((action) => (\n <div\n key={action.id}\n className=\"rounded-md border border-default bg-bg-canvas p-3 text-sm text-text-secondary\"\n >\n <div className=\"font-medium text-primary\">{action.label}</div>\n <div className=\"truncate text-xs\">{action.url}</div>\n </div>\n ))}\n </div>\n </div>\n )}\n\n {selectedNotification.scheduledNotification && (\n <div className=\"space-y-3 rounded-md border border-default bg-bg-canvas p-3\">\n <div className=\"text-sm font-semibold text-primary\">\n {tr('notifications.scheduling', 'Scheduling')}\n </div>\n <div className=\"text-sm text-text-secondary\">\n {formatDateTime(selectedNotification.scheduledNotification.scheduledFor)}\n </div>\n {selectedNotification.scheduledNotification.status === 'PENDING' && (\n <>\n <input\n type=\"datetime-local\"\n value={rescheduleAt}\n onChange={(event) => setRescheduleAt(event.target.value)}\n className=\"w-full rounded-md border border-default bg-surface px-3 py-2 text-sm text-primary\"\n />\n <div className=\"flex items-center gap-2\">\n <button\n type=\"button\"\n onClick={() =>\n rescheduleAt &&\n rescheduleNotification(\n selectedNotification.scheduledNotification!.id,\n new Date(rescheduleAt).toISOString()\n )\n }\n className=\"rounded-md bg-accent-primary px-3 py-2 text-xs font-medium text-text-inverse hover:opacity-90\"\n >\n {tr('notifications.reschedule', 'Reschedule')}\n </button>\n <button\n type=\"button\"\n onClick={() =>\n cancelScheduledNotification(\n selectedNotification.scheduledNotification!.id\n )\n }\n className=\"rounded-md border border-status-error-border px-3 py-2 text-xs text-status-error-text hover:bg-status-error-bg-subtle\"\n >\n {tr('notifications.cancel', 'Cancel')}\n </button>\n </div>\n </>\n )}\n </div>\n )}\n\n <div className=\"flex items-center gap-2\">\n {selectedNotification.archivedAt ? (\n <button\n type=\"button\"\n onClick={() => unarchiveNotification(selectedNotification.id)}\n className=\"rounded-md border border-default px-3 py-2 text-xs text-text-secondary hover:bg-bg-sunken\"\n >\n {tr('notifications.restore', 'Restore')}\n </button>\n ) : (\n <button\n type=\"button\"\n onClick={() => archiveNotification(selectedNotification.id)}\n className=\"rounded-md border border-default px-3 py-2 text-xs text-text-secondary hover:bg-bg-sunken\"\n >\n {tr('notifications.archive', 'Archive')}\n </button>\n )}\n </div>\n\n <div className=\"space-y-2\">\n <h3 className=\"text-sm font-semibold text-primary\">\n {tr('notifications.eventTimeline', 'Event Timeline')}\n </h3>\n {events.length === 0 ? (\n <div className=\"rounded-md border border-dashed border-border-seam p-4 text-sm text-text-secondary\">\n {tr('notifications.noEvents', 'No events recorded yet.')}\n </div>\n ) : (\n <ShowMore collapsedHeight={180}>\n <div className=\"space-y-2\">\n {events.map((event) => (\n <div\n key={event.id}\n className=\"rounded-md border border-border-seam bg-surface p-3 text-sm text-text-secondary\"\n >\n <div className=\"font-medium text-primary\">{event.eventType}</div>\n <div>{formatDateTime(event.timestamp)}</div>\n {event.deliveryStatus && (\n <div>\n {tr('notifications.detail.delivery', 'Delivery')}:{' '}\n {event.deliveryStatus}\n </div>\n )}\n </div>\n ))}\n </div>\n </ShowMore>\n )}\n </div>\n </div>\n ) : (\n <div className=\"flex h-full min-h-[360px] items-center justify-center\">\n <IllustratedEmptyState\n illustration=\"empty-search\"\n title={tr('notifications.selectNotificationTitle', 'Nothing selected')}\n description={tr(\n 'notifications.selectNotificationForDetails',\n 'Select a notification to inspect details, delivery receipts, and activity.'\n )}\n />\n </div>\n )}\n </aside>\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;AAkBA,SAASC,EAAe,GAAuB;CAE7C,OADKC,IACE,IAAI,KAAKA,CAAK,CAAC,CAAC,eAAe,IADnB;AAErB;AAGA,SAAgBC,IAA+B;CAC7C,IAAMC,IAAKC,EAAM,GACX,EAAE,kBAAe,WAAWC,MAAuBC,EAAe,GAClE,EAAE,cAAWC,EAAsB,GACnC,EACJ,YACA,eACA,kBACA,2BACA,yBACA,WACA,cACA,qBACA,wBACA,0BACA,gCACA,2BACA,sBACEC,EAAqB,GACnB,CAACC,GAAcC,KAAmBC,EAAS,EAAE;CAqBnD,OAnBIN,IAEA,kBAAC,OAAD;EAAK,WAAU;EACb,UAAA,kBAAC,OAAD,EAAK,WAAU,iFAAkF,CAAA;CAC9F,CAAA,IAIJO,EAAcC,EAAyB,iBAAiB,IAY3D,kBAAC,OAAD;EAAK,WAAU;EAAf,UAAA;GACE,kBAACC,GAAD;IAAa,MAAM,kBAACC,GAAD,EAAe,MAAM,GAAK,CAAA;IAC1C,UAAAZ,EACC,qCACA,gUACF;GACW,CAAA;GAEb,kBAACa,GAAD;IACE,YAAW;IACX,OAAO;KACL;M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AAyB;QACpD,CAAA,IAEL,kBAAC6C,GAAD;SAAU,iBAAiB;SACzB,UAAA,kBAAC,OAAD;UAAK,WAAU;UACZ,UAAAD,EAAO,KAAK,MACX,kBAAC,OAAD;WAEE,WAAU;WAFZ,UAAA;YAIE,kBAAC,OAAD;aAAK,WAAU;aAA4B,UAAApB,EAAM;YAAe,CAAA;YAChE,kBAAC,OAAD,EAAA,UAAM3B,EAAe2B,EAAM,SAAS,EAAO,CAAA;YAC1CA,EAAM,kBACL,kBAAC,OAAD,EAAA,UAAA;aACGxB,EAAG,iCAAiC,UAAU;aAAE;aAAE;aAClDwB,EAAM;YACJ,EAAA,CAAA;WAEJ;UAXE,GAAAA,EAAM,EAWR,CACN;SACE,CAAA;QACG,CAAA,CAET;;MACF;KAEL,CAAA,IAAA,kBAAC,OAAD;MAAK,WAAU;MACb,UAAA,kBAACM,GAAD;OACE,cAAa;OACb,OAAO9B,EAAG,yCAAyC,kBAAkB;OACrE,aAAaA,EACX,8CACA,4EACF;MACD,CAAA;KACE,CAAA;IAEF,CAAA,CACJ;;EACF;C,KA1eH,kBAAC,OAAD;EAAK,WAAU;EACZ,UAAAA,EACC,qCACA,yDACF;CACG,CAAA;AAueX"}
|
|
@@ -42,7 +42,7 @@ function x() {
|
|
|
42
42
|
className: "text-xl sm:text-2xl font-bold text-primary",
|
|
43
43
|
children: s("notifications.historyTitle", "Notification History")
|
|
44
44
|
}), /* @__PURE__ */ f("p", {
|
|
45
|
-
className: "text-sm text-secondary mt-1",
|
|
45
|
+
className: "text-sm text-text-secondary mt-1",
|
|
46
46
|
children: s("notifications.historySubtitle", "View and search all your notifications")
|
|
47
47
|
})] }), /* @__PURE__ */ p(m, {
|
|
48
48
|
"data-tour": "notification-history-export",
|
|
@@ -118,7 +118,7 @@ function x() {
|
|
|
118
118
|
className: "flex justify-end",
|
|
119
119
|
children: /* @__PURE__ */ f("button", {
|
|
120
120
|
onClick: () => O(t.id),
|
|
121
|
-
className: "rounded-md border border-default px-3 py-2 text-xs text-secondary hover:bg-bg-sunken",
|
|
121
|
+
className: "rounded-md border border-default px-3 py-2 text-xs text-text-secondary hover:bg-bg-sunken",
|
|
122
122
|
children: s("notifications.restore", "Restore")
|
|
123
123
|
})
|
|
124
124
|
})]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NotificationHistoryPage.js","names":["HISTORY_FILTER","NotificationHistoryPage","useNotification","jsx","navigationV2","NotificationArchivedV2","ClassicNotificationHistoryPage","tr","useTr","permissionsLoading","usePermissions","useNotificationTopics","useNotifications","hasActiveFilters","notificationFilter","hasPermission","NOTIFICATION_PERMISSIONS","currentUser","PagePurpose","History","EmphasisPanel","Button","exportNotificationsAsCsv","notifications","Download","GlassCard","Search","updateFilter","event","topics","topic","NotificationCard","archiveNotification","recordAction","notification","unarchiveNotification","IllustratedEmptyState"],"sources":["../../src/pages/NotificationHistoryPage.tsx"],"sourcesContent":["import { Download, History, Search } from 'lucide-react';\nimport { usePermissions } from '@burdenoff/fe-libs/shared/providers/shell';\nimport {\n Button,\n EmphasisPanel,\n GlassCard,\n IllustratedEmptyState,\n PagePurpose,\n} from '@burdenoff/fe-libs/ui';\nimport { NotificationCard } from '../components/NotificationCard';\nimport { useNotifications, useNotificationTopics } from '../hooks';\nimport { NOTIFICATION_PERMISSIONS } from '../constants/permissions';\nimport { useNotification } from '../providers/NotificationProvider';\nimport { useTr } from '../shared/hooks/useTr';\nimport { exportNotificationsAsCsv } from '../utils/notificationHistoryExport';\nimport { NotificationArchivedV2 } from '../navigation-v2/NotificationArchivedV2';\n\nconst HISTORY_FILTER = { archived: null, channel: 'ALL' as const };\n\n/**\n * User Notification History — personal history, filter, CSV export,\n * archive/unarchive. Under FluidGrids' Navigation v2 (BOFF-11872) it is the\n * \"Archived\" view instead; every other app keeps this page.\n */\nexport function NotificationHistoryPage() {\n const { navigationV2 } = useNotification();\n return navigationV2 ? <NotificationArchivedV2 /> : <ClassicNotificationHistoryPage />;\n}\n\nfunction ClassicNotificationHistoryPage() {\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\n const hasActiveFilters = Boolean(\n notificationFilter.search ||\n notificationFilter.topicId ||\n notificationFilter.dateRange.start ||\n notificationFilter.dateRange.end\n );\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 return (\n <div className=\"space-y-4 sm:space-y-6 p-3 sm:p-6 animate-in fade-in duration-200\">\n <PagePurpose icon={<History size={16} />}>\n {tr(\n 'notifications.historyPurpose',\n 'A searchable archive of every notification you have ever received, across all channels (in-app, email, push and more). Look back through anything you read or archived, narrow by topic or date range, and export the results to CSV for your own records.'\n )}\n </PagePurpose>\n\n {/* Single emphasis zone — the header summary + the one export CTA. */}\n <EmphasisPanel\n data-tour=\"notification-history-header\"\n className=\"flex flex-col gap-4 p-5 sm:flex-row sm:items-center sm:justify-between sm:p-6\"\n >\n <div>\n <h1 className=\"text-xl sm:text-2xl font-bold text-primary\">\n {tr('notifications.historyTitle', 'Notification History')}\n </h1>\n <p className=\"text-sm text-secondary mt-1\">\n {tr('notifications.historySubtitle', 'View and search all your notifications')}\n </p>\n </div>\n\n <Button\n data-tour=\"notification-history-export\"\n variant=\"outline\"\n onClick={() => exportNotificationsAsCsv(tr, notifications)}\n disabled={notifications.length === 0}\n className=\"gap-2\"\n >\n <Download size={16} />\n {tr('notifications.export', 'Export')}\n </Button>\n </EmphasisPanel>\n\n <GlassCard\n treatment=\"plain\"\n className=\"grid gap-3 border-border-seam p-3 sm:grid-cols-2 sm:p-4 xl:grid-cols-5\"\n >\n <div className=\"relative sm:col-span-2 xl:col-span-2\">\n <Search size={16} className=\"absolute left-3 top-1/2 -translate-y-1/2 text-tertiary\" />\n <input\n type=\"text\"\n placeholder={tr(\n 'notifications.searchByTitleOrContent',\n 'Search by title or content...'\n )}\n value={notificationFilter.search}\n onChange={(e) => updateFilter({ search: e.target.value })}\n className=\"w-full pl-9 pr-4 py-2 text-sm text-primary bg-surface border border-default rounded-lg focus:outline-none focus:ring-2 focus:ring-accent transition-shadow duration-150\"\n />\n </div>\n\n <select\n value={notificationFilter.topicId || ''}\n onChange={(event) => updateFilter({ topicId: event.target.value || undefined })}\n className=\"rounded-lg border border-default bg-surface px-3 py-2 text-sm text-primary scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary\"\n >\n <option value=\"\">{tr('notifications.allTopics', 'All Topics')}</option>\n {topics.map((topic) => (\n <option key={topic.id} value={topic.id}>\n {topic.name}\n </option>\n ))}\n </select>\n\n <input\n type=\"date\"\n aria-label={tr('notifications.startDate', 'Start date')}\n value={\n notificationFilter.dateRange.start\n ? notificationFilter.dateRange.start.toISOString().split('T')[0]\n : ''\n }\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 className=\"rounded-lg border border-default bg-surface px-3 py-2 text-sm text-primary\"\n />\n\n <input\n type=\"date\"\n aria-label={tr('notifications.endDate', 'End date')}\n value={\n notificationFilter.dateRange.end\n ? notificationFilter.dateRange.end.toISOString().split('T')[0]\n : ''\n }\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 className=\"rounded-lg border border-default bg-surface px-3 py-2 text-sm text-primary\"\n />\n </GlassCard>\n\n <div className=\"space-y-2\">\n {notifications.length > 0 ? (\n notifications.map((notification) => (\n <div key={notification.id} className=\"space-y-2\">\n <NotificationCard\n notification={notification}\n onArchive={archiveNotification}\n onAction={recordAction}\n showArchivedState\n analyticsSource=\"history\"\n />\n {notification.archivedAt && (\n <div className=\"flex justify-end\">\n <button\n onClick={() => unarchiveNotification(notification.id)}\n className=\"rounded-md border border-default px-3 py-2 text-xs text-secondary hover:bg-bg-sunken\"\n >\n {tr('notifications.restore', 'Restore')}\n </button>\n </div>\n )}\n </div>\n ))\n ) : (\n <div className=\"animate-in fade-in duration-200\">\n <IllustratedEmptyState\n illustration={hasActiveFilters ? 'empty-search' : 'empty-notifications'}\n title={\n hasActiveFilters\n ? tr('notifications.noNotificationsFound', 'No notifications found')\n : tr('notifications.historyEmptyTitle', 'No history yet')\n }\n description={\n hasActiveFilters\n ? tr('notifications.adjustSearchOrDateRange', 'Try adjusting your filters')\n : tr(\n 'notifications.historyEmptyDescription',\n 'Notifications you receive will be archived here so you can always find them again.'\n )\n }\n />\n </div>\n )}\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;AAiBA,IAAMA,IAAiB;CAAE,UAAU;CAAM,SAAS;AAAe;AAOjE,SAAgBC,IAA0B;CACxC,IAAM,EAAE,oBAAiBC,EAAgB;CACzC,OAAsBC,EAAfC,IAAgBC,IAA6BC,GAA9B,CAAyB,CAAqC;AACtF;AAEA,SAASA,IAAiC;CACxC,IAAMC,IAAKC,EAAM,GACX,EAAE,kBAAe,WAAWC,MAAuBC,EAAe,GAClE,EAAE,mBAAgBR,EAAgB,GAClC,EAAE,cAAWS,EAAsB,EAAE,UAAU,GAAK,CAAC,GACrD,EACJ,kBACA,uBACA,iBACA,wBACA,0BACA,oBACEC,EAAiB,EAAE,YAAYZ,EAAe,CAAC,GAE7Ca,IAAmB,GACvBC,EAAmB,UACnBA,EAAmB,WACnBA,EAAmB,UAAU,SAC7BA,EAAmB,UAAU;CAsB/B,OAnB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,EAAsBD,EAAa,EAAE;OACpD,WAAU;OAET,UAAA3B,EAAG,yBAAyB,SAAS;MAChC,CAAA;KACL,CAAA,CAEJ;IAlBK,GAAA2B,EAAa,EAkBlB,CACN,IAED,kBAAC,OAAD;KAAK,WAAU;KACb,UAAA,kBAACE,GAAD;MACE,cAAcvB,IAAmB,iBAAiB;MAClD,OACEA,IACIN,EAAG,sCAAsC,wBAAwB,IACjEA,EAAG,mCAAmC,gBAAgB;MAE5D,aACEM,IACIN,EAAG,yCAAyC,4BAA4B,IACxEA,EACE,yCACA,oFACF;KAEP,CAAA;IACE,CAAA;GAEJ,CAAA;EACF;;AAET"}
|
|
1
|
+
{"version":3,"file":"NotificationHistoryPage.js","names":["HISTORY_FILTER","NotificationHistoryPage","useNotification","jsx","navigationV2","NotificationArchivedV2","ClassicNotificationHistoryPage","tr","useTr","permissionsLoading","usePermissions","useNotificationTopics","useNotifications","hasActiveFilters","notificationFilter","hasPermission","NOTIFICATION_PERMISSIONS","currentUser","PagePurpose","History","EmphasisPanel","Button","exportNotificationsAsCsv","notifications","Download","GlassCard","Search","updateFilter","event","topics","topic","NotificationCard","archiveNotification","recordAction","notification","unarchiveNotification","IllustratedEmptyState"],"sources":["../../src/pages/NotificationHistoryPage.tsx"],"sourcesContent":["import { Download, History, Search } from 'lucide-react';\nimport { usePermissions } from '@burdenoff/fe-libs/shared/providers/shell';\nimport {\n Button,\n EmphasisPanel,\n GlassCard,\n IllustratedEmptyState,\n PagePurpose,\n} from '@burdenoff/fe-libs/ui';\nimport { NotificationCard } from '../components/NotificationCard';\nimport { useNotifications, useNotificationTopics } from '../hooks';\nimport { NOTIFICATION_PERMISSIONS } from '../constants/permissions';\nimport { useNotification } from '../providers/NotificationProvider';\nimport { useTr } from '../shared/hooks/useTr';\nimport { exportNotificationsAsCsv } from '../utils/notificationHistoryExport';\nimport { NotificationArchivedV2 } from '../navigation-v2/NotificationArchivedV2';\n\nconst HISTORY_FILTER = { archived: null, channel: 'ALL' as const };\n\n/**\n * User Notification History — personal history, filter, CSV export,\n * archive/unarchive. Under FluidGrids' Navigation v2 (BOFF-11872) it is the\n * \"Archived\" view instead; every other app keeps this page.\n */\nexport function NotificationHistoryPage() {\n const { navigationV2 } = useNotification();\n return navigationV2 ? <NotificationArchivedV2 /> : <ClassicNotificationHistoryPage />;\n}\n\nfunction ClassicNotificationHistoryPage() {\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\n const hasActiveFilters = Boolean(\n notificationFilter.search ||\n notificationFilter.topicId ||\n notificationFilter.dateRange.start ||\n notificationFilter.dateRange.end\n );\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 return (\n <div className=\"space-y-4 sm:space-y-6 p-3 sm:p-6 animate-in fade-in duration-200\">\n <PagePurpose icon={<History size={16} />}>\n {tr(\n 'notifications.historyPurpose',\n 'A searchable archive of every notification you have ever received, across all channels (in-app, email, push and more). Look back through anything you read or archived, narrow by topic or date range, and export the results to CSV for your own records.'\n )}\n </PagePurpose>\n\n {/* Single emphasis zone — the header summary + the one export CTA. */}\n <EmphasisPanel\n data-tour=\"notification-history-header\"\n className=\"flex flex-col gap-4 p-5 sm:flex-row sm:items-center sm:justify-between sm:p-6\"\n >\n <div>\n <h1 className=\"text-xl sm:text-2xl font-bold text-primary\">\n {tr('notifications.historyTitle', 'Notification History')}\n </h1>\n <p className=\"text-sm text-text-secondary mt-1\">\n {tr('notifications.historySubtitle', 'View and search all your notifications')}\n </p>\n </div>\n\n <Button\n data-tour=\"notification-history-export\"\n variant=\"outline\"\n onClick={() => exportNotificationsAsCsv(tr, notifications)}\n disabled={notifications.length === 0}\n className=\"gap-2\"\n >\n <Download size={16} />\n {tr('notifications.export', 'Export')}\n </Button>\n </EmphasisPanel>\n\n <GlassCard\n treatment=\"plain\"\n className=\"grid gap-3 border-border-seam p-3 sm:grid-cols-2 sm:p-4 xl:grid-cols-5\"\n >\n <div className=\"relative sm:col-span-2 xl:col-span-2\">\n <Search size={16} className=\"absolute left-3 top-1/2 -translate-y-1/2 text-tertiary\" />\n <input\n type=\"text\"\n placeholder={tr(\n 'notifications.searchByTitleOrContent',\n 'Search by title or content...'\n )}\n value={notificationFilter.search}\n onChange={(e) => updateFilter({ search: e.target.value })}\n className=\"w-full pl-9 pr-4 py-2 text-sm text-primary bg-surface border border-default rounded-lg focus:outline-none focus:ring-2 focus:ring-accent transition-shadow duration-150\"\n />\n </div>\n\n <select\n value={notificationFilter.topicId || ''}\n onChange={(event) => updateFilter({ topicId: event.target.value || undefined })}\n className=\"rounded-lg border border-default bg-surface px-3 py-2 text-sm text-primary scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary\"\n >\n <option value=\"\">{tr('notifications.allTopics', 'All Topics')}</option>\n {topics.map((topic) => (\n <option key={topic.id} value={topic.id}>\n {topic.name}\n </option>\n ))}\n </select>\n\n <input\n type=\"date\"\n aria-label={tr('notifications.startDate', 'Start date')}\n value={\n notificationFilter.dateRange.start\n ? notificationFilter.dateRange.start.toISOString().split('T')[0]\n : ''\n }\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 className=\"rounded-lg border border-default bg-surface px-3 py-2 text-sm text-primary\"\n />\n\n <input\n type=\"date\"\n aria-label={tr('notifications.endDate', 'End date')}\n value={\n notificationFilter.dateRange.end\n ? notificationFilter.dateRange.end.toISOString().split('T')[0]\n : ''\n }\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 className=\"rounded-lg border border-default bg-surface px-3 py-2 text-sm text-primary\"\n />\n </GlassCard>\n\n <div className=\"space-y-2\">\n {notifications.length > 0 ? (\n notifications.map((notification) => (\n <div key={notification.id} className=\"space-y-2\">\n <NotificationCard\n notification={notification}\n onArchive={archiveNotification}\n onAction={recordAction}\n showArchivedState\n analyticsSource=\"history\"\n />\n {notification.archivedAt && (\n <div className=\"flex justify-end\">\n <button\n onClick={() => unarchiveNotification(notification.id)}\n className=\"rounded-md border border-default px-3 py-2 text-xs text-text-secondary hover:bg-bg-sunken\"\n >\n {tr('notifications.restore', 'Restore')}\n </button>\n </div>\n )}\n </div>\n ))\n ) : (\n <div className=\"animate-in fade-in duration-200\">\n <IllustratedEmptyState\n illustration={hasActiveFilters ? 'empty-search' : 'empty-notifications'}\n title={\n hasActiveFilters\n ? tr('notifications.noNotificationsFound', 'No notifications found')\n : tr('notifications.historyEmptyTitle', 'No history yet')\n }\n description={\n hasActiveFilters\n ? tr('notifications.adjustSearchOrDateRange', 'Try adjusting your filters')\n : tr(\n 'notifications.historyEmptyDescription',\n 'Notifications you receive will be archived here so you can always find them again.'\n )\n }\n />\n </div>\n )}\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;AAiBA,IAAMA,IAAiB;CAAE,UAAU;CAAM,SAAS;AAAe;AAOjE,SAAgBC,IAA0B;CACxC,IAAM,EAAE,oBAAiBC,EAAgB;CACzC,OAAsBC,EAAfC,IAAgBC,IAA6BC,GAA9B,CAAyB,CAAqC;AACtF;AAEA,SAASA,IAAiC;CACxC,IAAMC,IAAKC,EAAM,GACX,EAAE,kBAAe,WAAWC,MAAuBC,EAAe,GAClE,EAAE,mBAAgBR,EAAgB,GAClC,EAA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BA,EAAc,KAAK,MACjB,kBAAC,OAAD;KAA2B,WAAU;KAArC,UAAA,CACE,kBAACQ,GAAD;MACgB;MACd,WAAWC;MACX,UAAUC;MACV,mBAAA;MACA,iBAAgB;KACjB,CAAA,GACAC,EAAa,cACZ,kBAAC,OAAD;MAAK,WAAU;MACb,UAAA,kBAAC,UAAD;OACE,eAAeC,EAAsBD,EAAa,EAAE;OACpD,WAAU;OAET,UAAA3B,EAAG,yBAAyB,SAAS;MAChC,CAAA;KACL,CAAA,CAEJ;IAlBK,GAAA2B,EAAa,EAkBlB,CACN,IAED,kBAAC,OAAD;KAAK,WAAU;KACb,UAAA,kBAACE,GAAD;MACE,cAAcvB,IAAmB,iBAAiB;MAClD,OACEA,IACIN,EAAG,sCAAsC,wBAAwB,IACjEA,EAAG,mCAAmC,gBAAgB;MAE5D,aACEM,IACIN,EAAG,yCAAyC,4BAA4B,IACxEA,EACE,yCACA,oFACF;KAEP,CAAA;IACE,CAAA;GAEJ,CAAA;EACF;;AAET"}
|
|
@@ -96,12 +96,12 @@ function S() {
|
|
|
96
96
|
children: e.title
|
|
97
97
|
}),
|
|
98
98
|
t && /* @__PURE__ */ p("span", {
|
|
99
|
-
className: "rounded-full bg-bg-sunken px-2 py-0.5 text-xs text-secondary",
|
|
99
|
+
className: "rounded-full bg-bg-sunken px-2 py-0.5 text-xs text-text-secondary",
|
|
100
100
|
children: t.frequency.replace("_", " ").toLowerCase()
|
|
101
101
|
})
|
|
102
102
|
]
|
|
103
103
|
}), /* @__PURE__ */ p("p", {
|
|
104
|
-
className: "text-sm text-secondary",
|
|
104
|
+
className: "text-sm text-text-secondary",
|
|
105
105
|
children: e.description
|
|
106
106
|
})]
|
|
107
107
|
}), /* @__PURE__ */ m("div", {
|
|
@@ -110,7 +110,7 @@ function S() {
|
|
|
110
110
|
type: "button",
|
|
111
111
|
disabled: r,
|
|
112
112
|
onClick: () => M(e.key),
|
|
113
|
-
className: "rounded-md border border-default px-3 py-2 text-sm text-secondary hover:bg-bg-sunken disabled:cursor-not-allowed disabled:opacity-50",
|
|
113
|
+
className: "rounded-md border border-default px-3 py-2 text-sm text-text-secondary hover:bg-bg-sunken disabled:cursor-not-allowed disabled:opacity-50",
|
|
114
114
|
children: a("notifications.reset", "Reset")
|
|
115
115
|
}), /* @__PURE__ */ m("button", {
|
|
116
116
|
type: "button",
|
|
@@ -122,7 +122,7 @@ function S() {
|
|
|
122
122
|
type: e.type,
|
|
123
123
|
topicId: e.topicId
|
|
124
124
|
}),
|
|
125
|
-
className: `inline-flex items-center gap-2 rounded-md border px-3 py-2 text-sm font-medium transition-colors ${n ? "border-accent-primary bg-action-primary-bg text-text-inverse hover:opacity-90" : "border-default bg-bg-sunken text-secondary hover:bg-bg-sunken/80"} disabled:cursor-not-allowed disabled:opacity-50`,
|
|
125
|
+
className: `inline-flex items-center gap-2 rounded-md border px-3 py-2 text-sm font-medium transition-colors ${n ? "border-accent-primary bg-action-primary-bg text-text-inverse hover:opacity-90" : "border-default bg-bg-sunken text-text-secondary hover:bg-bg-sunken/80"} disabled:cursor-not-allowed disabled:opacity-50`,
|
|
126
126
|
children: [p(n ? f : d, { size: 18 }), r ? a("notifications.saving", "Saving...") : n ? a("notifications.enabled", "Enabled") : a("notifications.disabled", "Disabled")]
|
|
127
127
|
})]
|
|
128
128
|
})]
|
|
@@ -150,7 +150,7 @@ function S() {
|
|
|
150
150
|
className: "text-2xl font-bold text-primary",
|
|
151
151
|
children: a("notifications.preferencesTitle", "Notification Preferences")
|
|
152
152
|
}), /* @__PURE__ */ p("p", {
|
|
153
|
-
className: "mt-1 text-sm text-secondary",
|
|
153
|
+
className: "mt-1 text-sm text-text-secondary",
|
|
154
154
|
children: a("notifications.preferencesSubtitle", "Control global, channel, type, and topic-level notification delivery.")
|
|
155
155
|
})] }),
|
|
156
156
|
/* @__PURE__ */ p(v, {
|
|
@@ -228,7 +228,7 @@ function S() {
|
|
|
228
228
|
className: "text-sm font-semibold uppercase tracking-wide text-tertiary",
|
|
229
229
|
children: a("notifications.topicPreferences", "Topics")
|
|
230
230
|
}), F ? /* @__PURE__ */ p("div", {
|
|
231
|
-
className: "rounded-lg border border-default bg-surface p-6 text-sm text-secondary",
|
|
231
|
+
className: "rounded-lg border border-default bg-surface p-6 text-sm text-text-secondary",
|
|
232
232
|
children: a("notifications.loadingPreferences", "Loading preferences...")
|
|
233
233
|
}) : E ? /* @__PURE__ */ p(g, {
|
|
234
234
|
illustration: "empty-generic",
|