mirror of
https://github.com/datahub-project/datahub.git
synced 2025-11-11 00:42:29 +00:00
feat(ui): Allow copying assertion urn from the UI (#9523)
This commit is contained in:
parent
c804b3c1aa
commit
cfb4d2f95f
@ -0,0 +1,16 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import { Menu } from 'antd';
|
||||||
|
import CopyUrnMenuItem from '../../../../../shared/share/items/CopyUrnMenuItem';
|
||||||
|
|
||||||
|
|
||||||
|
interface AssertionMenuProps {
|
||||||
|
urn: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export default function AssertionMenu({urn} : AssertionMenuProps){
|
||||||
|
return (
|
||||||
|
<Menu>
|
||||||
|
<CopyUrnMenuItem key="1" urn={urn} type="Assertion" />
|
||||||
|
</Menu>
|
||||||
|
);
|
||||||
|
}
|
||||||
@ -1,7 +1,7 @@
|
|||||||
import { Button, Empty, Image, message, Modal, Tag, Tooltip, Typography } from 'antd';
|
import { Button, Dropdown, Empty, Image, message, Modal, Tag, Tooltip, Typography } from 'antd';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import styled from 'styled-components';
|
import styled from 'styled-components';
|
||||||
import { DeleteOutlined, DownOutlined, RightOutlined, StopOutlined } from '@ant-design/icons';
|
import { DeleteOutlined, DownOutlined, MoreOutlined, RightOutlined, StopOutlined } from '@ant-design/icons';
|
||||||
import { DatasetAssertionDescription } from './DatasetAssertionDescription';
|
import { DatasetAssertionDescription } from './DatasetAssertionDescription';
|
||||||
import { StyledTable } from '../../../components/styled/StyledTable';
|
import { StyledTable } from '../../../components/styled/StyledTable';
|
||||||
import { DatasetAssertionDetails } from './DatasetAssertionDetails';
|
import { DatasetAssertionDetails } from './DatasetAssertionDetails';
|
||||||
@ -9,6 +9,7 @@ import { Assertion, AssertionRunStatus } from '../../../../../../types.generated
|
|||||||
import { getResultColor, getResultIcon, getResultText } from './assertionUtils';
|
import { getResultColor, getResultIcon, getResultText } from './assertionUtils';
|
||||||
import { useDeleteAssertionMutation } from '../../../../../../graphql/assertion.generated';
|
import { useDeleteAssertionMutation } from '../../../../../../graphql/assertion.generated';
|
||||||
import { capitalizeFirstLetterOnly } from '../../../../../shared/textUtil';
|
import { capitalizeFirstLetterOnly } from '../../../../../shared/textUtil';
|
||||||
|
import AssertionMenu from './AssertionMenu';
|
||||||
|
|
||||||
const ResultContainer = styled.div`
|
const ResultContainer = styled.div`
|
||||||
display: flex;
|
display: flex;
|
||||||
@ -30,6 +31,10 @@ const PlatformContainer = styled.div`
|
|||||||
margin-right: 8px;
|
margin-right: 8px;
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
const StyledMoreOutlined = styled(MoreOutlined)`
|
||||||
|
font-size: 18px;
|
||||||
|
`;
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
assertions: Array<Assertion>;
|
assertions: Array<Assertion>;
|
||||||
onDelete?: (urn: string) => void;
|
onDelete?: (urn: string) => void;
|
||||||
@ -141,6 +146,14 @@ export const DatasetAssertionsList = ({ assertions, onDelete }: Props) => {
|
|||||||
<Button onClick={() => onDeleteAssertion(record.urn)} type="text" shape="circle" danger>
|
<Button onClick={() => onDeleteAssertion(record.urn)} type="text" shape="circle" danger>
|
||||||
<DeleteOutlined />
|
<DeleteOutlined />
|
||||||
</Button>
|
</Button>
|
||||||
|
<Dropdown
|
||||||
|
overlay={
|
||||||
|
<AssertionMenu urn={record.urn}/>
|
||||||
|
}
|
||||||
|
trigger={['click']}
|
||||||
|
>
|
||||||
|
<StyledMoreOutlined />
|
||||||
|
</Dropdown>
|
||||||
</ActionButtonContainer>
|
</ActionButtonContainer>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user