Skip to content

Commit cfb4d2f

Browse files
authored
feat(ui): Allow copying assertion urn from the UI (datahub-project#9523)
1 parent c804b3c commit cfb4d2f

File tree

2 files changed

+31
-2
lines changed

2 files changed

+31
-2
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import React from 'react';
2+
import { Menu } from 'antd';
3+
import CopyUrnMenuItem from '../../../../../shared/share/items/CopyUrnMenuItem';
4+
5+
6+
interface AssertionMenuProps {
7+
urn: string;
8+
}
9+
10+
export default function AssertionMenu({urn} : AssertionMenuProps){
11+
return (
12+
<Menu>
13+
<CopyUrnMenuItem key="1" urn={urn} type="Assertion" />
14+
</Menu>
15+
);
16+
}

datahub-web-react/src/app/entity/shared/tabs/Dataset/Validations/DatasetAssertionsList.tsx

+15-2
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1-
import { Button, Empty, Image, message, Modal, Tag, Tooltip, Typography } from 'antd';
1+
import { Button, Dropdown, Empty, Image, message, Modal, Tag, Tooltip, Typography } from 'antd';
22
import React from 'react';
33
import styled from 'styled-components';
4-
import { DeleteOutlined, DownOutlined, RightOutlined, StopOutlined } from '@ant-design/icons';
4+
import { DeleteOutlined, DownOutlined, MoreOutlined, RightOutlined, StopOutlined } from '@ant-design/icons';
55
import { DatasetAssertionDescription } from './DatasetAssertionDescription';
66
import { StyledTable } from '../../../components/styled/StyledTable';
77
import { DatasetAssertionDetails } from './DatasetAssertionDetails';
88
import { Assertion, AssertionRunStatus } from '../../../../../../types.generated';
99
import { getResultColor, getResultIcon, getResultText } from './assertionUtils';
1010
import { useDeleteAssertionMutation } from '../../../../../../graphql/assertion.generated';
1111
import { capitalizeFirstLetterOnly } from '../../../../../shared/textUtil';
12+
import AssertionMenu from './AssertionMenu';
1213

1314
const ResultContainer = styled.div`
1415
display: flex;
@@ -30,6 +31,10 @@ const PlatformContainer = styled.div`
3031
margin-right: 8px;
3132
`;
3233

34+
const StyledMoreOutlined = styled(MoreOutlined)`
35+
font-size: 18px;
36+
`;
37+
3338
type Props = {
3439
assertions: Array<Assertion>;
3540
onDelete?: (urn: string) => void;
@@ -141,6 +146,14 @@ export const DatasetAssertionsList = ({ assertions, onDelete }: Props) => {
141146
<Button onClick={() => onDeleteAssertion(record.urn)} type="text" shape="circle" danger>
142147
<DeleteOutlined />
143148
</Button>
149+
<Dropdown
150+
overlay={
151+
<AssertionMenu urn={record.urn}/>
152+
}
153+
trigger={['click']}
154+
>
155+
<StyledMoreOutlined />
156+
</Dropdown>
144157
</ActionButtonContainer>
145158
),
146159
},

0 commit comments

Comments
 (0)