Merge branch '21128-toolbar-context-menu'
[arvados-workbench2.git] / src / views-components / context-menu / action-sets / trashed-collection-action-set.ts
index b3d893b4b345ce9ed554d74dc8b895643245059f..3e8f0cb647e38e8f73b35e33faf562ccc9caa155 100644 (file)
@@ -2,39 +2,41 @@
 //
 // SPDX-License-Identifier: AGPL-3.0
 
-import { ContextMenuActionSet } from "../context-menu-action-set";
+import { ContextMenuActionSet } from '../context-menu-action-set';
 import { DetailsIcon, ProvenanceGraphIcon, AdvancedIcon, RestoreFromTrashIcon } from 'components/icon/icon';
-import { toggleCollectionTrashed } from "store/trash/trash-actions";
-import { openAdvancedTabDialog } from "store/advanced-tab/advanced-tab";
+import { toggleCollectionTrashed } from 'store/trash/trash-actions';
+import { openAdvancedTabDialog } from 'store/advanced-tab/advanced-tab';
 import { toggleDetailsPanel } from 'store/details-panel/details-panel-action';
 
-export const trashedCollectionActionSet: ContextMenuActionSet = [[
-    {
-        icon: DetailsIcon,
-        name: "View details",
-        execute: dispatch => {
-            dispatch<any>(toggleDetailsPanel());
-        }
-    },
-    {
-        icon: ProvenanceGraphIcon,
-        name: "Provenance graph",
-        execute: (dispatch, resource) => {
-            // add code
-        }
-    },
-    {
-        icon: AdvancedIcon,
-        name: "Advanced",
-        execute: (dispatch, resource) => {
-            dispatch<any>(openAdvancedTabDialog(resource.uuid));
-        }
-    },
-    {
-        icon: RestoreFromTrashIcon,
-        name: "Restore",
-        execute: (dispatch, resource) => {
-            dispatch<any>(toggleCollectionTrashed(resource.uuid, true));
-        }
-    },
-]];
+export const trashedCollectionActionSet: ContextMenuActionSet = [
+    [
+        {
+            icon: DetailsIcon,
+            name: 'View details',
+            execute: (dispatch) => {
+                dispatch<any>(toggleDetailsPanel());
+            },
+        },
+        {
+            icon: ProvenanceGraphIcon,
+            name: 'Provenance graph',
+            execute: (dispatch, resource) => {
+                // add code
+            },
+        },
+        {
+            icon: AdvancedIcon,
+            name: 'API Details',
+            execute: (dispatch, resources) => {
+                dispatch<any>(openAdvancedTabDialog(resources[0].uuid));
+            },
+        },
+        {
+            icon: RestoreFromTrashIcon,
+            name: 'Restore',
+            execute: (dispatch, resources) => {
+                resources.forEach((resource) => dispatch<any>(toggleCollectionTrashed(resource.uuid, true)));
+            },
+        },
+    ],
+];