2ded3736b2130b2709667018ddb51d17ff2c7d75
[arvados-workbench2.git] / src / views-components / context-menu / action-sets / collection-files-item-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 { RemoveIcon } from "~/components/icon/icon";
7 import { DownloadCollectionFileAction } from "../actions/download-collection-file-action";
8 import { openFileRemoveDialog } from '~/store/collection-panel/collection-panel-files/collection-panel-files-actions';
9 import { CollectionFileViewerAction } from '~/views-components/context-menu/actions/collection-file-viewer-action';
10
11
12 export const readOnlyCollectionFilesItemActionSet: ContextMenuActionSet = [[
13     {
14         component: DownloadCollectionFileAction,
15         execute: () => { return; }
16     },
17     {
18         component: CollectionFileViewerAction,
19         execute: () => { return; },
20     }
21 ]];
22
23 export const collectionFilesItemActionSet: ContextMenuActionSet = readOnlyCollectionFilesItemActionSet.concat([[
24     // FIXME: This isn't working. Maybe something related to WebDAV?
25     // {
26     //     name: "Rename",
27     //     icon: RenameIcon,
28     //     execute: (dispatch, resource) => {
29     //         dispatch<any>(openRenameFileDialog({ name: resource.name, id: resource.uuid }));
30     //     }
31     // },
32     {
33         name: "Remove",
34         icon: RemoveIcon,
35         execute: (dispatch, resource) => {
36             dispatch<any>(openFileRemoveDialog(resource.uuid));
37         }
38     }
39 ]]);