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 { ToggleFavoriteAction } from "../actions/favorite-action";
7 import { ToggleTrashAction } from "~/views-components/context-menu/actions/trash-action";
8 import { toggleFavorite } from "~/store/favorites/favorites-actions";
9 import { RenameIcon, ShareIcon, MoveToIcon, CopyIcon, DetailsIcon, AdvancedIcon, OpenIcon } from '~/components/icon/icon';
10 import { openCollectionUpdateDialog } from "~/store/collections/collection-update-actions";
11 import { favoritePanelActions } from "~/store/favorite-panel/favorite-panel-action";
12 import { openMoveCollectionDialog } from '~/store/collections/collection-move-actions';
13 import { openCollectionCopyDialog } from '~/store/collections/collection-copy-actions';
14 import { toggleCollectionTrashed } from "~/store/trash/trash-actions";
15 import { openSharingDialog } from "~/store/sharing-dialog/sharing-dialog-actions";
16 import { openAdvancedTabDialog } from '~/store/advanced-tab/advanced-tab';
17 import { toggleDetailsPanel } from '~/store/details-panel/details-panel-action';
18 import { openInNewTabAction } from "~/store/open-in-new-tab/open-in-new-tab.actions";
20 export const collectionResourceActionSet: ContextMenuActionSet = [[
23 name: "Edit collection",
24 execute: (dispatch, resource) => {
25 dispatch<any>(openCollectionUpdateDialog(resource));
31 execute: (dispatch, { uuid }) => {
32 dispatch<any>(openSharingDialog(uuid));
36 component: ToggleFavoriteAction,
37 execute: (dispatch, resource) => {
38 dispatch<any>(toggleFavorite(resource)).then(() => {
39 dispatch<any>(favoritePanelActions.REQUEST_ITEMS());
45 name: "Open in new tab",
46 execute: (dispatch, resource) => {
47 dispatch<any>(openInNewTabAction(resource));
53 execute: (dispatch, resource) => {
54 dispatch<any>(openMoveCollectionDialog(resource));
59 name: "Copy to project",
60 execute: (dispatch, resource) => {
61 dispatch<any>(openCollectionCopyDialog(resource));
67 execute: dispatch => {
68 dispatch<any>(toggleDetailsPanel());
74 execute: (dispatch, resource) => {
75 dispatch<any>(openAdvancedTabDialog(resource.uuid));
79 component: ToggleTrashAction,
80 execute: (dispatch, resource) => {
81 dispatch<any>(toggleCollectionTrashed(resource.uuid, resource.isTrashed!!));
87 // execute: (dispatch, resource) => {