mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-09-26 17:34:41 +00:00
ui: fixed ingestion button redirection issue, testCase api call issue (#12575)
* ui: fixed ingestion button redirection issue, testCase api call issue * cypress fixed
This commit is contained in:
parent
0cdf2aa597
commit
80e2fc37d0
@ -192,10 +192,10 @@ describe('Data Quality and Profiler should work properly', () => {
|
|||||||
|
|
||||||
verifyResponseStatusCode('@getEntityDetails', 200);
|
verifyResponseStatusCode('@getEntityDetails', 200);
|
||||||
|
|
||||||
verifyResponseStatusCode('@testCase', 200);
|
|
||||||
cy.get('[data-testid="profiler-tab-left-panel"]')
|
cy.get('[data-testid="profiler-tab-left-panel"]')
|
||||||
.contains('Data Quality')
|
.contains('Data Quality')
|
||||||
.click();
|
.click();
|
||||||
|
verifyResponseStatusCode('@testCase', 200);
|
||||||
cy.contains(NEW_TABLE_TEST_CASE.name).should('be.visible');
|
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', () => {
|
it('Edit column test case should work properly', () => {
|
||||||
interceptURL('GET', '/api/v1/dataQuality/testCases?*', 'testCase');
|
interceptURL('GET', '/api/v1/dataQuality/testCases?*', 'testCase');
|
||||||
goToProfilerTab();
|
goToProfilerTab();
|
||||||
verifyResponseStatusCode('@testCase', 200);
|
|
||||||
cy.get('[data-testid="profiler-tab-left-panel"]')
|
cy.get('[data-testid="profiler-tab-left-panel"]')
|
||||||
.contains('Column Profile')
|
.contains('Column Profile')
|
||||||
.click();
|
.click();
|
||||||
|
verifyResponseStatusCode('@testCase', 200);
|
||||||
cy.get('[data-testid="id-test-count"]')
|
cy.get('[data-testid="id-test-count"]')
|
||||||
.scrollIntoView()
|
.scrollIntoView()
|
||||||
.should('be.visible')
|
.should('be.visible')
|
||||||
@ -385,11 +385,11 @@ describe('Data Quality and Profiler should work properly', () => {
|
|||||||
it('Delete Column Test Case should work properly', () => {
|
it('Delete Column Test Case should work properly', () => {
|
||||||
interceptURL('GET', '/api/v1/dataQuality/testCases?*', 'testCase');
|
interceptURL('GET', '/api/v1/dataQuality/testCases?*', 'testCase');
|
||||||
goToProfilerTab();
|
goToProfilerTab();
|
||||||
verifyResponseStatusCode('@testCase', 200);
|
|
||||||
cy.get('[data-testid="profiler-tab-left-panel"]')
|
cy.get('[data-testid="profiler-tab-left-panel"]')
|
||||||
.contains('Column Profile')
|
.contains('Column Profile')
|
||||||
.should('be.visible')
|
.should('be.visible')
|
||||||
.click();
|
.click();
|
||||||
|
verifyResponseStatusCode('@testCase', 200);
|
||||||
cy.get('[data-testid="id-test-count"]')
|
cy.get('[data-testid="id-test-count"]')
|
||||||
.scrollIntoView()
|
.scrollIntoView()
|
||||||
.should('be.visible')
|
.should('be.visible')
|
||||||
|
@ -28,12 +28,12 @@ import { DefaultOptionType } from 'antd/lib/select';
|
|||||||
import { ReactComponent as DropDownIcon } from 'assets/svg/DropDown.svg';
|
import { ReactComponent as DropDownIcon } from 'assets/svg/DropDown.svg';
|
||||||
import { AxiosError } from 'axios';
|
import { AxiosError } from 'axios';
|
||||||
import classNames from 'classnames';
|
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 DatePickerMenu from 'components/DatePickerMenu/DatePickerMenu.component';
|
||||||
import { DateRangeObject } from 'components/ProfilerDashboard/component/TestSummary';
|
import { DateRangeObject } from 'components/ProfilerDashboard/component/TestSummary';
|
||||||
import TabsLabel from 'components/TabsLabel/TabsLabel.component';
|
import TabsLabel from 'components/TabsLabel/TabsLabel.component';
|
||||||
import { useTourProvider } from 'components/TourProvider/TourProvider';
|
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 { mockDatasetData } from 'constants/mockTourData.constants';
|
||||||
import { Column } from 'generated/entity/data/container';
|
import { Column } from 'generated/entity/data/container';
|
||||||
import {
|
import {
|
||||||
@ -58,18 +58,18 @@ import React, {
|
|||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { Link, useHistory, useLocation, useParams } from 'react-router-dom';
|
import { Link, useHistory, useLocation, useParams } from 'react-router-dom';
|
||||||
import { getLatestTableProfileByFqn } from 'rest/tableAPI';
|
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 ColumnProfileIcon } from '../../assets/svg/column-profile.svg';
|
||||||
import { ReactComponent as DataQualityIcon } from '../../assets/svg/data-quality.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 SettingIcon } from '../../assets/svg/ic-settings-primery.svg';
|
||||||
import { ReactComponent as NoDataIcon } from '../../assets/svg/no-data-icon.svg';
|
import { ReactComponent as NoDataIcon } from '../../assets/svg/no-data-icon.svg';
|
||||||
import { ReactComponent as TableProfileIcon } from '../../assets/svg/table-profile.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 { API_RES_MAX_SIZE } from '../../constants/constants';
|
||||||
|
import { PAGE_HEADERS } from '../../constants/PageHeaders.constant';
|
||||||
import {
|
import {
|
||||||
|
allowedServiceForOperationGraph,
|
||||||
DEFAULT_RANGE_DATA,
|
DEFAULT_RANGE_DATA,
|
||||||
INITIAL_TEST_RESULT_SUMMARY,
|
INITIAL_TEST_RESULT_SUMMARY,
|
||||||
allowedServiceForOperationGraph,
|
|
||||||
} from '../../constants/profiler.constant';
|
} from '../../constants/profiler.constant';
|
||||||
import { ProfilerDashboardType } from '../../enums/table.enum';
|
import { ProfilerDashboardType } from '../../enums/table.enum';
|
||||||
import { ProfileSampleType, Table } from '../../generated/entity/data/table';
|
import { ProfileSampleType, Table } from '../../generated/entity/data/table';
|
||||||
@ -79,8 +79,8 @@ import { updateTestResults } from '../../utils/DataQualityAndProfilerUtils';
|
|||||||
import { getAddDataQualityTableTestPath } from '../../utils/RouterUtils';
|
import { getAddDataQualityTableTestPath } from '../../utils/RouterUtils';
|
||||||
import { generateEntityLink } from '../../utils/TableUtils';
|
import { generateEntityLink } from '../../utils/TableUtils';
|
||||||
import { showErrorToast } from '../../utils/ToastUtils';
|
import { showErrorToast } from '../../utils/ToastUtils';
|
||||||
import { TableProfilerTab } from '../ProfilerDashboard/profilerDashboard.interface';
|
|
||||||
import PageHeader from '../header/PageHeader.component';
|
import PageHeader from '../header/PageHeader.component';
|
||||||
|
import { TableProfilerTab } from '../ProfilerDashboard/profilerDashboard.interface';
|
||||||
import ColumnPickerMenu from './Component/ColumnPickerMenu';
|
import ColumnPickerMenu from './Component/ColumnPickerMenu';
|
||||||
import ColumnProfileTable from './Component/ColumnProfileTable';
|
import ColumnProfileTable from './Component/ColumnProfileTable';
|
||||||
import ColumnSummary from './Component/ColumnSummary';
|
import ColumnSummary from './Component/ColumnSummary';
|
||||||
@ -462,10 +462,17 @@ const TableProfilerV1: FC<TableProfilerProps> = ({
|
|||||||
}, [activeColumnFqn, columnTests]);
|
}, [activeColumnFqn, columnTests]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!isUndefined(table) && viewTest && !isTourOpen) {
|
const fetchTest =
|
||||||
|
!isUndefined(table) &&
|
||||||
|
viewTest &&
|
||||||
|
!isTourOpen &&
|
||||||
|
!isTableProfile &&
|
||||||
|
isEmpty(allTests.current);
|
||||||
|
|
||||||
|
if (fetchTest) {
|
||||||
fetchAllTests();
|
fetchAllTests();
|
||||||
}
|
}
|
||||||
}, [table, viewTest, isTourOpen]);
|
}, [table, viewTest, isTourOpen, isTableProfile, allTests]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!isTableDeleted && datasetFQN && !isTourOpen) {
|
if (!isTableDeleted && datasetFQN && !isTourOpen) {
|
||||||
|
@ -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 (
|
|
||||||
<Col span={24}>
|
|
||||||
<NextPrevious
|
|
||||||
currentPage={currentPage}
|
|
||||||
pageSize={PAGE_SIZE}
|
|
||||||
paging={paging}
|
|
||||||
pagingHandler={testCasePageHandler}
|
|
||||||
totalCount={paging.total}
|
|
||||||
/>
|
|
||||||
</Col>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Row className="tw-mt-4" gutter={[16, 16]}>
|
|
||||||
{showButton && (
|
|
||||||
<Col className="d-flex tw-justify-end" span={24}>
|
|
||||||
{hasAccess && (
|
|
||||||
<Button type="primary" onClick={onButtonClick}>
|
|
||||||
{buttonName}
|
|
||||||
</Button>
|
|
||||||
)}
|
|
||||||
</Col>
|
|
||||||
)}
|
|
||||||
{children}
|
|
||||||
<NextPreviousComponent />
|
|
||||||
</Row>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export default TestCaseCommonTabContainer;
|
|
@ -12,7 +12,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { CheckOutlined, PlusOutlined } from '@ant-design/icons';
|
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 { ColumnsType } from 'antd/lib/table';
|
||||||
import { ReactComponent as ExternalLinkIcon } from 'assets/svg/external-links.svg';
|
import { ReactComponent as ExternalLinkIcon } from 'assets/svg/external-links.svg';
|
||||||
import { AxiosError } from 'axios';
|
import { AxiosError } from 'axios';
|
||||||
@ -24,7 +24,6 @@ import EntityDeleteModal from 'components/Modals/EntityDeleteModal/EntityDeleteM
|
|||||||
import KillIngestionModal from 'components/Modals/KillIngestionPipelineModal/KillIngestionPipelineModal';
|
import KillIngestionModal from 'components/Modals/KillIngestionPipelineModal/KillIngestionPipelineModal';
|
||||||
import { usePermissionProvider } from 'components/PermissionProvider/PermissionProvider';
|
import { usePermissionProvider } from 'components/PermissionProvider/PermissionProvider';
|
||||||
import { ResourceEntity } from 'components/PermissionProvider/PermissionProvider.interface';
|
import { ResourceEntity } from 'components/PermissionProvider/PermissionProvider.interface';
|
||||||
import TestCaseCommonTabContainer from 'components/TestCaseCommonTabContainer/TestCaseCommonTabContainer.component';
|
|
||||||
import cronstrue from 'cronstrue';
|
import cronstrue from 'cronstrue';
|
||||||
import { ERROR_PLACEHOLDER_TYPE } from 'enums/common.enum';
|
import { ERROR_PLACEHOLDER_TYPE } from 'enums/common.enum';
|
||||||
import { EntityType } from 'enums/entity.enum';
|
import { EntityType } from 'enums/entity.enum';
|
||||||
@ -605,41 +604,29 @@ const TestSuitePipelineTab = ({ testSuite }: Props) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<TestCaseCommonTabContainer
|
<div className="m-t-md">
|
||||||
buttonName={t('label.add-entity', {
|
<Table
|
||||||
entity: t('label.ingestion'),
|
bordered
|
||||||
})}
|
columns={pipelineColumns}
|
||||||
hasAccess={createPermission}
|
dataSource={testSuitePipelines.map((test) => ({
|
||||||
showButton={testSuitePipelines.length === 0}
|
...test,
|
||||||
onButtonClick={() => {
|
key: test.name,
|
||||||
history.push(getTestSuiteIngestionPath(testSuiteFQN));
|
}))}
|
||||||
}}>
|
locale={{ emptyText: errorPlaceholder }}
|
||||||
<Col span={24}>
|
pagination={false}
|
||||||
<Table
|
rowKey="name"
|
||||||
bordered
|
scroll={{ x: 1200 }}
|
||||||
columns={pipelineColumns}
|
size="small"
|
||||||
dataSource={testSuitePipelines.map((test) => ({
|
/>
|
||||||
...test,
|
<EntityDeleteModal
|
||||||
key: test.name,
|
entityName={deleteSelection.name}
|
||||||
}))}
|
entityType={t('label.ingestion-lowercase')}
|
||||||
locale={{ emptyText: errorPlaceholder }}
|
loadingState={deleteSelection.state}
|
||||||
pagination={false}
|
visible={isConfirmationModalOpen}
|
||||||
rowKey="name"
|
onCancel={handleCancelConfirmationModal}
|
||||||
scroll={{ x: 1200 }}
|
onConfirm={() => handleDelete(deleteSelection.id, deleteSelection.name)}
|
||||||
size="small"
|
/>
|
||||||
/>
|
</div>
|
||||||
<EntityDeleteModal
|
|
||||||
entityName={deleteSelection.name}
|
|
||||||
entityType={t('label.ingestion-lowercase')}
|
|
||||||
loadingState={deleteSelection.state}
|
|
||||||
visible={isConfirmationModalOpen}
|
|
||||||
onCancel={handleCancelConfirmationModal}
|
|
||||||
onConfirm={() =>
|
|
||||||
handleDelete(deleteSelection.id, deleteSelection.name)
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
</Col>
|
|
||||||
</TestCaseCommonTabContainer>
|
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -30,10 +30,7 @@ import { getTestSuiteByName } from 'rest/testAPI';
|
|||||||
import { getEntityName } from 'utils/EntityUtils';
|
import { getEntityName } from 'utils/EntityUtils';
|
||||||
import { IngestionPipeline } from '../../generated/entity/services/ingestionPipelines/ingestionPipeline';
|
import { IngestionPipeline } from '../../generated/entity/services/ingestionPipelines/ingestionPipeline';
|
||||||
import { TestSuite } from '../../generated/tests/testSuite';
|
import { TestSuite } from '../../generated/tests/testSuite';
|
||||||
import {
|
import { getDataQualityPagePath } from '../../utils/RouterUtils';
|
||||||
getDataQualityPagePath,
|
|
||||||
getTestSuitePath,
|
|
||||||
} from '../../utils/RouterUtils';
|
|
||||||
import { showErrorToast } from '../../utils/ToastUtils';
|
import { showErrorToast } from '../../utils/ToastUtils';
|
||||||
|
|
||||||
const TestSuiteIngestionPage = () => {
|
const TestSuiteIngestionPage = () => {
|
||||||
@ -111,7 +108,7 @@ const TestSuiteIngestionPage = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handleCancelBtn = () => {
|
const handleCancelBtn = () => {
|
||||||
history.push(getTestSuitePath(testSuiteFQN || ''));
|
history.goBack();
|
||||||
};
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user