diff --git a/openmetadata-ui/src/main/resources/ui/src/assets/svg/icon-add-test.svg b/openmetadata-ui/src/main/resources/ui/src/assets/svg/icon-add-test.svg new file mode 100644 index 00000000000..e3a3ab82c2c --- /dev/null +++ b/openmetadata-ui/src/main/resources/ui/src/assets/svg/icon-add-test.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/openmetadata-ui/src/main/resources/ui/src/components/DatasetDetails/DatasetDetails.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/DatasetDetails/DatasetDetails.component.tsx index a98fcfa287f..e3567a070d6 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/DatasetDetails/DatasetDetails.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/DatasetDetails/DatasetDetails.component.tsx @@ -269,7 +269,7 @@ const DatasetDetails: React.FC = ({ position: 4, }, { - name: 'Profiler', + name: 'Profiler & Data Quality', icon: { alt: 'profiler', name: 'icon-profiler', diff --git a/openmetadata-ui/src/main/resources/ui/src/components/DatasetDetails/DatasetDetails.test.tsx b/openmetadata-ui/src/main/resources/ui/src/components/DatasetDetails/DatasetDetails.test.tsx index 92ab3126503..9d2cee47113 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/DatasetDetails/DatasetDetails.test.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/DatasetDetails/DatasetDetails.test.tsx @@ -272,7 +272,7 @@ describe('Test MyDataDetailsPage page', () => { const activityFeedTab = await findByTestId(tabs, 'Activity Feeds & Tasks'); const sampleDataTab = await findByTestId(tabs, 'Sample Data'); const queriesTab = await findByTestId(tabs, 'Queries'); - const profilerTab = await findByTestId(tabs, 'Profiler'); + const profilerTab = await findByTestId(tabs, 'Profiler & Data Quality'); const lineageTab = await findByTestId(tabs, 'Lineage'); const dbtTab = queryByTestId(tabs, 'DBT'); diff --git a/openmetadata-ui/src/main/resources/ui/src/components/TableProfiler/Component/ColumnProfileTable.test.tsx b/openmetadata-ui/src/main/resources/ui/src/components/TableProfiler/Component/ColumnProfileTable.test.tsx index b937b8162d3..c963a5d715e 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/TableProfiler/Component/ColumnProfileTable.test.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/TableProfiler/Component/ColumnProfileTable.test.tsx @@ -39,6 +39,9 @@ jest.mock('antd', () => ({ .mockImplementation(({ children, ...props }) => (
{children}
)), + Tooltip: jest + .fn() + .mockImplementation(({ children }) => {children}), Table: jest.fn().mockImplementation(({ columns, dataSource }) => ( @@ -102,6 +105,7 @@ const mockProps: ColumnProfileTableProps = { columns: MOCK_TABLE.columns, onAddTestClick: jest.fn, columnTests: [], + hasEditAccess: true, }; describe('Test ColumnProfileTable component', () => { diff --git a/openmetadata-ui/src/main/resources/ui/src/components/TableProfiler/Component/ColumnProfileTable.tsx b/openmetadata-ui/src/main/resources/ui/src/components/TableProfiler/Component/ColumnProfileTable.tsx index 4c5b2bebce3..e3080c40d5b 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/TableProfiler/Component/ColumnProfileTable.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/TableProfiler/Component/ColumnProfileTable.tsx @@ -11,7 +11,7 @@ * limitations under the License. */ -import { Button, Space, Table } from 'antd'; +import { Button, Space, Table, Tooltip } from 'antd'; import { ColumnsType } from 'antd/lib/table'; import { isUndefined } from 'lodash'; import React, { FC, useEffect, useMemo, useState } from 'react'; @@ -21,6 +21,7 @@ import { SECONDARY_COLOR, SUCCESS_COLOR, } from '../../../constants/constants'; +import { NO_PERMISSION_FOR_ACTION } from '../../../constants/HelperTextUtil'; import { DEFAULT_TEST_VALUE, INITIAL_TEST_RESULT_SUMMARY, @@ -32,6 +33,7 @@ import { getAddDataQualityTableTestPath, getProfilerDashboardWithFqnPath, } from '../../../utils/RouterUtils'; +import SVGIcons, { Icons } from '../../../utils/SvgUtils'; import Ellipses from '../../common/Ellipses/Ellipses'; import Searchbar from '../../common/searchbar/Searchbar'; import TestIndicator from '../../common/TestIndicator/TestIndicator'; @@ -43,6 +45,7 @@ import ProfilerProgressWidget from './ProfilerProgressWidget'; const ColumnProfileTable: FC = ({ columnTests, + hasEditAccess, columns = [], }) => { const [searchText, setSearchText] = useState(''); @@ -125,11 +128,19 @@ const ColumnProfileTable: FC = ({ render: (profile: ColumnProfile) => profile?.valuesCount || 0, }, { - title: 'Test', + title: 'Tests', + dataIndex: 'Tests', + key: 'Tests', + render: (_, record) => + columnTestSummary?.[record.fullyQualifiedName || '']?.count || 0, + }, + { + title: 'Status', dataIndex: 'dataQualityTest', key: 'dataQualityTest', render: (_, record) => { - const summary = columnTestSummary?.[record.fullyQualifiedName || '']; + const summary = + columnTestSummary?.[record.fullyQualifiedName || '']?.results; const currentResult = summary ? Object.entries(summary).map(([key, value]) => ({ value, @@ -151,17 +162,28 @@ const ColumnProfileTable: FC = ({ dataIndex: 'actions', key: 'actions', render: (_, record) => ( - - - + + + - + + + @@ -252,6 +257,7 @@ const TableProfilerV1: FC = ({ ...col, key: col.name, }))} + hasEditAccess={hasEditAccess} onAddTestClick={onAddTestClick} /> diff --git a/openmetadata-ui/src/main/resources/ui/src/utils/SvgUtils.tsx b/openmetadata-ui/src/main/resources/ui/src/utils/SvgUtils.tsx index 6007f1ec70d..f345af29926 100644 --- a/openmetadata-ui/src/main/resources/ui/src/utils/SvgUtils.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/utils/SvgUtils.tsx @@ -111,6 +111,7 @@ import IconTrends from '../assets/svg/ic-trends.svg'; import IconUpArrow from '../assets/svg/ic-up-arrow.svg'; import IconVEllipsis from '../assets/svg/ic-v-ellipsis.svg'; import IconWorkflows from '../assets/svg/ic-workflows.svg'; +import IconAddTest from '../assets/svg/icon-add-test.svg'; import IconChevronDown from '../assets/svg/icon-chevron-down.svg'; import IconCopy from '../assets/svg/icon-copy.svg'; import IconDown from '../assets/svg/icon-down.svg'; @@ -228,6 +229,7 @@ export const Icons = { LINEAGE: 'icon-lineage', MANAGE: 'icon-manage', HOME: 'icon-home', + ADD_TEST: 'icon-add-test', GROWTH_ARROW: 'icon-growth-arrow', LOSS_ARROW: 'icon-loss-arrow', CHECK_CIRCLE: 'icon-check-circle', @@ -420,6 +422,10 @@ const SVGIcons: FunctionComponent = ({ case Icons.LOGO_SMALL: IconComponent = LogoMonogram; + break; + case Icons.ADD_TEST: + IconComponent = IconAddTest; + break; case Icons.WELCOME_POPPER: IconComponent = IconWelcomePopper;