Skip to content

Commit 3e9a6d5

Browse files
pierrejeambrunjroachgolf84
authored andcommitted
Fix Dashboard overflow and handle no status tasks (apache#49964)
1 parent 25aee9d commit 3e9a6d5

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

airflow-core/src/airflow/ui/src/pages/Dashboard/Dashboard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export const Dashboard = () => {
3232
const alerts = useConfig("dashboard_alert") as Array<UIAlert>;
3333

3434
return (
35-
<Box px={4}>
35+
<Box overflow="auto" px={4}>
3636
<VStack alignItems="start">
3737
{alerts.length > 0 ? (
3838
<Accordion.Root collapsible defaultValue={["ui_alerts"]}>

airflow-core/src/airflow/ui/src/pages/Dashboard/HistoricalMetrics/MetricSection.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import { Box, Flex, HStack, VStack, Text } from "@chakra-ui/react";
2020
import { Link as RouterLink } from "react-router-dom";
2121

22-
import type { TaskInstanceState } from "openapi/requests/types.gen";
22+
import type { TaskInstanceStateCount } from "openapi/requests/types.gen";
2323
import { StateBadge } from "src/components/StateBadge";
2424
import { capitalize } from "src/utils";
2525

@@ -31,7 +31,7 @@ type MetricSectionProps = {
3131
readonly kind: string;
3232
readonly runs: number;
3333
readonly startDate: string;
34-
readonly state: TaskInstanceState;
34+
readonly state: keyof TaskInstanceStateCount;
3535
readonly total: number;
3636
};
3737

@@ -53,7 +53,8 @@ export const MetricSection = ({ endDate, kind, runs, startDate, state, total }:
5353
<Flex justify="space-between">
5454
<HStack>
5555
<RouterLink to={`/${kind}?${searchParams.toString()}`}>
56-
<StateBadge fontSize="md" state={state}>
56+
{/* eslint-disable-next-line unicorn/no-null */}
57+
<StateBadge fontSize="md" state={state === "no_status" ? null : state}>
5758
{runs}
5859
</StateBadge>
5960
</RouterLink>
@@ -68,7 +69,7 @@ export const MetricSection = ({ endDate, kind, runs, startDate, state, total }:
6869
</Flex>
6970
<HStack gap={0} mt={2}>
7071
<Box
71-
bg={`${state}.solid`}
72+
bg={`${state === "no_status" ? "none" : state}.solid`}
7273
borderLeftRadius={5}
7374
height={`${BAR_HEIGHT}px`}
7475
minHeight={2}

airflow-core/src/airflow/ui/src/pages/Dashboard/HistoricalMetrics/TaskInstanceMetrics.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ const TASK_STATES: Array<keyof TaskInstanceStateCount> = [
4545
"up_for_reschedule",
4646
"upstream_failed",
4747
"deferred",
48+
"no_status",
4849
];
4950

5051
export const TaskInstanceMetrics = ({

0 commit comments

Comments
 (0)