From 3be1a40c050d4596b6bed16867e7dd9a62bd5ee2 Mon Sep 17 00:00:00 2001 From: Karan Hotchandani <33024356+karanh37@users.noreply.github.com> Date: Wed, 19 Feb 2025 14:00:47 +0530 Subject: [PATCH] pass filters when refreshing for domain assets (#19872) * pass filters when refreshing assets * verify query_filter being passed for refresh --- .../main/resources/ui/playwright/utils/domain.ts | 15 +++++++++++++++ .../GlossaryTerms/tabs/AssetsTabs.component.tsx | 7 +++++++ 2 files changed, 22 insertions(+) diff --git a/openmetadata-ui/src/main/resources/ui/playwright/utils/domain.ts b/openmetadata-ui/src/main/resources/ui/playwright/utils/domain.ts index 2530c4c4517..6262005adab 100644 --- a/openmetadata-ui/src/main/resources/ui/playwright/utils/domain.ts +++ b/openmetadata-ui/src/main/resources/ui/playwright/utils/domain.ts @@ -344,9 +344,24 @@ export const addAssetsToDomain = async ( } const assetsAddRes = page.waitForResponse(`/api/v1/domains/*/assets/add`); + const searchRes = page.waitForResponse((response) => { + const url = new URL(response.url()); + const queryParams = new URLSearchParams(url.search); + const queryFilter = queryParams.get('query_filter'); + + return ( + response + .url() + .includes('/api/v1/search/query?q=**&index=all&from=0&size=15') && + queryFilter !== null && + queryFilter !== '' + ); + }); await page.getByTestId('save-btn').click(); await assetsAddRes; + await searchRes; + await page.reload(); await page.waitForLoadState('networkidle'); diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Glossary/GlossaryTerms/tabs/AssetsTabs.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/Glossary/GlossaryTerms/tabs/AssetsTabs.component.tsx index 8c751df5fff..1885f07b5ec 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/Glossary/GlossaryTerms/tabs/AssetsTabs.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/Glossary/GlossaryTerms/tabs/AssetsTabs.component.tsx @@ -753,12 +753,19 @@ const AssetsTabs = forwardRef( refreshAssets() { // Reset page to one and trigger fetchAssets handlePageChange(1); + + const newFilter = getCombinedQueryFilterObject( + queryFilter as unknown as QueryFilterInterface, + quickFilterQuery as QueryFilterInterface + ); + // If current page is already 1 it won't trigger fetchAset from useEffect // Hence need to manually trigger it for this case currentPage === 1 && fetchAssets({ index: isEmpty(activeFilter) ? [SearchIndex.ALL] : activeFilter, page: 1, + queryFilter: newFilter, }); }, closeSummaryPanel() {