issue 382:- added error place holder for no data found and connection issue (#395)

This commit is contained in:
Shailesh Parmar 2021-09-03 19:04:39 +05:30 committed by GitHub
parent 59c74fffcd
commit dbe60628f8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 71 additions and 6 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

View File

@ -0,0 +1,65 @@
import React from 'react';
import AppState from '../../../AppState';
import NoDataFoundPlaceHolder from '../../../assets/img/no-data-placeholder.png';
type Props = {
type: 'error' | 'noData';
};
const ErrorPlaceHolderES = ({ type }: Props) => {
const noRecordForES = () => {
return (
<>
<p>
We are unable to get any results from{' '}
<a
className="tw-text-primary tw-font-medium"
href="https://docs.open-metadata.org/install/metadata-ingestion/connectors/elastic-search"
rel="noopener noreferrer"
target="_blank">
Elasticsearch.
</a>
</p>
<p>Please make sure you ran the Elasticsearch indexing.</p>
<p>
Refer to our{' '}
<a
className="tw-text-primary tw-font-medium"
href="https://docs.open-metadata.org/install/metadata-ingestion/connectors/elastic-search"
rel="noopener noreferrer"
target="_blank">
docs
</a>{' '}
for Elasticsearch indexing
</p>
</>
);
};
return (
<>
<div className="tw-flex tw-flex-col tw-mt-24 tw-place-items-center">
{' '}
<img src={NoDataFoundPlaceHolder} width={200} />
</div>
<div className="tw-flex tw-flex-col tw-items-center tw-mt-10 tw-text-base tw-font-normal">
<p className="tw-text-lg tw-font-bold tw-mb-1 tw-text-primary">
{`Hi, ${AppState.userDetails.displayName}!`}
</p>
{type === 'noData' && noRecordForES()}
{type === 'error' && (
<p className="tw-max-w-sm tw-text-center">
OpenMetadata requires Elasticsearch 7+ running and configured in
<span className="tw-text-primary tw-font-medium tw-mx-1">
openmetadata.yaml.
</span>
Please check the configuration and make sure the Elasticsearch is
running.
</p>
)}
</div>
</>
);
};
export default ErrorPlaceHolderES;

View File

@ -26,7 +26,7 @@ import {
getOwnerFromId,
getTierFromSearchTableTags,
} from '../../utils/TableUtils';
import ErrorPlaceHolder from '../common/error-with-placeholder/ErrorPlaceHolder';
import ErrorPlaceHolderES from '../common/error-with-placeholder/ErrorPlaceHolderES';
import TableDataCard from '../common/table-data-card/TableDataCard';
import PageContainer from '../containers/PageContainer';
import Loader from '../Loader/Loader';
@ -124,7 +124,7 @@ const SearchedData: React.FC<SearchedDataProp> = ({
)}
</>
) : (
<ErrorPlaceHolder />
<ErrorPlaceHolderES type="noData" />
)}
</>
)}

View File

@ -28,7 +28,7 @@ import React, { useCallback, useEffect, useRef, useState } from 'react';
import { useLocation, useParams } from 'react-router-dom';
import { searchData } from '../../axiosAPIs/miscAPI';
import { Button } from '../../components/buttons/Button/Button';
import Error from '../../components/common/error/Error';
import ErrorPlaceHolderES from '../../components/common/error-with-placeholder/ErrorPlaceHolderES';
import FacetFilter from '../../components/common/facetfilter/FacetFilter';
import DropDownList from '../../components/dropdown/DropDownList';
import SearchedData from '../../components/searched-data/SearchedData';
@ -419,7 +419,7 @@ const ExplorePage: React.FC = (): React.ReactElement => {
return (
<>
{error ? (
<Error error={error} />
<ErrorPlaceHolderES type="error" />
) : (
<SearchedData
showResultCount

View File

@ -22,7 +22,7 @@ import { FormatedTableData, SearchResponse } from 'Models';
import React, { useEffect, useRef, useState } from 'react';
import AppState from '../../AppState';
import { searchData } from '../../axiosAPIs/miscAPI';
import Error from '../../components/common/error/Error';
import ErrorPlaceHolderES from '../../components/common/error-with-placeholder/ErrorPlaceHolderES';
import Loader from '../../components/Loader/Loader';
import MyDataHeader from '../../components/my-data/MyDataHeader';
import SearchedData from '../../components/searched-data/SearchedData';
@ -151,7 +151,7 @@ const MyDataPage: React.FC = (): React.ReactElement => {
) : (
<>
{error ? (
<Error error={error} />
<ErrorPlaceHolderES type="error" />
) : (
<SearchedData
showOnboardingTemplate