Merge branch '21128-toolbar-context-menu'
[arvados-workbench2.git] / src / views-components / context-menu / action-sets / repository-action-set.ts
index 82c2f2b8e04909b861d561ff59557c89ae973a1c..cbdcd004288780cbdbd3c5cfe2e41449d966fae5 100644 (file)
@@ -2,34 +2,41 @@
 //
 // SPDX-License-Identifier: AGPL-3.0
 
-import { ContextMenuActionSet } from "~/views-components/context-menu/context-menu-action-set";
-import { AdvancedIcon, RemoveIcon, ShareIcon, AttributesIcon } from "~/components/icon/icon";
-import { openAdvancedTabDialog } from "~/store/advanced-tab/advanced-tab";
-import { openRepositoryAttributes, openRemoveRepositoryDialog } from "~/store/repositories/repositories-actions";
-import { openSharingDialog } from "~/store/sharing-dialog/sharing-dialog-actions";
+import { ContextMenuActionSet } from 'views-components/context-menu/context-menu-action-set';
+import { AdvancedIcon, RemoveIcon, ShareIcon, AttributesIcon } from 'components/icon/icon';
+import { openAdvancedTabDialog } from 'store/advanced-tab/advanced-tab';
+import { openRepositoryAttributes, openRemoveRepositoryDialog } from 'store/repositories/repositories-actions';
+import { openSharingDialog } from 'store/sharing-dialog/sharing-dialog-actions';
 
-export const repositoryActionSet: ContextMenuActionSet = [[{
-    name: "Attributes",
-    icon: AttributesIcon,
-    execute: (dispatch, { uuid }) => {
-        dispatch<any>(openRepositoryAttributes(uuid));
-    }
-}, {
-    name: "Share",
-    icon: ShareIcon,
-    execute: (dispatch, { uuid }) => {
-        dispatch<any>(openSharingDialog(uuid));
-    }
-}, {
-    name: "Advanced",
-    icon: AdvancedIcon,
-    execute: (dispatch, resource) => {
-        dispatch<any>(openAdvancedTabDialog(resource.uuid));
-    }
-}, {
-    name: "Remove",
-    icon: RemoveIcon,
-    execute: (dispatch, { uuid }) => {
-        dispatch<any>(openRemoveRepositoryDialog(uuid));
-    }
-}]];
+export const repositoryActionSet: ContextMenuActionSet = [
+    [
+        {
+            name: 'Attributes',
+            icon: AttributesIcon,
+            execute: (dispatch, resources) => {
+                 dispatch<any>(openRepositoryAttributes(resources[0].uuid));
+            },
+        },
+        {
+            name: 'Share',
+            icon: ShareIcon,
+            execute: (dispatch, resources) => {
+                 dispatch<any>(openSharingDialog(resources[0].uuid));
+            },
+        },
+        {
+            name: 'API Details',
+            icon: AdvancedIcon,
+            execute: (dispatch, resources) => {
+                 dispatch<any>(openAdvancedTabDialog(resources[0].uuid));
+            },
+        },
+        {
+            name: 'Remove',
+            icon: RemoveIcon,
+            execute: (dispatch, resources) => {
+                 dispatch<any>(openRemoveRepositoryDialog(resources[0].uuid));
+            },
+        },
+    ],
+];