diff --git a/airflow-core/src/airflow/ui/public/i18n/locales/en/dag.json b/airflow-core/src/airflow/ui/public/i18n/locales/en/dag.json index 04380b149a8b2..7f701f94b7391 100644 --- a/airflow-core/src/airflow/ui/public/i18n/locales/en/dag.json +++ b/airflow-core/src/airflow/ui/public/i18n/locales/en/dag.json @@ -45,7 +45,8 @@ "buttons": { "resetToLatest": "Reset to latest", "toggleGroup": "Toggle group" - } + }, + "runTypeLegend": "Run Type Legend" }, "header": { "buttons": { diff --git a/airflow-core/src/airflow/ui/src/layouts/Details/Grid/GridLegend.tsx b/airflow-core/src/airflow/ui/src/layouts/Details/Grid/GridLegend.tsx new file mode 100644 index 0000000000000..81a76e5173417 --- /dev/null +++ b/airflow-core/src/airflow/ui/src/layouts/Details/Grid/GridLegend.tsx @@ -0,0 +1,51 @@ +/*! + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +import { Box, Flex, Text } from "@chakra-ui/react"; +import { useTranslation } from "react-i18next"; +import { LuInfo } from "react-icons/lu"; + +import type { DAGRunResponse } from "openapi/requests/types.gen"; +import { RunTypeIcon } from "src/components/RunTypeIcon"; +import { Tooltip } from "src/components/ui"; + +const runTypes: Array = ["scheduled", "manual", "backfill", "asset_triggered"]; + +export const RunTypeLegend = () => { + const { t: translate } = useTranslation("common"); + + return ( + + {runTypes.map((runType) => ( + + + {translate(`runTypes.${runType}`)} + + ))} + + } + portalled + > + + + + + ); +}; diff --git a/airflow-core/src/airflow/ui/src/layouts/Details/PanelButtons.tsx b/airflow-core/src/airflow/ui/src/layouts/Details/PanelButtons.tsx index 488b1b388b63c..df2342ca621db 100644 --- a/airflow-core/src/airflow/ui/src/layouts/Details/PanelButtons.tsx +++ b/airflow-core/src/airflow/ui/src/layouts/Details/PanelButtons.tsx @@ -54,6 +54,7 @@ import { dagRunTypeOptions, dagRunStateOptions } from "src/constants/stateOption import { useContainerWidth } from "src/utils/useContainerWidth"; import { DagRunSelect } from "./DagRunSelect"; +import { GridLegend } from "./Grid/GridLegend"; import { TaskStreamFilter } from "./TaskStreamFilter"; import { ToggleGroups } from "./ToggleGroups"; @@ -480,7 +481,8 @@ export const PanelButtons = ({ {dagView === "grid" && ( - + +