// Copyright (C) The Arvados Authors. All rights reserved. // // SPDX-License-Identifier: AGPL-3.0 import { ContextMenuActionSet } from "../context-menu-action-set"; 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 { dataExplorerActions } from "../../../store/data-explorer/data-explorer-action"; import { FAVORITE_PANEL_ID } from "../../../views/favorite-panel/favorite-panel"; export const projectActionSet: ContextMenuActionSet = [[{ icon: NewProjectIcon, name: "New project", execute: (dispatch, resource) => { dispatch(projectActions.OPEN_PROJECT_CREATOR({ ownerUuid: resource.uuid })); } }, { component: ToggleFavoriteAction, execute: (dispatch, resource) => { dispatch(toggleFavorite(resource)).then(() => { dispatch(dataExplorerActions.REQUEST_ITEMS({ id : FAVORITE_PANEL_ID })); }); } }]];