feat(platform): promote alert events surface
This commit is contained in:
@@ -48,7 +48,18 @@ describe('parseAppHash', () => {
|
||||
});
|
||||
});
|
||||
|
||||
test('parses quality governance filters from hash query', () => {
|
||||
test('parses alert event filters from hash query', () => {
|
||||
expect(parseAppHash('#/alert-events?keyword=%E7%B2%A4A&protocol=VEHICLE_SERVICE&issueType=NO_SOURCE')).toEqual({
|
||||
page: 'alert-events',
|
||||
keyword: '粤A',
|
||||
protocol: 'VEHICLE_SERVICE',
|
||||
filters: {
|
||||
issueType: 'NO_SOURCE'
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
test('keeps legacy quality governance hash compatible', () => {
|
||||
expect(parseAppHash('#/quality?keyword=%E7%B2%A4A&protocol=VEHICLE_SERVICE&issueType=NO_SOURCE')).toEqual({
|
||||
page: 'quality',
|
||||
keyword: '粤A',
|
||||
@@ -110,7 +121,11 @@ describe('buildAppHash', () => {
|
||||
expect(buildAppHash({ page: 'vehicles', filters: { coverage: 'multi', serviceStatus: 'degraded', archiveStatus: 'incomplete', archiveMissing: 'phone', missingProtocol: 'YUTONG_MQTT' } })).toBe('#/vehicles?coverage=multi&serviceStatus=degraded&archiveStatus=incomplete&archiveMissing=phone&missingProtocol=YUTONG_MQTT');
|
||||
});
|
||||
|
||||
test('builds shareable quality hash with filters', () => {
|
||||
test('builds shareable alert events hash with filters', () => {
|
||||
expect(buildAppHash({ page: 'alert-events', keyword: '粤A', protocol: 'VEHICLE_SERVICE', filters: { issueType: 'NO_SOURCE' } })).toBe('#/alert-events?keyword=%E7%B2%A4A&protocol=VEHICLE_SERVICE&issueType=NO_SOURCE');
|
||||
});
|
||||
|
||||
test('keeps building legacy quality hash when requested', () => {
|
||||
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');
|
||||
});
|
||||
|
||||
@@ -127,6 +142,6 @@ describe('buildAppHash', () => {
|
||||
});
|
||||
|
||||
test('builds page-only hash when keyword is empty', () => {
|
||||
expect(buildAppHash({ page: 'quality', keyword: '' })).toBe('#/quality');
|
||||
expect(buildAppHash({ page: 'alert-events', keyword: '' })).toBe('#/alert-events');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { PageKey } from '../layout/AppShell';
|
||||
|
||||
const pageKeys = new Set<PageKey>(['dashboard', 'vehicles', 'map', 'realtime', 'detail', 'history', 'history-query', 'mileage', 'quality', 'notification-rules', 'ops-quality']);
|
||||
const pageKeys = new Set<PageKey>(['dashboard', 'vehicles', 'map', 'realtime', 'detail', 'history', 'history-query', 'mileage', 'alert-events', 'quality', 'notification-rules', 'ops-quality']);
|
||||
|
||||
export type AppRoute = {
|
||||
page?: PageKey;
|
||||
|
||||
Reference in New Issue
Block a user