Skip to content

Commit

Permalink
Fix task name selection
Browse files Browse the repository at this point in the history
  • Loading branch information
bbovenzi committed Feb 20, 2024
1 parent 044c077 commit 6e5b97c
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 30 deletions.
44 changes: 23 additions & 21 deletions airflow/www/static/js/dag/TaskName.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/

import React, { CSSProperties } from "react";
import { Text, TextProps, useTheme } from "@chakra-ui/react";
import { Text, TextProps, useTheme, chakra } from "@chakra-ui/react";
import { FiChevronUp, FiArrowUpRight, FiArrowDownRight } from "react-icons/fi";

interface Props extends TextProps {
Expand All @@ -39,6 +39,7 @@ const TaskName = ({
id,
setupTeardownType,
isZoomedOut,
onClick,
...rest
}: Props) => {
const { colors } = useTheme();
Expand All @@ -51,31 +52,32 @@ const TaskName = ({
<Text
cursor="pointer"
data-testid={id}
width="100%"
color={colors.gray[800]}
fontSize={isZoomedOut ? 24 : undefined}
textAlign="justify"
{...rest}
>
{label}
{isMapped && " [ ]"}
{isGroup && (
<FiChevronUp
size={isZoomedOut ? 24 : 15}
strokeWidth={3}
style={{
transition: "transform 0.5s",
transform: `rotate(${isOpen ? 0 : 180}deg)`,
...iconStyle,
}}
/>
)}
{setupTeardownType === "setup" && (
<FiArrowUpRight size={isZoomedOut ? 24 : 15} style={iconStyle} />
)}
{setupTeardownType === "teardown" && (
<FiArrowDownRight size={isZoomedOut ? 24 : 15} style={iconStyle} />
)}
<chakra.span onClick={onClick}>
{label}
{isMapped && " [ ]"}
{isGroup && (
<FiChevronUp
size={isZoomedOut ? 24 : 15}
strokeWidth={3}
style={{
transition: "transform 0.5s",
transform: `rotate(${isOpen ? 0 : 180}deg)`,
...iconStyle,
}}
/>
)}
{setupTeardownType === "setup" && (
<FiArrowUpRight size={isZoomedOut ? 24 : 15} style={iconStyle} />
)}
{setupTeardownType === "teardown" && (
<FiArrowDownRight size={isZoomedOut ? 24 : 15} style={iconStyle} />
)}
</chakra.span>
</Text>
);
};
Expand Down
10 changes: 1 addition & 9 deletions airflow/www/static/js/dag/grid/renderTaskRows.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -162,15 +162,7 @@ const Row = (props: RowProps) => {
position="sticky"
left={0}
cursor="pointer"
onClick={(e) => {
// Double click to expand
if (e.detail === 2 && isGroup) {
memoizedToggle();
} else {
// Otherwise select the task row
onSelect({ taskId: task.id });
}
}}
onClick={() => onSelect({ taskId: task.id })}
borderBottom={0}
width="100%"
zIndex={1}
Expand Down

0 comments on commit 6e5b97c

Please sign in to comment.