mirror of
https://github.com/datahub-project/datahub.git
synced 2025-06-27 05:03:31 +00:00
feat(ui): entity profile add copy url option update (#4821)
This commit is contained in:
parent
34155ca4ad
commit
6610265b68
@ -2,8 +2,10 @@ import React, { useState } from 'react';
|
||||
import {
|
||||
CheckOutlined,
|
||||
CopyOutlined,
|
||||
ExclamationCircleOutlined,
|
||||
FolderOpenOutlined,
|
||||
InfoCircleOutlined,
|
||||
LinkOutlined,
|
||||
MoreOutlined,
|
||||
RightOutlined,
|
||||
} from '@ant-design/icons';
|
||||
@ -238,6 +240,7 @@ export const EntityHeader = ({ showDeprecateOption }: Props) => {
|
||||
const hasDetails = entityData?.deprecation?.note !== '' || entityData?.deprecation?.decommissionTime !== null;
|
||||
const isDividerNeeded = entityData?.deprecation?.note !== '' && entityData?.deprecation?.decommissionTime !== null;
|
||||
const showAdditionalOptions = showDeprecateOption;
|
||||
const pageUrl = window.location.href;
|
||||
|
||||
return (
|
||||
<>
|
||||
@ -334,13 +337,23 @@ export const EntityHeader = ({ showDeprecateOption }: Props) => {
|
||||
overlay={
|
||||
<Menu>
|
||||
<Menu.Item key="0">
|
||||
<MenuItem
|
||||
onClick={() => {
|
||||
navigator.clipboard.writeText(pageUrl);
|
||||
message.info('Copied URL!', 1.2);
|
||||
}}
|
||||
>
|
||||
<LinkOutlined /> Copy Url
|
||||
</MenuItem>
|
||||
</Menu.Item>
|
||||
<Menu.Item key="1">
|
||||
{!entityData?.deprecation?.deprecated ? (
|
||||
<MenuItem onClick={() => setShowAddDeprecationDetailsModal(true)}>
|
||||
Mark as deprecated
|
||||
<ExclamationCircleOutlined /> Mark as deprecated
|
||||
</MenuItem>
|
||||
) : (
|
||||
<MenuItem onClick={() => handleUpdateDeprecation(false)}>
|
||||
Mark as un-deprecated
|
||||
<ExclamationCircleOutlined /> Mark as un-deprecated
|
||||
</MenuItem>
|
||||
)}
|
||||
</Menu.Item>
|
||||
|
Loading…
x
Reference in New Issue
Block a user