Merge branch '21621-io-panel-json-tab-copy' into main. Closes #21621
[arvados.git] / services / workbench2 / src / views-components / context-menu / action-sets / trash-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 { ToggleTrashAction } from 'views-components/context-menu/actions/trash-action';
7 import { toggleTrashed } from 'store/trash/trash-actions';
8
9 export const trashActionSet: ContextMenuActionSet = [
10     [
11         {
12             component: ToggleTrashAction,
13             name: ContextMenuActionNames.MOVE_TO_TRASH,
14             execute: (dispatch, resources) => {
15                 resources.forEach((resource) => dispatch<any>(toggleTrashed(resource.kind, resource.uuid, resource.ownerUuid, resource.isTrashed!!)));
16             },
17         },
18     ],
19 ];