Add batch run button to DeadTasksTable

This commit is contained in:
Ken Hibino
2020-12-15 06:46:23 -08:00
parent 706e80580d
commit 9bfd373f85
6 changed files with 132 additions and 5 deletions

View File

@@ -33,6 +33,9 @@ import {
RUN_DEAD_TASK_BEGIN,
RUN_DEAD_TASK_SUCCESS,
RUN_DEAD_TASK_ERROR,
BATCH_RUN_DEAD_TASKS_BEGIN,
BATCH_RUN_DEAD_TASKS_ERROR,
BATCH_RUN_DEAD_TASKS_SUCCESS,
} from "../actions/tasksActions";
import {
ActiveTask,
@@ -464,6 +467,7 @@ function tasksReducer(
},
};
case BATCH_RUN_DEAD_TASKS_BEGIN:
case BATCH_DELETE_DEAD_TASKS_BEGIN:
return {
...state,
@@ -473,6 +477,20 @@ function tasksReducer(
},
};
case BATCH_RUN_DEAD_TASKS_SUCCESS: {
const newData = state.deadTasks.data.filter(
(task) => !action.payload.pending_keys.includes(task.key)
);
return {
...state,
deadTasks: {
...state.deadTasks,
batchActionPending: false,
data: newData,
},
};
}
case BATCH_DELETE_DEAD_TASKS_SUCCESS: {
const newData = state.deadTasks.data.filter(
(task) => !action.payload.deleted_keys.includes(task.key)
@@ -487,6 +505,7 @@ function tasksReducer(
};
}
case BATCH_RUN_DEAD_TASKS_ERROR:
case BATCH_DELETE_DEAD_TASKS_ERROR:
return {
...state,