From e063f07ecc681a4d1318c1a8b4cde2bfe9630568 Mon Sep 17 00:00:00 2001 From: sumukhswamy Date: Mon, 10 Feb 2025 16:52:24 -0800 Subject: [PATCH 1/4] updated the flyout fix Signed-off-by: sumukhswamy --- common/types/explorer.ts | 1 + .../__snapshots__/log_config.test.tsx.snap | 4 --- .../service_config.test.tsx.snap | 4 --- .../__snapshots__/trace_config.test.tsx.snap | 4 --- .../custom_panel_view.test.tsx.snap | 8 ----- .../__snapshots__/panel_grid.test.tsx.snap | 2 -- .../acceleration_details_flyout.test.tsx | 7 ++-- .../acceleration_details_flyout.tsx | 29 ++++++++++------ .../create/create_acceleration.tsx | 1 + .../create/create_acceleration_button.tsx | 5 +-- .../__snapshots__/metrics_grid.test.tsx.snap | 4 --- .../__snapshots__/dashboard.test.tsx.snap | 12 ------- .../__snapshots__/services.test.tsx.snap | 12 ------- .../__snapshots__/traces.test.tsx.snap | 12 ------- .../framework/catalog_cache/cache_loader.tsx | 33 ++++++++++--------- public/services/requests/dsl.ts | 12 +++---- 16 files changed, 52 insertions(+), 98 deletions(-) diff --git a/common/types/explorer.ts b/common/types/explorer.ts index 6a495218c6..98cd7f7cc2 100644 --- a/common/types/explorer.ts +++ b/common/types/explorer.ts @@ -438,4 +438,5 @@ export interface DirectQueryRequest { lang: string; datasource: string; sessionId?: string; + dataSourceMDSId?: string; } diff --git a/public/components/application_analytics/__tests__/__snapshots__/log_config.test.tsx.snap b/public/components/application_analytics/__tests__/__snapshots__/log_config.test.tsx.snap index 7f61082163..4422eb9c1f 100644 --- a/public/components/application_analytics/__tests__/__snapshots__/log_config.test.tsx.snap +++ b/public/components/application_analytics/__tests__/__snapshots__/log_config.test.tsx.snap @@ -90,12 +90,10 @@ exports[`Log Config component renders empty log config 1`] = ` "getCenter$": [MockFunction], "getLeft$": [MockFunction], "getLeftBottom$": [MockFunction], - "getPrimaryHeaderRight$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], "registerLeftBottom": [MockFunction], - "registerPrimaryHeaderRight": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { @@ -762,12 +760,10 @@ exports[`Log Config component renders with query 1`] = ` "getCenter$": [MockFunction], "getLeft$": [MockFunction], "getLeftBottom$": [MockFunction], - "getPrimaryHeaderRight$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], "registerLeftBottom": [MockFunction], - "registerPrimaryHeaderRight": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { diff --git a/public/components/application_analytics/__tests__/__snapshots__/service_config.test.tsx.snap b/public/components/application_analytics/__tests__/__snapshots__/service_config.test.tsx.snap index 276df00044..d910aa3d3a 100644 --- a/public/components/application_analytics/__tests__/__snapshots__/service_config.test.tsx.snap +++ b/public/components/application_analytics/__tests__/__snapshots__/service_config.test.tsx.snap @@ -90,12 +90,10 @@ exports[`Service Config component renders empty service config 1`] = ` "getCenter$": [MockFunction], "getLeft$": [MockFunction], "getLeftBottom$": [MockFunction], - "getPrimaryHeaderRight$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], "registerLeftBottom": [MockFunction], - "registerPrimaryHeaderRight": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { @@ -1444,12 +1442,10 @@ exports[`Service Config component renders with one service selected 1`] = ` "getCenter$": [MockFunction], "getLeft$": [MockFunction], "getLeftBottom$": [MockFunction], - "getPrimaryHeaderRight$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], "registerLeftBottom": [MockFunction], - "registerPrimaryHeaderRight": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { diff --git a/public/components/application_analytics/__tests__/__snapshots__/trace_config.test.tsx.snap b/public/components/application_analytics/__tests__/__snapshots__/trace_config.test.tsx.snap index 598f9f4e0e..5625bdbce8 100644 --- a/public/components/application_analytics/__tests__/__snapshots__/trace_config.test.tsx.snap +++ b/public/components/application_analytics/__tests__/__snapshots__/trace_config.test.tsx.snap @@ -89,12 +89,10 @@ exports[`Trace Config component renders empty trace config 1`] = ` "getCenter$": [MockFunction], "getLeft$": [MockFunction], "getLeftBottom$": [MockFunction], - "getPrimaryHeaderRight$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], "registerLeftBottom": [MockFunction], - "registerPrimaryHeaderRight": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { @@ -2541,12 +2539,10 @@ exports[`Trace Config component renders with one trace selected 1`] = ` "getCenter$": [MockFunction], "getLeft$": [MockFunction], "getLeftBottom$": [MockFunction], - "getPrimaryHeaderRight$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], "registerLeftBottom": [MockFunction], - "registerPrimaryHeaderRight": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { diff --git a/public/components/custom_panels/__tests__/__snapshots__/custom_panel_view.test.tsx.snap b/public/components/custom_panels/__tests__/__snapshots__/custom_panel_view.test.tsx.snap index 919589a70d..34346b53c9 100644 --- a/public/components/custom_panels/__tests__/__snapshots__/custom_panel_view.test.tsx.snap +++ b/public/components/custom_panels/__tests__/__snapshots__/custom_panel_view.test.tsx.snap @@ -1237,12 +1237,10 @@ exports[`Panels View Component renders panel view container with visualizations "getCenter$": [MockFunction], "getLeft$": [MockFunction], "getLeftBottom$": [MockFunction], - "getPrimaryHeaderRight$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], "registerLeftBottom": [MockFunction], - "registerPrimaryHeaderRight": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { @@ -3146,12 +3144,10 @@ exports[`Panels View Component renders panel view container with visualizations "getCenter$": [MockFunction], "getLeft$": [MockFunction], "getLeftBottom$": [MockFunction], - "getPrimaryHeaderRight$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], "registerLeftBottom": [MockFunction], - "registerPrimaryHeaderRight": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { @@ -3609,12 +3605,10 @@ exports[`Panels View Component renders panel view container without visualizatio "getCenter$": [MockFunction], "getLeft$": [MockFunction], "getLeftBottom$": [MockFunction], - "getPrimaryHeaderRight$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], "registerLeftBottom": [MockFunction], - "registerPrimaryHeaderRight": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { @@ -5402,12 +5396,10 @@ exports[`Panels View Component renders panel view container without visualizatio "getCenter$": [MockFunction], "getLeft$": [MockFunction], "getLeftBottom$": [MockFunction], - "getPrimaryHeaderRight$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], "registerLeftBottom": [MockFunction], - "registerPrimaryHeaderRight": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { diff --git a/public/components/custom_panels/panel_modules/panel_grid/__tests__/__snapshots__/panel_grid.test.tsx.snap b/public/components/custom_panels/panel_modules/panel_grid/__tests__/__snapshots__/panel_grid.test.tsx.snap index b8818b70cb..7562b58210 100644 --- a/public/components/custom_panels/panel_modules/panel_grid/__tests__/__snapshots__/panel_grid.test.tsx.snap +++ b/public/components/custom_panels/panel_modules/panel_grid/__tests__/__snapshots__/panel_grid.test.tsx.snap @@ -247,12 +247,10 @@ exports[`Panel Grid Component renders panel grid component with empty visualizat "getCenter$": [MockFunction], "getLeft$": [MockFunction], "getLeftBottom$": [MockFunction], - "getPrimaryHeaderRight$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], "registerLeftBottom": [MockFunction], - "registerPrimaryHeaderRight": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { diff --git a/public/components/datasources/components/__tests__/acceleration_details_flyout.test.tsx b/public/components/datasources/components/__tests__/acceleration_details_flyout.test.tsx index 1ee87c474b..de9a2b162c 100644 --- a/public/components/datasources/components/__tests__/acceleration_details_flyout.test.tsx +++ b/public/components/datasources/components/__tests__/acceleration_details_flyout.test.tsx @@ -76,12 +76,13 @@ describe('AccelerationDetailsFlyout Component Tests', () => { index="mockIndex" acceleration={mockAcceleration} dataSourceName="mockDataSource" + dataSourceMDSId="" /> ); - expect(coreRefsModule.coreRefs.dslService!.fetchFields).toHaveBeenCalledWith('testIndex'); - expect(coreRefsModule.coreRefs.dslService!.fetchSettings).toHaveBeenCalledWith('testIndex'); - expect(coreRefsModule.coreRefs.dslService!.fetchIndices).toHaveBeenCalledWith('testIndex'); + expect(coreRefsModule.coreRefs.dslService!.fetchFields).toHaveBeenCalledWith('testIndex', ''); + expect(coreRefsModule.coreRefs.dslService!.fetchSettings).toHaveBeenCalledWith('testIndex', ''); + expect(coreRefsModule.coreRefs.dslService!.fetchIndices).toHaveBeenCalledWith('testIndex', ''); }); it('switches tabs correctly', async () => { diff --git a/public/components/datasources/components/manage/accelerations/acceleration_details_flyout.tsx b/public/components/datasources/components/manage/accelerations/acceleration_details_flyout.tsx index 8c64efa15a..c2b3293833 100644 --- a/public/components/datasources/components/manage/accelerations/acceleration_details_flyout.tsx +++ b/public/components/datasources/components/manage/accelerations/acceleration_details_flyout.tsx @@ -37,16 +37,25 @@ export interface AccelerationDetailsFlyoutProps { dataSourceMDSId?: string; } -const getMappings = (index: string): Promise | undefined => { - return coreRefs.dslService?.fetchFields(index); +const getMappings = ( + index: string, + dataSourceMDSId?: string +): Promise | undefined => { + return coreRefs.dslService?.fetchFields(index, dataSourceMDSId); }; -const getSettings = (index: string): Promise | undefined => { - return coreRefs.dslService?.fetchSettings(index); +const getSettings = ( + index: string, + dataSourceMDSId?: string +): Promise | undefined => { + return coreRefs.dslService?.fetchSettings(index, dataSourceMDSId); }; -const getIndexInfo = (index: string): Promise | undefined => { - return coreRefs.dslService?.fetchIndices(index); +const getIndexInfo = ( + index: string, + dataSourceMDSId?: string +): Promise | undefined => { + return coreRefs.dslService?.fetchIndices(index, dataSourceMDSId); }; const handleDetailsFetchingPromise = ( @@ -59,7 +68,7 @@ const handleDetailsFetchingPromise = ( }; export const AccelerationDetailsFlyout = (props: AccelerationDetailsFlyoutProps) => { - const { dataSourceName, acceleration, resetFlyout, handleRefresh } = props; + const { dataSourceName, acceleration, resetFlyout, handleRefresh, dataSourceMDSId } = props; const { flintIndexName } = acceleration; const [selectedTab, setSelectedTab] = useState('details'); const tabsMap: { [key: string]: any } = { @@ -113,9 +122,9 @@ export const AccelerationDetailsFlyout = (props: AccelerationDetailsFlyoutProps) const getAccDetail = (selectedIndex: string) => { Promise.all([ - handleDetailsFetchingPromise(getMappings(selectedIndex), 'getMappings'), - handleDetailsFetchingPromise(getSettings(selectedIndex), 'getSettings'), - handleDetailsFetchingPromise(getIndexInfo(selectedIndex), 'getIndexInfo'), + handleDetailsFetchingPromise(getMappings(selectedIndex, dataSourceMDSId), 'getMappings'), + handleDetailsFetchingPromise(getSettings(selectedIndex, dataSourceMDSId), 'getSettings'), + handleDetailsFetchingPromise(getIndexInfo(selectedIndex, dataSourceMDSId), 'getIndexInfo'), ]) .then((results) => { updateMapping(results[0]); diff --git a/public/components/datasources/components/manage/accelerations/create_accelerations_flyout/create/create_acceleration.tsx b/public/components/datasources/components/manage/accelerations/create_accelerations_flyout/create/create_acceleration.tsx index e5fc9a7156..43df19719d 100644 --- a/public/components/datasources/components/manage/accelerations/create_accelerations_flyout/create/create_acceleration.tsx +++ b/public/components/datasources/components/manage/accelerations/create_accelerations_flyout/create/create_acceleration.tsx @@ -277,6 +277,7 @@ export const CreateAcceleration = ({ setAccelerationFormData={setAccelerationFormData} resetFlyout={resetFlyout} refreshHandler={refreshHandler} + dataSourceMDSId={dataSourceMDSId} /> diff --git a/public/components/datasources/components/manage/accelerations/create_accelerations_flyout/create/create_acceleration_button.tsx b/public/components/datasources/components/manage/accelerations/create_accelerations_flyout/create/create_acceleration_button.tsx index ac6123edc3..ba5e3e5c92 100644 --- a/public/components/datasources/components/manage/accelerations/create_accelerations_flyout/create/create_acceleration_button.tsx +++ b/public/components/datasources/components/manage/accelerations/create_accelerations_flyout/create/create_acceleration_button.tsx @@ -21,6 +21,7 @@ interface CreateAccelerationButtonProps { setAccelerationFormData: React.Dispatch>; resetFlyout: () => void; refreshHandler?: () => void; + dataSourceMDSId?: string; } export const CreateAccelerationButton = ({ @@ -28,6 +29,7 @@ export const CreateAccelerationButton = ({ setAccelerationFormData, resetFlyout, refreshHandler, + dataSourceMDSId, }: CreateAccelerationButtonProps) => { const { setToast } = useToast(); const { loadStatus: directqueryLoadStatus, startLoading: startDirectQuery } = useDirectQuery(); @@ -45,8 +47,7 @@ export const CreateAccelerationButton = ({ query: accelerationQueryBuilder(accelerationFormData).replaceAll(SANITIZE_QUERY_REGEX, ' '), datasource: accelerationFormData.dataSource, }; - - startDirectQuery(requestPayload); + startDirectQuery(requestPayload, dataSourceMDSId); setIsLoading(true); }; diff --git a/public/components/metrics/view/__tests__/__snapshots__/metrics_grid.test.tsx.snap b/public/components/metrics/view/__tests__/__snapshots__/metrics_grid.test.tsx.snap index 69529db465..cb4832d470 100644 --- a/public/components/metrics/view/__tests__/__snapshots__/metrics_grid.test.tsx.snap +++ b/public/components/metrics/view/__tests__/__snapshots__/metrics_grid.test.tsx.snap @@ -100,12 +100,10 @@ exports[`Metrics Grid Component renders Metrics Grid Component 1`] = ` "getCenter$": [MockFunction], "getLeft$": [MockFunction], "getLeftBottom$": [MockFunction], - "getPrimaryHeaderRight$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], "registerLeftBottom": [MockFunction], - "registerPrimaryHeaderRight": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { @@ -279,12 +277,10 @@ exports[`Metrics Grid Component renders Metrics Grid Component 1`] = ` "getCenter$": [MockFunction], "getLeft$": [MockFunction], "getLeftBottom$": [MockFunction], - "getPrimaryHeaderRight$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], "registerLeftBottom": [MockFunction], - "registerPrimaryHeaderRight": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { diff --git a/public/components/trace_analytics/components/dashboard/__tests__/__snapshots__/dashboard.test.tsx.snap b/public/components/trace_analytics/components/dashboard/__tests__/__snapshots__/dashboard.test.tsx.snap index f61c20b661..d79b166695 100644 --- a/public/components/trace_analytics/components/dashboard/__tests__/__snapshots__/dashboard.test.tsx.snap +++ b/public/components/trace_analytics/components/dashboard/__tests__/__snapshots__/dashboard.test.tsx.snap @@ -103,12 +103,10 @@ exports[`Dashboard component renders dashboard 1`] = ` "getCenter$": [MockFunction], "getLeft$": [MockFunction], "getLeftBottom$": [MockFunction], - "getPrimaryHeaderRight$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], "registerLeftBottom": [MockFunction], - "registerPrimaryHeaderRight": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { @@ -498,12 +496,10 @@ exports[`Dashboard component renders dashboard 1`] = ` "getCenter$": [MockFunction], "getLeft$": [MockFunction], "getLeftBottom$": [MockFunction], - "getPrimaryHeaderRight$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], "registerLeftBottom": [MockFunction], - "registerPrimaryHeaderRight": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { @@ -2751,12 +2747,10 @@ exports[`Dashboard component renders empty dashboard 1`] = ` "getCenter$": [MockFunction], "getLeft$": [MockFunction], "getLeftBottom$": [MockFunction], - "getPrimaryHeaderRight$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], "registerLeftBottom": [MockFunction], - "registerPrimaryHeaderRight": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { @@ -3145,12 +3139,10 @@ exports[`Dashboard component renders empty dashboard 1`] = ` "getCenter$": [MockFunction], "getLeft$": [MockFunction], "getLeftBottom$": [MockFunction], - "getPrimaryHeaderRight$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], "registerLeftBottom": [MockFunction], - "registerPrimaryHeaderRight": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { @@ -5397,12 +5389,10 @@ exports[`Dashboard component renders empty jaeger dashboard 1`] = ` "getCenter$": [MockFunction], "getLeft$": [MockFunction], "getLeftBottom$": [MockFunction], - "getPrimaryHeaderRight$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], "registerLeftBottom": [MockFunction], - "registerPrimaryHeaderRight": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { @@ -5793,12 +5783,10 @@ exports[`Dashboard component renders empty jaeger dashboard 1`] = ` "getCenter$": [MockFunction], "getLeft$": [MockFunction], "getLeftBottom$": [MockFunction], - "getPrimaryHeaderRight$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], "registerLeftBottom": [MockFunction], - "registerPrimaryHeaderRight": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { diff --git a/public/components/trace_analytics/components/services/__tests__/__snapshots__/services.test.tsx.snap b/public/components/trace_analytics/components/services/__tests__/__snapshots__/services.test.tsx.snap index f94e942f60..743f44954c 100644 --- a/public/components/trace_analytics/components/services/__tests__/__snapshots__/services.test.tsx.snap +++ b/public/components/trace_analytics/components/services/__tests__/__snapshots__/services.test.tsx.snap @@ -103,12 +103,10 @@ exports[`Services component renders empty services page 1`] = ` "getCenter$": [MockFunction], "getLeft$": [MockFunction], "getLeftBottom$": [MockFunction], - "getPrimaryHeaderRight$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], "registerLeftBottom": [MockFunction], - "registerPrimaryHeaderRight": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { @@ -336,12 +334,10 @@ exports[`Services component renders empty services page 1`] = ` "getCenter$": [MockFunction], "getLeft$": [MockFunction], "getLeftBottom$": [MockFunction], - "getPrimaryHeaderRight$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], "registerLeftBottom": [MockFunction], - "registerPrimaryHeaderRight": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { @@ -3498,12 +3494,10 @@ exports[`Services component renders jaeger services page 1`] = ` "getCenter$": [MockFunction], "getLeft$": [MockFunction], "getLeftBottom$": [MockFunction], - "getPrimaryHeaderRight$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], "registerLeftBottom": [MockFunction], - "registerPrimaryHeaderRight": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { @@ -3731,12 +3725,10 @@ exports[`Services component renders jaeger services page 1`] = ` "getCenter$": [MockFunction], "getLeft$": [MockFunction], "getLeftBottom$": [MockFunction], - "getPrimaryHeaderRight$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], "registerLeftBottom": [MockFunction], - "registerPrimaryHeaderRight": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { @@ -6003,12 +5995,10 @@ exports[`Services component renders services page 1`] = ` "getCenter$": [MockFunction], "getLeft$": [MockFunction], "getLeftBottom$": [MockFunction], - "getPrimaryHeaderRight$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], "registerLeftBottom": [MockFunction], - "registerPrimaryHeaderRight": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { @@ -6235,12 +6225,10 @@ exports[`Services component renders services page 1`] = ` "getCenter$": [MockFunction], "getLeft$": [MockFunction], "getLeftBottom$": [MockFunction], - "getPrimaryHeaderRight$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], "registerLeftBottom": [MockFunction], - "registerPrimaryHeaderRight": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { diff --git a/public/components/trace_analytics/components/traces/__tests__/__snapshots__/traces.test.tsx.snap b/public/components/trace_analytics/components/traces/__tests__/__snapshots__/traces.test.tsx.snap index f164ba6959..c9f184bbfe 100644 --- a/public/components/trace_analytics/components/traces/__tests__/__snapshots__/traces.test.tsx.snap +++ b/public/components/trace_analytics/components/traces/__tests__/__snapshots__/traces.test.tsx.snap @@ -103,12 +103,10 @@ exports[`Traces component renders empty traces page 1`] = ` "getCenter$": [MockFunction], "getLeft$": [MockFunction], "getLeftBottom$": [MockFunction], - "getPrimaryHeaderRight$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], "registerLeftBottom": [MockFunction], - "registerPrimaryHeaderRight": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { @@ -345,12 +343,10 @@ exports[`Traces component renders empty traces page 1`] = ` "getCenter$": [MockFunction], "getLeft$": [MockFunction], "getLeftBottom$": [MockFunction], - "getPrimaryHeaderRight$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], "registerLeftBottom": [MockFunction], - "registerPrimaryHeaderRight": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { @@ -2558,12 +2554,10 @@ exports[`Traces component renders jaeger traces page 1`] = ` "getCenter$": [MockFunction], "getLeft$": [MockFunction], "getLeftBottom$": [MockFunction], - "getPrimaryHeaderRight$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], "registerLeftBottom": [MockFunction], - "registerPrimaryHeaderRight": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { @@ -2800,12 +2794,10 @@ exports[`Traces component renders jaeger traces page 1`] = ` "getCenter$": [MockFunction], "getLeft$": [MockFunction], "getLeftBottom$": [MockFunction], - "getPrimaryHeaderRight$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], "registerLeftBottom": [MockFunction], - "registerPrimaryHeaderRight": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { @@ -4853,12 +4845,10 @@ exports[`Traces component renders traces page 1`] = ` "getCenter$": [MockFunction], "getLeft$": [MockFunction], "getLeftBottom$": [MockFunction], - "getPrimaryHeaderRight$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], "registerLeftBottom": [MockFunction], - "registerPrimaryHeaderRight": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { @@ -5094,12 +5084,10 @@ exports[`Traces component renders traces page 1`] = ` "getCenter$": [MockFunction], "getLeft$": [MockFunction], "getLeftBottom$": [MockFunction], - "getPrimaryHeaderRight$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], "registerLeftBottom": [MockFunction], - "registerPrimaryHeaderRight": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { diff --git a/public/framework/catalog_cache/cache_loader.tsx b/public/framework/catalog_cache/cache_loader.tsx index 294346c441..3f46014456 100644 --- a/public/framework/catalog_cache/cache_loader.tsx +++ b/public/framework/catalog_cache/cache_loader.tsx @@ -134,13 +134,15 @@ export const updateAccelerationsToCache = ( const currentTime = new Date().toUTCString(); if (!pollingResult) { - CatalogCacheManager.addOrUpdateAccelerationsByDataSource({ - name: dataSourceName, - accelerations: [], - lastUpdated: currentTime, - status: CachedDataSourceStatus.Failed, - ...(dataSourceMDSId && { dataSourceMDSId }), - }); + CatalogCacheManager.addOrUpdateAccelerationsByDataSource( + { + name: dataSourceName, + accelerations: [], + lastUpdated: currentTime, + status: CachedDataSourceStatus.Failed, + }, + dataSourceMDSId + ); return; } @@ -155,14 +157,15 @@ export const updateAccelerationsToCache = ( autoRefresh: row.auto_refresh, status: row.status, })); - - CatalogCacheManager.addOrUpdateAccelerationsByDataSource({ - name: dataSourceName, - accelerations: newAccelerations, - lastUpdated: currentTime, - status: CachedDataSourceStatus.Updated, - ...(dataSourceMDSId && { dataSourceMDSId }), - }); + CatalogCacheManager.addOrUpdateAccelerationsByDataSource( + { + name: dataSourceName, + accelerations: newAccelerations, + lastUpdated: currentTime, + status: CachedDataSourceStatus.Updated, + }, + dataSourceMDSId + ); }; export const updateTableColumnsToCache = ( diff --git a/public/services/requests/dsl.ts b/public/services/requests/dsl.ts index f1050fddf6..b7ca9849b0 100644 --- a/public/services/requests/dsl.ts +++ b/public/services/requests/dsl.ts @@ -28,9 +28,9 @@ export default class DSLService { .catch((error) => console.error(error)); }; - fetchIndices = async (index: string = '') => { + fetchIndices = async (index: string = '', dataSourceMDSId?: string) => { return this.http - .get(`${DSL_BASE}${DSL_CAT}`, { + .get(`${DSL_BASE}${DSL_CAT}/dataSourceMDSId=${dataSourceMDSId}`, { query: { format: 'json', index, @@ -39,16 +39,16 @@ export default class DSLService { .catch((error) => console.error(error)); }; - fetchFields = async (index: string) => { - return this.http.get(`${DSL_BASE}${DSL_MAPPING}`, { + fetchFields = async (index: string, dataSourceMDSId?: string) => { + return this.http.get(`${DSL_BASE}${DSL_MAPPING}/dataSourceMDSId=${dataSourceMDSId}`, { query: { index, }, }); }; - fetchSettings = async (index: string) => { - return this.http.get(`${DSL_BASE}${DSL_SETTINGS}`, { + fetchSettings = async (index: string, dataSourceMDSId?: string) => { + return this.http.get(`${DSL_BASE}${DSL_SETTINGS}/dataSourceMDSId=${dataSourceMDSId}`, { query: { index, }, From 5d8a228bab76cfe2fd8472672a308e48246347fe Mon Sep 17 00:00:00 2001 From: sumukhswamy Date: Wed, 12 Feb 2025 15:07:19 -0800 Subject: [PATCH 2/4] updated the flyout fix Signed-off-by: sumukhswamy --- public/framework/catalog_cache/cache_manager.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/public/framework/catalog_cache/cache_manager.ts b/public/framework/catalog_cache/cache_manager.ts index bcd0dedbf8..10143961e0 100644 --- a/public/framework/catalog_cache/cache_manager.ts +++ b/public/framework/catalog_cache/cache_manager.ts @@ -100,12 +100,11 @@ export class CatalogCacheManager { ); } else { index = accCacheData.dataSources.findIndex( - (ds: CachedAccelerationByDataSource) => - ds.name === dataSource.name && ds.dataSourceMDSId === dataSourceMDSId + (ds: CachedAccelerationByDataSource) => ds.name === dataSource.name ); } if (index !== -1) { - accCacheData.dataSources[index] = dataSource; + accCacheData.dataSources[index] = { ...dataSource, dataSourceMDSId }; } else { accCacheData.dataSources.push(dataSource); } @@ -161,8 +160,11 @@ export class CatalogCacheManager { (ds: CachedDataSource) => ds.name === dataSource.name && ds.dataSourceMDSId === dataSourceMDSId ); + } else { + index = cacheData.dataSources.findIndex( + (ds: CachedDataSource) => ds.name === dataSource.name + ); } - index = cacheData.dataSources.findIndex((ds: CachedDataSource) => ds.name === dataSource.name); if (index !== -1) { cacheData.dataSources[index] = dataSource; } else { From bab33aed4d6c47ce169b00324590207b81136284 Mon Sep 17 00:00:00 2001 From: sumukhswamy Date: Wed, 19 Feb 2025 13:50:06 -0800 Subject: [PATCH 3/4] updated snapshots Signed-off-by: sumukhswamy --- .../__tests__/__snapshots__/log_config.test.tsx.snap | 4 ++++ .../__snapshots__/service_config.test.tsx.snap | 4 ++++ .../__snapshots__/trace_config.test.tsx.snap | 4 ++++ .../__snapshots__/custom_panel_view.test.tsx.snap | 8 ++++++++ .../__tests__/__snapshots__/panel_grid.test.tsx.snap | 2 ++ .../__snapshots__/metrics_grid.test.tsx.snap | 4 ++++ .../__tests__/__snapshots__/dashboard.test.tsx.snap | 12 ++++++++++++ .../__tests__/__snapshots__/services.test.tsx.snap | 12 ++++++++++++ .../__tests__/__snapshots__/traces.test.tsx.snap | 12 ++++++++++++ 9 files changed, 62 insertions(+) diff --git a/public/components/application_analytics/__tests__/__snapshots__/log_config.test.tsx.snap b/public/components/application_analytics/__tests__/__snapshots__/log_config.test.tsx.snap index 4422eb9c1f..7f61082163 100644 --- a/public/components/application_analytics/__tests__/__snapshots__/log_config.test.tsx.snap +++ b/public/components/application_analytics/__tests__/__snapshots__/log_config.test.tsx.snap @@ -90,10 +90,12 @@ exports[`Log Config component renders empty log config 1`] = ` "getCenter$": [MockFunction], "getLeft$": [MockFunction], "getLeftBottom$": [MockFunction], + "getPrimaryHeaderRight$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], "registerLeftBottom": [MockFunction], + "registerPrimaryHeaderRight": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { @@ -760,10 +762,12 @@ exports[`Log Config component renders with query 1`] = ` "getCenter$": [MockFunction], "getLeft$": [MockFunction], "getLeftBottom$": [MockFunction], + "getPrimaryHeaderRight$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], "registerLeftBottom": [MockFunction], + "registerPrimaryHeaderRight": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { diff --git a/public/components/application_analytics/__tests__/__snapshots__/service_config.test.tsx.snap b/public/components/application_analytics/__tests__/__snapshots__/service_config.test.tsx.snap index d910aa3d3a..276df00044 100644 --- a/public/components/application_analytics/__tests__/__snapshots__/service_config.test.tsx.snap +++ b/public/components/application_analytics/__tests__/__snapshots__/service_config.test.tsx.snap @@ -90,10 +90,12 @@ exports[`Service Config component renders empty service config 1`] = ` "getCenter$": [MockFunction], "getLeft$": [MockFunction], "getLeftBottom$": [MockFunction], + "getPrimaryHeaderRight$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], "registerLeftBottom": [MockFunction], + "registerPrimaryHeaderRight": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { @@ -1442,10 +1444,12 @@ exports[`Service Config component renders with one service selected 1`] = ` "getCenter$": [MockFunction], "getLeft$": [MockFunction], "getLeftBottom$": [MockFunction], + "getPrimaryHeaderRight$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], "registerLeftBottom": [MockFunction], + "registerPrimaryHeaderRight": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { diff --git a/public/components/application_analytics/__tests__/__snapshots__/trace_config.test.tsx.snap b/public/components/application_analytics/__tests__/__snapshots__/trace_config.test.tsx.snap index 5625bdbce8..598f9f4e0e 100644 --- a/public/components/application_analytics/__tests__/__snapshots__/trace_config.test.tsx.snap +++ b/public/components/application_analytics/__tests__/__snapshots__/trace_config.test.tsx.snap @@ -89,10 +89,12 @@ exports[`Trace Config component renders empty trace config 1`] = ` "getCenter$": [MockFunction], "getLeft$": [MockFunction], "getLeftBottom$": [MockFunction], + "getPrimaryHeaderRight$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], "registerLeftBottom": [MockFunction], + "registerPrimaryHeaderRight": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { @@ -2539,10 +2541,12 @@ exports[`Trace Config component renders with one trace selected 1`] = ` "getCenter$": [MockFunction], "getLeft$": [MockFunction], "getLeftBottom$": [MockFunction], + "getPrimaryHeaderRight$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], "registerLeftBottom": [MockFunction], + "registerPrimaryHeaderRight": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { diff --git a/public/components/custom_panels/__tests__/__snapshots__/custom_panel_view.test.tsx.snap b/public/components/custom_panels/__tests__/__snapshots__/custom_panel_view.test.tsx.snap index 34346b53c9..919589a70d 100644 --- a/public/components/custom_panels/__tests__/__snapshots__/custom_panel_view.test.tsx.snap +++ b/public/components/custom_panels/__tests__/__snapshots__/custom_panel_view.test.tsx.snap @@ -1237,10 +1237,12 @@ exports[`Panels View Component renders panel view container with visualizations "getCenter$": [MockFunction], "getLeft$": [MockFunction], "getLeftBottom$": [MockFunction], + "getPrimaryHeaderRight$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], "registerLeftBottom": [MockFunction], + "registerPrimaryHeaderRight": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { @@ -3144,10 +3146,12 @@ exports[`Panels View Component renders panel view container with visualizations "getCenter$": [MockFunction], "getLeft$": [MockFunction], "getLeftBottom$": [MockFunction], + "getPrimaryHeaderRight$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], "registerLeftBottom": [MockFunction], + "registerPrimaryHeaderRight": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { @@ -3605,10 +3609,12 @@ exports[`Panels View Component renders panel view container without visualizatio "getCenter$": [MockFunction], "getLeft$": [MockFunction], "getLeftBottom$": [MockFunction], + "getPrimaryHeaderRight$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], "registerLeftBottom": [MockFunction], + "registerPrimaryHeaderRight": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { @@ -5396,10 +5402,12 @@ exports[`Panels View Component renders panel view container without visualizatio "getCenter$": [MockFunction], "getLeft$": [MockFunction], "getLeftBottom$": [MockFunction], + "getPrimaryHeaderRight$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], "registerLeftBottom": [MockFunction], + "registerPrimaryHeaderRight": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { diff --git a/public/components/custom_panels/panel_modules/panel_grid/__tests__/__snapshots__/panel_grid.test.tsx.snap b/public/components/custom_panels/panel_modules/panel_grid/__tests__/__snapshots__/panel_grid.test.tsx.snap index 7562b58210..b8818b70cb 100644 --- a/public/components/custom_panels/panel_modules/panel_grid/__tests__/__snapshots__/panel_grid.test.tsx.snap +++ b/public/components/custom_panels/panel_modules/panel_grid/__tests__/__snapshots__/panel_grid.test.tsx.snap @@ -247,10 +247,12 @@ exports[`Panel Grid Component renders panel grid component with empty visualizat "getCenter$": [MockFunction], "getLeft$": [MockFunction], "getLeftBottom$": [MockFunction], + "getPrimaryHeaderRight$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], "registerLeftBottom": [MockFunction], + "registerPrimaryHeaderRight": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { diff --git a/public/components/metrics/view/__tests__/__snapshots__/metrics_grid.test.tsx.snap b/public/components/metrics/view/__tests__/__snapshots__/metrics_grid.test.tsx.snap index cb4832d470..69529db465 100644 --- a/public/components/metrics/view/__tests__/__snapshots__/metrics_grid.test.tsx.snap +++ b/public/components/metrics/view/__tests__/__snapshots__/metrics_grid.test.tsx.snap @@ -100,10 +100,12 @@ exports[`Metrics Grid Component renders Metrics Grid Component 1`] = ` "getCenter$": [MockFunction], "getLeft$": [MockFunction], "getLeftBottom$": [MockFunction], + "getPrimaryHeaderRight$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], "registerLeftBottom": [MockFunction], + "registerPrimaryHeaderRight": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { @@ -277,10 +279,12 @@ exports[`Metrics Grid Component renders Metrics Grid Component 1`] = ` "getCenter$": [MockFunction], "getLeft$": [MockFunction], "getLeftBottom$": [MockFunction], + "getPrimaryHeaderRight$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], "registerLeftBottom": [MockFunction], + "registerPrimaryHeaderRight": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { diff --git a/public/components/trace_analytics/components/dashboard/__tests__/__snapshots__/dashboard.test.tsx.snap b/public/components/trace_analytics/components/dashboard/__tests__/__snapshots__/dashboard.test.tsx.snap index d79b166695..f61c20b661 100644 --- a/public/components/trace_analytics/components/dashboard/__tests__/__snapshots__/dashboard.test.tsx.snap +++ b/public/components/trace_analytics/components/dashboard/__tests__/__snapshots__/dashboard.test.tsx.snap @@ -103,10 +103,12 @@ exports[`Dashboard component renders dashboard 1`] = ` "getCenter$": [MockFunction], "getLeft$": [MockFunction], "getLeftBottom$": [MockFunction], + "getPrimaryHeaderRight$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], "registerLeftBottom": [MockFunction], + "registerPrimaryHeaderRight": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { @@ -496,10 +498,12 @@ exports[`Dashboard component renders dashboard 1`] = ` "getCenter$": [MockFunction], "getLeft$": [MockFunction], "getLeftBottom$": [MockFunction], + "getPrimaryHeaderRight$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], "registerLeftBottom": [MockFunction], + "registerPrimaryHeaderRight": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { @@ -2747,10 +2751,12 @@ exports[`Dashboard component renders empty dashboard 1`] = ` "getCenter$": [MockFunction], "getLeft$": [MockFunction], "getLeftBottom$": [MockFunction], + "getPrimaryHeaderRight$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], "registerLeftBottom": [MockFunction], + "registerPrimaryHeaderRight": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { @@ -3139,10 +3145,12 @@ exports[`Dashboard component renders empty dashboard 1`] = ` "getCenter$": [MockFunction], "getLeft$": [MockFunction], "getLeftBottom$": [MockFunction], + "getPrimaryHeaderRight$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], "registerLeftBottom": [MockFunction], + "registerPrimaryHeaderRight": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { @@ -5389,10 +5397,12 @@ exports[`Dashboard component renders empty jaeger dashboard 1`] = ` "getCenter$": [MockFunction], "getLeft$": [MockFunction], "getLeftBottom$": [MockFunction], + "getPrimaryHeaderRight$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], "registerLeftBottom": [MockFunction], + "registerPrimaryHeaderRight": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { @@ -5783,10 +5793,12 @@ exports[`Dashboard component renders empty jaeger dashboard 1`] = ` "getCenter$": [MockFunction], "getLeft$": [MockFunction], "getLeftBottom$": [MockFunction], + "getPrimaryHeaderRight$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], "registerLeftBottom": [MockFunction], + "registerPrimaryHeaderRight": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { diff --git a/public/components/trace_analytics/components/services/__tests__/__snapshots__/services.test.tsx.snap b/public/components/trace_analytics/components/services/__tests__/__snapshots__/services.test.tsx.snap index 743f44954c..f94e942f60 100644 --- a/public/components/trace_analytics/components/services/__tests__/__snapshots__/services.test.tsx.snap +++ b/public/components/trace_analytics/components/services/__tests__/__snapshots__/services.test.tsx.snap @@ -103,10 +103,12 @@ exports[`Services component renders empty services page 1`] = ` "getCenter$": [MockFunction], "getLeft$": [MockFunction], "getLeftBottom$": [MockFunction], + "getPrimaryHeaderRight$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], "registerLeftBottom": [MockFunction], + "registerPrimaryHeaderRight": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { @@ -334,10 +336,12 @@ exports[`Services component renders empty services page 1`] = ` "getCenter$": [MockFunction], "getLeft$": [MockFunction], "getLeftBottom$": [MockFunction], + "getPrimaryHeaderRight$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], "registerLeftBottom": [MockFunction], + "registerPrimaryHeaderRight": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { @@ -3494,10 +3498,12 @@ exports[`Services component renders jaeger services page 1`] = ` "getCenter$": [MockFunction], "getLeft$": [MockFunction], "getLeftBottom$": [MockFunction], + "getPrimaryHeaderRight$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], "registerLeftBottom": [MockFunction], + "registerPrimaryHeaderRight": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { @@ -3725,10 +3731,12 @@ exports[`Services component renders jaeger services page 1`] = ` "getCenter$": [MockFunction], "getLeft$": [MockFunction], "getLeftBottom$": [MockFunction], + "getPrimaryHeaderRight$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], "registerLeftBottom": [MockFunction], + "registerPrimaryHeaderRight": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { @@ -5995,10 +6003,12 @@ exports[`Services component renders services page 1`] = ` "getCenter$": [MockFunction], "getLeft$": [MockFunction], "getLeftBottom$": [MockFunction], + "getPrimaryHeaderRight$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], "registerLeftBottom": [MockFunction], + "registerPrimaryHeaderRight": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { @@ -6225,10 +6235,12 @@ exports[`Services component renders services page 1`] = ` "getCenter$": [MockFunction], "getLeft$": [MockFunction], "getLeftBottom$": [MockFunction], + "getPrimaryHeaderRight$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], "registerLeftBottom": [MockFunction], + "registerPrimaryHeaderRight": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { diff --git a/public/components/trace_analytics/components/traces/__tests__/__snapshots__/traces.test.tsx.snap b/public/components/trace_analytics/components/traces/__tests__/__snapshots__/traces.test.tsx.snap index c9f184bbfe..f164ba6959 100644 --- a/public/components/trace_analytics/components/traces/__tests__/__snapshots__/traces.test.tsx.snap +++ b/public/components/trace_analytics/components/traces/__tests__/__snapshots__/traces.test.tsx.snap @@ -103,10 +103,12 @@ exports[`Traces component renders empty traces page 1`] = ` "getCenter$": [MockFunction], "getLeft$": [MockFunction], "getLeftBottom$": [MockFunction], + "getPrimaryHeaderRight$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], "registerLeftBottom": [MockFunction], + "registerPrimaryHeaderRight": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { @@ -343,10 +345,12 @@ exports[`Traces component renders empty traces page 1`] = ` "getCenter$": [MockFunction], "getLeft$": [MockFunction], "getLeftBottom$": [MockFunction], + "getPrimaryHeaderRight$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], "registerLeftBottom": [MockFunction], + "registerPrimaryHeaderRight": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { @@ -2554,10 +2558,12 @@ exports[`Traces component renders jaeger traces page 1`] = ` "getCenter$": [MockFunction], "getLeft$": [MockFunction], "getLeftBottom$": [MockFunction], + "getPrimaryHeaderRight$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], "registerLeftBottom": [MockFunction], + "registerPrimaryHeaderRight": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { @@ -2794,10 +2800,12 @@ exports[`Traces component renders jaeger traces page 1`] = ` "getCenter$": [MockFunction], "getLeft$": [MockFunction], "getLeftBottom$": [MockFunction], + "getPrimaryHeaderRight$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], "registerLeftBottom": [MockFunction], + "registerPrimaryHeaderRight": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { @@ -4845,10 +4853,12 @@ exports[`Traces component renders traces page 1`] = ` "getCenter$": [MockFunction], "getLeft$": [MockFunction], "getLeftBottom$": [MockFunction], + "getPrimaryHeaderRight$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], "registerLeftBottom": [MockFunction], + "registerPrimaryHeaderRight": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { @@ -5084,10 +5094,12 @@ exports[`Traces component renders traces page 1`] = ` "getCenter$": [MockFunction], "getLeft$": [MockFunction], "getLeftBottom$": [MockFunction], + "getPrimaryHeaderRight$": [MockFunction], "getRight$": [MockFunction], "registerCenter": [MockFunction], "registerLeft": [MockFunction], "registerLeftBottom": [MockFunction], + "registerPrimaryHeaderRight": [MockFunction], "registerRight": [MockFunction], }, "navGroup": Object { From f227c2a22f7cebad9141d52254b52509ba53105f Mon Sep 17 00:00:00 2001 From: sumukhswamy Date: Wed, 19 Feb 2025 15:00:56 -0800 Subject: [PATCH 4/4] Added test for accleration details flyout with MDSId Signed-off-by: sumukhswamy --- .../acceleration_details_flyout.test.tsx | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/public/components/datasources/components/__tests__/acceleration_details_flyout.test.tsx b/public/components/datasources/components/__tests__/acceleration_details_flyout.test.tsx index de9a2b162c..8f7fe27ebf 100644 --- a/public/components/datasources/components/__tests__/acceleration_details_flyout.test.tsx +++ b/public/components/datasources/components/__tests__/acceleration_details_flyout.test.tsx @@ -85,6 +85,56 @@ describe('AccelerationDetailsFlyout Component Tests', () => { expect(coreRefsModule.coreRefs.dslService!.fetchIndices).toHaveBeenCalledWith('testIndex', ''); }); + it('fetches acceleration details with specific mdsId', async () => { + mount( + + ); + + expect(coreRefsModule.coreRefs.dslService!.fetchFields).toHaveBeenCalledWith( + 'testIndex', + '746ebe20-ee4a-11ef-823a-bd0a7d9fd697' + ); + expect(coreRefsModule.coreRefs.dslService!.fetchSettings).toHaveBeenCalledWith( + 'testIndex', + '746ebe20-ee4a-11ef-823a-bd0a7d9fd697' + ); + expect(coreRefsModule.coreRefs.dslService!.fetchIndices).toHaveBeenCalledWith( + 'testIndex', + '746ebe20-ee4a-11ef-823a-bd0a7d9fd697' + ); + }); + + it('renders the correct tab content on tab switch', async () => { + const wrapper = mount( + + ); + await new Promise(setImmediate); + wrapper.update(); + + const detailsTab = wrapper.find('EuiTab').filterWhere((node) => node.text() === 'Details'); + detailsTab.simulate('click'); + await new Promise(setImmediate); + wrapper.update(); + + expect(wrapper.find('AccelerationDetailsTab').exists()).toBe(true); + + const schemaTab = wrapper.find('EuiTab').filterWhere((node) => node.text() === 'Schema'); + schemaTab.simulate('click'); + await new Promise(setImmediate); + wrapper.update(); + + expect(wrapper.find('AccelerationSchemaTab').exists()).toBe(true); + }); + it('switches tabs correctly', async () => { const wrapper = mount(