X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/da85f1807c0223ab3de12448ae75df5482a457d8..30557563fd5fb704554f4d6109493f673ae7f5e5:/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 1dae4a60a1..81bd54d4f7 100644
--- a/src/views/subprocess-panel/subprocess-panel.tsx
+++ b/src/views/subprocess-panel/subprocess-panel.tsx
@@ -4,30 +4,30 @@
 
 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 kind = resourceKindToContextMenuKind(resourceUuid);
-        if (kind) {
-            dispatch<any>(openContextMenu(event, {
-                name: '',
-                uuid: resourceUuid,
-                ownerUuid: '',
-                kind: ResourceKind.PROCESS,
-                menuKind: kind
-            }));
+    onContextMenu: (event, resourceUuid, resources) => {
+        const process = getProcess(resourceUuid)(resources);
+        if (process) {
+            dispatch<any>(openProcessContextMenu(event, process));
         }
     },
-    onItemClick: (resourceUuid: string) => { return; },
-    onItemDoubleClick: uuid => { return; }
+    onItemClick: (uuid: string) => {
+        dispatch<any>(loadDetailsPanel(uuid));
+    },
+    onItemDoubleClick: uuid => {
+        dispatch<any>(navigateTo(uuid));
+    }
 });
 
 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
