From ad687c4dc723fa86403d3f6472ad73a0a78d0f03 Mon Sep 17 00:00:00 2001 From: Ken Hibino Date: Sat, 26 Mar 2022 14:09:24 -0700 Subject: [PATCH] (ui): Add error and not found alert box in AggregatingTasksTable --- ui/src/components/AggregatingTasksTable.tsx | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/ui/src/components/AggregatingTasksTable.tsx b/ui/src/components/AggregatingTasksTable.tsx index bcfc5de..533bd88 100644 --- a/ui/src/components/AggregatingTasksTable.tsx +++ b/ui/src/components/AggregatingTasksTable.tsx @@ -17,6 +17,8 @@ import ArchiveIcon from "@material-ui/icons/Archive"; import DeleteIcon from "@material-ui/icons/Delete"; import MoreHorizIcon from "@material-ui/icons/MoreHoriz"; import FileCopyOutlinedIcon from "@material-ui/icons/FileCopyOutlined"; +import Alert from "@material-ui/lab/Alert"; +import AlertTitle from "@material-ui/lab/AlertTitle"; import { useHistory } from "react-router-dom"; import { listGroupsAsync } from "../actions/groupsActions"; import GroupSelect from "./GroupSelect"; @@ -62,6 +64,7 @@ function mapStateToProps(state: AppState) { groups: state.groups.data, groupsError: state.groups.error, loading: state.tasks.aggregatingTasks.loading, + error: state.tasks.aggregatingTasks.error, group: state.tasks.aggregatingTasks.group, tasks: state.tasks.aggregatingTasks.data, pollInterval: state.settings.pollInterval, @@ -144,6 +147,23 @@ function AggregatingTasksTable( usePolling(fetchGroups, pollInterval); usePolling(fetchTasks, pollInterval); + if (props.error.length > 0) { + return ( + + Error + {props.error} + + ); + } + if (props.groups.length === 0) { + return ( + + Info + No aggregating tasks at this time. + + ); + } + const rowCount = props.tasks.length; const numSelected = selectedIds.length; return (