15768: changed all context menu actions to take an array of resources Arvados-DCO...
[arvados.git] / src / views-components / process-remove-many-dialog / process-remove-many-dialog.tsx
1 // Copyright (C) The Arvados Authors. All rights reserved.
2 //
3 // SPDX-License-Identifier: AGPL-3.0
4
5 //this file can probably be removed - lk
6
7 import { Dispatch, compose } from 'redux';
8 import { connect } from 'react-redux';
9 import { ConfirmationDialog } from 'components/confirmation-dialog/confirmation-dialog';
10 import { withDialog, WithDialogProps } from 'store/dialog/with-dialog';
11 import { removeProcessPermanently, REMOVE_MANY_PROCESSES_DIALOG } from 'store/processes/processes-actions';
12
13 const mapDispatchToProps = (dispatch: Dispatch, props: WithDialogProps<any>) => ({
14     onConfirm: () => {
15         props.closeDialog();
16         props.data.list.forEach((uuid: string) => dispatch<any>(removeProcessPermanently(uuid)));
17     },
18 });
19
20 export const RemoveManyProcessesDialog = compose(withDialog(REMOVE_MANY_PROCESSES_DIALOG), connect(null, mapDispatchToProps))(ConfirmationDialog);