message: add support for copy enity url in enity page contex menu
diff: @@ -26,12 +26,14 @@ import {
  import { makeStyles } from '@material-ui/core/styles';
  import BugReportIcon from '@material-ui/icons/BugReport';
  import MoreVert from '@material-ui/icons/MoreVert';
  +import FileCopyTwoToneIcon from '@material-ui/icons/FileCopyTwoTone';
  import React, { useState } from 'react';
  import { IconComponent } from '@backstage/core-plugin-api';
  import { useEntityPermission } from '@backstage/plugin-catalog-react';
  import { catalogEntityDeletePermission } from '@backstage/plugin-catalog-common';
  import { BackstageTheme } from '@backstage/theme';
  import { UnregisterEntity, UnregisterEntityOptions } from './UnregisterEntity';
  +import Snackbar from '@material-ui/core/Snackbar';
  /** @public */
  export type EntityContextMenuClassKey = 'button';
  @@ -84,6 +86,22 @@ export function EntityContextMenu(props: EntityContextMenuProps) {
  setAnchorEl(undefined);
  };
  + const [state, setState] = useState({
  + open: false,
  + vertical: 'top',
  + horizontal:'right'
  + });
  +
  + const { open, vertical, horizontal } = state;
  +
  + const handleClose = () => {
  + setState({ ...state, open: false });
  + };
  +
  + const copyToClipboard = () => {
  + navigator.clipboard.writeText(window.location.toString()).then(()=> setState({...state, open:true}));
  + };
  +
  const extraItems = UNSTABLE_extraContextMenuItems && [
  ...UNSTABLE_extraContextMenuItems.map(item => (
  <MenuItem
  @@ -144,6 +162,24 @@ export function EntityContextMenu(props: EntityContextMenuProps) {
  </ListItemIcon>
  <ListItemText primary="Inspect entity" />
  </MenuItem>
  + <MenuItem
  + onClick={() => {
  + copyToClipboard();
  + }}
  + >
  + <ListItemIcon>
  + <FileCopyTwoToneIcon fontSize="small" />
  + </ListItemIcon>
  + <ListItemText primary="Copy entity url" />
  + </MenuItem>
  + <Snackbar
  + anchorOrigin={{ vertical: 'top', horizontal: 'right' }}
  + autoHideDuration={1000}
  + open={open}
  + onClose={handleClose}
  + message="copied!"
  + key={vertical + horizontal}
  + />
  </MenuList>
  </Popover>
  </>
  