diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Database/Profiler/DataObservability/DataObservabilityTab.tsx b/openmetadata-ui/src/main/resources/ui/src/components/Database/Profiler/DataObservability/DataObservabilityTab.tsx index fd0e87a95c0..4c63d3a4bbf 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/Database/Profiler/DataObservability/DataObservabilityTab.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/Database/Profiler/DataObservability/DataObservabilityTab.tsx @@ -89,11 +89,7 @@ const DataObservabilityTab = (props: TableProfilerProps) => { 'background-color 0.2s ease-in, color 0.2s ease-in', borderRadius: '6px', }, - '.Mui-selected': { - backgroundColor: `${theme.palette.primary.main} !important`, - color: `${theme.palette.primary.contrastText} !important`, - }, - '.MuiTab-root:hover': { + '.Mui-selected, .MuiTab-root:hover': { backgroundColor: `${theme.palette.primary.main} !important`, color: `${theme.palette.primary.contrastText} !important`, }, diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Database/Profiler/DataQualityTab/DataQualityTab.tsx b/openmetadata-ui/src/main/resources/ui/src/components/Database/Profiler/DataQualityTab/DataQualityTab.tsx index 65b1ba90b57..5be5fdcf6d0 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/Database/Profiler/DataQualityTab/DataQualityTab.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/Database/Profiler/DataQualityTab/DataQualityTab.tsx @@ -82,6 +82,7 @@ const DataQualityTab: React.FC = ({ fetchTestCases, isEditAllowed, tableHeader, + removeTableBorder = false, }: DataQualityTabProps) => { const { t } = useTranslation(); const { getEntityPermissionByFqn } = usePermissionProvider(); @@ -512,7 +513,8 @@ const DataQualityTab: React.FC = ({ Promise; isEditAllowed?: boolean; tableHeader?: ReactNode; + removeTableBorder?: boolean; } export interface TestSummaryProps { diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Database/Profiler/TableProfiler/QualityTab/QualityTab.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/Database/Profiler/TableProfiler/QualityTab/QualityTab.component.tsx index 70854974908..e0b11d63dde 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/Database/Profiler/TableProfiler/QualityTab/QualityTab.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/Database/Profiler/TableProfiler/QualityTab/QualityTab.component.tsx @@ -10,9 +10,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { Grid, Stack } from '@mui/material'; -import { Col, Form, Row, Select, Space, Tabs } from 'antd'; +import { Box, Grid, Stack, Tab, Tabs, useTheme } from '@mui/material'; +import { Col, Form, Row, Select, Space } from 'antd'; import { isEmpty } from 'lodash'; +import QueryString from 'qs'; import { useEffect, useMemo, useState } from 'react'; import { useTranslation } from 'react-i18next'; import { useNavigate } from 'react-router-dom'; @@ -66,6 +67,7 @@ export const QualityTab = () => { testCaseSummary, } = useTableProfiler(); const { getResourceLimit } = useLimitStore(); + const theme = useTheme(); const { currentPage, @@ -91,6 +93,26 @@ export const QualityTab = () => { const location = useCustomLocation(); const { t } = useTranslation(); + const searchData = useMemo(() => { + const param = location.search; + const searchData = QueryString.parse( + param.startsWith('?') ? param.substring(1) : param + ); + + return searchData as { + activeTab: TableProfilerTab; + activeColumnFqn: string; + qualityTab: string; + }; + }, [location.search]); + + const { qualityTab = EntityTabs.TEST_CASES } = searchData; + + const isTestCaseTab = useMemo( + () => qualityTab === EntityTabs.TEST_CASES, + [qualityTab] + ); + const [selectedTestCaseStatus, setSelectedTestCaseStatus] = useState('' as TestCaseStatus); const [selectedTestType, setSelectedTestType] = useState(TestCaseType.all); @@ -235,69 +257,6 @@ export const QualityTab = () => { /> ), key: EntityTabs.TEST_CASES, - children: ( - - - - - - - - - - - - - - - { - await fetchAllTests(...params); // Update current count when Create / Delete operation performed - params?.length && - (await getResourceLimit('dataQuality', true, true)); - }} - breadcrumbData={tableBreadcrumb} - fetchTestCases={handleSortTestCase} - isEditAllowed={editTest} - isLoading={isTestsLoading} - showTableColumn={false} - testCases={allTestCases} - onTestCaseResultUpdate={onTestCaseUpdate} - onTestUpdate={onTestCaseUpdate} - /> - - - {showPagination && ( - - )} - - - ), }, { label: ( @@ -308,7 +267,6 @@ export const QualityTab = () => { /> ), key: EntityTabs.PIPELINE, - children: , }, ], [ @@ -324,11 +282,11 @@ export const QualityTab = () => { ] ); - const handleTabChange = () => { + const handleTabChange = (_: React.SyntheticEvent, tab: string) => { navigate( { pathname: location.pathname, - search: location.search, + search: QueryString.stringify({ ...searchData, qualityTab: tab }), }, { state: undefined, replace: true } ); @@ -360,7 +318,132 @@ export const QualityTab = () => { ))} - + + + + + {tabs.map(({ label, key }) => ( + + ))} + + + {isTestCaseTab && ( + + + + )} + + + {isTestCaseTab && ( +
+ + + + + + + )} +
+ + {isTestCaseTab && ( + +
+ { + await fetchAllTests(...params); // Update current count when Create / Delete operation performed + params?.length && + (await getResourceLimit('dataQuality', true, true)); + }} + breadcrumbData={tableBreadcrumb} + fetchTestCases={handleSortTestCase} + isEditAllowed={editTest} + isLoading={isTestsLoading} + showTableColumn={false} + testCases={allTestCases} + onTestCaseResultUpdate={onTestCaseUpdate} + onTestUpdate={onTestCaseUpdate} + /> + + + {showPagination && ( + + )} + + + )} + + {qualityTab === EntityTabs.PIPELINE && ( + + )} + ); };