Skip to content

Commit d43bcd7

Browse files
committed
feat(admin): add notification audit and ghost accounts audit pages
Notification Audit (Phase 17): - Health score dashboard, push/email failure breakdowns - Failed subscriptions table with bulk select + disable action - Email bounces table with type filtering - DLQ viewer for push and email dead letter queues Ghost Accounts Audit (Phase 15): - Summary cards by ghost type (7 categories incl. anonymous) - Ghost accounts table with filtering, sorting, bulk delete - Smart deletion: auto-chooses hard vs soft based on FK impact - Anonymous session cleanup with configurable age threshold - Deletion impact modal before destructive actions Navigation: added Audit section to sidebar with 2 new links Types: 14 new interfaces for audit data structures API: 14 new fetch functions for audit endpoints
1 parent 038e2d0 commit d43bcd7

6 files changed

Lines changed: 2014 additions & 3 deletions

File tree

packages/admin-dashboard/src/components/layout/Sidebar.tsx

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import Link from 'next/link'
33
import { useRouter } from 'next/router'
44
import { LuLayoutDashboard, LuLogOut } from 'react-icons/lu'
55

6-
import { navItems } from '@/constants/navigation'
6+
import { auditItems, navItems } from '@/constants/navigation'
77
import { supabase } from '@/lib/supabase'
88

99
import { ThemeToggle } from './ThemeToggle'
@@ -46,6 +46,34 @@ export function Sidebar() {
4646
</Link>
4747
)
4848
})}
49+
50+
{/* Audit Section */}
51+
{auditItems.length > 0 && (
52+
<>
53+
<div className="!mt-4 mb-1 px-3 text-xs font-semibold tracking-wider uppercase opacity-50">
54+
Audit
55+
</div>
56+
{auditItems.map((item) => {
57+
const isActive = router.pathname === item.href
58+
const Icon = item.icon
59+
60+
return (
61+
<Link
62+
key={item.href}
63+
href={item.href}
64+
className={clsx(
65+
'flex items-center gap-3 rounded-lg px-3 py-2 transition-colors',
66+
isActive
67+
? 'bg-primary text-primary-content'
68+
: 'hover:bg-base-300 text-base-content'
69+
)}>
70+
<Icon className="h-5 w-5" />
71+
<span>{item.label}</span>
72+
</Link>
73+
)
74+
})}
75+
</>
76+
)}
4977
</nav>
5078

5179
{/* Footer */}

packages/admin-dashboard/src/constants/navigation.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@ import {
33
LuActivity,
44
LuBell,
55
LuFileText,
6+
LuGhost,
67
LuLayoutDashboard,
78
LuMessageSquare,
9+
LuShieldAlert,
810
LuUsers
911
} from 'react-icons/lu'
1012

@@ -14,6 +16,11 @@ export interface NavItem {
1416
icon: IconType
1517
}
1618

19+
export interface NavSection {
20+
title?: string
21+
items: NavItem[]
22+
}
23+
1724
/**
1825
* Navigation items for admin dashboard sidebar
1926
* Single source of truth - used by Sidebar and MobileMenu
@@ -26,3 +33,11 @@ export const navItems: NavItem[] = [
2633
{ href: '/notifications', label: 'Notifications', icon: LuBell },
2734
{ href: '/system', label: 'System', icon: LuActivity }
2835
]
36+
37+
/**
38+
* Audit section items — grouped separately in sidebar
39+
*/
40+
export const auditItems: NavItem[] = [
41+
{ href: '/audit/notifications', label: 'Notification Audit', icon: LuShieldAlert },
42+
{ href: '/audit/ghost-accounts', label: 'Ghost Accounts', icon: LuGhost }
43+
]

0 commit comments

Comments
 (0)