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, RemoveIcon } 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 { detailsPanelActions } from '~/store/details-panel/details-panel-action';
17 export const collectionResourceActionSet: ContextMenuActionSet = [[
20 name: "Edit collection",
21 execute: (dispatch, resource) => {
22 dispatch<any>(openCollectionUpdateDialog(resource));
28 execute: (dispatch, resource) => {
35 execute: (dispatch, resource) => {
36 dispatch<any>(openMoveCollectionDialog(resource));
40 component: ToggleFavoriteAction,
41 execute: (dispatch, resource) => {
42 dispatch<any>(toggleFavorite(resource)).then(() => {
43 dispatch<any>(favoritePanelActions.REQUEST_ITEMS());
48 component: ToggleTrashAction,
49 execute: (dispatch, resource) => {
50 dispatch<any>(toggleCollectionTrashed(resource.uuid, resource.isTrashed!!));
55 name: "Copy to project",
56 execute: (dispatch, resource) => {
57 dispatch<any>(openCollectionCopyDialog(resource));
63 execute: dispatch => {
64 dispatch(detailsPanelActions.TOGGLE_DETAILS_PANEL());
70 execute: (dispatch, resource) => {