Merge branch '21388-arvados-3.0-distros-docs'
[arvados.git] / services / workbench2 / src / views-components / context-menu / action-sets / resource-action-set.ts
1 // Copyright (C) The Arvados Authors. All rights reserved.
2 //
3 // SPDX-License-Identifier: AGPL-3.0
4
5 import { ContextMenuActionSet, ContextMenuActionNames } from '../context-menu-action-set';
6 import { ToggleFavoriteAction } from '../actions/favorite-action';
7 import { toggleFavorite } from 'store/favorites/favorites-actions';
8
9 export const resourceActionSet: ContextMenuActionSet = [
10     [
11         {
12             component: ToggleFavoriteAction,
13             name: ContextMenuActionNames.ADD_TO_FAVORITES,
14             execute: (dispatch, resources) => {
15                 resources.forEach((resource) => dispatch<any>(toggleFavorite(resource)));
16             },
17         },
18     ],
19 ];