Feat: supporting PR for export dashboard (#20672)

* Feat: supporting PR for export dashboard

* fixed failing unit test
This commit is contained in:
Shailesh Parmar 2025-04-08 10:06:03 +05:30 committed by GitHub
parent 880a2cd7a8
commit 07256abb0b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 24 additions and 1 deletions

View File

@ -10,6 +10,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
import { ItemType } from 'antd/lib/menu/hooks/useItems';
import { ReactComponent as TestCaseIcon } from '../../assets/svg/all-activity-v2.svg'; import { ReactComponent as TestCaseIcon } from '../../assets/svg/all-activity-v2.svg';
import { ReactComponent as TableIcon } from '../../assets/svg/ic-table.svg'; import { ReactComponent as TableIcon } from '../../assets/svg/ic-table.svg';
import { ReactComponent as TestSuiteIcon } from '../../assets/svg/icon-test-suite.svg'; import { ReactComponent as TestSuiteIcon } from '../../assets/svg/icon-test-suite.svg';
@ -105,6 +106,10 @@ class DataQualityClassBase {
public getDefaultActiveTab(): DataQualityPageTabs { public getDefaultActiveTab(): DataQualityPageTabs {
return DataQualityPageTabs.TABLES; return DataQualityPageTabs.TABLES;
} }
public getManageExtraOptions(_activeTab: DataQualityPageTabs): ItemType[] {
return [];
}
} }
const dataQualityClassBase = new DataQualityClassBase(); const dataQualityClassBase = new DataQualityClassBase();

View File

@ -52,6 +52,7 @@ jest.mock('./DataQualityClassBase', () => {
}, },
]), ]),
getDefaultActiveTab: jest.fn().mockReturnValue('tables'), getDefaultActiveTab: jest.fn().mockReturnValue('tables'),
getManageExtraOptions: jest.fn().mockReturnValue([]),
}; };
}); });
jest.mock('../../components/common/ResizablePanels/ResizableLeftPanels', () => { jest.mock('../../components/common/ResizablePanels/ResizableLeftPanels', () => {

View File

@ -12,6 +12,7 @@
*/ */
import { Card, Col, Menu, MenuProps, Row, Typography } from 'antd'; import { Card, Col, Menu, MenuProps, Row, Typography } from 'antd';
import { isEmpty } from 'lodash';
import React, { useMemo } from 'react'; import React, { useMemo } from 'react';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
import { import {
@ -21,10 +22,12 @@ import {
useHistory, useHistory,
useParams, useParams,
} from 'react-router-dom'; } from 'react-router-dom';
import ManageButton from '../../components/common/EntityPageInfos/ManageButton/ManageButton';
import LeftPanelCard from '../../components/common/LeftPanelCard/LeftPanelCard'; import LeftPanelCard from '../../components/common/LeftPanelCard/LeftPanelCard';
import ResizableLeftPanels from '../../components/common/ResizablePanels/ResizableLeftPanels'; import ResizableLeftPanels from '../../components/common/ResizablePanels/ResizableLeftPanels';
import TabsLabel from '../../components/common/TabsLabel/TabsLabel.component'; import TabsLabel from '../../components/common/TabsLabel/TabsLabel.component';
import { ROUTES } from '../../constants/constants'; import { ROUTES } from '../../constants/constants';
import { EntityType } from '../../enums/entity.enum';
import { withPageLayout } from '../../hoc/withPageLayout'; import { withPageLayout } from '../../hoc/withPageLayout';
import i18n from '../../utils/i18next/LocalUtil'; import i18n from '../../utils/i18next/LocalUtil';
import { getDataQualityPagePath } from '../../utils/RouterUtils'; import { getDataQualityPagePath } from '../../utils/RouterUtils';
@ -61,6 +64,11 @@ const DataQualityPage = () => {
return DataQualityClassBase.getDataQualityTab(); return DataQualityClassBase.getDataQualityTab();
}, []); }, []);
const extraDropdownContent = useMemo(
() => DataQualityClassBase.getManageExtraOptions(activeTab),
[activeTab]
);
const handleTabChange: MenuProps['onClick'] = (event) => { const handleTabChange: MenuProps['onClick'] = (event) => {
const activeKey = event.key; const activeKey = event.key;
if (activeKey !== activeTab) { if (activeKey !== activeTab) {
@ -97,7 +105,7 @@ const DataQualityPage = () => {
<Card> <Card>
<DataQualityProvider> <DataQualityProvider>
<Row data-testid="data-insight-container" gutter={[0, 16]}> <Row data-testid="data-insight-container" gutter={[0, 16]}>
<Col span={24}> <Col span={isEmpty(extraDropdownContent) ? 24 : 23}>
<Typography.Title <Typography.Title
className="m-b-md" className="m-b-md"
data-testid="page-title" data-testid="page-title"
@ -110,6 +118,15 @@ const DataQualityPage = () => {
{t('message.page-sub-header-for-data-quality')} {t('message.page-sub-header-for-data-quality')}
</Typography.Paragraph> </Typography.Paragraph>
</Col> </Col>
{isEmpty(extraDropdownContent) ? null : (
<Col className="d-flex justify-end" span={1}>
<ManageButton
entityName={EntityType.TEST_CASE}
entityType={EntityType.TEST_CASE}
extraDropdownContent={extraDropdownContent}
/>
</Col>
)}
<Col span={24}> <Col span={24}>
<Switch> <Switch>
{tabDetailsComponent.map((tab) => ( {tabDetailsComponent.map((tab) => (