mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-11-02 19:48:17 +00:00
fix: error placeholder for explore tree (#20817)
This commit is contained in:
parent
003e759709
commit
b17ab5e5ea
@ -260,16 +260,7 @@ export const fillRule = async (
|
||||
await dropdownInput.fill(searchData);
|
||||
|
||||
if (aggregateRes) {
|
||||
const res = 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 aggregateRes;
|
||||
}
|
||||
|
||||
await page
|
||||
|
||||
@ -34,7 +34,7 @@ import {
|
||||
SUPPORTED_EMPTY_FILTER_FIELDS,
|
||||
TAG_FQN_KEY,
|
||||
} 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 { getDropDownItems } from '../../utils/AdvancedSearchUtils';
|
||||
import { Transi18next } from '../../utils/CommonUtils';
|
||||
@ -45,6 +45,7 @@ import {
|
||||
} from '../../utils/ExploreUtils';
|
||||
import { getApplicationDetailsPath } from '../../utils/RouterUtils';
|
||||
import searchClassBase from '../../utils/SearchClassBase';
|
||||
import FilterErrorPlaceHolder from '../common/ErrorWithPlaceholder/FilterErrorPlaceHolder';
|
||||
import Loader from '../common/Loader/Loader';
|
||||
import ResizableLeftPanels from '../common/ResizablePanels/ResizableLeftPanels';
|
||||
import {
|
||||
@ -56,6 +57,7 @@ import ExploreTree from '../Explore/ExploreTree/ExploreTree';
|
||||
import SearchedData from '../SearchedData/SearchedData';
|
||||
import { SearchedDataProps } from '../SearchedData/SearchedData.interface';
|
||||
import './exploreV1.less';
|
||||
|
||||
const IndexNotFoundBanner = () => {
|
||||
const { theme } = useApplicationStore();
|
||||
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(() => {
|
||||
const escapeKeyHandler = (e: KeyboardEvent) => {
|
||||
if (e.key === 'Escape') {
|
||||
@ -265,28 +299,7 @@ const ExploreV1: React.FC<ExploreProps> = ({
|
||||
flex: 0.13,
|
||||
minWidth: 280,
|
||||
title: t('label.data-asset-plural'),
|
||||
children: (
|
||||
<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>
|
||||
),
|
||||
children: <div className="p-x-sm">{exploreLeftPanel}</div>,
|
||||
}}
|
||||
secondPanel={{
|
||||
className: 'content-height-with-resizable-panel',
|
||||
|
||||
@ -745,7 +745,6 @@ class AdvancedSearchClassBase {
|
||||
asyncFetch: this.autocomplete({
|
||||
searchIndex: entitySearchIndex,
|
||||
entityField: EntityFields.COLUMN,
|
||||
isCaseInsensitive: true,
|
||||
}),
|
||||
useAsyncSearch: true,
|
||||
},
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user