X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/8095c4a7852131043b682b809ed78ca65386dd30..44821dc84765936ce99fa2d760ef683281f0a578:/src/views-components/context-menu/actions/collection-copy-to-clipboard-action.tsx

diff --git a/src/views-components/context-menu/actions/collection-copy-to-clipboard-action.tsx b/src/views-components/context-menu/actions/collection-copy-to-clipboard-action.tsx
index f6038b8010..c92f7bc88b 100644
--- a/src/views-components/context-menu/actions/collection-copy-to-clipboard-action.tsx
+++ b/src/views-components/context-menu/actions/collection-copy-to-clipboard-action.tsx
@@ -4,15 +4,19 @@
 
 import { connect } from "react-redux";
 import { RootState } from "../../../store/store";
-import { getNodeValue } from "~/models/tree";
-import { ContextMenuKind } from '~/views-components/context-menu/context-menu';
+import { getNodeValue } from "models/tree";
+import { ContextMenuKind } from 'views-components/context-menu/context-menu';
 import { CopyToClipboardAction } from "./copy-to-clipboard-action";
 
 const mapStateToProps = (state: RootState) => {
     const { resource } = state.contextMenu;
     const currentCollectionUuid = state.collectionPanel.item ? state.collectionPanel.item.uuid : '';
     const { keepWebServiceUrl } = state.auth.config;
-    if (resource && resource.menuKind === ContextMenuKind.COLLECTION_FILES_ITEM) {
+    if (resource && [
+        ContextMenuKind.COLLECTION_FILE_ITEM,
+        ContextMenuKind.READONLY_COLLECTION_FILE_ITEM,
+        ContextMenuKind.COLLECTION_DIRECTORY_ITEM,
+        ContextMenuKind.READONLY_COLLECTION_DIRECTORY_ITEM ].indexOf(resource.menuKind as ContextMenuKind) > -1) {
         const file = getNodeValue(resource.uuid)(state.collectionPanelFiles);
         if (file) {
             return {
@@ -21,10 +25,8 @@ const mapStateToProps = (state: RootState) => {
                 currentCollectionUuid
             };
         }
-    } else {
-        return ;
     }
-    return ;
+    return {};
 };
 
 export const CollectionCopyToClipboardAction = connect(mapStateToProps)(CopyToClipboardAction);
