fix: error placeholder for explore tree (#20817)

This commit is contained in:
Pranita Fulsundar 2025-04-15 10:14:42 +05:30 committed by GitHub
parent 003e759709
commit b17ab5e5ea
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 37 additions and 34 deletions

View File

@ -260,16 +260,7 @@ export const fillRule = async (
await dropdownInput.fill(searchData); await dropdownInput.fill(searchData);
if (aggregateRes) { if (aggregateRes) {
const res = await aggregateRes; await aggregateRes;
if (field.id === 'Column') {
// check if aggregateRes has queryParam called 'sourceField'
const urlParams = new URLSearchParams(res.request().url());
const sourceField = urlParams.get('sourceFields');
if (sourceField) {
// check value of sourceField
expect(sourceField).toBe('columns.name');
}
}
} }
await page await page

View File

@ -34,7 +34,7 @@ import {
SUPPORTED_EMPTY_FILTER_FIELDS, SUPPORTED_EMPTY_FILTER_FIELDS,
TAG_FQN_KEY, TAG_FQN_KEY,
} from '../../constants/explore.constants'; } from '../../constants/explore.constants';
import { SORT_ORDER } from '../../enums/common.enum'; import { SIZE, SORT_ORDER } from '../../enums/common.enum';
import { useApplicationStore } from '../../hooks/useApplicationStore'; import { useApplicationStore } from '../../hooks/useApplicationStore';
import { getDropDownItems } from '../../utils/AdvancedSearchUtils'; import { getDropDownItems } from '../../utils/AdvancedSearchUtils';
import { Transi18next } from '../../utils/CommonUtils'; import { Transi18next } from '../../utils/CommonUtils';
@ -45,6 +45,7 @@ import {
} from '../../utils/ExploreUtils'; } from '../../utils/ExploreUtils';
import { getApplicationDetailsPath } from '../../utils/RouterUtils'; import { getApplicationDetailsPath } from '../../utils/RouterUtils';
import searchClassBase from '../../utils/SearchClassBase'; import searchClassBase from '../../utils/SearchClassBase';
import FilterErrorPlaceHolder from '../common/ErrorWithPlaceholder/FilterErrorPlaceHolder';
import Loader from '../common/Loader/Loader'; import Loader from '../common/Loader/Loader';
import ResizableLeftPanels from '../common/ResizablePanels/ResizableLeftPanels'; import ResizableLeftPanels from '../common/ResizablePanels/ResizableLeftPanels';
import { import {
@ -56,6 +57,7 @@ import ExploreTree from '../Explore/ExploreTree/ExploreTree';
import SearchedData from '../SearchedData/SearchedData'; import SearchedData from '../SearchedData/SearchedData';
import { SearchedDataProps } from '../SearchedData/SearchedData.interface'; import { SearchedDataProps } from '../SearchedData/SearchedData.interface';
import './exploreV1.less'; import './exploreV1.less';
const IndexNotFoundBanner = () => { const IndexNotFoundBanner = () => {
const { theme } = useApplicationStore(); const { theme } = useApplicationStore();
const { t } = useTranslation(); const { t } = useTranslation();
@ -206,6 +208,38 @@ const ExploreV1: React.FC<ExploreProps> = ({
}); });
}; };
const exploreLeftPanel = useMemo(() => {
if (tabItems.length === 0) {
return (
<FilterErrorPlaceHolder
className="h-min-80 d-flex flex-col justify-center border-none"
size={SIZE.MEDIUM}
/>
);
}
if (searchQueryParam) {
return (
<Menu
className="custom-menu"
data-testid="explore-left-panel"
items={tabItems}
mode="inline"
rootClassName="left-container"
selectedKeys={[activeTabKey]}
onClick={(info) => {
if (info && info.key !== activeTabKey) {
onChangeSearchIndex(info.key as ExploreSearchIndex);
setShowSummaryPanel(false);
}
}}
/>
);
}
return <ExploreTree onFieldValueSelect={handleQuickFiltersChange} />;
}, [searchQueryParam, tabItems]);
useEffect(() => { useEffect(() => {
const escapeKeyHandler = (e: KeyboardEvent) => { const escapeKeyHandler = (e: KeyboardEvent) => {
if (e.key === 'Escape') { if (e.key === 'Escape') {
@ -265,28 +299,7 @@ const ExploreV1: React.FC<ExploreProps> = ({
flex: 0.13, flex: 0.13,
minWidth: 280, minWidth: 280,
title: t('label.data-asset-plural'), title: t('label.data-asset-plural'),
children: ( children: <div className="p-x-sm">{exploreLeftPanel}</div>,
<div className="p-x-sm">
{searchQueryParam ? (
<Menu
className="custom-menu"
data-testid="explore-left-panel"
items={tabItems}
mode="inline"
rootClassName="left-container"
selectedKeys={[activeTabKey]}
onClick={(info) => {
if (info && info.key !== activeTabKey) {
onChangeSearchIndex(info.key as ExploreSearchIndex);
setShowSummaryPanel(false);
}
}}
/>
) : (
<ExploreTree onFieldValueSelect={handleQuickFiltersChange} />
)}
</div>
),
}} }}
secondPanel={{ secondPanel={{
className: 'content-height-with-resizable-panel', className: 'content-height-with-resizable-panel',

View File

@ -745,7 +745,6 @@ class AdvancedSearchClassBase {
asyncFetch: this.autocomplete({ asyncFetch: this.autocomplete({
searchIndex: entitySearchIndex, searchIndex: entitySearchIndex,
entityField: EntityFields.COLUMN, entityField: EntityFields.COLUMN,
isCaseInsensitive: true,
}), }),
useAsyncSearch: true, useAsyncSearch: true,
}, },