This is an automated email from the ASF dual-hosted git repository.

bbovenzi pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new 7621f71dd7 Fix misc grid/graph view UI bugs (#30752)
7621f71dd7 is described below

commit 7621f71dd7c3e5926dff03ba6cfe3f8a5a03f2d3
Author: Brent Bovenzi <[email protected]>
AuthorDate: Wed Apr 19 18:30:23 2023 -0400

    Fix misc grid/graph view UI bugs (#30752)
---
 airflow/www/static/js/dag/details/graph/utils.ts | 3 +--
 airflow/www/static/js/dag/grid/index.tsx         | 2 +-
 airflow/www/static/js/utils/graph.ts             | 6 ++++--
 3 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/airflow/www/static/js/dag/details/graph/utils.ts 
b/airflow/www/static/js/dag/details/graph/utils.ts
index f6305a76d2..703fb38b9c 100644
--- a/airflow/www/static/js/dag/details/graph/utils.ts
+++ b/airflow/www/static/js/dag/details/graph/utils.ts
@@ -160,8 +160,7 @@ export const buildEdges = ({
       const targetIds = e.target.split(".");
       const isSelected =
         selectedTaskId &&
-        (e.source.includes(selectedTaskId) ||
-          e.target.includes(selectedTaskId));
+        (e.source === selectedTaskId || e.target === selectedTaskId);
 
       if (
         sourceIds.length === targetIds.length &&
diff --git a/airflow/www/static/js/dag/grid/index.tsx 
b/airflow/www/static/js/dag/grid/index.tsx
index 782ff4d5af..9c9638d7c1 100644
--- a/airflow/www/static/js/dag/grid/index.tsx
+++ b/airflow/www/static/js/dag/grid/index.tsx
@@ -52,7 +52,7 @@ const Grid = ({
 }: Props) => {
   const scrollRef = useRef<HTMLDivElement>(null);
   const tableRef = useRef<HTMLTableSectionElement>(null);
-  const offsetTop = useOffsetTop(scrollRef);
+  const offsetTop = useOffsetTop(tableRef);
   const { selected } = useSelection();
 
   const {
diff --git a/airflow/www/static/js/utils/graph.ts 
b/airflow/www/static/js/utils/graph.ts
index 24d3bb3750..d2d2923c5a 100644
--- a/airflow/www/static/js/utils/graph.ts
+++ b/airflow/www/static/js/utils/graph.ts
@@ -87,12 +87,14 @@ const generateGraph = ({
   const formatChildNode = (node: any) => {
     const { id, value, children } = node;
     const isOpen = openGroupIds?.includes(value.label);
+    const childCount =
+      children?.filter((c: any) => !c.id.includes("join_id")).length || 0;
     if (isOpen && children.length) {
       return {
         id,
         value: {
           ...value,
-          childCount: children.length,
+          childCount,
           isOpen: true,
         },
         label: value.label,
@@ -110,7 +112,7 @@ const generateGraph = ({
       value: {
         ...value,
         isJoinNode,
-        childCount: children?.length || 0,
+        childCount,
       },
       width: isJoinNode ? 10 : 200,
       height: isJoinNode ? 10 : 60,

Reply via email to