mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-08-31 04:14:34 +00:00
pass filters when refreshing for domain assets (#19872)
* pass filters when refreshing assets * verify query_filter being passed for refresh
This commit is contained in:
parent
eddaf75121
commit
3be1a40c05
@ -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');
|
||||
|
||||
|
@ -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() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user