Skip to content

Commit

Permalink
feat(ui): entity profile add copy url option update (datahub-project#…
Browse files Browse the repository at this point in the history
  • Loading branch information
ShubhamThakre authored and maggiehays committed Aug 1, 2022
1 parent 226cf9c commit caf42ea
Showing 1 changed file with 15 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ import React, { useState } from 'react';
import {
CheckOutlined,
CopyOutlined,
ExclamationCircleOutlined,
FolderOpenOutlined,
InfoCircleOutlined,
LinkOutlined,
MoreOutlined,
RightOutlined,
} from '@ant-design/icons';
Expand Down Expand Up @@ -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 (
<>
Expand Down Expand Up @@ -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 /> &nbsp; Copy Url
</MenuItem>
</Menu.Item>
<Menu.Item key="1">
{!entityData?.deprecation?.deprecated ? (
<MenuItem onClick={() => setShowAddDeprecationDetailsModal(true)}>
Mark as deprecated
<ExclamationCircleOutlined /> &nbsp; Mark as deprecated
</MenuItem>
) : (
<MenuItem onClick={() => handleUpdateDeprecation(false)}>
Mark as un-deprecated
<ExclamationCircleOutlined /> &nbsp; Mark as un-deprecated
</MenuItem>
)}
</Menu.Item>
Expand Down

0 comments on commit caf42ea

Please sign in to comment.