X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/761e9780888a343e0655563acea23577eeb5d29a..7eb16e136a720bdfda5a4d4782d9cce1d00f5ded:/src/views-components/context-menu/action-sets/search-results-action-set.ts diff --git a/src/views-components/context-menu/action-sets/search-results-action-set.ts b/src/views-components/context-menu/action-sets/search-results-action-set.ts new file mode 100644 index 00000000..e916a105 --- /dev/null +++ b/src/views-components/context-menu/action-sets/search-results-action-set.ts @@ -0,0 +1,42 @@ +// Copyright (C) The Arvados Authors. All rights reserved. +// +// SPDX-License-Identifier: AGPL-3.0 + +import { ContextMenuActionSet } from "../context-menu-action-set"; +import { DetailsIcon, AdvancedIcon, OpenIcon, Link } from 'components/icon/icon'; +import { openAdvancedTabDialog } from "store/advanced-tab/advanced-tab"; +import { toggleDetailsPanel } from 'store/details-panel/details-panel-action'; +import { copyToClipboardAction, openInNewTabAction } from "store/open-in-new-tab/open-in-new-tab.actions"; + +export const searchResultsActionSet: ContextMenuActionSet = [ + [ + { + icon: OpenIcon, + name: "Open in new tab", + execute: (dispatch, resource) => { + dispatch(openInNewTabAction(resource)); + } + }, + { + icon: Link, + name: "Copy to clipboard", + execute: (dispatch, resource) => { + dispatch(copyToClipboardAction(resource)); + } + }, + { + icon: DetailsIcon, + name: "View details", + execute: dispatch => { + dispatch(toggleDetailsPanel()); + } + }, + { + icon: AdvancedIcon, + name: "Advanced", + execute: (dispatch, resource) => { + dispatch(openAdvancedTabDialog(resource.uuid)); + } + }, + ] +];