Merge branch '21448-menu-reorder' into 21224-project-details
[arvados.git] / services / workbench2 / src / views-components / context-menu / action-sets / link-action-set.ts
1 // Copyright (C) The Arvados Authors. All rights reserved.
2 //
3 // SPDX-License-Identifier: AGPL-3.0
4
5 import { openLinkAttributesDialog, openLinkRemoveDialog } from 'store/link-panel/link-panel-actions';
6 import { openAdvancedTabDialog } from 'store/advanced-tab/advanced-tab';
7 import { ContextMenuActionSet, ContextMenuActionNames } from 'views-components/context-menu/context-menu-action-set';
8 import { AdvancedIcon, RemoveIcon, AttributesIcon } from 'components/icon/icon';
9
10 export const linkActionSet: ContextMenuActionSet = [
11     [
12         {
13             name: ContextMenuActionNames.ATTRIBUTES,
14             icon: AttributesIcon,
15             execute: (dispatch, resources) => {
16                  dispatch<any>(openLinkAttributesDialog(resources[0].uuid));
17             },
18         },
19         {
20             name: ContextMenuActionNames.API_DETAILS,
21             icon: AdvancedIcon,
22             execute: (dispatch, resources) => {
23                  dispatch<any>(openAdvancedTabDialog(resources[0].uuid));
24             },
25         },
26         {
27             name: ContextMenuActionNames.REMOVE,
28             icon: RemoveIcon,
29             execute: (dispatch, resources) => {
30                  dispatch<any>(openLinkRemoveDialog(resources[0].uuid));
31             },
32         },
33     ],
34 ];