Merge branch '21128-toolbar-context-menu'
[arvados-workbench2.git] / src / views-components / context-menu / action-sets / trashed-collection-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 '../context-menu-action-set';
6 import { DetailsIcon, ProvenanceGraphIcon, AdvancedIcon, RestoreFromTrashIcon } from 'components/icon/icon';
7 import { toggleCollectionTrashed } from 'store/trash/trash-actions';
8 import { openAdvancedTabDialog } from 'store/advanced-tab/advanced-tab';
9 import { toggleDetailsPanel } from 'store/details-panel/details-panel-action';
10
11 export const trashedCollectionActionSet: ContextMenuActionSet = [
12     [
13         {
14             icon: DetailsIcon,
15             name: 'View details',
16             execute: (dispatch) => {
17                 dispatch<any>(toggleDetailsPanel());
18             },
19         },
20         {
21             icon: ProvenanceGraphIcon,
22             name: 'Provenance graph',
23             execute: (dispatch, resource) => {
24                 // add code
25             },
26         },
27         {
28             icon: AdvancedIcon,
29             name: 'API Details',
30             execute: (dispatch, resources) => {
31                 dispatch<any>(openAdvancedTabDialog(resources[0].uuid));
32             },
33         },
34         {
35             icon: RestoreFromTrashIcon,
36             name: 'Restore',
37             execute: (dispatch, resources) => {
38                 resources.forEach((resource) => dispatch<any>(toggleCollectionTrashed(resource.uuid, true)));
39             },
40         },
41     ],
42 ];