Merge branch 'master' into 13854-tags-card
[arvados-workbench2.git] / src / views-components / context-menu / action-sets / project-action-set.ts
index 66dbd4d16c5ba30034d5de8283ff5d8f4ea6c712..df298e4b1f8c1c472bae5fdc7c2b8d5ba8f464ad 100644 (file)
@@ -4,7 +4,10 @@
 
 import { ContextMenuActionSet } from "../context-menu-action-set";
 import { projectActions } from "../../../store/project/project-action";
-import { ShareIcon, NewProjectIcon  } from "../../../components/icon/icon";
+import { NewProjectIcon } from "../../../components/icon/icon";
+import { ToggleFavoriteAction } from "../actions/favorite-action";
+import { toggleFavorite } from "../../../store/favorites/favorites-actions";
+import { favoritePanelActions } from "../../../store/favorite-panel/favorite-panel-action";
 
 export const projectActionSet: ContextMenuActionSet = [[{
     icon: NewProjectIcon,
@@ -13,7 +16,10 @@ export const projectActionSet: ContextMenuActionSet = [[{
         dispatch(projectActions.OPEN_PROJECT_CREATOR({ ownerUuid: resource.uuid }));
     }
 }, {
-    icon: ShareIcon,
-    name: "Share",
-    execute: () => { return; }
+    component: ToggleFavoriteAction,
+    execute: (dispatch, resource) => {
+        dispatch<any>(toggleFavorite(resource)).then(() => {
+            dispatch<any>(favoritePanelActions.REQUEST_ITEMS());
+        });
+    }
 }]];