15768: changed all context menu actions to take an array of resources Arvados-DCO...
[arvados-workbench2.git] / src / views-components / context-menu / action-sets / virtual-machine-action-set.ts
1 // Copyright (C) The Arvados Authors. All rights reserved.
2 //
3 // SPDX-License-Identifier: AGPL-3.0
4
5 import { ContextMenuActionSet } from 'views-components/context-menu/context-menu-action-set';
6 import { AdvancedIcon, RemoveIcon, AttributesIcon } from 'components/icon/icon';
7 import { openAdvancedTabDialog } from 'store/advanced-tab/advanced-tab';
8 import { openVirtualMachineAttributes, openRemoveVirtualMachineDialog } from 'store/virtual-machines/virtual-machines-actions';
9
10 export const virtualMachineActionSet: ContextMenuActionSet = [
11     [
12         {
13             name: 'Attributes',
14             icon: AttributesIcon,
15             execute: (dispatch, resources) => {
16                 resources.forEach((resource) => dispatch<any>(openVirtualMachineAttributes(resource.uuid)));
17             },
18         },
19         {
20             name: 'API Details',
21             icon: AdvancedIcon,
22             execute: (dispatch, resources) => {
23                 resources.forEach((resource) => dispatch<any>(openAdvancedTabDialog(resource.uuid)));
24             },
25         },
26         {
27             name: 'Remove',
28             icon: RemoveIcon,
29             execute: (dispatch, resources) => {
30                 resources.forEach((resource) => dispatch<any>(openRemoveVirtualMachineDialog(resource.uuid)));
31             },
32         },
33     ],
34 ];