From 99b27bc87af08a043006ec3ed6ad32dd176d26fc Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Fri, 11 Jul 2025 20:50:04 +0000 Subject: [PATCH 1/3] Checkpoint before follow-up message --- apps/api/server/src/routes/rest/routes/mod.rs | 2 +- .../src/api/buster_rest/metrics/requests.ts | 24 +++++++++---------- .../context/Assets/useGetFileLink.test.tsx | 10 ++++---- .../routes/busterRoutes/busterAppRoutes.ts | 16 ++++++------- 4 files changed, 26 insertions(+), 26 deletions(-) diff --git a/apps/api/server/src/routes/rest/routes/mod.rs b/apps/api/server/src/routes/rest/routes/mod.rs index ced93cb5c..eb97dbeaa 100644 --- a/apps/api/server/src/routes/rest/routes/mod.rs +++ b/apps/api/server/src/routes/rest/routes/mod.rs @@ -32,7 +32,7 @@ pub fn router() -> Router { .nest("/organizations", organizations::router()) .nest("/chats", chats::router()) .nest("/messages", messages::router()) - .nest("/metrics", metrics::router()) + .nest("/metric_files", metrics::router()) .nest("/dashboards", dashboards::router()) .nest("/users", users::router()) .nest("/collections", collections::router()) diff --git a/apps/web/src/api/buster_rest/metrics/requests.ts b/apps/web/src/api/buster_rest/metrics/requests.ts index af2b91ec6..3f60a4b1f 100644 --- a/apps/web/src/api/buster_rest/metrics/requests.ts +++ b/apps/web/src/api/buster_rest/metrics/requests.ts @@ -25,14 +25,14 @@ import { mainApi } from '../instances'; export const getMetric = async (params: GetMetricRequest): Promise => { return mainApi - .get(`/metrics/${params.id}`, { + .get(`/metric_files/${params.id}`, { params }) .then((res) => res.data); }; export const getMetric_server = async ({ id, password }: Parameters[0]) => { - return await serverFetch(`/metrics/${id}`, { + return await serverFetch(`/metric_files/${id}`, { params: { ...(password && { password }) } }); }; @@ -43,25 +43,25 @@ export const getMetricData = async ({ password }: GetMetricDataRequest): Promise => { return mainApi - .get(`/metrics/${id}/data`, { params: { password, version_number } }) + .get(`/metric_files/${id}/data`, { params: { password, version_number } }) .then((res) => res.data); }; export const listMetrics = async (params: GetMetricListRequest) => { - return mainApi.get('/metrics', { params }).then((res) => res.data); + return mainApi.get('/metric_files', { params }).then((res) => res.data); }; export const listMetrics_server = async (params: Parameters[0]) => { - return await serverFetch('/metrics', { params }); + return await serverFetch('/metric_files', { params }); }; export const updateMetric = async (params: UpdateMetricRequest) => { - return mainApi.put(`/metrics/${params.id}`, params).then((res) => res.data); + return mainApi.put(`/metric_files/${params.id}`, params).then((res) => res.data); }; export const deleteMetrics = async (data: DeleteMetricRequest) => { return mainApi - .delete('/metrics', { + .delete('/metric_files', { data }) .then((res) => res.data); @@ -69,7 +69,7 @@ export const deleteMetrics = async (data: DeleteMetricRequest) => { export const duplicateMetric = async (params: DuplicateMetricRequest) => { return mainApi - .post('/metrics/duplicate', params) + .post('/metric_files/duplicate', params) .then((res) => res.data); }; @@ -77,7 +77,7 @@ export const bulkUpdateMetricVerificationStatus = async ( params: BulkUpdateMetricVerificationStatusRequest ) => { return mainApi - .put('/metrics', params) + .put('/metric_files', params) .then((res) => res.data); }; @@ -85,13 +85,13 @@ export const bulkUpdateMetricVerificationStatus = async ( export const shareMetric = async ({ id, params }: { id: string; params: ShareMetricRequest }) => { return mainApi - .post(`/metrics/${id}/sharing`, params) + .post(`/metric_files/${id}/sharing`, params) .then((res) => res.data); }; export const unshareMetric = async ({ id, data }: { id: string; data: ShareDeleteRequest }) => { return mainApi - .delete(`/metrics/${id}/sharing`, { data }) + .delete(`/metric_files/${id}/sharing`, { data }) .then((res) => res.data); }; @@ -102,5 +102,5 @@ export const updateMetricShare = async ({ id: string; params: ShareUpdateRequest; }) => { - return mainApi.put(`/metrics/${id}/sharing`, params).then((res) => res.data); + return mainApi.put(`/metric_files/${id}/sharing`, params).then((res) => res.data); }; diff --git a/apps/web/src/context/Assets/useGetFileLink.test.tsx b/apps/web/src/context/Assets/useGetFileLink.test.tsx index b4afc0f25..4b386a0fa 100644 --- a/apps/web/src/context/Assets/useGetFileLink.test.tsx +++ b/apps/web/src/context/Assets/useGetFileLink.test.tsx @@ -50,7 +50,7 @@ describe('useGetFileLink', () => { secondaryView: string; }) => { if (type === 'metric') { - return `/metrics/${assetId}${versionNumber ? `/v${versionNumber}` : ''}${secondaryView ? `/${secondaryView}` : ''}`; + return `/metric_files/${assetId}${versionNumber ? `/v${versionNumber}` : ''}${secondaryView ? `/${secondaryView}` : ''}`; } if (type === 'dashboard') { return `/dashboards/${assetId}${versionNumber ? `/v${versionNumber}` : ''}${secondaryView ? `/${secondaryView}` : ''}`; @@ -81,7 +81,7 @@ describe('useGetFileLink', () => { versionNumber: 3, secondaryView: undefined }); - expect(link).toBe(`/metrics/${mockMetricId}/v3`); + expect(link).toBe(`/metric_files/${mockMetricId}/v3`); }); it('should generate correct file link for dashboard', () => { @@ -121,7 +121,7 @@ describe('useGetFileLink', () => { versionNumber: 3, secondaryView: 'version-history' }); - expect(link).toBe(`/metrics/${mockMetricId}/v3/version-history`); + expect(link).toBe(`/metric_files/${mockMetricId}/v3/version-history`); }); }); @@ -220,7 +220,7 @@ describe('useGetFileLink', () => { }); expect(meta).toEqual({ - link: `/metrics/${mockMetricId}/v${mockMetricVersionNumber}`, + link: `/metric_files/${mockMetricId}/v${mockMetricVersionNumber}`, isSelected: true, selectedVersionNumber: mockMetricVersionNumber }); @@ -253,7 +253,7 @@ describe('useGetFileLink', () => { }); expect(meta).toEqual({ - link: '/metrics/different-metric/v999', + link: '/metric_files/different-metric/v999', isSelected: false, selectedVersionNumber: mockMetricVersionNumber }); diff --git a/apps/web/src/routes/busterRoutes/busterAppRoutes.ts b/apps/web/src/routes/busterRoutes/busterAppRoutes.ts index 395d4f058..74d592fb4 100644 --- a/apps/web/src/routes/busterRoutes/busterAppRoutes.ts +++ b/apps/web/src/routes/busterRoutes/busterAppRoutes.ts @@ -4,10 +4,10 @@ export enum BusterAppRoutes { APP_HOME = '/app/home', APP_COLLECTIONS = '/app/collections', APP_COLLECTIONS_ID = '/app/collections/:collectionId', - APP_METRIC = '/app/metrics', - APP_METRIC_ID_CHART = '/app/metrics/:metricId/chart?secondary_view=:secondaryView&metric_version_number=:metricVersionNumber', - APP_METRIC_ID_RESULTS = '/app/metrics/:metricId/results?secondary_view=:secondaryView&metric_version_number=:metricVersionNumber', - APP_METRIC_ID_SQL = '/app/metrics/:metricId/sql?secondary_view=:secondaryView&metric_version_number=:metricVersionNumber', + APP_METRIC = '/app/metric_files', + APP_METRIC_ID_CHART = '/app/metric_files/:metricId/chart?secondary_view=:secondaryView&metric_version_number=:metricVersionNumber', + APP_METRIC_ID_RESULTS = '/app/metric_files/:metricId/results?secondary_view=:secondaryView&metric_version_number=:metricVersionNumber', + APP_METRIC_ID_SQL = '/app/metric_files/:metricId/sql?secondary_view=:secondaryView&metric_version_number=:metricVersionNumber', APP_DASHBOARDS = '/app/dashboards', APP_DASHBOARD_ID = '/app/dashboards/:dashboardId?secondary_view=:secondaryView&dashboard_version_number=:dashboardVersionNumber', APP_DASHBOARD_ID_FILE = '/app/dashboards/:dashboardId/file?dashboard_version_number=:dashboardVersionNumber&secondary_view=:secondaryView', @@ -26,10 +26,10 @@ export enum BusterAppRoutes { APP_CHAT = '/app/chats', APP_CHAT_ID = '/app/chats/:chatId', APP_CHAT_ID_REASONING_ID = '/app/chats/:chatId/reasoning/:messageId', - APP_CHAT_ID_METRIC_ID = '/app/chats/:chatId/metrics/:metricId?secondary_view=:secondaryView&metric_version_number=:metricVersionNumber', - APP_CHAT_ID_METRIC_ID_CHART = '/app/chats/:chatId/metrics/:metricId/chart?secondary_view=:secondaryView&metric_version_number=:metricVersionNumber', - APP_CHAT_ID_METRIC_ID_SQL = '/app/chats/:chatId/metrics/:metricId/sql?secondary_view=:secondaryView&metric_version_number=:metricVersionNumber', - APP_CHAT_ID_METRIC_ID_RESULTS = '/app/chats/:chatId/metrics/:metricId/results?secondary_view=:secondaryView&metric_version_number=:metricVersionNumber', + APP_CHAT_ID_METRIC_ID = '/app/chats/:chatId/metric_files/:metricId?secondary_view=:secondaryView&metric_version_number=:metricVersionNumber', + APP_CHAT_ID_METRIC_ID_CHART = '/app/chats/:chatId/metric_files/:metricId/chart?secondary_view=:secondaryView&metric_version_number=:metricVersionNumber', + APP_CHAT_ID_METRIC_ID_SQL = '/app/chats/:chatId/metric_files/:metricId/sql?secondary_view=:secondaryView&metric_version_number=:metricVersionNumber', + APP_CHAT_ID_METRIC_ID_RESULTS = '/app/chats/:chatId/metric_files/:metricId/results?secondary_view=:secondaryView&metric_version_number=:metricVersionNumber', APP_CHAT_ID_COLLECTION_ID = '/app/chats/:chatId/collections/:collectionId', APP_CHAT_ID_DASHBOARD_ID = '/app/chats/:chatId/dashboards/:dashboardId?secondary_view=:secondaryView&dashboard_version_number=:dashboardVersionNumber', APP_CHAT_ID_DASHBOARD_ID_FILE = '/app/chats/:chatId/dashboards/:dashboardId/file?secondary_view=:secondaryView&dashboard_version_number=:dashboardVersionNumber', From 2fca16e7b446f577ad5b82511d7b05b958d4de0d Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Fri, 11 Jul 2025 20:52:29 +0000 Subject: [PATCH 2/3] Update metric routes from metric_files to metrics Co-authored-by: dallin --- .../src/context/Assets/useGetFileLink.test.tsx | 10 +++++----- .../src/routes/busterRoutes/busterAppRoutes.ts | 18 +++++++++--------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/apps/web/src/context/Assets/useGetFileLink.test.tsx b/apps/web/src/context/Assets/useGetFileLink.test.tsx index 4b386a0fa..b4afc0f25 100644 --- a/apps/web/src/context/Assets/useGetFileLink.test.tsx +++ b/apps/web/src/context/Assets/useGetFileLink.test.tsx @@ -50,7 +50,7 @@ describe('useGetFileLink', () => { secondaryView: string; }) => { if (type === 'metric') { - return `/metric_files/${assetId}${versionNumber ? `/v${versionNumber}` : ''}${secondaryView ? `/${secondaryView}` : ''}`; + return `/metrics/${assetId}${versionNumber ? `/v${versionNumber}` : ''}${secondaryView ? `/${secondaryView}` : ''}`; } if (type === 'dashboard') { return `/dashboards/${assetId}${versionNumber ? `/v${versionNumber}` : ''}${secondaryView ? `/${secondaryView}` : ''}`; @@ -81,7 +81,7 @@ describe('useGetFileLink', () => { versionNumber: 3, secondaryView: undefined }); - expect(link).toBe(`/metric_files/${mockMetricId}/v3`); + expect(link).toBe(`/metrics/${mockMetricId}/v3`); }); it('should generate correct file link for dashboard', () => { @@ -121,7 +121,7 @@ describe('useGetFileLink', () => { versionNumber: 3, secondaryView: 'version-history' }); - expect(link).toBe(`/metric_files/${mockMetricId}/v3/version-history`); + expect(link).toBe(`/metrics/${mockMetricId}/v3/version-history`); }); }); @@ -220,7 +220,7 @@ describe('useGetFileLink', () => { }); expect(meta).toEqual({ - link: `/metric_files/${mockMetricId}/v${mockMetricVersionNumber}`, + link: `/metrics/${mockMetricId}/v${mockMetricVersionNumber}`, isSelected: true, selectedVersionNumber: mockMetricVersionNumber }); @@ -253,7 +253,7 @@ describe('useGetFileLink', () => { }); expect(meta).toEqual({ - link: '/metric_files/different-metric/v999', + link: '/metrics/different-metric/v999', isSelected: false, selectedVersionNumber: mockMetricVersionNumber }); diff --git a/apps/web/src/routes/busterRoutes/busterAppRoutes.ts b/apps/web/src/routes/busterRoutes/busterAppRoutes.ts index 74d592fb4..4c9a3f61b 100644 --- a/apps/web/src/routes/busterRoutes/busterAppRoutes.ts +++ b/apps/web/src/routes/busterRoutes/busterAppRoutes.ts @@ -4,10 +4,10 @@ export enum BusterAppRoutes { APP_HOME = '/app/home', APP_COLLECTIONS = '/app/collections', APP_COLLECTIONS_ID = '/app/collections/:collectionId', - APP_METRIC = '/app/metric_files', - APP_METRIC_ID_CHART = '/app/metric_files/:metricId/chart?secondary_view=:secondaryView&metric_version_number=:metricVersionNumber', - APP_METRIC_ID_RESULTS = '/app/metric_files/:metricId/results?secondary_view=:secondaryView&metric_version_number=:metricVersionNumber', - APP_METRIC_ID_SQL = '/app/metric_files/:metricId/sql?secondary_view=:secondaryView&metric_version_number=:metricVersionNumber', + APP_METRIC = '/app/metrics', + APP_METRIC_ID_CHART = '/app/metrics/:metricId/chart?secondary_view=:secondaryView&metric_version_number=:metricVersionNumber', + APP_METRIC_ID_RESULTS = '/app/metrics/:metricId/results?secondary_view=:secondaryView&metric_version_number=:metricVersionNumber', + APP_METRIC_ID_SQL = '/app/metrics/:metricId/sql?secondary_view=:secondaryView&metric_version_number=:metricVersionNumber', APP_DASHBOARDS = '/app/dashboards', APP_DASHBOARD_ID = '/app/dashboards/:dashboardId?secondary_view=:secondaryView&dashboard_version_number=:dashboardVersionNumber', APP_DASHBOARD_ID_FILE = '/app/dashboards/:dashboardId/file?dashboard_version_number=:dashboardVersionNumber&secondary_view=:secondaryView', @@ -26,14 +26,14 @@ export enum BusterAppRoutes { APP_CHAT = '/app/chats', APP_CHAT_ID = '/app/chats/:chatId', APP_CHAT_ID_REASONING_ID = '/app/chats/:chatId/reasoning/:messageId', - APP_CHAT_ID_METRIC_ID = '/app/chats/:chatId/metric_files/:metricId?secondary_view=:secondaryView&metric_version_number=:metricVersionNumber', - APP_CHAT_ID_METRIC_ID_CHART = '/app/chats/:chatId/metric_files/:metricId/chart?secondary_view=:secondaryView&metric_version_number=:metricVersionNumber', - APP_CHAT_ID_METRIC_ID_SQL = '/app/chats/:chatId/metric_files/:metricId/sql?secondary_view=:secondaryView&metric_version_number=:metricVersionNumber', - APP_CHAT_ID_METRIC_ID_RESULTS = '/app/chats/:chatId/metric_files/:metricId/results?secondary_view=:secondaryView&metric_version_number=:metricVersionNumber', + APP_CHAT_ID_METRIC_ID = '/app/chats/:chatId/metrics/:metricId?secondary_view=:secondaryView&metric_version_number=:metricVersionNumber', + APP_CHAT_ID_METRIC_ID_CHART = '/app/chats/:chatId/metrics/:metricId/chart?secondary_view=:secondaryView&metric_version_number=:metricVersionNumber', + APP_CHAT_ID_METRIC_ID_SQL = '/app/chats/:chatId/metrics/:metricId/sql?secondary_view=:secondaryView&metric_version_number=:metricVersionNumber', + APP_CHAT_ID_METRIC_ID_RESULTS = '/app/chats/:chatId/metrics/:metricId/results?secondary_view=:secondaryView&metric_version_number=:metricVersionNumber', APP_CHAT_ID_COLLECTION_ID = '/app/chats/:chatId/collections/:collectionId', APP_CHAT_ID_DASHBOARD_ID = '/app/chats/:chatId/dashboards/:dashboardId?secondary_view=:secondaryView&dashboard_version_number=:dashboardVersionNumber', APP_CHAT_ID_DASHBOARD_ID_FILE = '/app/chats/:chatId/dashboards/:dashboardId/file?secondary_view=:secondaryView&dashboard_version_number=:dashboardVersionNumber', - APP_CHAT_ID_DASHBOARD_ID_METRIC_ID = '/app/chats/:chatId/dashboards/:dashboardId/metrics/:metricId?secondary_view=:secondaryView&metric_version_number=:metricVersionNumber&dashboard_version_number=:dashboardVersionNumber', + APP_CHAT_ID_DASHBOARD_ID_METRIC_ID = '/app/chats/:chatId/dashboards/:dashboardId/metric_files/:metricId?secondary_view=:secondaryView&metric_version_number=:metricVersionNumber&dashboard_version_number=:dashboardVersionNumber', APP_CHAT_ID_DASHBOARD_ID_METRIC_ID_CHART = '/app/chats/:chatId/dashboards/:dashboardId/metrics/:metricId/chart?secondary_view=:secondaryView&metric_version_number=:metricVersionNumber&dashboard_version_number=:dashboardVersionNumber', APP_CHAT_ID_DASHBOARD_ID_METRIC_ID_SQL = '/app/chats/:chatId/dashboards/:dashboardId/metrics/:metricId/sql?secondary_view=:secondaryView&metric_version_number=:metricVersionNumber&dashboard_version_number=:dashboardVersionNumber', APP_CHAT_ID_DASHBOARD_ID_METRIC_ID_RESULTS = '/app/chats/:chatId/dashboards/:dashboardId/metrics/:metricId/results?secondary_view=:secondaryView&metric_version_number=:metricVersionNumber&dashboard_version_number=:dashboardVersionNumber', From 8b34fd153a02090fa1576e11e17593583a1af63d Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Fri, 11 Jul 2025 20:53:51 +0000 Subject: [PATCH 3/3] Update route path for metric files to use 'metrics' instead of 'metric_files' Co-authored-by: dallin --- apps/web/src/routes/busterRoutes/busterAppRoutes.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/web/src/routes/busterRoutes/busterAppRoutes.ts b/apps/web/src/routes/busterRoutes/busterAppRoutes.ts index 4c9a3f61b..395d4f058 100644 --- a/apps/web/src/routes/busterRoutes/busterAppRoutes.ts +++ b/apps/web/src/routes/busterRoutes/busterAppRoutes.ts @@ -33,7 +33,7 @@ export enum BusterAppRoutes { APP_CHAT_ID_COLLECTION_ID = '/app/chats/:chatId/collections/:collectionId', APP_CHAT_ID_DASHBOARD_ID = '/app/chats/:chatId/dashboards/:dashboardId?secondary_view=:secondaryView&dashboard_version_number=:dashboardVersionNumber', APP_CHAT_ID_DASHBOARD_ID_FILE = '/app/chats/:chatId/dashboards/:dashboardId/file?secondary_view=:secondaryView&dashboard_version_number=:dashboardVersionNumber', - APP_CHAT_ID_DASHBOARD_ID_METRIC_ID = '/app/chats/:chatId/dashboards/:dashboardId/metric_files/:metricId?secondary_view=:secondaryView&metric_version_number=:metricVersionNumber&dashboard_version_number=:dashboardVersionNumber', + APP_CHAT_ID_DASHBOARD_ID_METRIC_ID = '/app/chats/:chatId/dashboards/:dashboardId/metrics/:metricId?secondary_view=:secondaryView&metric_version_number=:metricVersionNumber&dashboard_version_number=:dashboardVersionNumber', APP_CHAT_ID_DASHBOARD_ID_METRIC_ID_CHART = '/app/chats/:chatId/dashboards/:dashboardId/metrics/:metricId/chart?secondary_view=:secondaryView&metric_version_number=:metricVersionNumber&dashboard_version_number=:dashboardVersionNumber', APP_CHAT_ID_DASHBOARD_ID_METRIC_ID_SQL = '/app/chats/:chatId/dashboards/:dashboardId/metrics/:metricId/sql?secondary_view=:secondaryView&metric_version_number=:metricVersionNumber&dashboard_version_number=:dashboardVersionNumber', APP_CHAT_ID_DASHBOARD_ID_METRIC_ID_RESULTS = '/app/chats/:chatId/dashboards/:dashboardId/metrics/:metricId/results?secondary_view=:secondaryView&metric_version_number=:metricVersionNumber&dashboard_version_number=:dashboardVersionNumber',