mirror of
https://github.com/datahub-project/datahub.git
synced 2025-12-25 17:08:29 +00:00
feat(ownership): add button to copy urn of an Ownership Type (#9452)
This commit is contained in:
parent
eb8cbd8b41
commit
5af799ee89
@ -1,6 +1,6 @@
|
||||
import React from 'react';
|
||||
import { Dropdown, MenuProps, Popconfirm, Typography, message, notification } from 'antd';
|
||||
import { DeleteOutlined, EditOutlined, MoreOutlined } from '@ant-design/icons';
|
||||
import { CopyOutlined, DeleteOutlined, EditOutlined, MoreOutlined } from '@ant-design/icons';
|
||||
import styled from 'styled-components/macro';
|
||||
import { OwnershipTypeEntity } from '../../../../types.generated';
|
||||
import { useDeleteOwnershipTypeMutation } from '../../../../graphql/ownership.generated';
|
||||
@ -48,6 +48,10 @@ export const ActionsColumn = ({ ownershipType, setIsOpen, setOwnershipType, refe
|
||||
setOwnershipType(ownershipType);
|
||||
};
|
||||
|
||||
const onCopy=() => {
|
||||
navigator.clipboard.writeText(ownershipType.urn);
|
||||
}
|
||||
|
||||
const [deleteOwnershipTypeMutation] = useDeleteOwnershipTypeMutation();
|
||||
|
||||
const onDelete = () => {
|
||||
@ -106,6 +110,15 @@ export const ActionsColumn = ({ ownershipType, setIsOpen, setOwnershipType, refe
|
||||
</Popconfirm>
|
||||
),
|
||||
},
|
||||
{
|
||||
key: 'copy',
|
||||
icon: (
|
||||
<MenuButtonContainer>
|
||||
<CopyOutlined />
|
||||
<MenuButtonText>Copy Urn</MenuButtonText>
|
||||
</MenuButtonContainer>
|
||||
),
|
||||
},
|
||||
];
|
||||
|
||||
const onClick: MenuProps['onClick'] = (e) => {
|
||||
@ -113,6 +126,9 @@ export const ActionsColumn = ({ ownershipType, setIsOpen, setOwnershipType, refe
|
||||
if (key === 'edit') {
|
||||
editOnClick();
|
||||
}
|
||||
else if( key === 'copy') {
|
||||
onCopy();
|
||||
}
|
||||
};
|
||||
|
||||
const menuProps: MenuProps = {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user