UI Improvements
[arvados-workbench2.git] / src / views-components / context-menu / action-sets / collection-action-set.ts
index a7d16c680f636655a19b4b0f70981ac703bf338a..d6095d10ce4b2ce0a8b64aa56ab59e2aa0ebbe1b 100644 (file)
@@ -12,6 +12,10 @@ import { openMoveCollectionDialog } from '~/store/collections/collection-move-ac
 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";
+import { toggleDetailsPanel } from '~/store/details-panel/details-panel-action';
 
 export const collectionActionSet: ContextMenuActionSet = [[
     {
@@ -24,15 +28,10 @@ export const collectionActionSet: ContextMenuActionSet = [[
     {
         icon: ShareIcon,
         name: "Share",
-        execute: (dispatch, resource) => {
-            // add code
+        execute: (dispatch, { uuid }) => {
+            dispatch<any>(openSharingDialog(uuid));
         }
     },
-    {
-        icon: MoveToIcon,
-        name: "Move to",
-        execute: (dispatch, resource) => dispatch<any>(openMoveCollectionDialog(resource))
-    },
     {
         component: ToggleFavoriteAction,
         execute: (dispatch, resource) => {
@@ -42,10 +41,9 @@ export const collectionActionSet: ContextMenuActionSet = [[
         }
     },
     {
-        component: ToggleTrashAction,
-        execute: (dispatch, resource) => {
-            dispatch<any>(toggleCollectionTrashed(resource));
-        }
+        icon: MoveToIcon,
+        name: "Move to",
+        execute: (dispatch, resource) => dispatch<any>(openMoveCollectionDialog(resource))
     },
     {
         icon: CopyIcon,
@@ -53,33 +51,40 @@ export const collectionActionSet: ContextMenuActionSet = [[
         execute: (dispatch, resource) => {
             dispatch<any>(openCollectionCopyDialog(resource));
         }
+
     },
     {
         icon: DetailsIcon,
         name: "View details",
-        execute: (dispatch, resource) => {
-            // add code
-        }
-    },
-    {
-        icon: ProvenanceGraphIcon,
-        name: "Provenance graph",
-        execute: (dispatch, resource) => {
-            // add code
+        execute: dispatch => {
+            dispatch<any>(toggleDetailsPanel());
         }
     },
+    // {
+    //     icon: ProvenanceGraphIcon,
+    //     name: "Provenance graph",
+    //     execute: (dispatch, resource) => {
+    //         // add code
+    //     }
+    // },
     {
         icon: AdvancedIcon,
         name: "Advanced",
         execute: (dispatch, resource) => {
-            // add code
+            dispatch<any>(openAdvancedTabDialog(resource.uuid));
         }
     },
     {
-        icon: RemoveIcon,
-        name: "Remove",
+        component: ToggleTrashAction,
         execute: (dispatch, resource) => {
-            // add code
+            dispatch<any>(toggleCollectionTrashed(resource.uuid, resource.isTrashed!!));
         }
-    }
+    },
+    // {
+    //     icon: RemoveIcon,
+    //     name: "Remove",
+    //     execute: (dispatch, resource) => {
+    //         // add code
+    //     }
+    // }
 ]];