mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-08-24 17:08:28 +00:00
* Improvement #6656 : Edited the text in sample data tab when no data is available * Used antd Empty component to show for no data
This commit is contained in:
parent
383f4497cc
commit
f686f606ca
@ -16,7 +16,7 @@ import {
|
|||||||
faChevronRight,
|
faChevronRight,
|
||||||
} from '@fortawesome/free-solid-svg-icons';
|
} from '@fortawesome/free-solid-svg-icons';
|
||||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
||||||
import { Space } from 'antd';
|
import { Empty, Space } from 'antd';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import { lowerCase } from 'lodash';
|
import { lowerCase } from 'lodash';
|
||||||
import React, {
|
import React, {
|
||||||
@ -26,6 +26,7 @@ import React, {
|
|||||||
useRef,
|
useRef,
|
||||||
useState,
|
useState,
|
||||||
} from 'react';
|
} from 'react';
|
||||||
|
import { Link } from 'react-router-dom';
|
||||||
import { TableData } from '../../generated/entity/data/table';
|
import { TableData } from '../../generated/entity/data/table';
|
||||||
import { withLoader } from '../../hoc/withLoader';
|
import { withLoader } from '../../hoc/withLoader';
|
||||||
import { isEven } from '../../utils/CommonUtils';
|
import { isEven } from '../../utils/CommonUtils';
|
||||||
@ -151,7 +152,26 @@ const SampleDataTable: FunctionComponent<Props> = ({ sampleData }: Props) => {
|
|||||||
</table>
|
</table>
|
||||||
) : (
|
) : (
|
||||||
<div className="tw-flex tw-justify-center tw-font-medium tw-items-center tw-border tw-border-main tw-rounded-md tw-p-8">
|
<div className="tw-flex tw-justify-center tw-font-medium tw-items-center tw-border tw-border-main tw-rounded-md tw-p-8">
|
||||||
No sample data available
|
<Empty
|
||||||
|
description={
|
||||||
|
<>
|
||||||
|
<p>No sample data available</p>
|
||||||
|
<p className="tw-mt-2">
|
||||||
|
To view Sample Data, run the Profiler Ingestion. Please
|
||||||
|
refer to this doc to schedule the{' '}
|
||||||
|
<Link
|
||||||
|
className="tw-ml-1"
|
||||||
|
target="_blank"
|
||||||
|
to={{
|
||||||
|
pathname:
|
||||||
|
'https://docs.open-metadata.org/openmetadata/ingestion/workflows/profiler',
|
||||||
|
}}>
|
||||||
|
Profiler Ingestion
|
||||||
|
</Link>
|
||||||
|
</p>
|
||||||
|
</>
|
||||||
|
}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
@ -37,6 +37,10 @@ const mockSampleData = {
|
|||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
|
jest.mock('react-router-dom', () => ({
|
||||||
|
Link: jest.fn().mockImplementation(({ children }) => <span>{children}</span>),
|
||||||
|
}));
|
||||||
|
|
||||||
describe('Test SampleDataTable Component', () => {
|
describe('Test SampleDataTable Component', () => {
|
||||||
it('Renders all the data that was sent to the component', () => {
|
it('Renders all the data that was sent to the component', () => {
|
||||||
const { container } = render(
|
const { container } = render(
|
||||||
|
@ -20,6 +20,10 @@ const mockSampleData = {
|
|||||||
messages: ['{"email":"data","name":"job"}'],
|
messages: ['{"email":"data","name":"job"}'],
|
||||||
};
|
};
|
||||||
|
|
||||||
|
jest.mock('react-router-dom', () => ({
|
||||||
|
Link: jest.fn().mockImplementation(({ children }) => <span>{children}</span>),
|
||||||
|
}));
|
||||||
|
|
||||||
describe('Test SampleData Component', () => {
|
describe('Test SampleData Component', () => {
|
||||||
it('Should render message cards', () => {
|
it('Should render message cards', () => {
|
||||||
const { getAllByTestId } = render(
|
const { getAllByTestId } = render(
|
||||||
|
@ -12,8 +12,10 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
||||||
|
import { Empty } from 'antd';
|
||||||
import { isUndefined } from 'lodash';
|
import { isUndefined } from 'lodash';
|
||||||
import React, { FC, HTMLAttributes, useState } from 'react';
|
import React, { FC, HTMLAttributes, useState } from 'react';
|
||||||
|
import { Link } from 'react-router-dom';
|
||||||
import { TopicSampleData } from '../../generated/entity/data/topic';
|
import { TopicSampleData } from '../../generated/entity/data/topic';
|
||||||
import { withLoader } from '../../hoc/withLoader';
|
import { withLoader } from '../../hoc/withLoader';
|
||||||
import SchemaEditor from '../schema-editor/SchemaEditor';
|
import SchemaEditor from '../schema-editor/SchemaEditor';
|
||||||
@ -82,7 +84,26 @@ const SampleDataTopic: FC<SampleDataTopicProp> = ({ sampleData }) => {
|
|||||||
<div
|
<div
|
||||||
className="tw-flex tw-justify-center tw-font-medium tw-items-center tw-border tw-border-main tw-rounded-md tw-p-8"
|
className="tw-flex tw-justify-center tw-font-medium tw-items-center tw-border tw-border-main tw-rounded-md tw-p-8"
|
||||||
data-testid="no-data">
|
data-testid="no-data">
|
||||||
No sample data available
|
<Empty
|
||||||
|
description={
|
||||||
|
<>
|
||||||
|
<p>No sample data available</p>
|
||||||
|
<p className="tw-mt-2">
|
||||||
|
To view Sample Data, run the MetaData Ingestion. Please refer to
|
||||||
|
this doc to schedule the{' '}
|
||||||
|
<Link
|
||||||
|
className="tw-ml-1"
|
||||||
|
target="_blank"
|
||||||
|
to={{
|
||||||
|
pathname:
|
||||||
|
'https://docs.open-metadata.org/openmetadata/ingestion/workflows/metadata',
|
||||||
|
}}>
|
||||||
|
MetaData Ingestion
|
||||||
|
</Link>
|
||||||
|
</p>
|
||||||
|
</>
|
||||||
|
}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user