mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-09-25 08:50:18 +00:00
Feat: supporting PR for export dashboard (#20672)
* Feat: supporting PR for export dashboard * fixed failing unit test
This commit is contained in:
parent
880a2cd7a8
commit
07256abb0b
@ -10,6 +10,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* 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 TableIcon } from '../../assets/svg/ic-table.svg';
|
||||
import { ReactComponent as TestSuiteIcon } from '../../assets/svg/icon-test-suite.svg';
|
||||
@ -105,6 +106,10 @@ class DataQualityClassBase {
|
||||
public getDefaultActiveTab(): DataQualityPageTabs {
|
||||
return DataQualityPageTabs.TABLES;
|
||||
}
|
||||
|
||||
public getManageExtraOptions(_activeTab: DataQualityPageTabs): ItemType[] {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
const dataQualityClassBase = new DataQualityClassBase();
|
||||
|
@ -52,6 +52,7 @@ jest.mock('./DataQualityClassBase', () => {
|
||||
},
|
||||
]),
|
||||
getDefaultActiveTab: jest.fn().mockReturnValue('tables'),
|
||||
getManageExtraOptions: jest.fn().mockReturnValue([]),
|
||||
};
|
||||
});
|
||||
jest.mock('../../components/common/ResizablePanels/ResizableLeftPanels', () => {
|
||||
|
@ -12,6 +12,7 @@
|
||||
*/
|
||||
|
||||
import { Card, Col, Menu, MenuProps, Row, Typography } from 'antd';
|
||||
import { isEmpty } from 'lodash';
|
||||
import React, { useMemo } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import {
|
||||
@ -21,10 +22,12 @@ import {
|
||||
useHistory,
|
||||
useParams,
|
||||
} from 'react-router-dom';
|
||||
import ManageButton from '../../components/common/EntityPageInfos/ManageButton/ManageButton';
|
||||
import LeftPanelCard from '../../components/common/LeftPanelCard/LeftPanelCard';
|
||||
import ResizableLeftPanels from '../../components/common/ResizablePanels/ResizableLeftPanels';
|
||||
import TabsLabel from '../../components/common/TabsLabel/TabsLabel.component';
|
||||
import { ROUTES } from '../../constants/constants';
|
||||
import { EntityType } from '../../enums/entity.enum';
|
||||
import { withPageLayout } from '../../hoc/withPageLayout';
|
||||
import i18n from '../../utils/i18next/LocalUtil';
|
||||
import { getDataQualityPagePath } from '../../utils/RouterUtils';
|
||||
@ -61,6 +64,11 @@ const DataQualityPage = () => {
|
||||
return DataQualityClassBase.getDataQualityTab();
|
||||
}, []);
|
||||
|
||||
const extraDropdownContent = useMemo(
|
||||
() => DataQualityClassBase.getManageExtraOptions(activeTab),
|
||||
[activeTab]
|
||||
);
|
||||
|
||||
const handleTabChange: MenuProps['onClick'] = (event) => {
|
||||
const activeKey = event.key;
|
||||
if (activeKey !== activeTab) {
|
||||
@ -97,7 +105,7 @@ const DataQualityPage = () => {
|
||||
<Card>
|
||||
<DataQualityProvider>
|
||||
<Row data-testid="data-insight-container" gutter={[0, 16]}>
|
||||
<Col span={24}>
|
||||
<Col span={isEmpty(extraDropdownContent) ? 24 : 23}>
|
||||
<Typography.Title
|
||||
className="m-b-md"
|
||||
data-testid="page-title"
|
||||
@ -110,6 +118,15 @@ const DataQualityPage = () => {
|
||||
{t('message.page-sub-header-for-data-quality')}
|
||||
</Typography.Paragraph>
|
||||
</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}>
|
||||
<Switch>
|
||||
{tabDetailsComponent.map((tab) => (
|
||||
|
Loading…
x
Reference in New Issue
Block a user