21448: adjusted test specs Arvados-DCO-1.1-Signed-off-by: Lisa Knox <lisa.knox@curii...
[arvados.git] / services / workbench2 / src / views-components / context-menu / action-sets / process-resource-action-set.ts
index 2aa7faa1242369be4ea985bad80805b94529b72f..0203e3fe23c2541f9b78a9ff0dde08d08f0b0fe6 100644 (file)
@@ -2,13 +2,11 @@
 //
 // SPDX-License-Identifier: AGPL-3.0
 
-import { ContextMenuActionSet } from "../context-menu-action-set";
+import { ContextMenuActionSet, ContextMenuActionNames } from "../context-menu-action-set";
 import { ToggleFavoriteAction } from "../actions/favorite-action";
 import { toggleFavorite } from "store/favorites/favorites-actions";
 import {
     RenameIcon,
-    ShareIcon,
-    MoveToIcon,
     DetailsIcon,
     RemoveIcon,
     ReRunProcessIcon,
@@ -18,10 +16,8 @@ import {
     StopIcon,
 } from "components/icon/icon";
 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 { openSharingDialog } from "store/sharing-dialog/sharing-dialog-actions";
 import { openRemoveProcessDialog } from "store/processes/processes-actions";
 import { toggleDetailsPanel } from "store/details-panel/details-panel-action";
 import { navigateToOutput } from "store/process-panel/process-panel-actions";
@@ -36,6 +32,7 @@ export const readOnlyProcessResourceActionSet: ContextMenuActionSet = [
     [
         {
             component: ToggleFavoriteAction,
+            name: ContextMenuActionNames.ADD_TO_FAVORITES,
             execute: (dispatch, resources) => {
                 dispatch<any>(toggleFavorite(resources[0])).then(() => {
                     dispatch<any>(favoritePanelActions.REQUEST_ITEMS());
@@ -44,21 +41,21 @@ export const readOnlyProcessResourceActionSet: ContextMenuActionSet = [
         },
         {
             icon: OpenIcon,
-            name: "Open in new tab",
+            name: ContextMenuActionNames.OPEN_IN_NEW_TAB,
             execute: (dispatch, resources) => {
                 dispatch<any>(openInNewTabAction(resources[0]));
             },
         },
         {
             icon: ReRunProcessIcon,
-            name: "Copy and re-run process",
+            name: ContextMenuActionNames.COPY_AND_RERUN_PROCESS,
             execute: (dispatch, resources) => {
                 dispatch<any>(openCopyProcessDialog(resources[0]));
             },
         },
         {
             icon: OutputIcon,
-            name: "Outputs",
+            name: ContextMenuActionNames.OUTPUTS,
             execute: (dispatch, resources) => {
                 if (resources[0]) {
                     dispatch<any>(navigateToOutput(resources[0]));
@@ -67,14 +64,14 @@ export const readOnlyProcessResourceActionSet: ContextMenuActionSet = [
         },
         {
             icon: DetailsIcon,
-            name: "View details",
+            name: ContextMenuActionNames.VIEW_DETAILS,
             execute: dispatch => {
                 dispatch<any>(toggleDetailsPanel());
             },
         },
         {
             icon: AdvancedIcon,
-            name: "API Details",
+            name: ContextMenuActionNames.API_DETAILS,
             execute: (dispatch, resources) => {
                 dispatch<any>(openAdvancedTabDialog(resources[0].uuid));
             },
@@ -87,27 +84,21 @@ export const processResourceActionSet: ContextMenuActionSet = [
         ...readOnlyProcessResourceActionSet.reduce((prev, next) => prev.concat(next), []),
         {
             icon: RenameIcon,
-            name: "Edit process",
+            name: ContextMenuActionNames.EDIT_PROCESS,
             execute: (dispatch, resources) => {
                 dispatch<any>(openProcessUpdateDialog(resources[0]));
             },
         },
+        // removed until auto-move children is implemented
+        // {
+        //     icon: MoveToIcon,
+        //     name: ContextMenuActionNames.MOVE_TO,
+        //     execute: (dispatch, resources) => {
+        //         dispatch<any>(openMoveProcessDialog(resources[0]));
+        //     },
+        // },
         {
-            icon: ShareIcon,
-            name: "Share",
-            execute: (dispatch, resources) => {
-                dispatch<any>(openSharingDialog(resources[0].uuid));
-            },
-        },
-        {
-            icon: MoveToIcon,
-            name: "Move to",
-            execute: (dispatch, resources) => {
-                dispatch<any>(openMoveProcessDialog(resources[0]));
-            },
-        },
-        {
-            name: "Remove",
+            name: ContextMenuActionNames.REMOVE,
             icon: RemoveIcon,
             execute: (dispatch, resources) => {
                 dispatch<any>(openRemoveProcessDialog(resources[0], resources.length));
@@ -119,7 +110,7 @@ export const processResourceActionSet: ContextMenuActionSet = [
 const runningProcessOnlyActionSet: ContextMenuActionSet = [
     [
         {
-            name: "CANCEL",
+            name: ContextMenuActionNames.CANCEL,
             icon: StopIcon,
             execute: (dispatch, resources) => {
                 dispatch<any>(cancelRunningWorkflow(resources[0].uuid));
@@ -133,7 +124,7 @@ export const processResourceAdminActionSet: ContextMenuActionSet = [
         ...processResourceActionSet.reduce((prev, next) => prev.concat(next), []),
         {
             component: TogglePublicFavoriteAction,
-            name: "Add to public favorites",
+            name: ContextMenuActionNames.ADD_TO_PUBLIC_FAVORITES,
             execute: (dispatch, resources) => {
                 dispatch<any>(togglePublicFavorite(resources[0])).then(() => {
                     dispatch<any>(publicFavoritePanelActions.REQUEST_ITEMS());