Merge branch 'master' into 13853-collection-view-info-card
[arvados-workbench2.git] / src / views-components / context-menu / action-sets / favorite-action-set.ts
1 // Copyright (C) The Arvados Authors. All rights reserved.
2 //
3 // SPDX-License-Identifier: AGPL-3.0
4
5 import { ContextMenuActionSet } from "../context-menu-action-set";
6 import { ToggleFavoriteAction } from "../actions/favorite-action";
7 import { toggleFavorite } from "../../../store/favorites/favorites-actions";
8 import { dataExplorerActions } from "../../../store/data-explorer/data-explorer-action";
9 import { FAVORITE_PANEL_ID } from "../../../views/favorite-panel/favorite-panel";
10
11 export const favoriteActionSet: ContextMenuActionSet = [[{
12     component: ToggleFavoriteAction,
13     execute: (dispatch, resource) => {
14         dispatch<any>(toggleFavorite(resource)).then(() => {
15             dispatch<any>(dataExplorerActions.REQUEST_ITEMS({ id : FAVORITE_PANEL_ID }));
16         });
17     }
18 }]];