From d1f2067860e8c33b529a98de22ccef4c8091bb4b Mon Sep 17 00:00:00 2001 From: Ashish Gupta Date: Wed, 15 Mar 2023 10:41:30 +0530 Subject: [PATCH] Change Explore Placeholder when ES failed (#10575) --- .../ui/src/components/Explore/Explore.component.tsx | 2 -- .../ui/src/components/Explore/explore.interface.ts | 1 - .../searched-data/SearchedData.interface.ts | 1 - .../components/searched-data/SearchedData.test.tsx | 1 - .../src/components/searched-data/SearchedData.tsx | 7 +------ .../ui/src/pages/explore/ExplorePage.component.tsx | 13 +------------ 6 files changed, 2 insertions(+), 23 deletions(-) diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Explore/Explore.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/Explore/Explore.component.tsx index af4214ad2e3..1c993e5a186 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/Explore/Explore.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/Explore/Explore.component.tsx @@ -74,7 +74,6 @@ const Explore: React.FC = ({ page = 1, onChangePage = noop, loading, - isElasticSearchIssue = false, }) => { const { t } = useTranslation(); const { tab } = useParams<{ tab: string }>(); @@ -330,7 +329,6 @@ const Explore: React.FC = ({ currentPage={page} data={searchResults?.hits.hits ?? []} handleSummaryPanelDisplay={handleSummaryPanelDisplay} - isElasticSearchIssue={isElasticSearchIssue} isSummaryPanelVisible={showSummaryPanel} paginate={(value) => { if (isNumber(value)) { diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Explore/explore.interface.ts b/openmetadata-ui/src/main/resources/ui/src/components/Explore/explore.interface.ts index 662388188f5..2ac000a5424 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/Explore/explore.interface.ts +++ b/openmetadata-ui/src/main/resources/ui/src/components/Explore/explore.interface.ts @@ -72,7 +72,6 @@ export interface ExploreProps { onChangePage?: (page: number) => void; loading?: boolean; - isElasticSearchIssue?: boolean; } export interface ExploreQuickFilterField { diff --git a/openmetadata-ui/src/main/resources/ui/src/components/searched-data/SearchedData.interface.ts b/openmetadata-ui/src/main/resources/ui/src/components/searched-data/SearchedData.interface.ts index b569137a315..835f3823bfa 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/searched-data/SearchedData.interface.ts +++ b/openmetadata-ui/src/main/resources/ui/src/components/searched-data/SearchedData.interface.ts @@ -78,5 +78,4 @@ export interface SearchedDataProps { details: EntityDetailsType, entityType: string ) => void; - isElasticSearchIssue: boolean; } diff --git a/openmetadata-ui/src/main/resources/ui/src/components/searched-data/SearchedData.test.tsx b/openmetadata-ui/src/main/resources/ui/src/components/searched-data/SearchedData.test.tsx index 27ee7237d30..9bb1ffc3fb0 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/searched-data/SearchedData.test.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/searched-data/SearchedData.test.tsx @@ -88,7 +88,6 @@ jest.mock('../common/error-with-placeholder/ErrorPlaceHolderES', () => { }); const MOCK_PROPS = { - isElasticSearchIssue: false, isFilterSelected: false, isSummaryPanelVisible: false, currentPage: 0, diff --git a/openmetadata-ui/src/main/resources/ui/src/components/searched-data/SearchedData.tsx b/openmetadata-ui/src/main/resources/ui/src/components/searched-data/SearchedData.tsx index 3f236f007b8..7cd18c01171 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/searched-data/SearchedData.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/searched-data/SearchedData.tsx @@ -49,7 +49,6 @@ const SearchedData: React.FC = ({ searchText, selectedEntityId, handleSummaryPanelDisplay, - isElasticSearchIssue, }) => { const highlightSearchResult = () => { return data.map(({ _source: table, highlight, _index }, index) => { @@ -162,11 +161,7 @@ const SearchedData: React.FC = ({ {children} )} diff --git a/openmetadata-ui/src/main/resources/ui/src/pages/explore/ExplorePage.component.tsx b/openmetadata-ui/src/main/resources/ui/src/pages/explore/ExplorePage.component.tsx index 7b7b7f41382..ff94d3c3d45 100644 --- a/openmetadata-ui/src/main/resources/ui/src/pages/explore/ExplorePage.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/pages/explore/ExplorePage.component.tsx @@ -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(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 (