From f8f2083d6ba2b775c936297af1c593f2f12b31bb Mon Sep 17 00:00:00 2001 From: Akash Sharma <2akash111998@gmail.com> Date: Wed, 10 May 2023 01:26:58 +0530 Subject: [PATCH 1/8] spinner added --- .../www/static/js/dag/details/taskInstance/Logs/index.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/airflow/www/static/js/dag/details/taskInstance/Logs/index.tsx b/airflow/www/static/js/dag/details/taskInstance/Logs/index.tsx index 827a69edbaef3..89b865bc685b0 100644 --- a/airflow/www/static/js/dag/details/taskInstance/Logs/index.tsx +++ b/airflow/www/static/js/dag/details/taskInstance/Logs/index.tsx @@ -26,6 +26,7 @@ import { Button, Checkbox, Icon, + Spinner } from "@chakra-ui/react"; import { MdWarning } from "react-icons/md"; @@ -266,12 +267,14 @@ const Logs = ({ {warning} )} - {!!parsedLogs && ( + {parsedLogs ? ( + ) : ( + )} )} From c61a863a4eb521a47c8465e4e598d3dd9b54fbc7 Mon Sep 17 00:00:00 2001 From: Akash Sharma <2akash111998@gmail.com> Date: Wed, 10 May 2023 02:59:32 +0530 Subject: [PATCH 2/8] fixed static checks --- airflow/www/static/js/dag/details/taskInstance/Logs/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/airflow/www/static/js/dag/details/taskInstance/Logs/index.tsx b/airflow/www/static/js/dag/details/taskInstance/Logs/index.tsx index 89b865bc685b0..72241a7662be4 100644 --- a/airflow/www/static/js/dag/details/taskInstance/Logs/index.tsx +++ b/airflow/www/static/js/dag/details/taskInstance/Logs/index.tsx @@ -26,7 +26,7 @@ import { Button, Checkbox, Icon, - Spinner + Spinner, } from "@chakra-ui/react"; import { MdWarning } from "react-icons/md"; From ca0d581ba4a6d7211858ee7130d959c3ac845213 Mon Sep 17 00:00:00 2001 From: Akash Sharma <2akash111998@gmail.com> Date: Wed, 10 May 2023 11:54:06 +0530 Subject: [PATCH 3/8] isFetching --- .../js/dag/details/taskInstance/Logs/index.tsx | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/airflow/www/static/js/dag/details/taskInstance/Logs/index.tsx b/airflow/www/static/js/dag/details/taskInstance/Logs/index.tsx index 72241a7662be4..9af975e5fae32 100644 --- a/airflow/www/static/js/dag/details/taskInstance/Logs/index.tsx +++ b/airflow/www/static/js/dag/details/taskInstance/Logs/index.tsx @@ -120,7 +120,7 @@ const Logs = ({ const { timezone } = useTimezone(); const taskTryNumber = selectedTryNumber || tryNumber || 1; - const { data } = useTaskLog({ + const { data, isFetching } = useTaskLog({ dagId, dagRunId, taskId, @@ -267,14 +267,16 @@ const Logs = ({ {warning} )} - {parsedLogs ? ( - - ) : ( + {isFetching ? ( + ) : ( + !!parsedLogs && ( + + ) )} )} From d0deabcf5cc6faa23cdfcb6016896627a2f99247 Mon Sep 17 00:00:00 2001 From: Akash Sharma <2akash111998@gmail.com> Date: Wed, 10 May 2023 23:04:46 +0530 Subject: [PATCH 4/8] isFetching replaced with isLoading --- airflow/www/static/js/api/useTaskLog.ts | 1 - airflow/www/static/js/dag/details/taskInstance/Logs/index.tsx | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/airflow/www/static/js/api/useTaskLog.ts b/airflow/www/static/js/api/useTaskLog.ts index fb8c6ee727071..a5e9bab69f82d 100644 --- a/airflow/www/static/js/api/useTaskLog.ts +++ b/airflow/www/static/js/api/useTaskLog.ts @@ -74,7 +74,6 @@ const useTaskLog = ({ }); }, { - placeholderData: "", refetchInterval: expectingLogs && isRefreshOn && (autoRefreshInterval || 1) * 1000, } diff --git a/airflow/www/static/js/dag/details/taskInstance/Logs/index.tsx b/airflow/www/static/js/dag/details/taskInstance/Logs/index.tsx index 9af975e5fae32..97499b41a752e 100644 --- a/airflow/www/static/js/dag/details/taskInstance/Logs/index.tsx +++ b/airflow/www/static/js/dag/details/taskInstance/Logs/index.tsx @@ -120,7 +120,7 @@ const Logs = ({ const { timezone } = useTimezone(); const taskTryNumber = selectedTryNumber || tryNumber || 1; - const { data, isFetching } = useTaskLog({ + const { data, isLoading } = useTaskLog({ dagId, dagRunId, taskId, @@ -267,7 +267,7 @@ const Logs = ({ {warning} )} - {isFetching ? ( + {isLoading ? ( ) : ( !!parsedLogs && ( From bb38c149aca9c4d493eb4460035000149b22b028 Mon Sep 17 00:00:00 2001 From: Akash Sharma <35839624+Adaverse@users.noreply.github.com> Date: Sat, 20 May 2023 13:41:07 +0530 Subject: [PATCH 5/8] Update CONTRIBUTING.rst --- CONTRIBUTING.rst | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index f88a12979a441..4836efc7d6902 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -1160,7 +1160,11 @@ To install yarn on macOS: export PATH="$HOME/.yarn/bin:$PATH" -4. Install third-party libraries defined in ``package.json`` by running the +4. Install third-party libraries defined in ``package.json`` by running the following command + +.. code-block:: bash + + yarn install Generate Bundled Files with yarn -------------------------------- From 360478b2fad92f9a775d23abdfda7077aeba2328 Mon Sep 17 00:00:00 2001 From: Akash Sharma <2akash111998@gmail.com> Date: Fri, 26 May 2023 04:54:29 +0530 Subject: [PATCH 6/8] - fix where collapsed Grid won't show up when Details is uncollapsed - removing clearSelection when Details is collapsed - making experience uniform when collapsing or uncollapsing Grid or Detaials view --- airflow/www/static/js/dag/Main.tsx | 50 ++++++++++++------------ airflow/www/static/js/dag/grid/index.tsx | 38 +++++++++--------- 2 files changed, 45 insertions(+), 43 deletions(-) diff --git a/airflow/www/static/js/dag/Main.tsx b/airflow/www/static/js/dag/Main.tsx index 5f0aa532b6ce0..2ade4e2d95139 100644 --- a/airflow/www/static/js/dag/Main.tsx +++ b/airflow/www/static/js/dag/Main.tsx @@ -31,11 +31,10 @@ import Grid from "./grid"; import FilterBar from "./nav/FilterBar"; import LegendRow from "./nav/LegendRow"; import useToggleGroups from "./useToggleGroups"; -import useSelection from "./useSelection"; const detailsPanelKey = "hideDetailsPanel"; const minPanelWidth = 300; -const collapsedWidth = "28px"; +const collapsedWidth = "1px"; const gridWidthKey = "grid-width"; const saveWidth = debounce( @@ -68,7 +67,6 @@ const Main = () => { const gridRef = useRef(null); const isPanelOpen = localStorage.getItem(detailsPanelKey) !== "true"; const { isOpen, onToggle } = useDisclosure({ defaultIsOpen: isPanelOpen }); - const { clearSelection } = useSelection(); const [hoveredTaskState, setHoveredTaskState] = useState< string | null | undefined >(); @@ -91,8 +89,10 @@ const Main = () => { if (!isOpen) { localStorage.setItem(detailsPanelKey, "false"); } else { - clearSelection(); localStorage.setItem(detailsPanelKey, "true"); + if (isGridCollapsed) { + setIsGridCollapsed(!isGridCollapsed); + } } onToggle(); }; @@ -179,29 +179,29 @@ const Main = () => { setIsGridCollapsed={onToggleGridCollapse} /> + {isOpen && !isGridCollapsed && ( + + )} {isOpen && ( - <> - +
- -
- - + )} )} diff --git a/airflow/www/static/js/dag/grid/index.tsx b/airflow/www/static/js/dag/grid/index.tsx index 9c9638d7c1a85..977afae7b3ee1 100644 --- a/airflow/www/static/js/dag/grid/index.tsx +++ b/airflow/www/static/js/dag/grid/index.tsx @@ -94,14 +94,14 @@ const Grid = ({ return ( - {isPanelOpen && ( + {(isPanelOpen || isGridCollapsed) && ( @@ -114,22 +114,24 @@ const Grid = ({ transitionProperty="none" /> )} - } - transform={isPanelOpen ? undefined : "rotateZ(180deg)"} - transitionProperty="none" - /> + {!isGridCollapsed && ( + } + transform={isPanelOpen ? undefined : "rotateZ(180deg)"} + transitionProperty="none" + /> + )} Date: Fri, 26 May 2023 18:09:32 +0530 Subject: [PATCH 7/8] resize oberserver re-registering when Grid is un-collapsed --- airflow/www/static/js/dag/Main.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/airflow/www/static/js/dag/Main.tsx b/airflow/www/static/js/dag/Main.tsx index 2ade4e2d95139..004273c9c4d1d 100644 --- a/airflow/www/static/js/dag/Main.tsx +++ b/airflow/www/static/js/dag/Main.tsx @@ -131,7 +131,7 @@ const Main = () => { }; } return () => {}; - }, [resize, isLoading, isOpen]); + }, [resize, isLoading, isOpen, isGridCollapsed]); const onToggleGridCollapse = () => { const gridElement = gridRef.current; From 252010da97cf8d30480cbfaf88eff8810701996b Mon Sep 17 00:00:00 2001 From: Akash Sharma <2akash111998@gmail.com> Date: Fri, 26 May 2023 18:51:29 +0530 Subject: [PATCH 8/8] reverting 28px to show atleast one (latest) dag run instance --- airflow/www/static/js/dag/Main.tsx | 46 ++++++++++++------------ airflow/www/static/js/dag/grid/index.tsx | 2 +- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/airflow/www/static/js/dag/Main.tsx b/airflow/www/static/js/dag/Main.tsx index 004273c9c4d1d..97644492aebba 100644 --- a/airflow/www/static/js/dag/Main.tsx +++ b/airflow/www/static/js/dag/Main.tsx @@ -34,7 +34,7 @@ import useToggleGroups from "./useToggleGroups"; const detailsPanelKey = "hideDetailsPanel"; const minPanelWidth = 300; -const collapsedWidth = "1px"; +const collapsedWidth = "28px"; const gridWidthKey = "grid-width"; const saveWidth = debounce( @@ -131,7 +131,7 @@ const Main = () => { }; } return () => {}; - }, [resize, isLoading, isOpen, isGridCollapsed]); + }, [resize, isLoading, isOpen]); const onToggleGridCollapse = () => { const gridElement = gridRef.current; @@ -179,29 +179,29 @@ const Main = () => { setIsGridCollapsed={onToggleGridCollapse} /> - {isOpen && !isGridCollapsed && ( - - )} {isOpen && ( - -
+ - + +
+ + )} )} diff --git a/airflow/www/static/js/dag/grid/index.tsx b/airflow/www/static/js/dag/grid/index.tsx index 977afae7b3ee1..b598a7fb5895d 100644 --- a/airflow/www/static/js/dag/grid/index.tsx +++ b/airflow/www/static/js/dag/grid/index.tsx @@ -101,7 +101,7 @@ const Grid = ({ color="gray.400" size="sm" position="absolute" - right={isGridCollapsed ? -8 : 0} + right={isGridCollapsed ? -10 : 0} zIndex={2} top={-8} onClick={() =>