Merge branch '21128-toolbar-context-menu'
[arvados-workbench2.git] / src / views-components / context-menu / action-sets / root-project-action-set.ts
index 139bd26f90195e549a78ab0df12e6f72a89eb89a..a779d1eb2967877c766d7166b63ae00697a4bfb4 100644 (file)
@@ -2,14 +2,26 @@
 //
 // SPDX-License-Identifier: AGPL-3.0
 
-import { ContextMenuActionSet } from "../context-menu-action-set";
-import { projectActions } from "../../../store/project/project-action";
-import { NewProjectIcon } from "../../../components/icon/icon";
+import { ContextMenuActionSet } from '../context-menu-action-set';
+import { openCollectionCreateDialog } from 'store/collections/collection-create-actions';
+import { NewProjectIcon, CollectionIcon } from 'components/icon/icon';
+import { openProjectCreateDialog } from 'store/projects/project-create-actions';
 
-export const rootProjectActionSet: ContextMenuActionSet =  [[{
-    icon: NewProjectIcon,
-    name: "New project",
-    execute: (dispatch, resource) => {
-        dispatch(projectActions.OPEN_PROJECT_CREATOR({ ownerUuid: resource.uuid }));
-    }
-}]];
+export const rootProjectActionSet: ContextMenuActionSet = [
+    [
+        {
+            icon: NewProjectIcon,
+            name: 'New project',
+            execute: (dispatch, resources) => {
+                 dispatch<any>(openProjectCreateDialog(resources[0].uuid));
+            },
+        },
+        {
+            icon: CollectionIcon,
+            name: 'New Collection',
+            execute: (dispatch, resources) => {
+                 dispatch<any>(openCollectionCreateDialog(resources[0].uuid));
+            },
+        },
+    ],
+];