Skip to content

Commit

Permalink
Fix calendar view with no DAG Run. (#38964)
Browse files Browse the repository at this point in the history
  • Loading branch information
tirkarthi authored Apr 12, 2024
1 parent 8fad98d commit 5f6f4a5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion airflow/www/static/js/dag/details/dag/Calendar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

import React from "react";
import type { EChartsOption } from "echarts";
import { Box, Spinner, Flex } from "@chakra-ui/react";
import { Box, Spinner, Flex, Text } from "@chakra-ui/react";

import ReactECharts from "src/components/ReactECharts";
import { useCalendarData } from "src/api";
Expand All @@ -37,6 +37,10 @@ const Calendar = () => {

const { dagStates } = calendarData;

if (dagStates.length < 1) {
return <Text>Calendar view requires at least one DAG Run.</Text>;
}

const startDate = dagStates[0].date;
const endDate = dagStates[dagStates.length - 1].date;
// @ts-ignore
Expand Down

0 comments on commit 5f6f4a5

Please sign in to comment.