Add batch delete button to DeadTasksTable

This commit is contained in:
Ken Hibino
2020-12-13 07:51:40 -08:00
parent 62780e201e
commit ef60304015
7 changed files with 175 additions and 19 deletions

View File

@@ -3,6 +3,7 @@ import {
SnackbarActionTypes,
} from "../actions/snackbarActions";
import {
BATCH_DELETE_DEAD_TASKS_SUCCESS,
DELETE_DEAD_TASK_SUCCESS,
DELETE_RETRY_TASK_SUCCESS,
DELETE_SCHEDULED_TASK_SUCCESS,
@@ -53,6 +54,14 @@ function snackbarReducer(
message: `Dead task ${action.taskKey} deleted`,
};
case BATCH_DELETE_DEAD_TASKS_SUCCESS: {
const n = action.payload.deleted_keys.length;
return {
isOpen: true,
message: `${n} Dead ${n === 1 ? "task" : "tasks"} deleted`,
};
}
default:
return state;
}