Merge branch '21128-toolbar-context-menu'
[arvados-workbench2.git] / src / views-components / context-menu / action-sets / repository-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, ShareIcon, AttributesIcon } from 'components/icon/icon';
7 import { openAdvancedTabDialog } from 'store/advanced-tab/advanced-tab';
8 import { openRepositoryAttributes, openRemoveRepositoryDialog } from 'store/repositories/repositories-actions';
9 import { openSharingDialog } from 'store/sharing-dialog/sharing-dialog-actions';
10
11 export const repositoryActionSet: ContextMenuActionSet = [
12     [
13         {
14             name: 'Attributes',
15             icon: AttributesIcon,
16             execute: (dispatch, resources) => {
17                  dispatch<any>(openRepositoryAttributes(resources[0].uuid));
18             },
19         },
20         {
21             name: 'Share',
22             icon: ShareIcon,
23             execute: (dispatch, resources) => {
24                  dispatch<any>(openSharingDialog(resources[0].uuid));
25             },
26         },
27         {
28             name: 'API Details',
29             icon: AdvancedIcon,
30             execute: (dispatch, resources) => {
31                  dispatch<any>(openAdvancedTabDialog(resources[0].uuid));
32             },
33         },
34         {
35             name: 'Remove',
36             icon: RemoveIcon,
37             execute: (dispatch, resources) => {
38                  dispatch<any>(openRemoveRepositoryDialog(resources[0].uuid));
39             },
40         },
41     ],
42 ];