feat(platform): add notification rules workspace

This commit is contained in:
lingniu
2026-07-04 16:27:37 +08:00
parent 33da8ba5a4
commit c060317fb0
8 changed files with 287 additions and 9 deletions

View File

@@ -48,6 +48,13 @@ describe('parseAppHash', () => {
});
});
test('parses notification rules page', () => {
expect(parseAppHash('#/notification-rules')).toEqual({
page: 'notification-rules',
filters: {}
});
});
test('ignores unknown pages', () => {
expect(parseAppHash('#/unknown?keyword=VIN001')).toEqual({});
});
@@ -70,6 +77,10 @@ describe('buildAppHash', () => {
expect(buildAppHash({ page: 'quality', keyword: '粤A', protocol: 'VEHICLE_SERVICE', filters: { issueType: 'NO_SOURCE' } })).toBe('#/quality?keyword=%E7%B2%A4A&protocol=VEHICLE_SERVICE&issueType=NO_SOURCE');
});
test('builds notification rules page hash', () => {
expect(buildAppHash({ page: 'notification-rules' })).toBe('#/notification-rules');
});
test('builds page-only hash when keyword is empty', () => {
expect(buildAppHash({ page: 'quality', keyword: '' })).toBe('#/quality');
});

View File

@@ -1,6 +1,6 @@
import type { PageKey } from '../layout/AppShell';
const pageKeys = new Set<PageKey>(['dashboard', 'vehicles', 'realtime', 'detail', 'history', 'mileage', 'quality']);
const pageKeys = new Set<PageKey>(['dashboard', 'vehicles', 'realtime', 'detail', 'history', 'mileage', 'quality', 'notification-rules']);
export type AppRoute = {
page?: PageKey;