X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/f528f6f6ca52c8654b52f84e52339da8e91a9d9c..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 be7f756c2a..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,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(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", @@ -29,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,20 +62,6 @@ export const processResourceActionSet: ContextMenuActionSet = [[ dispatch(openMoveProcessDialog(resource)); } }, - { - icon: CopyIcon, - name: "Copy to project", - execute: (dispatch, resource) => { - dispatch(openCopyProcessDialog(resource)); - } - }, - { - icon: DetailsIcon, - name: "View details", - execute: dispatch => { - dispatch(detailsPanelActions.TOGGLE_DETAILS_PANEL()); - } - }, { name: "Remove", icon: RemoveIcon,