Skip to content

Commit 010ba65

Browse files
github-actions[bot]fat-catTWpotiukpierrejeambrun
authored
[v3-2-test] open task group when navigating via group name; preserve arrow toggl… (#64284) (#64919)
* open task group when navigating via group name; preserve arrow toggle behavior * Remove redundant comment. * Update airflow-core/src/airflow/ui/src/layouts/Details/Grid/TaskNames.tsx * Update airflow-core/src/airflow/ui/src/layouts/Details/Grid/TaskNames.tsx * Fixing static checks * Update TaskNames.tsx --------- (cherry picked from commit 11a0aa8) Co-authored-by: fat-catTW <124506982+fat-catTW@users.noreply.github.com> Co-authored-by: Jarek Potiuk <jarek@potiuk.com> Co-authored-by: Pierre Jeambrun <pierrejbrun@gmail.com>
1 parent ba4be73 commit 010ba65

1 file changed

Lines changed: 18 additions & 1 deletion

File tree

  • airflow-core/src/airflow/ui/src/layouts/Details/Grid

airflow-core/src/airflow/ui/src/layouts/Details/Grid/TaskNames.tsx

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,22 @@ export const TaskNames = ({ nodes, onRowClick, virtualItems }: Props) => {
6767
}
6868
};
6969

70+
const onClick = (event: MouseEvent<HTMLSpanElement>) => {
71+
const groupNodeId = event.currentTarget.dataset.groupId;
72+
73+
if (groupNodeId === undefined || groupNodeId === "") {
74+
return;
75+
}
76+
77+
const id = groupNodeId;
78+
const isViewingSameGroup = typeof groupId === "string" && groupId === id;
79+
80+
if (isViewingSameGroup) {
81+
toggleGroupId(id);
82+
}
83+
onRowClick?.();
84+
};
85+
7086
const search = searchParams.toString();
7187

7288
// If virtualItems is provided, use virtualization; otherwise render all items
@@ -109,7 +125,8 @@ export const TaskNames = ({ nodes, onRowClick, virtualItems }: Props) => {
109125
{node.isGroup ? (
110126
<Link asChild data-testid={node.id} display="block" width="100%">
111127
<RouterLink
112-
onClick={onRowClick}
128+
data-group-id={node.id}
129+
onClick={onClick}
113130
replace
114131
style={{ outline: "none" }}
115132
to={{

0 commit comments

Comments
 (0)