diff --git a/openmetadata-ui/src/main/resources/ui/src/components/AppRouter/AuthenticatedAppRouter.tsx b/openmetadata-ui/src/main/resources/ui/src/components/AppRouter/AuthenticatedAppRouter.tsx index f8e7cb6e6a2..924de53680f 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/AppRouter/AuthenticatedAppRouter.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/AppRouter/AuthenticatedAppRouter.tsx @@ -447,7 +447,11 @@ const AuthenticatedAppRouter: FunctionComponent = () => { ResourceEntity.TEST_SUITE, permissions )} - path={[ROUTES.DATA_QUALITY_WITH_TAB, ROUTES.DATA_QUALITY]} + path={[ + ROUTES.DATA_QUALITY_WITH_TAB, + ROUTES.DATA_QUALITY, + ROUTES.DATA_QUALITY_WITH_SUB_TAB, + ]} /> { const [form] = useForm(); + const { tab = DataQualityClassBase.getDefaultActiveTab() } = + useParams<{ tab: DataQualityPageTabs }>(); const history = useHistory(); const location = useCustomLocation(); const { t } = useTranslation(); const { permissions } = usePermissionProvider(); - const { - isTestCaseSummaryLoading, - testCaseSummary, - activeTab: tab, - } = useDataQualityProvider(); + const { isTestCaseSummaryLoading, testCaseSummary } = + useDataQualityProvider(); const { testCase: testCasePermission } = permissions; const [tableOptions, setTableOptions] = useState([]); const [isOptionsLoading, setIsOptionsLoading] = useState(false); diff --git a/openmetadata-ui/src/main/resources/ui/src/components/DataQuality/TestSuite/TestSuiteList/TestSuites.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/DataQuality/TestSuite/TestSuiteList/TestSuites.component.tsx index d30d6dedd94..9ce1d2dbba4 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/DataQuality/TestSuite/TestSuiteList/TestSuites.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/DataQuality/TestSuite/TestSuiteList/TestSuites.component.tsx @@ -10,14 +10,24 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { Button, Col, Form, Row, Select, Space, Typography } from 'antd'; +import { + Button, + Col, + Form, + Radio, + RadioChangeEvent, + Row, + Select, + Space, + Typography, +} from 'antd'; import { ColumnsType } from 'antd/lib/table'; import { AxiosError } from 'axios'; import { isEmpty } from 'lodash'; import QueryString from 'qs'; import React, { useCallback, useEffect, useMemo, useState } from 'react'; import { useTranslation } from 'react-i18next'; -import { Link, useHistory } from 'react-router-dom'; +import { Link, useHistory, useParams } from 'react-router-dom'; import { INITIAL_PAGING_VALUE, ROUTES } from '../../../../constants/constants'; import { PROGRESS_BAR_COLOR } from '../../../../constants/TestSuite.constant'; import { usePermissionProvider } from '../../../../context/PermissionProvider/PermissionProvider'; @@ -34,7 +44,10 @@ import { EntityReference } from '../../../../generated/entity/type'; import { TestSuite, TestSummary } from '../../../../generated/tests/testCase'; import { usePaging } from '../../../../hooks/paging/usePaging'; import useCustomLocation from '../../../../hooks/useCustomLocation/useCustomLocation'; -import { DataQualityPageTabs } from '../../../../pages/DataQuality/DataQualityPage.interface'; +import { + DataQualityPageTabs, + DataQualitySubTabs, +} from '../../../../pages/DataQuality/DataQualityPage.interface'; import { useDataQualityProvider } from '../../../../pages/DataQuality/DataQualityProvider'; import { getListTestSuitesBySearch, @@ -43,6 +56,7 @@ import { } from '../../../../rest/testAPI'; import { getEntityName } from '../../../../utils/EntityUtils'; import { + getDataQualityPagePath, getEntityDetailsPath, getTestSuitePath, } from '../../../../utils/RouterUtils'; @@ -61,13 +75,17 @@ import { SummaryPanel } from '../../SummaryPannel/SummaryPanel.component'; export const TestSuites = () => { const { t } = useTranslation(); + const { + tab = DataQualityPageTabs.TEST_CASES, + subTab = DataQualitySubTabs.TABLE_SUITES, + } = useParams<{ + tab?: DataQualityPageTabs; + subTab?: DataQualitySubTabs; + }>(); const history = useHistory(); const location = useCustomLocation(); - const { - isTestCaseSummaryLoading, - testCaseSummary, - activeTab: tab, - } = useDataQualityProvider(); + const { isTestCaseSummaryLoading, testCaseSummary } = + useDataQualityProvider(); const params = useMemo(() => { const search = location.search; @@ -181,6 +199,7 @@ export const TestSuites = () => { return ( @@ -205,9 +224,9 @@ export const TestSuites = () => { q: searchValue ? `*${searchValue}*` : undefined, owner: ownerFilterValue?.key, offset: (currentPage - 1) * pageSize, - includeEmptyTestSuites: tab !== DataQualityPageTabs.TABLES, + includeEmptyTestSuites: subTab !== DataQualitySubTabs.TABLE_SUITES, testSuiteType: - tab === DataQualityPageTabs.TABLES + subTab === DataQualitySubTabs.TABLE_SUITES ? TestSuiteType.basic : TestSuiteType.logical, sortField: 'testCaseResultSummary.timestamp', @@ -251,6 +270,12 @@ export const TestSuites = () => { ); }; + const handleSubTabChange = (e: RadioChangeEvent) => { + history.replace( + getDataQualityPagePath(tab, e.target.value as DataQualitySubTabs) + ); + }; + useEffect(() => { if (testSuitePermission?.ViewAll || testSuitePermission?.ViewBasic) { fetchTestSuites(INITIAL_PAGING_VALUE, { @@ -259,7 +284,7 @@ export const TestSuites = () => { } else { setIsLoading(false); } - }, [testSuitePermission, pageSize, searchValue, owner]); + }, [testSuitePermission, pageSize, searchValue, owner, subTab]); if (!testSuitePermission?.ViewAll && !testSuitePermission?.ViewBasic) { return ( @@ -333,6 +358,27 @@ export const TestSuites = () => { testSummary={testCaseSummary} /> + + + + + + {t('label.table-suite-plural')} + + + {t('label.bundle-suite-plural')} + + + + + handleSearchParam(value, 'searchValue')} + /> + + + { return { diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Database/Profiler/TableProfiler/ProfilerProgressWidget/ProfilerProgressWidget.tsx b/openmetadata-ui/src/main/resources/ui/src/components/Database/Profiler/TableProfiler/ProfilerProgressWidget/ProfilerProgressWidget.tsx index c7319afe7ae..c4773a50ee0 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/Database/Profiler/TableProfiler/ProfilerProgressWidget/ProfilerProgressWidget.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/Database/Profiler/TableProfiler/ProfilerProgressWidget/ProfilerProgressWidget.tsx @@ -12,23 +12,30 @@ */ import { Col, Progress, Row } from 'antd'; +import classNames from 'classnames'; import React from 'react'; import { ProfilerProgressWidgetProps } from '../TableProfiler.interface'; const ProfilerProgressWidget: React.FC = ({ value, strokeColor, + direction = 'left', }) => { const modifedValue = Math.round(value * 100); return ( - +

{`${modifedValue}%`}

- + { - const { tab: activeTab } = useParams<{ tab: DataQualityPageTabs }>(); + const { tab: activeTab = DataQualityClassBase.getDefaultActiveTab() } = + useParams<{ tab: DataQualityPageTabs }>(); const history = useHistory(); const { t } = useTranslation(); - const menuItems: MenuProps['items'] = useMemo(() => { - const data = DataQualityClassBase.getLeftSideBar(); + const menuItems = useMemo(() => { + const data = DataQualityClassBase.getDataQualityTab(); return data.map((value) => { - const SvgIcon = value.icon; + const Component = value.component; return { key: value.key, - label: ( - - ), - icon: , + label: , + children: , }; }); }, []); - const tabDetailsComponent = useMemo(() => { - return DataQualityClassBase.getDataQualityTab(); - }, []); - const extraDropdownContent = useMemo( () => DataQualityClassBase.getManageExtraOptions(activeTab), [activeTab] ); - const handleTabChange: MenuProps['onClick'] = (event) => { - const activeKey = event.key; + const handleTabChange = (activeKey: string) => { if (activeKey !== activeTab) { - history.push(getDataQualityPagePath(activeKey as DataQualityPageTabs)); + history.replace(getDataQualityPagePath(activeKey as DataQualityPageTabs)); } }; return (
- - + + +
+ + {t('label.data-quality')} + + + {t('message.page-sub-header-for-data-quality')} + + + {isEmpty(extraDropdownContent) ? null : ( + + + + )} + + - - ), - }} - pageTitle={t('label.data-quality')} - secondPanel={{ - children: ( - - - - - - {t('label.data-quality')} - - - {t('message.page-sub-header-for-data-quality')} - - - {isEmpty(extraDropdownContent) ? null : ( - - - - )} - - - {tabDetailsComponent.map((tab) => ( - - ))} - - - - - - - - - - ), - className: 'content-resizable-panel-container', - minWidth: 800, - flex: 0.87, - }} - /> + + + + ); }; diff --git a/openmetadata-ui/src/main/resources/ui/src/utils/RouterUtils.ts b/openmetadata-ui/src/main/resources/ui/src/utils/RouterUtils.ts index 0391c7df9d9..39eefab5a08 100644 --- a/openmetadata-ui/src/main/resources/ui/src/utils/RouterUtils.ts +++ b/openmetadata-ui/src/main/resources/ui/src/utils/RouterUtils.ts @@ -487,13 +487,28 @@ export const getGlossaryTermsVersionsPath = ( return path; }; -export const getDataQualityPagePath = (tab?: DataQualityPageTabs) => { - let path = tab ? ROUTES.DATA_QUALITY_WITH_TAB : ROUTES.DATA_QUALITY; +export const getDataQualityPagePath = ( + tab?: DataQualityPageTabs, + subTab?: string +) => { + let path = ROUTES.DATA_QUALITY; + + if (tab) { + path = ROUTES.DATA_QUALITY_WITH_TAB; + } + + if (subTab) { + path = ROUTES.DATA_QUALITY_WITH_SUB_TAB; + } if (tab) { path = path.replace(PLACEHOLDER_ROUTE_TAB, tab); } + if (subTab) { + path = path.replace(PLACEHOLDER_ROUTE_SUB_TAB, subTab); + } + return path; };