mirror of
https://github.com/hibiken/asynqmon.git
synced 2025-09-21 22:36:33 +08:00
Add redux actions/reducer for aggregating task actions
This commit is contained in:
@@ -34,7 +34,10 @@ import { TableColumn } from "../types/table";
|
||||
import TablePaginationActions, {
|
||||
rowsPerPageOptions,
|
||||
} from "./TablePaginationActions";
|
||||
import { listAggregatingTasksAsync } from "../actions/tasksActions";
|
||||
import {
|
||||
listAggregatingTasksAsync,
|
||||
deleteAllAggregatingTasksAsync,
|
||||
} from "../actions/tasksActions";
|
||||
import { taskRowsPerPageChange } from "../actions/settingsActions";
|
||||
|
||||
const useStyles = makeStyles((theme) => ({
|
||||
@@ -75,6 +78,7 @@ function mapStateToProps(state: AppState) {
|
||||
const mapDispatchToProps = {
|
||||
listGroupsAsync,
|
||||
listAggregatingTasksAsync,
|
||||
deleteAllAggregatingTasksAsync,
|
||||
taskRowsPerPageChange,
|
||||
};
|
||||
|
||||
@@ -131,6 +135,13 @@ function AggregatingTasksTable(
|
||||
}
|
||||
};
|
||||
|
||||
const handleDeleteAllClick = () => {
|
||||
if (selectedGroup === null) {
|
||||
return;
|
||||
}
|
||||
props.deleteAllAggregatingTasksAsync(queue, selectedGroup.group);
|
||||
};
|
||||
|
||||
const fetchGroups = useCallback(() => {
|
||||
listGroupsAsync(queue);
|
||||
}, [listGroupsAsync, queue]);
|
||||
@@ -194,7 +205,7 @@ function AggregatingTasksTable(
|
||||
menuItemActions={[
|
||||
{
|
||||
label: "Delete All",
|
||||
onClick: () => {}, //TODO: handleDeleteAllClick,
|
||||
onClick: handleDeleteAllClick,
|
||||
disabled: false, // TODO: props.allActionPending,
|
||||
},
|
||||
{
|
||||
|
Reference in New Issue
Block a user