X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/4b8cc1acf54add3e4337b27a7e957a84dc9c07b4..31e84a9315728c2f58a26bf0e9e1d2b38326fb86:/src/views-components/context-menu/action-sets/process-resource-action-set.ts diff --git a/src/views-components/context-menu/action-sets/process-resource-action-set.ts b/src/views-components/context-menu/action-sets/process-resource-action-set.ts index 4a0a83b91d..73a65a2d41 100644 --- a/src/views-components/context-menu/action-sets/process-resource-action-set.ts +++ b/src/views-components/context-menu/action-sets/process-resource-action-set.ts @@ -10,10 +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(toggleFavorite(resource)).then(() => { + dispatch(favoritePanelActions.REQUEST_ITEMS()); + }); + } + }, + { + icon: CopyIcon, + name: "Copy to project", + execute: (dispatch, resource) => { + dispatch(openCopyProcessDialog(resource)); + } + }, + { + icon: DetailsIcon, + name: "View details", + execute: dispatch => { + dispatch(toggleDetailsPanel()); + } + }, +]]; export const processResourceActionSet: ContextMenuActionSet = [[ + ...readOnlyProcessResourceActionSet.reduce((prev, next) => prev.concat(next), []), { icon: RenameIcon, name: "Edit process", @@ -28,14 +55,6 @@ export const processResourceActionSet: ContextMenuActionSet = [[ dispatch(openSharingDialog(uuid)); } }, - { - component: ToggleFavoriteAction, - execute: (dispatch, resource) => { - dispatch(toggleFavorite(resource)).then(() => { - dispatch(favoritePanelActions.REQUEST_ITEMS()); - }); - } - }, { icon: MoveToIcon, name: "Move to", @@ -44,24 +63,10 @@ export const processResourceActionSet: ContextMenuActionSet = [[ } }, { - icon: CopyIcon, - name: "Copy to project", + name: "Remove", + icon: RemoveIcon, execute: (dispatch, resource) => { - dispatch(openCopyProcessDialog(resource)); - } - }, - { - icon: DetailsIcon, - name: "View details", - execute: dispatch => { - dispatch(detailsPanelActions.TOGGLE_DETAILS_PANEL()); + dispatch(openRemoveProcessDialog(resource.uuid)); } } - // { - // icon: RemoveIcon, - // name: "Remove", - // execute: (dispatch, resource) => { - // // add code - // } - // } ]];