15768: removeMany request fires, still gettig 403 from server Arvados-DCO-1.1-Signed...
authorLisa Knox <lisaknox83@gmail.com>
Wed, 17 May 2023 21:04:35 +0000 (17:04 -0400)
committerLisa Knox <lisaknox83@gmail.com>
Wed, 17 May 2023 21:04:35 +0000 (17:04 -0400)
src/store/processes/processes-actions.ts
src/views-components/process-remove-many-dialog/process-remove-many-dialog.tsx

index 195e9db6d30a5e6e5e6329db6ffb3d4036d479e3..8e481687626afd7dc4569ceec0328c2fa9a0891d 100644 (file)
@@ -299,7 +299,7 @@ export const openRemoveProcessDialog = (uuid: string) => (dispatch: Dispatch, ge
 export const openRemoveManyProcessesDialog = (list: Array<string>) => (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
     dispatch(
         dialogActions.OPEN_DIALOG({
-            id: REMOVE_PROCESS_DIALOG,
+            id: REMOVE_MANY_PROCESSES_DIALOG,
             data: {
                 title: 'Remove processes permanently',
                 text: `Are you sure you want to remove all ${list.length} processes?`,
@@ -311,6 +311,7 @@ export const openRemoveManyProcessesDialog = (list: Array<string>) => (dispatch:
 };
 
 export const REMOVE_PROCESS_DIALOG = 'removeProcessDialog';
+export const REMOVE_MANY_PROCESSES_DIALOG = 'removeManyProcessesDialog';
 
 export const removeProcessPermanently = (uuid: string) => async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
     dispatch(snackbarActions.OPEN_SNACKBAR({ message: 'Removing ...', kind: SnackbarKind.INFO }));
index 271831ec328a55bcf022fd80d02b5f3bab926259..d6d35a78aa3594c1f1fb9fffe4f77c6eda393cdf 100644 (file)
@@ -6,13 +6,14 @@ import { Dispatch, compose } from 'redux';
 import { connect } from 'react-redux';
 import { ConfirmationDialog } from 'components/confirmation-dialog/confirmation-dialog';
 import { withDialog, WithDialogProps } from 'store/dialog/with-dialog';
-import { removeProcessPermanently, REMOVE_PROCESS_DIALOG } from 'store/processes/processes-actions';
+import { removeProcessPermanently, REMOVE_MANY_PROCESSES_DIALOG } from 'store/processes/processes-actions';
 
 const mapDispatchToProps = (dispatch: Dispatch, props: WithDialogProps<any>) => ({
     onConfirm: () => {
+        console.log(props.data.list);
         props.closeDialog();
-        dispatch<any>(removeProcessPermanently(props.data.uuid));
+        props.data.list.forEach((uuid: string) => dispatch<any>(removeProcessPermanently(uuid)));
     },
 });
 
-export const RemoveManyProcessesDialog = compose(withDialog(REMOVE_PROCESS_DIALOG), connect(null, mapDispatchToProps))(ConfirmationDialog);
+export const RemoveManyProcessesDialog = compose(withDialog(REMOVE_MANY_PROCESSES_DIALOG), connect(null, mapDispatchToProps))(ConfirmationDialog);