refactor(ui/alerts): single inbox — remove AllAlerts + History pages, trim sidebar
Sidebar Alerts section now just: Inbox · Rules · Silences. The /alerts redirect still lands in /alerts/inbox; /alerts/all and /alerts/history routes are gone (no redirect — stale URLs 404 per clean-break policy). Also updates sidebar-utils.test.ts to match the new 3-entry shape. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -2,16 +2,14 @@ import { describe, it, expect } from 'vitest';
|
||||
import { buildAlertsTreeNodes } from './sidebar-utils';
|
||||
|
||||
describe('buildAlertsTreeNodes', () => {
|
||||
it('returns 5 entries with inbox/all/rules/silences/history paths', () => {
|
||||
it('returns 3 entries with inbox/rules/silences paths', () => {
|
||||
const nodes = buildAlertsTreeNodes();
|
||||
expect(nodes).toHaveLength(5);
|
||||
expect(nodes).toHaveLength(3);
|
||||
const paths = nodes.map((n) => n.path);
|
||||
expect(paths).toEqual([
|
||||
'/alerts/inbox',
|
||||
'/alerts/all',
|
||||
'/alerts/rules',
|
||||
'/alerts/silences',
|
||||
'/alerts/history',
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { createElement, type ReactNode } from 'react';
|
||||
import type { SidebarTreeNode } from '@cameleer/design-system';
|
||||
import { AlertTriangle, Inbox, List, ScrollText, BellOff } from 'lucide-react';
|
||||
import { AlertTriangle, Inbox, BellOff } from 'lucide-react';
|
||||
|
||||
/* ------------------------------------------------------------------ */
|
||||
/* Domain types (moved out of DS — no longer exported there) */
|
||||
@@ -117,15 +117,13 @@ export function buildAdminTreeNodes(opts?: { infrastructureEndpoints?: boolean }
|
||||
|
||||
/**
|
||||
* Alerts tree — static nodes for the alerting section.
|
||||
* Paths: /alerts/{inbox|all|rules|silences|history}
|
||||
* Paths: /alerts/{inbox|rules|silences}
|
||||
*/
|
||||
export function buildAlertsTreeNodes(): SidebarTreeNode[] {
|
||||
const icon = (el: ReactNode) => el;
|
||||
return [
|
||||
{ id: 'alerts-inbox', label: 'Inbox', path: '/alerts/inbox', icon: icon(createElement(Inbox, { size: 14 })) },
|
||||
{ id: 'alerts-all', label: 'All', path: '/alerts/all', icon: icon(createElement(List, { size: 14 })) },
|
||||
{ id: 'alerts-rules', label: 'Rules', path: '/alerts/rules', icon: icon(createElement(AlertTriangle, { size: 14 })) },
|
||||
{ id: 'alerts-silences', label: 'Silences', path: '/alerts/silences', icon: icon(createElement(BellOff, { size: 14 })) },
|
||||
{ id: 'alerts-history', label: 'History', path: '/alerts/history', icon: icon(createElement(ScrollText, { size: 14 })) },
|
||||
];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user