19153: Update tests
[arvados.git] / src / views-components / context-menu / actions / download-collection-file-action.tsx
index e1986d3cd338454551cc46b9563405d097257ab2..3b1f770220a02a6f8faab446797ead523a5cfafe 100644 (file)
@@ -7,15 +7,17 @@ import { RootState } from "../../../store/store";
 import { DownloadAction } from "./download-action";
 import { getNodeValue } from "../../../models/tree";
 import { ContextMenuKind } from '../context-menu';
-import { filterCollectionFilesBySelection } from "~/store/collection-panel/collection-panel-files/collection-panel-files-state";
+import { filterCollectionFilesBySelection } from "store/collection-panel/collection-panel-files/collection-panel-files-state";
 import { sanitizeToken } from "./helpers";
 
 const mapStateToProps = (state: RootState) => {
     const { resource } = state.contextMenu;
     const currentCollectionUuid = state.collectionPanel.item ? state.collectionPanel.item.uuid : '';
-    if (resource && (
-        resource.menuKind === ContextMenuKind.COLLECTION_FILES_ITEM ||
-        resource.menuKind === ContextMenuKind.READONLY_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 {