diff --git a/airflow-core/src/airflow/ui/public/i18n/locales/en/common.json b/airflow-core/src/airflow/ui/public/i18n/locales/en/common.json index cb83efcedb9d1..6d1c8cc4d8244 100644 --- a/airflow-core/src/airflow/ui/public/i18n/locales/en/common.json +++ b/airflow-core/src/airflow/ui/public/i18n/locales/en/common.json @@ -17,6 +17,7 @@ "auditLog": "Audit Log", "xcoms": "XComs" }, + "collapseDetailsPanel": "Collapse Details Panel", "createdAssetEvent_one": "Created Asset Event", "createdAssetEvent_other": "Created Asset Events", "dag_one": "Dag", @@ -144,6 +145,7 @@ "users": "Users" }, "selectLanguage": "Select Language", + "showDetailsPanel": "Show Details Panel", "sourceAssetEvent_one": "Source Asset Event", "sourceAssetEvent_other": "Source Asset Events", "startDate": "Start Date", diff --git a/airflow-core/src/airflow/ui/public/i18n/locales/zh-TW/common.json b/airflow-core/src/airflow/ui/public/i18n/locales/zh-TW/common.json index 7df78a954dd47..8ffe50696d106 100644 --- a/airflow-core/src/airflow/ui/public/i18n/locales/zh-TW/common.json +++ b/airflow-core/src/airflow/ui/public/i18n/locales/zh-TW/common.json @@ -17,6 +17,7 @@ "auditLog": "審計日誌", "xcoms": "XComs" }, + "collapseDetailsPanel": "收起詳細資訊", "createdAssetEvent_one": "已建立資源事件", "createdAssetEvent_other": "已建立資源事件", "dag_one": "Dag", @@ -144,6 +145,7 @@ "users": "使用者" }, "selectLanguage": "選擇語言", + "showDetailsPanel": "顯示詳細資訊", "sourceAssetEvent_one": "來源資源事件", "sourceAssetEvent_other": "來源資源事件", "startDate": "開始日期", diff --git a/airflow-core/src/airflow/ui/src/layouts/Details/DetailsLayout.tsx b/airflow-core/src/airflow/ui/src/layouts/Details/DetailsLayout.tsx index 5ff7ed51ff64e..d1d90cf803a06 100644 --- a/airflow-core/src/airflow/ui/src/layouts/Details/DetailsLayout.tsx +++ b/airflow-core/src/airflow/ui/src/layouts/Details/DetailsLayout.tsx @@ -16,11 +16,12 @@ * specific language governing permissions and limitations * under the License. */ -import { Box, HStack, Flex, useDisclosure } from "@chakra-ui/react"; +import { Box, HStack, Flex, useDisclosure, IconButton } from "@chakra-ui/react"; import { useReactFlow } from "@xyflow/react"; -import { useRef } from "react"; +import { useRef, useState } from "react"; import type { PropsWithChildren, ReactNode } from "react"; import { useTranslation } from "react-i18next"; +import { FaChevronLeft, FaChevronRight } from "react-icons/fa"; import { LuFileWarning } from "react-icons/lu"; import { Panel, PanelGroup, PanelResizeHandle } from "react-resizable-panels"; import { Outlet, useParams } from "react-router-dom"; @@ -66,6 +67,7 @@ export const DetailsLayout = ({ children, error, isLoading, tabs }: Props) => { dagId, }); const { onClose, onOpen, open } = useDisclosure(); + const [isRightPanelCollapsed, setIsRightPanelCollapsed] = useState(false); return ( @@ -79,6 +81,23 @@ export const DetailsLayout = ({ children, error, isLoading, tabs }: Props) => { + {isRightPanelCollapsed ? ( + setIsRightPanelCollapsed(false)} + position="absolute" + right={0} + size="sm" + top="50%" + zIndex={10} + > + + + ) : undefined} @@ -92,50 +111,76 @@ export const DetailsLayout = ({ children, error, isLoading, tabs }: Props) => { {dagView === "graph" ? : } - { - if (!isDragging) { - const zoom = getZoom(); + {!isRightPanelCollapsed && ( + { + if (!isDragging) { + const zoom = getZoom(); - void fitView({ maxZoom: zoom, minZoom: zoom }); - } - }} - > - - - - - {children} - {Boolean(error) || (warningData?.dag_warnings.length ?? 0) > 0 ? ( - <> - } - margin="2" - marginBottom="-1" - onClick={onOpen} - rounded="full" - text={String(warningData?.total_entries ?? 0 + Number(error))} - variant="solid" - /> + void fitView({ maxZoom: zoom, minZoom: zoom }); + } + }} + > + + setIsRightPanelCollapsed(true)} + size="xs" + zIndex={2} + > + + + + + )} + {!isRightPanelCollapsed && ( + + + {children} + {Boolean(error) || (warningData?.dag_warnings.length ?? 0) > 0 ? ( + <> + } + margin="2" + marginBottom="-1" + onClick={onOpen} + rounded="full" + text={String(warningData?.total_entries ?? 0 + Number(error))} + variant="solid" + /> - - - ) : undefined} - - - - + + + ) : undefined} + + + + + - - + + )}