Force window resize after open/close details panel because of material-ui issue
[arvados.git] / src / views-components / context-menu / action-sets / process-resource-action-set.ts
index 9deaff961fde49002070b189b5728c42bfa48238..21f3041591c2a828d1fc9bea6370ac03c0a64010 100644 (file)
@@ -9,25 +9,26 @@ import { RenameIcon, ShareIcon, MoveToIcon, CopyIcon, DetailsIcon, RemoveIcon }
 import { favoritePanelActions } from "~/store/favorite-panel/favorite-panel-action";
 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 { detailsPanelActions } from '~/store/details-panel/details-panel-action';
+import { openSharingDialog } from "~/store/sharing-dialog/sharing-dialog-actions";
+import { toggleDetailsPanel } from '~/store/details-panel/details-panel-action';
 
 export const processResourceActionSet: ContextMenuActionSet = [[
     {
         icon: RenameIcon,
         name: "Edit process",
-        execute: (dispatch, resource) => dispatch<any>(openProcessUpdateDialog(resource))
+        execute: (dispatch, resource) => {
+            dispatch<any>(openProcessUpdateDialog(resource));
+        }
     },
     {
         icon: ShareIcon,
         name: "Share",
-        execute: (dispatch, resource) => {
-            // add code
+        execute: (dispatch, { uuid }) => {
+            dispatch<any>(openSharingDialog(uuid));
         }
     },
-    {
-        icon: MoveToIcon,
-        name: "Move to",
-        execute: (dispatch, resource) => dispatch<any>(openMoveProcessDialog(resource))
-    },
     {
         component: ToggleFavoriteAction,
         execute: (dispatch, resource) => {
@@ -37,24 +38,31 @@ export const processResourceActionSet: ContextMenuActionSet = [[
         }
     },
     {
-        icon: CopyIcon,
-        name: "Copy to project",
+        icon: MoveToIcon,
+        name: "Move to",
         execute: (dispatch, resource) => {
-            // add code
+            dispatch<any>(openMoveProcessDialog(resource));
         }
     },
     {
-        icon: DetailsIcon,
-        name: "View details",
+        icon: CopyIcon,
+        name: "Copy to project",
         execute: (dispatch, resource) => {
-            // add code
+            dispatch<any>(openCopyProcessDialog(resource));
         }
     },
     {
-        icon: RemoveIcon,
-        name: "Remove",
-        execute: (dispatch, resource) => {
-            // add code
+        icon: DetailsIcon,
+        name: "View details",
+        execute: dispatch => {
+            dispatch<any>(toggleDetailsPanel());
         }
     }
+    // {
+    //     icon: RemoveIcon,
+    //     name: "Remove",
+    //     execute: (dispatch, resource) => {
+    //         // add code
+    //     }
+    // }
 ]];