X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/c038a5258d5790773ccca89a192c8c2b7dcd86cb..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 cf8aba5975..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", @@ -36,32 +63,10 @@ export const processResourceActionSet: 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(detailsPanelActions.TOGGLE_DETAILS_PANEL()); - } - }, - { - icon: RemoveIcon, name: "Remove", + icon: RemoveIcon, execute: (dispatch, resource) => { - // add code + dispatch(openRemoveProcessDialog(resource.uuid)); } } ]];