X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/9b390921232a4a3d1279d59da96f00dabeba1150..42c529f08bbeccaeb0d4c07f639c74504569c621:/src/views-components/context-menu/action-sets/project-action-set.ts 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 61ff9fe1ae..06ffb9d8f2 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,35 @@ // // 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 { ShareIcon, NewProjectIcon } from "../../../components/icon/icon"; +import { projectActions } from "../../../store/project/project-action"; +import { NewProjectIcon, MoveToIcon } 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 { openMoveToDialog } from "../../move-to-dialog/move-to-dialog"; +import { PROJECT_CREATE_DIALOG } from "../../dialog-create/dialog-project-create"; export const projectActionSet: ContextMenuActionSet = [[{ 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: ShareIcon, - name: "Share", - execute: () => { return; } -}]]; \ No newline at end of file + component: ToggleFavoriteAction, + execute: (dispatch, resource) => { + dispatch(toggleFavorite(resource)).then(() => { + dispatch(favoritePanelActions.REQUEST_ITEMS()); + }); + } +}, { + icon: MoveToIcon, + name: "Move to", + execute: (dispatch) => { + dispatch(openMoveToDialog()); + } +},]];