diff --git a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/DataQualityAndProfiler.spec.js b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/DataQualityAndProfiler.spec.js index 85d0ee1c2c4..38e70d02517 100644 --- a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/DataQualityAndProfiler.spec.js +++ b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/DataQualityAndProfiler.spec.js @@ -192,10 +192,10 @@ describe('Data Quality and Profiler should work properly', () => { verifyResponseStatusCode('@getEntityDetails', 200); - verifyResponseStatusCode('@testCase', 200); cy.get('[data-testid="profiler-tab-left-panel"]') .contains('Data Quality') .click(); + verifyResponseStatusCode('@testCase', 200); cy.contains(NEW_TABLE_TEST_CASE.name).should('be.visible'); }); @@ -341,10 +341,10 @@ describe('Data Quality and Profiler should work properly', () => { it('Edit column test case should work properly', () => { interceptURL('GET', '/api/v1/dataQuality/testCases?*', 'testCase'); goToProfilerTab(); - verifyResponseStatusCode('@testCase', 200); cy.get('[data-testid="profiler-tab-left-panel"]') .contains('Column Profile') .click(); + verifyResponseStatusCode('@testCase', 200); cy.get('[data-testid="id-test-count"]') .scrollIntoView() .should('be.visible') @@ -385,11 +385,11 @@ describe('Data Quality and Profiler should work properly', () => { it('Delete Column Test Case should work properly', () => { interceptURL('GET', '/api/v1/dataQuality/testCases?*', 'testCase'); goToProfilerTab(); - verifyResponseStatusCode('@testCase', 200); cy.get('[data-testid="profiler-tab-left-panel"]') .contains('Column Profile') .should('be.visible') .click(); + verifyResponseStatusCode('@testCase', 200); cy.get('[data-testid="id-test-count"]') .scrollIntoView() .should('be.visible') diff --git a/openmetadata-ui/src/main/resources/ui/src/components/TableProfiler/TableProfilerV1.tsx b/openmetadata-ui/src/main/resources/ui/src/components/TableProfiler/TableProfilerV1.tsx index a0d598cdd8b..d4f7cc2fdb6 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/TableProfiler/TableProfilerV1.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/TableProfiler/TableProfilerV1.tsx @@ -28,12 +28,12 @@ import { DefaultOptionType } from 'antd/lib/select'; import { ReactComponent as DropDownIcon } from 'assets/svg/DropDown.svg'; import { AxiosError } from 'axios'; import classNames from 'classnames'; +import { SummaryCard } from 'components/common/SummaryCard/SummaryCard.component'; +import { SummaryCardProps } from 'components/common/SummaryCard/SummaryCard.interface'; import DatePickerMenu from 'components/DatePickerMenu/DatePickerMenu.component'; import { DateRangeObject } from 'components/ProfilerDashboard/component/TestSummary'; import TabsLabel from 'components/TabsLabel/TabsLabel.component'; import { useTourProvider } from 'components/TourProvider/TourProvider'; -import { SummaryCard } from 'components/common/SummaryCard/SummaryCard.component'; -import { SummaryCardProps } from 'components/common/SummaryCard/SummaryCard.interface'; import { mockDatasetData } from 'constants/mockTourData.constants'; import { Column } from 'generated/entity/data/container'; import { @@ -58,18 +58,18 @@ import React, { import { useTranslation } from 'react-i18next'; import { Link, useHistory, useLocation, useParams } from 'react-router-dom'; import { getLatestTableProfileByFqn } from 'rest/tableAPI'; -import { ListTestCaseParams, getListTestCase } from 'rest/testAPI'; +import { getListTestCase, ListTestCaseParams } from 'rest/testAPI'; import { ReactComponent as ColumnProfileIcon } from '../../assets/svg/column-profile.svg'; import { ReactComponent as DataQualityIcon } from '../../assets/svg/data-quality.svg'; import { ReactComponent as SettingIcon } from '../../assets/svg/ic-settings-primery.svg'; import { ReactComponent as NoDataIcon } from '../../assets/svg/no-data-icon.svg'; import { ReactComponent as TableProfileIcon } from '../../assets/svg/table-profile.svg'; -import { PAGE_HEADERS } from '../../constants/PageHeaders.constant'; import { API_RES_MAX_SIZE } from '../../constants/constants'; +import { PAGE_HEADERS } from '../../constants/PageHeaders.constant'; import { + allowedServiceForOperationGraph, DEFAULT_RANGE_DATA, INITIAL_TEST_RESULT_SUMMARY, - allowedServiceForOperationGraph, } from '../../constants/profiler.constant'; import { ProfilerDashboardType } from '../../enums/table.enum'; import { ProfileSampleType, Table } from '../../generated/entity/data/table'; @@ -79,8 +79,8 @@ import { updateTestResults } from '../../utils/DataQualityAndProfilerUtils'; import { getAddDataQualityTableTestPath } from '../../utils/RouterUtils'; import { generateEntityLink } from '../../utils/TableUtils'; import { showErrorToast } from '../../utils/ToastUtils'; -import { TableProfilerTab } from '../ProfilerDashboard/profilerDashboard.interface'; import PageHeader from '../header/PageHeader.component'; +import { TableProfilerTab } from '../ProfilerDashboard/profilerDashboard.interface'; import ColumnPickerMenu from './Component/ColumnPickerMenu'; import ColumnProfileTable from './Component/ColumnProfileTable'; import ColumnSummary from './Component/ColumnSummary'; @@ -462,10 +462,17 @@ const TableProfilerV1: FC = ({ }, [activeColumnFqn, columnTests]); useEffect(() => { - if (!isUndefined(table) && viewTest && !isTourOpen) { + const fetchTest = + !isUndefined(table) && + viewTest && + !isTourOpen && + !isTableProfile && + isEmpty(allTests.current); + + if (fetchTest) { fetchAllTests(); } - }, [table, viewTest, isTourOpen]); + }, [table, viewTest, isTourOpen, isTableProfile, allTests]); useEffect(() => { if (!isTableDeleted && datasetFQN && !isTourOpen) { diff --git a/openmetadata-ui/src/main/resources/ui/src/components/TestCaseCommonTabContainer/TestCaseCommonTabContainer.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/TestCaseCommonTabContainer/TestCaseCommonTabContainer.component.tsx deleted file mode 100644 index 8dedb96e671..00000000000 --- a/openmetadata-ui/src/main/resources/ui/src/components/TestCaseCommonTabContainer/TestCaseCommonTabContainer.component.tsx +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright 2022 Collate. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { Button, Col, Row } from 'antd'; -import { isUndefined } from 'lodash'; -import React from 'react'; -import { PAGE_SIZE } from '../../constants/constants'; -import { Paging } from '../../generated/type/paging'; -import NextPrevious from '../common/next-previous/NextPrevious'; - -interface Props { - buttonName: string; - hasAccess: boolean; - showButton?: boolean; - children?: JSX.Element; - paging?: Paging; - onButtonClick?: () => void; - currentPage?: number; - testCasePageHandler?: ( - cursorValue: string | number, - activePage?: number | undefined - ) => void; - isPaging?: boolean; -} - -const TestCaseCommonTabContainer = ({ - buttonName, - children, - paging, - currentPage, - testCasePageHandler, - onButtonClick, - showButton = true, - isPaging = false, - hasAccess, -}: Props) => { - const NextPreviousComponent = () => { - if ( - isPaging && - !isUndefined(paging) && - paging?.total > PAGE_SIZE && - !isUndefined(currentPage) && - testCasePageHandler - ) { - return ( - - - - ); - } - - return null; - }; - - return ( - - {showButton && ( - - {hasAccess && ( - - )} - - )} - {children} - - - ); -}; - -export default TestCaseCommonTabContainer; diff --git a/openmetadata-ui/src/main/resources/ui/src/components/TestSuite/TestSuitePipelineTab/TestSuitePipelineTab.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/TestSuite/TestSuitePipelineTab/TestSuitePipelineTab.component.tsx index ebb5951e0ab..bede8aab121 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/TestSuite/TestSuitePipelineTab/TestSuitePipelineTab.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/TestSuite/TestSuitePipelineTab/TestSuitePipelineTab.component.tsx @@ -12,7 +12,7 @@ */ import { CheckOutlined, PlusOutlined } from '@ant-design/icons'; -import { Button, Col, Popover, Row, Space, Table, Tooltip } from 'antd'; +import { Button, Popover, Row, Space, Table, Tooltip } from 'antd'; import { ColumnsType } from 'antd/lib/table'; import { ReactComponent as ExternalLinkIcon } from 'assets/svg/external-links.svg'; import { AxiosError } from 'axios'; @@ -24,7 +24,6 @@ import EntityDeleteModal from 'components/Modals/EntityDeleteModal/EntityDeleteM import KillIngestionModal from 'components/Modals/KillIngestionPipelineModal/KillIngestionPipelineModal'; import { usePermissionProvider } from 'components/PermissionProvider/PermissionProvider'; import { ResourceEntity } from 'components/PermissionProvider/PermissionProvider.interface'; -import TestCaseCommonTabContainer from 'components/TestCaseCommonTabContainer/TestCaseCommonTabContainer.component'; import cronstrue from 'cronstrue'; import { ERROR_PLACEHOLDER_TYPE } from 'enums/common.enum'; import { EntityType } from 'enums/entity.enum'; @@ -605,41 +604,29 @@ const TestSuitePipelineTab = ({ testSuite }: Props) => { } return ( - { - history.push(getTestSuiteIngestionPath(testSuiteFQN)); - }}> - - ({ - ...test, - key: test.name, - }))} - locale={{ emptyText: errorPlaceholder }} - pagination={false} - rowKey="name" - scroll={{ x: 1200 }} - size="small" - /> - - handleDelete(deleteSelection.id, deleteSelection.name) - } - /> - - +
+
({ + ...test, + key: test.name, + }))} + locale={{ emptyText: errorPlaceholder }} + pagination={false} + rowKey="name" + scroll={{ x: 1200 }} + size="small" + /> + handleDelete(deleteSelection.id, deleteSelection.name)} + /> + ); }; diff --git a/openmetadata-ui/src/main/resources/ui/src/pages/TestSuiteIngestionPage/TestSuiteIngestionPage.tsx b/openmetadata-ui/src/main/resources/ui/src/pages/TestSuiteIngestionPage/TestSuiteIngestionPage.tsx index d8cf5c9a231..157f6e6c360 100644 --- a/openmetadata-ui/src/main/resources/ui/src/pages/TestSuiteIngestionPage/TestSuiteIngestionPage.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/pages/TestSuiteIngestionPage/TestSuiteIngestionPage.tsx @@ -30,10 +30,7 @@ import { getTestSuiteByName } from 'rest/testAPI'; import { getEntityName } from 'utils/EntityUtils'; import { IngestionPipeline } from '../../generated/entity/services/ingestionPipelines/ingestionPipeline'; import { TestSuite } from '../../generated/tests/testSuite'; -import { - getDataQualityPagePath, - getTestSuitePath, -} from '../../utils/RouterUtils'; +import { getDataQualityPagePath } from '../../utils/RouterUtils'; import { showErrorToast } from '../../utils/ToastUtils'; const TestSuiteIngestionPage = () => { @@ -111,7 +108,7 @@ const TestSuiteIngestionPage = () => { }; const handleCancelBtn = () => { - history.push(getTestSuitePath(testSuiteFQN || '')); + history.goBack(); }; useEffect(() => {