X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/0213fdd808604f83ef79d0e0a415d8311e018a2f..4529d3902679b7cb4753cb0c478856e4acb77147:/src/views-components/context-menu/context-menu.tsx

diff --git a/src/views-components/context-menu/context-menu.tsx b/src/views-components/context-menu/context-menu.tsx
index a61690c68e..aeb69de762 100644
--- a/src/views-components/context-menu/context-menu.tsx
+++ b/src/views-components/context-menu/context-menu.tsx
@@ -11,10 +11,11 @@ import { ContextMenuActionSet, ContextMenuAction } from "./context-menu-action-s
 import { Dispatch } from "redux";
 import { memoize } from "lodash";
 import { sortByProperty } from "common/array-utils";
+
 type DataProps = Pick<ContextMenuProps, "anchorEl" | "items" | "open"> & { resource?: ContextMenuResource };
+
 const mapStateToProps = (state: RootState): DataProps => {
     const { open, position, resource } = state.contextMenu;
-
     const filteredItems = getMenuActionSet(resource).map(group =>
         group.filter(item => {
             if (resource && item.filters) {
@@ -42,7 +43,7 @@ const mapDispatchToProps = (dispatch: Dispatch): ActionProps => ({
     onItemClick: (action: ContextMenuAction, resource?: ContextMenuResource) => {
         dispatch(contextMenuActions.CLOSE_CONTEXT_MENU());
         if (resource) {
-            action.execute(dispatch, resource);
+            action.execute(dispatch, [resource]);
         }
     },
 });
@@ -50,7 +51,7 @@ const mapDispatchToProps = (dispatch: Dispatch): ActionProps => ({
 const handleItemClick = memoize(
     (resource: DataProps["resource"], onItemClick: ActionProps["onItemClick"]): ContextMenuProps["onItemClick"] =>
         item => {
-            onItemClick(item, resource);
+            onItemClick(item, { ...resource, fromContextMenu: true } as ContextMenuResource);
         }
 );
 
@@ -87,18 +88,21 @@ export enum ContextMenuKind {
     FAVORITE = "Favorite",
     TRASH = "Trash",
     COLLECTION_FILES = "CollectionFiles",
+    COLLECTION_FILES_MULTIPLE = "CollectionFilesMultiple",
     READONLY_COLLECTION_FILES = "ReadOnlyCollectionFiles",
+    READONLY_COLLECTION_FILES_MULTIPLE = "ReadOnlyCollectionFilesMultiple",
+    COLLECTION_FILES_NOT_SELECTED = "CollectionFilesNotSelected",
     COLLECTION_FILE_ITEM = "CollectionFileItem",
     COLLECTION_DIRECTORY_ITEM = "CollectionDirectoryItem",
     READONLY_COLLECTION_FILE_ITEM = "ReadOnlyCollectionFileItem",
     READONLY_COLLECTION_DIRECTORY_ITEM = "ReadOnlyCollectionDirectoryItem",
-    COLLECTION_FILES_NOT_SELECTED = "CollectionFilesNotSelected",
     COLLECTION = "Collection",
     COLLECTION_ADMIN = "CollectionAdmin",
     READONLY_COLLECTION = "ReadOnlyCollection",
     OLD_VERSION_COLLECTION = "OldVersionCollection",
     TRASHED_COLLECTION = "TrashedCollection",
     PROCESS = "Process",
+    RUNNING_PROCESS_ADMIN = "RunningProcessAdmin",
     PROCESS_ADMIN = "ProcessAdmin",
     RUNNING_PROCESS_RESOURCE = "RunningProcessResource",
     PROCESS_RESOURCE = "ProcessResource",
@@ -114,5 +118,6 @@ export enum ContextMenuKind {
     PERMISSION_EDIT = "PermissionEdit",
     LINK = "Link",
     WORKFLOW = "Workflow",
+    READONLY_WORKFLOW = "ReadOnlyWorkflow",
     SEARCH_RESULTS = "SearchResults",
 }
