X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/e6039bec0497aa7e1391958e5c4f84bbaeef653e..786d7c2b99da82c92d0ab5bc242f75513a46b4b5:/src/views-components/context-menu/action-sets/project-action-set.ts?ds=inline diff --git a/src/views-components/context-menu/action-sets/project-action-set.ts b/src/views-components/context-menu/action-sets/project-action-set.ts index 9a1b1d5b12..4e7a600288 100644 --- a/src/views-components/context-menu/action-sets/project-action-set.ts +++ b/src/views-components/context-menu/action-sets/project-action-set.ts @@ -2,18 +2,28 @@ // // SPDX-License-Identifier: AGPL-3.0 +import { reset } from "redux-form"; + 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 { 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"; +import { PROJECT_CREATE_DIALOG } from "../../dialog-create/dialog-project-create"; export const projectActionSet: ContextMenuActionSet = [[{ - icon: IconTypes.FOLDER, + icon: NewProjectIcon, name: "New project", execute: (dispatch, resource) => { - dispatch(actions.OPEN_PROJECT_CREATOR({ ownerUuid: resource.uuid })); + dispatch(reset(PROJECT_CREATE_DIALOG)); + dispatch(projectActions.OPEN_PROJECT_CREATOR({ ownerUuid: resource.uuid })); } }, { - icon: IconTypes.ANNOUNCEMENT, - name: "Share", - execute: () => { return; } -}]]; \ No newline at end of file + component: ToggleFavoriteAction, + execute: (dispatch, resource) => { + dispatch(toggleFavorite(resource)).then(() => { + dispatch(favoritePanelActions.REQUEST_ITEMS()); + }); + } +}]];