Merge branch 'master'
[arvados-workbench2.git] / src / views-components / context-menu / action-sets / collection-action-set.ts
index b3fdc3fbab642561d823cddd003a70b9ab288149..07e150245486d85442034849250a2a41acdb4d0d 100644 (file)
@@ -10,6 +10,11 @@ import { openCollectionUpdateDialog } from "~/store/collections/collection-updat
 import { favoritePanelActions } from "~/store/favorite-panel/favorite-panel-action";
 import { openMoveCollectionDialog } from '~/store/collections/collection-move-actions';
 import { openCollectionCopyDialog } from "~/store/collections/collection-copy-actions";
+import { ToggleTrashAction } from "~/views-components/context-menu/actions/trash-action";
+import { toggleCollectionTrashed } from "~/store/trash/trash-actions";
+import { detailsPanelActions } from '~/store/details-panel/details-panel-action';
+import { openSharingDialog } from '~/store/sharing-dialog/sharing-dialog-actions';
+import { openAdvancedTabDialog } from "~/store/advanced-tab/advanced-tab";
 
 export const collectionActionSet: ContextMenuActionSet = [[
     {
@@ -22,8 +27,8 @@ export const collectionActionSet: ContextMenuActionSet = [[
     {
         icon: ShareIcon,
         name: "Share",
-        execute: (dispatch, resource) => {
-            // add code
+        execute: (dispatch, { uuid }) => {
+            dispatch<any>(openSharingDialog(uuid));
         }
     },
     {
@@ -39,18 +44,25 @@ export const collectionActionSet: ContextMenuActionSet = [[
             });
         }
     },
+    {
+        component: ToggleTrashAction,
+        execute: (dispatch, resource) => {
+            dispatch<any>(toggleCollectionTrashed(resource.uuid, resource.isTrashed!!));
+        }
+    },
     {
         icon: CopyIcon,
         name: "Copy to project",
         execute: (dispatch, resource) => {
             dispatch<any>(openCollectionCopyDialog(resource));
         }
+
     },
     {
         icon: DetailsIcon,
         name: "View details",
-        execute: (dispatch, resource) => {
-            // add code
+        execute: dispatch => {
+            dispatch(detailsPanelActions.TOGGLE_DETAILS_PANEL());
         }
     },
     {
@@ -64,7 +76,7 @@ export const collectionActionSet: ContextMenuActionSet = [[
         icon: AdvancedIcon,
         name: "Advanced",
         execute: (dispatch, resource) => {
-            // add code
+            dispatch<any>(openAdvancedTabDialog(resource.uuid));
         }
     },
     {