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, AdvancedIcon } from "~/components/icon/icon";
9 import { openCollectionUpdateDialog } from "~/store/collections/collection-update-actions";
10 import { favoritePanelActions } from "~/store/favorite-panel/favorite-panel-action";
11 import { openMoveCollectionDialog } from '~/store/collections/collection-move-actions';
12 import { openCollectionCopyDialog } from "~/store/collections/collection-copy-actions";
13 import { ToggleTrashAction } from "~/views-components/context-menu/actions/trash-action";
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 { TogglePublicFavoriteAction } from "~/views-components/context-menu/actions/public-favorite-action";
19 import { publicFavoritePanelActions } from "~/store/public-favorites-panel/public-favorites-action";
20 import { togglePublicFavorite } from "~/store/public-favorites/public-favorites-actions";
22 export const collectionAdminActionSet: ContextMenuActionSet = [[
25 name: "Edit collection",
26 execute: (dispatch, resource) => {
27 dispatch<any>(openCollectionUpdateDialog(resource));
33 execute: (dispatch, { uuid }) => {
34 dispatch<any>(openSharingDialog(uuid));
38 component: ToggleFavoriteAction,
39 execute: (dispatch, resource) => {
40 dispatch<any>(toggleFavorite(resource)).then(() => {
41 dispatch<any>(favoritePanelActions.REQUEST_ITEMS());
46 component: TogglePublicFavoriteAction,
47 execute: (dispatch, resource) => {
48 dispatch<any>(togglePublicFavorite(resource)).then(() => {
49 dispatch<any>(publicFavoritePanelActions.REQUEST_ITEMS());
56 execute: (dispatch, resource) => dispatch<any>(openMoveCollectionDialog(resource))
60 name: "Copy to project",
61 execute: (dispatch, resource) => {
62 dispatch<any>(openCollectionCopyDialog(resource));
69 execute: dispatch => {
70 dispatch<any>(toggleDetailsPanel());
74 // icon: ProvenanceGraphIcon,
75 // name: "Provenance graph",
76 // execute: (dispatch, resource) => {
83 execute: (dispatch, resource) => {
84 dispatch<any>(openAdvancedTabDialog(resource.uuid));
88 component: ToggleTrashAction,
89 execute: (dispatch, resource) => {
90 dispatch<any>(toggleCollectionTrashed(resource.uuid, resource.isTrashed!!));
96 // execute: (dispatch, resource) => {