refs #master Merge branch 'origin/master' into 14007-ts-paths
[arvados-workbench2.git] / src / views-components / context-menu / action-sets / root-project-action-set.ts
1 // Copyright (C) The Arvados Authors. All rights reserved.
2 //
3 // SPDX-License-Identifier: AGPL-3.0
4
5 import { reset } from "redux-form";
6
7 import { ContextMenuActionSet } from "../context-menu-action-set";
8 import { projectActions } from "~/store/project/project-action";
9 import { NewProjectIcon } from "~/components/icon/icon";
10 import { collectionCreateActions } from "../../../store/collections/creator/collection-creator-action";
11 import { PROJECT_CREATE_DIALOG } from "../../dialog-create/dialog-project-create";
12 import { COLLECTION_CREATE_DIALOG } from "../../dialog-create/dialog-collection-create";
13 import { NewProjectIcon, CollectionIcon } from "../../../components/icon/icon";
14
15 export const rootProjectActionSet: ContextMenuActionSet =  [[
16     {
17         icon: NewProjectIcon,
18         name: "New project",
19         execute: (dispatch, resource) => {
20             dispatch(reset(PROJECT_CREATE_DIALOG));
21             dispatch(projectActions.OPEN_PROJECT_CREATOR({ ownerUuid: resource.uuid }));
22         }
23     }, 
24     {
25         icon: CollectionIcon,
26         name: "New Collection",
27         execute: (dispatch, resource) => {
28             dispatch(reset(COLLECTION_CREATE_DIALOG));
29             dispatch(collectionCreateActions.OPEN_COLLECTION_CREATOR({ ownerUuid: resource.uuid }));
30         }
31     }
32 ]];