Implement action for toggling favorite status
[arvados-workbench2.git] / src / views-components / context-menu / action-sets / project-action-set.ts
index 66dbd4d16c5ba30034d5de8283ff5d8f4ea6c712..e0284e85ef670293b63271948909bd0041d899f5 100644 (file)
@@ -4,7 +4,9 @@
 
 import { ContextMenuActionSet } from "../context-menu-action-set";
 import { projectActions } from "../../../store/project/project-action";
-import { ShareIcon, NewProjectIcon  } from "../../../components/icon/icon";
+import { ShareIcon, NewProjectIcon } from "../../../components/icon/icon";
+import { FavoriteActionText, FavoriteActionIcon } from "./favorite-action";
+import { favoritesActions, toggleFavorite } from "../../../store/favorites/favorites-actions";
 
 export const projectActionSet: ContextMenuActionSet = [[{
     icon: NewProjectIcon,
@@ -13,7 +15,9 @@ export const projectActionSet: ContextMenuActionSet = [[{
         dispatch(projectActions.OPEN_PROJECT_CREATOR({ ownerUuid: resource.uuid }));
     }
 }, {
-    icon: ShareIcon,
-    name: "Share",
-    execute: () => { return; }
+    name: FavoriteActionText,
+    icon: FavoriteActionIcon,
+    execute: (dispatch, resource) => {
+        dispatch<any>(toggleFavorite(resource.uuid));
+    }
 }]];