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 { toggleFavorite } from "~/store/favorites/favorites-actions";
8 import { RenameIcon, ShareIcon, MoveToIcon, CopyIcon, DetailsIcon, RemoveIcon } from "~/components/icon/icon";
9 import { openUpdater } from "~/store/collections/updater/collection-updater-action";
10 import { favoritePanelActions } from "~/store/favorite-panel/favorite-panel-action";
11 import { openMakeACopyDialog, MAKE_A_COPY_DIALOG } from "~/views-components/make-a-copy-dialog/make-a-copy-dialog";
12 import { openMoveToDialog } from '../../move-to-dialog/move-to-dialog';
13 import { reset } from 'redux-form';
15 export const collectionResourceActionSet: ContextMenuActionSet = [[
18 name: "Edit collection",
19 execute: (dispatch, resource) => {
20 dispatch<any>(openUpdater(resource));
26 execute: (dispatch, resource) => {
33 execute: dispatch => dispatch<any>(openMoveToDialog())
36 component: ToggleFavoriteAction,
37 execute: (dispatch, resource) => {
38 dispatch<any>(toggleFavorite(resource)).then(() => {
39 dispatch<any>(favoritePanelActions.REQUEST_ITEMS());
45 name: "Copy to project",
46 execute: (dispatch, resource) => {
47 dispatch(reset(MAKE_A_COPY_DIALOG));
48 dispatch<any>(openMakeACopyDialog({name: resource.name, projectUuid: resource.uuid}));
54 execute: (dispatch, resource) => {
61 execute: (dispatch, resource) => {