Merge branch '17426-plug-ins' refs #17426
[arvados-workbench2.git] / src / views-components / context-menu / action-sets / process-resource-action-set.ts
index be7f756c2ac7233689e2fdb459e11b9b1b6adef0..73a65a2d417f6006050f9e82939c73418367a27c 100644 (file)
@@ -10,11 +10,37 @@ import { favoritePanelActions } from "~/store/favorite-panel/favorite-panel-acti
 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 { openRemoveProcessDialog } from "~/store/processes/processes-actions";
+import { toggleDetailsPanel } from '~/store/details-panel/details-panel-action';
+
+export const readOnlyProcessResourceActionSet: ContextMenuActionSet = [[
+    {
+        component: ToggleFavoriteAction,
+        execute: (dispatch, resource) => {
+            dispatch<any>(toggleFavorite(resource)).then(() => {
+                dispatch<any>(favoritePanelActions.REQUEST_ITEMS());
+            });
+        }
+    },
+    {
+        icon: CopyIcon,
+        name: "Copy to project",
+        execute: (dispatch, resource) => {
+            dispatch<any>(openCopyProcessDialog(resource));
+        }
+    },
+    {
+        icon: DetailsIcon,
+        name: "View details",
+        execute: dispatch => {
+            dispatch<any>(toggleDetailsPanel());
+        }
+    },
+]];
 
 export const processResourceActionSet: ContextMenuActionSet = [[
+    ...readOnlyProcessResourceActionSet.reduce((prev, next) => prev.concat(next), []),
     {
         icon: RenameIcon,
         name: "Edit process",
@@ -29,14 +55,6 @@ export const processResourceActionSet: ContextMenuActionSet = [[
             dispatch<any>(openSharingDialog(uuid));
         }
     },
-    {
-        component: ToggleFavoriteAction,
-        execute: (dispatch, resource) => {
-            dispatch<any>(toggleFavorite(resource)).then(() => {
-                dispatch<any>(favoritePanelActions.REQUEST_ITEMS());
-            });
-        }
-    },
     {
         icon: MoveToIcon,
         name: "Move to",
@@ -44,20 +62,6 @@ export const processResourceActionSet: ContextMenuActionSet = [[
             dispatch<any>(openMoveProcessDialog(resource));
         }
     },
-    {
-        icon: CopyIcon,
-        name: "Copy to project",
-        execute: (dispatch, resource) => {
-            dispatch<any>(openCopyProcessDialog(resource));
-        }
-    },
-    {
-        icon: DetailsIcon,
-        name: "View details",
-        execute: dispatch => {
-            dispatch(detailsPanelActions.TOGGLE_DETAILS_PANEL());
-        }
-    },
     {
         name: "Remove",
         icon: RemoveIcon,