Implement action for toggling favorite status
[arvados-workbench2.git] / src / views-components / context-menu / action-sets / project-action-set.ts
index 9a1b1d5b12907d3115859aefa0abdc49727f2333..e0284e85ef670293b63271948909bd0041d899f5 100644 (file)
@@ -3,17 +3,21 @@
 // SPDX-License-Identifier: AGPL-3.0
 
 import { ContextMenuActionSet } from "../context-menu-action-set";
-import actions from "../../../store/project/project-action";
-import { IconTypes } from "../../../components/icon/icon";
+import { projectActions } from "../../../store/project/project-action";
+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: IconTypes.FOLDER,
+    icon: NewProjectIcon,
     name: "New project",
     execute: (dispatch, resource) => {
-        dispatch(actions.OPEN_PROJECT_CREATOR({ ownerUuid: resource.uuid }));
+        dispatch(projectActions.OPEN_PROJECT_CREATOR({ ownerUuid: resource.uuid }));
     }
 }, {
-    icon: IconTypes.ANNOUNCEMENT,
-    name: "Share",
-    execute: () => { return; }
-}]];
\ No newline at end of file
+    name: FavoriteActionText,
+    icon: FavoriteActionIcon,
+    execute: (dispatch, resource) => {
+        dispatch<any>(toggleFavorite(resource.uuid));
+    }
+}]];