You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by je...@apache.org on 2024/04/26 23:00:35 UTC
(airflow) 19/48: Fix calendar view with no DAG Run. (#38964)
This is an automated email from the ASF dual-hosted git repository.
jedcunningham pushed a commit to branch v2-9-test
in repository https://gitbox.apache.org/repos/asf/airflow.git
commit b35f67dc4cf695aa18885eb1fba445e8699ba847
Author: Karthikeyan Singaravelan <ti...@gmail.com>
AuthorDate: Sat Apr 13 00:30:39 2024 +0530
Fix calendar view with no DAG Run. (#38964)
(cherry picked from commit 5f6f4a5f4654d64efb4c0cabb6e0e054d13a2e0f)
---
airflow/www/static/js/dag/details/dag/Calendar.tsx | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/airflow/www/static/js/dag/details/dag/Calendar.tsx b/airflow/www/static/js/dag/details/dag/Calendar.tsx
index 0c9e5afb93..6826ab5d67 100644
--- a/airflow/www/static/js/dag/details/dag/Calendar.tsx
+++ b/airflow/www/static/js/dag/details/dag/Calendar.tsx
@@ -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";
@@ -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