mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-09-25 08:50:18 +00:00
Change Explore Placeholder when ES failed (#10575)
This commit is contained in:
parent
5fb5333f8b
commit
d1f2067860
@ -74,7 +74,6 @@ const Explore: React.FC<ExploreProps> = ({
|
||||
page = 1,
|
||||
onChangePage = noop,
|
||||
loading,
|
||||
isElasticSearchIssue = false,
|
||||
}) => {
|
||||
const { t } = useTranslation();
|
||||
const { tab } = useParams<{ tab: string }>();
|
||||
@ -330,7 +329,6 @@ const Explore: React.FC<ExploreProps> = ({
|
||||
currentPage={page}
|
||||
data={searchResults?.hits.hits ?? []}
|
||||
handleSummaryPanelDisplay={handleSummaryPanelDisplay}
|
||||
isElasticSearchIssue={isElasticSearchIssue}
|
||||
isSummaryPanelVisible={showSummaryPanel}
|
||||
paginate={(value) => {
|
||||
if (isNumber(value)) {
|
||||
|
@ -72,7 +72,6 @@ export interface ExploreProps {
|
||||
onChangePage?: (page: number) => void;
|
||||
|
||||
loading?: boolean;
|
||||
isElasticSearchIssue?: boolean;
|
||||
}
|
||||
|
||||
export interface ExploreQuickFilterField {
|
||||
|
@ -78,5 +78,4 @@ export interface SearchedDataProps {
|
||||
details: EntityDetailsType,
|
||||
entityType: string
|
||||
) => void;
|
||||
isElasticSearchIssue: boolean;
|
||||
}
|
||||
|
@ -88,7 +88,6 @@ jest.mock('../common/error-with-placeholder/ErrorPlaceHolderES', () => {
|
||||
});
|
||||
|
||||
const MOCK_PROPS = {
|
||||
isElasticSearchIssue: false,
|
||||
isFilterSelected: false,
|
||||
isSummaryPanelVisible: false,
|
||||
currentPage: 0,
|
||||
|
@ -49,7 +49,6 @@ const SearchedData: React.FC<SearchedDataProps> = ({
|
||||
searchText,
|
||||
selectedEntityId,
|
||||
handleSummaryPanelDisplay,
|
||||
isElasticSearchIssue,
|
||||
}) => {
|
||||
const highlightSearchResult = () => {
|
||||
return data.map(({ _source: table, highlight, _index }, index) => {
|
||||
@ -162,11 +161,7 @@ const SearchedData: React.FC<SearchedDataProps> = ({
|
||||
{children}
|
||||
<ErrorPlaceHolderES
|
||||
query={searchText}
|
||||
type={
|
||||
isElasticSearchIssue
|
||||
? ELASTICSEARCH_ERROR_PLACEHOLDER_TYPE.ERROR
|
||||
: ELASTICSEARCH_ERROR_PLACEHOLDER_TYPE.NO_DATA
|
||||
}
|
||||
type={ELASTICSEARCH_ERROR_PLACEHOLDER_TYPE.NO_DATA}
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
|
@ -20,7 +20,7 @@ import {
|
||||
UrlParams,
|
||||
} from 'components/Explore/explore.interface';
|
||||
import { SORT_ORDER } from 'enums/common.enum';
|
||||
import { get, isNil, isString } from 'lodash';
|
||||
import { isNil, isString } from 'lodash';
|
||||
import Qs from 'qs';
|
||||
import React, {
|
||||
FunctionComponent,
|
||||
@ -69,9 +69,6 @@ const ExplorePage: FunctionComponent = () => {
|
||||
|
||||
const [isLoading, setIsLoading] = useState(true);
|
||||
|
||||
const [isElasticSearchIssue, setIsElasticSearchIssue] =
|
||||
useState<boolean>(false);
|
||||
|
||||
const parsedSearch = useMemo(
|
||||
() =>
|
||||
Qs.parse(
|
||||
@ -268,13 +265,6 @@ const ExplorePage: FunctionComponent = () => {
|
||||
])
|
||||
.catch((err) => {
|
||||
showErrorToast(err);
|
||||
if (
|
||||
get(err, 'response.data.responseMessage', '').includes(
|
||||
'elasticsearch'
|
||||
)
|
||||
) {
|
||||
setIsElasticSearchIssue(true);
|
||||
}
|
||||
})
|
||||
.finally(() => setIsLoading(false));
|
||||
}, [
|
||||
@ -303,7 +293,6 @@ const ExplorePage: FunctionComponent = () => {
|
||||
return (
|
||||
<PageContainerV1>
|
||||
<Explore
|
||||
isElasticSearchIssue={isElasticSearchIssue}
|
||||
loading={isLoading}
|
||||
page={page}
|
||||
postFilter={postFilter}
|
||||
|
Loading…
x
Reference in New Issue
Block a user