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 } 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';
19 export const collectionResourceActionSet: ContextMenuActionSet = [[
22 name: "Edit collection",
23 execute: (dispatch, resource) => {
24 dispatch<any>(openCollectionUpdateDialog(resource));
30 execute: (dispatch, { uuid }) => {
31 dispatch<any>(openSharingDialog(uuid));
35 component: ToggleFavoriteAction,
36 execute: (dispatch, resource) => {
37 dispatch<any>(toggleFavorite(resource)).then(() => {
38 dispatch<any>(favoritePanelActions.REQUEST_ITEMS());
45 execute: (dispatch, resource) => {
46 dispatch<any>(openMoveCollectionDialog(resource));
51 name: "Copy to project",
52 execute: (dispatch, resource) => {
53 dispatch<any>(openCollectionCopyDialog(resource));
59 execute: dispatch => {
60 dispatch<any>(toggleDetailsPanel());
66 execute: (dispatch, resource) => {
67 dispatch<any>(openAdvancedTabDialog(resource.uuid));
71 component: ToggleTrashAction,
72 execute: (dispatch, resource) => {
73 dispatch<any>(toggleCollectionTrashed(resource.uuid, resource.isTrashed!!));
79 // execute: (dispatch, resource) => {