X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/ca35c8be981ad0bab1f93de2893cd760be4a472d..cbf153e45314bddf4458a5f8fc02462edc0d0595:/src/views/subprocess-panel/subprocess-panel.tsx

diff --git a/src/views/subprocess-panel/subprocess-panel.tsx b/src/views/subprocess-panel/subprocess-panel.tsx
index cf1de9af..81bd54d4 100644
--- a/src/views/subprocess-panel/subprocess-panel.tsx
+++ b/src/views/subprocess-panel/subprocess-panel.tsx
@@ -4,26 +4,18 @@
 
 import { Dispatch } from "redux";
 import { connect } from "react-redux";
-import { openContextMenu, resourceKindToContextMenuKind } from '~/store/context-menu/context-menu-actions';
+import { openProcessContextMenu } from '~/store/context-menu/context-menu-actions';
 import { SubprocessPanelRoot, SubprocessPanelActionProps, SubprocessPanelDataProps } from '~/views/subprocess-panel/subprocess-panel-root';
-import { ResourceKind } from '~/models/resource';
 import { RootState } from "~/store/store";
 import { navigateTo } from "~/store/navigation/navigation-action";
 import { loadDetailsPanel } from "~/store/details-panel/details-panel-action";
 import { getProcess } from "~/store/processes/process";
 
 const mapDispatchToProps = (dispatch: Dispatch): SubprocessPanelActionProps => ({
-    onContextMenu: (event, resourceUuid, isAdmin) => {
-        const menuKind = resourceKindToContextMenuKind(resourceUuid, isAdmin);
-        const resource = getProcess(resourceUuid);
-        if (menuKind && resource) {
-            dispatch<any>(openContextMenu(event, {
-                name: resource.name,
-                uuid: resourceUuid,
-                ownerUuid: '',
-                kind: ResourceKind.PROCESS,
-                menuKind
-            }));
+    onContextMenu: (event, resourceUuid, resources) => {
+        const process = getProcess(resourceUuid)(resources);
+        if (process) {
+            dispatch<any>(openProcessContextMenu(event, process));
         }
     },
     onItemClick: (uuid: string) => {
@@ -35,7 +27,7 @@ const mapDispatchToProps = (dispatch: Dispatch): SubprocessPanelActionProps => (
 });
 
 const mapStateToProps = (state: RootState): SubprocessPanelDataProps => ({
-    isAdmin: state.auth.user ? state.auth.user.isAdmin : false
+    resources: state.resources
 });
 
 export const SubprocessPanel = connect(mapStateToProps, mapDispatchToProps)(SubprocessPanelRoot);
\ No newline at end of file
