[ARVADOS-WORKBENCH2] created: 1.3.0-122-g445787c

Git user git at public.curoverse.com
Fri Dec 14 06:27:26 EST 2018


        at  445787c80c5abc9949133f45c3d9540b426fc046 (commit)


commit 445787c80c5abc9949133f45c3d9540b426fc046
Author: Pawel Kowalczyk <pawel.kowalczyk at contractors.roche.com>
Date:   Fri Dec 14 12:25:39 2018 +0100

    -14614-added-output-and-remove-functionality-inside-process-menu
    
    Feature #14614
    
    Arvados-DCO-1.1-Signed-off-by: Pawel Kowalczyk <pawel.kowalczyk at contractors.roche.com>

diff --git a/src/store/context-menu/context-menu-actions.ts b/src/store/context-menu/context-menu-actions.ts
index e9b08a8..06d1018 100644
--- a/src/store/context-menu/context-menu-actions.ts
+++ b/src/store/context-menu/context-menu-actions.ts
@@ -19,6 +19,7 @@ import { VirtualMachinesResource } from '~/models/virtual-machines';
 import { KeepServiceResource } from '~/models/keep-services';
 import { NodeResource } from '~/models/node';
 import { ApiClientAuthorization } from '~/models/api-client-authorization';
+import { ProcessResource } from '~/models/process';
 
 export const contextMenuActions = unionize({
     OPEN_CONTEXT_MENU: ofType<{ position: ContextMenuPosition, resource: ContextMenuResource }>(),
@@ -35,7 +36,7 @@ export type ContextMenuResource = {
     kind: ResourceKind,
     menuKind: ContextMenuKind;
     isTrashed?: boolean;
-    index?: number
+    outputUuid?: string;
 };
 
 export const isKeyboardClick = (event: React.MouseEvent<HTMLElement>) => event.nativeEvent.detail === 0;
@@ -122,7 +123,7 @@ export const openComputeNodeContextMenu = (event: React.MouseEvent<HTMLElement>,
         }));
     };
 
-export const openApiClientAuthorizationContextMenu = 
+export const openApiClientAuthorizationContextMenu =
     (event: React.MouseEvent<HTMLElement>, apiClientAuthorization: ApiClientAuthorization) =>
         (dispatch: Dispatch) => {
             dispatch<any>(openContextMenu(event, {
@@ -178,15 +179,18 @@ export const openSidePanelContextMenu = (event: React.MouseEvent<HTMLElement>, i
 
 export const openProcessContextMenu = (event: React.MouseEvent<HTMLElement>, process: Process) =>
     (dispatch: Dispatch, getState: () => RootState) => {
-        const resource = {
-            uuid: process.containerRequest.uuid,
-            ownerUuid: process.containerRequest.ownerUuid,
-            kind: ResourceKind.PROCESS,
-            name: process.containerRequest.name,
-            description: process.containerRequest.description,
-            menuKind: ContextMenuKind.PROCESS
-        };
-        dispatch<any>(openContextMenu(event, resource));
+        const res = getResource<ProcessResource>(process.containerRequest.uuid)(getState().resources);
+        if (res) {
+            dispatch<any>(openContextMenu(event, {
+                uuid: res.uuid,
+                ownerUuid: res.ownerUuid,
+                kind: ResourceKind.PROCESS,
+                name: res.name,
+                description: res.description,
+                outputUuid: res.outputUuid || '',
+                menuKind: ContextMenuKind.PROCESS
+            }));
+        }
     };
 
 export const resourceKindToContextMenuKind = (uuid: string) => {
diff --git a/src/views-components/context-menu/action-sets/process-action-set.ts b/src/views-components/context-menu/action-sets/process-action-set.ts
index 2d15254..1a2e49d 100644
--- a/src/views-components/context-menu/action-sets/process-action-set.ts
+++ b/src/views-components/context-menu/action-sets/process-action-set.ts
@@ -15,11 +15,12 @@ import { openMoveProcessDialog } from '~/store/processes/process-move-actions';
 import { openProcessUpdateDialog } from "~/store/processes/process-update-actions";
 import { openCopyProcessDialog } from '~/store/processes/process-copy-actions';
 import { openProcessCommandDialog } from '~/store/processes/process-command-actions';
-import { detailsPanelActions } from '~/store/details-panel/details-panel-action';
 import { openSharingDialog } from "~/store/sharing-dialog/sharing-dialog-actions";
 import { openAdvancedTabDialog } from "~/store/advanced-tab/advanced-tab";
 import { openProcessInputDialog } from "~/store/processes/process-input-actions";
 import { toggleDetailsPanel } from '~/store/details-panel/details-panel-action';
+import { openRemoveProcessDialog } from "~/store/processes/processes-actions";
+import { navigateToOutput } from "~/store/process-panel/process-panel-actions";
 
 export const processActionSet: ContextMenuActionSet = [[
     {
@@ -76,7 +77,7 @@ export const processActionSet: ContextMenuActionSet = [[
         icon: OutputIcon,
         name: "Outputs",
         execute: (dispatch, resource) => {
-            // add code
+            dispatch<any>(navigateToOutput(resource.outputUuid || ''));
         }
     },
     {
@@ -113,12 +114,12 @@ export const processActionSet: ContextMenuActionSet = [[
         execute: (dispatch, resource) => {
             dispatch<any>(openAdvancedTabDialog(resource.uuid));
         }
+    },
+    {
+        name: "Remove",
+        icon: RemoveIcon,
+        execute: (dispatch, resource) => {
+            dispatch<any>(openRemoveProcessDialog(resource.uuid));
+        }
     }
-    // {
-    //     icon: RemoveIcon,
-    //     name: "Remove",
-    //     execute: (dispatch, resource) => {
-    //         // add code
-    //     }
-    // }
 ]];

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list