diff --git a/ui/src/components/QueueBreadcrumb.tsx b/ui/src/components/QueueBreadcrumb.tsx index b3d31ca..4470630 100644 --- a/ui/src/components/QueueBreadcrumb.tsx +++ b/ui/src/components/QueueBreadcrumb.tsx @@ -31,7 +31,9 @@ interface Props { // All queue names. queues: string[]; // Name of the queue currently selected. - selectedQueue: string; + queueName: string; + // ID of the task currently selected (optional). + taskId?: string; } export default function QueueBreadcrumbs(props: Props) { @@ -57,11 +59,12 @@ export default function QueueBreadcrumbs(props: Props) { onClick={() => history.push(paths.HOME)} /> } onClick={handleClick} onDelete={handleClick} /> + {props.taskId && } q.name), // FIXME: This data may not be available }; } -const connector = connect(mapStateToProps, { getTaskInfoAsync }); +const connector = connect(mapStateToProps, { + getTaskInfoAsync, + listQueuesAsync, +}); const useStyles = makeStyles((theme) => ({ container: { paddingTop: theme.spacing(2), }, + breadcrumbs: { + marginBottom: theme.spacing(2), + }, })); type Props = ConnectedProps; @@ -32,7 +41,7 @@ type Props = ConnectedProps; function TaskDetailsView(props: Props) { const classes = useStyles(); const { qname, taskId } = useParams(); - const { getTaskInfoAsync, pollInterval } = props; + const { getTaskInfoAsync, pollInterval, listQueuesAsync } = props; const fetchTaskInfo = useMemo(() => { return () => { @@ -42,9 +51,21 @@ function TaskDetailsView(props: Props) { usePolling(fetchTaskInfo, pollInterval); + // Fetch queues data to populate props.queues + useEffect(() => { + listQueuesAsync(); + }, [listQueuesAsync]); + return ( - + + + + Task Details View Queue: {qname} TaskID: {taskId} diff --git a/ui/src/views/TasksView.tsx b/ui/src/views/TasksView.tsx index 32e0961..23db498 100644 --- a/ui/src/views/TasksView.tsx +++ b/ui/src/views/TasksView.tsx @@ -51,7 +51,6 @@ function TasksView(props: ConnectedProps) { } const { listQueuesAsync } = props; - // Shoudn't we polling here? useEffect(() => { listQueuesAsync(); }, [listQueuesAsync]); @@ -60,7 +59,7 @@ function TasksView(props: ConnectedProps) { - +