diff --git a/web/src/layouts/ChatLayout/FileContainer/FileContainerHeader/MetricContainerHeaderSegment.tsx b/web/src/layouts/ChatLayout/FileContainer/FileContainerHeader/MetricContainerHeaderSegment.tsx index 19c7c557a..42fabd9b1 100644 --- a/web/src/layouts/ChatLayout/FileContainer/FileContainerHeader/MetricContainerHeaderSegment.tsx +++ b/web/src/layouts/ChatLayout/FileContainer/FileContainerHeader/MetricContainerHeaderSegment.tsx @@ -22,17 +22,29 @@ export const MetricContainerHeaderSegment: React.FC = { label: 'Chart', value: 'chart', - link: createBusterRoute({ route: BusterRoutes.APP_CHAT_ID_QUERY, chatId, metricId }) + link: createBusterRoute({ + route: BusterRoutes.APP_CHAT_ID_METRIC_ID_CHART, + chatId, + metricId + }) }, { label: 'Results', value: 'results', - link: createBusterRoute({ route: BusterRoutes.APP_CHAT_ID_QUERY, chatId, metricId }) + link: createBusterRoute({ + route: BusterRoutes.APP_CHAT_ID_METRIC_ID_RESULTS, + chatId, + metricId + }) }, { label: 'File', value: 'file', - link: createBusterRoute({ route: BusterRoutes.APP_CHAT_ID_QUERY, chatId, metricId }) + link: createBusterRoute({ + route: BusterRoutes.APP_CHAT_ID_METRIC_ID_FILE, + chatId, + metricId + }) } ]; } diff --git a/web/src/routes/busterRoutes/busterAppRoutes.ts b/web/src/routes/busterRoutes/busterAppRoutes.ts index 0970f52cd..3de1e0520 100644 --- a/web/src/routes/busterRoutes/busterAppRoutes.ts +++ b/web/src/routes/busterRoutes/busterAppRoutes.ts @@ -27,7 +27,6 @@ export enum BusterAppRoutes { //NEW CHAT APP_CHAT = '/app/chats', APP_CHAT_ID = '/app/chats/:chatId', - APP_CHAT_ID_QUERY = '/app/chats/:chatId?metricId=:metricId&dashboardId=:dashboardId&messageId=:messageId', APP_CHAT_ID_REASONING_ID = '/app/chats/:chatId/reasoning/:messageId', APP_CHAT_ID_METRIC_ID = '/app/chats/:chatId/metrics/:metricId', APP_CHAT_ID_METRIC_ID_CHART = '/app/chats/:chatId/metrics/:metricId/chart', @@ -110,13 +109,6 @@ export type BusterAppRoutesWithArgs = { [BusterAppRoutes.NEW_USER]: { route: BusterAppRoutes.NEW_USER }; [BusterAppRoutes.APP_CHAT]: { route: BusterAppRoutes.APP_CHAT }; [BusterAppRoutes.APP_CHAT_ID]: { route: BusterAppRoutes.APP_CHAT_ID; chatId: string }; - [BusterAppRoutes.APP_CHAT_ID_QUERY]: { - route: BusterAppRoutes.APP_CHAT_ID_QUERY; - chatId: string; - metricId?: string; - dashboardId?: string; - messageId?: string; - }; [BusterAppRoutes.APP_CHAT_ID_REASONING_ID]: { route: BusterAppRoutes.APP_CHAT_ID_REASONING_ID; chatId: string; diff --git a/web/src/routes/busterRoutes/createRouteHelpers.test.ts b/web/src/routes/busterRoutes/createRouteHelpers.test.ts index 46f7a1dd9..72f3eb460 100644 --- a/web/src/routes/busterRoutes/createRouteHelpers.test.ts +++ b/web/src/routes/busterRoutes/createRouteHelpers.test.ts @@ -28,41 +28,6 @@ describe('createBusterRoute', () => { const result = createBusterRoute(input); expect(result).toBe('/app/settings/permission-groups/group123/datasets'); }); - - test('should handle query parameters in route', () => { - // Test with all query parameters - const input = { - route: BusterAppRoutes.APP_CHAT_ID_QUERY, - chatId: '123', - metricId: 'metric456', - dashboardId: 'dash789', - messageId: 'reason101' - } as const; - const result = createBusterRoute(input); - expect(result).toBe( - '/app/chats/123?metricId=metric456&dashboardId=dash789&messageId=reason101' - ); - - // Test with some undefined parameters - const partialInput: any = { - route: BusterAppRoutes.APP_CHAT_ID_QUERY, - chatId: '123', - metricId: 'metric456', - dashboardId: undefined, - reasoningId: null, - yourMom: 'yourMom' - }; - const result2 = createBusterRoute(partialInput); - expect(result2).toBe('/app/chats/123?metricId=metric456'); - - // Test with all query parameters undefined - const minimalInput: any = { - route: BusterAppRoutes.APP_CHAT_ID_QUERY, - chatId: '123' - }; - const result3 = createBusterRoute(minimalInput); - expect(result3).toBe('/app/chats/123'); - }); }); describe('createPathnameToBusterRoute', () => { @@ -84,18 +49,6 @@ describe('createPathnameToBusterRoute', () => { expect(result).toEqual(BusterSettingsRoutes.SETTINGS_PERMISSION_GROUPS_ID_DATASETS); }); - test('should convert chat route with query parameters', () => { - const pathname = '/app/chats/123?metricId=metric456&dashboardId=dash789&messageId=msg101'; - const result = createPathnameToBusterRoute(pathname); - expect(result).toEqual(BusterAppRoutes.APP_CHAT_ID_QUERY); - }); - - test('should handle partial query parameters', () => { - const pathname = '/app/chats/123?metricId=metric456'; - const result = createPathnameToBusterRoute(pathname); - expect(result).toEqual(BusterAppRoutes.APP_CHAT_ID_QUERY); - }); - test('should convert dataset route with ID', () => { const pathname = '/app/datasets/dataset123'; const result = createPathnameToBusterRoute(pathname);