Merge branch '21128-toolbar-context-menu'
[arvados-workbench2.git] / src / views-components / context-menu / action-sets / root-project-action-set.ts
index 386c5162f3c6ab9858c55f9b25468acbd98b353c..a779d1eb2967877c766d7166b63ae00697a4bfb4 100644 (file)
@@ -2,24 +2,26 @@
 //
 // SPDX-License-Identifier: AGPL-3.0
 
-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';
+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<any>(openProjectCreateDialog(resource.uuid));
-        }
-    },
-    {
-        icon: CollectionIcon,
-        name: "New Collection",
-        execute: (dispatch, resource) => {
-            dispatch<any>(openCollectionCreateDialog(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));
+            },
+        },
+    ],
+];