1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
5 import { ContextMenuActionSet } from "../context-menu-action-set";
6 import { RemoveIcon, RenameIcon } from "components/icon/icon";
7 import { DownloadCollectionFileAction } from "../actions/download-collection-file-action";
8 import { openFileRemoveDialog, openRenameFileDialog } 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 import { CollectionCopyToClipboardAction } from "../actions/collection-copy-to-clipboard-action";
12 export const readOnlyCollectionDirectoryItemActionSet: ContextMenuActionSet = [[
14 component: CollectionFileViewerAction,
15 execute: () => { return; },
18 component: CollectionCopyToClipboardAction,
19 execute: () => { return; },
23 export const readOnlyCollectionFileItemActionSet: ContextMenuActionSet = [[
25 component: DownloadCollectionFileAction,
26 execute: () => { return; }
28 ...readOnlyCollectionDirectoryItemActionSet.reduce((prev, next) => prev.concat(next), []),
31 const writableActionSet: ContextMenuActionSet = [[
35 execute: (dispatch, resource) => {
36 dispatch<any>(openRenameFileDialog({
39 path: resource.uuid.split('/').slice(1).join('/') }));
45 execute: (dispatch, resource) => {
46 dispatch<any>(openFileRemoveDialog(resource.uuid));
51 export const collectionDirectoryItemActionSet: ContextMenuActionSet = readOnlyCollectionDirectoryItemActionSet.concat(writableActionSet);
53 export const collectionFileItemActionSet: ContextMenuActionSet = readOnlyCollectionFileItemActionSet.concat(writableActionSet);