refs #13989 Merge branch 'origin/13989-webdav-service'
[arvados.git] / src / views-components / context-menu / action-sets / root-project-action-set.ts
index 53642d03fbab75425fb360363feea3eaab5e8397..de3b954f4c1c819c5d9aab4a136cd0e03a377a6a 100644 (file)
@@ -2,14 +2,30 @@
 //
 // SPDX-License-Identifier: AGPL-3.0
 
+import { reset } from "redux-form";
+
 import { ContextMenuActionSet } from "../context-menu-action-set";
-import actions from "../../../store/project/project-action";
-import { IconTypes } from "../../../components/icon/icon";
+import { projectActions } from "~/store/project/project-action";
+import { collectionCreateActions } from "~/store/collections/creator/collection-creator-action";
+import { PROJECT_CREATE_DIALOG } from "../../dialog-create/dialog-project-create";
+import { COLLECTION_CREATE_DIALOG } from "../../dialog-create/dialog-collection-create";
+import { NewProjectIcon, CollectionIcon } from "~/components/icon/icon";
 
-export const rootProjectActionSet: ContextMenuActionSet =  [[{
-    icon: IconTypes.FOLDER,
-    name: "New project",
-    execute: (dispatch, resource) => {
-        dispatch(actions.OPEN_PROJECT_CREATOR({ ownerUuid: resource.uuid }));
+export const rootProjectActionSet: ContextMenuActionSet =  [[
+    {
+        icon: NewProjectIcon,
+        name: "New project",
+        execute: (dispatch, resource) => {
+            dispatch(reset(PROJECT_CREATE_DIALOG));
+            dispatch(projectActions.OPEN_PROJECT_CREATOR({ ownerUuid: resource.uuid }));
+        }
+    },
+    {
+        icon: CollectionIcon,
+        name: "New Collection",
+        execute: (dispatch, resource) => {
+            dispatch(reset(COLLECTION_CREATE_DIALOG));
+            dispatch(collectionCreateActions.OPEN_COLLECTION_CREATOR({ ownerUuid: resource.uuid }));
+        }
     }
-}]];
\ No newline at end of file
+]];