Skip to content

Commit

Permalink
Default tooltips to showArrow (apache#45468)
Browse files Browse the repository at this point in the history
  • Loading branch information
bbovenzi authored Jan 7, 2025
1 parent c2ab839 commit df16572
Show file tree
Hide file tree
Showing 10 changed files with 13 additions and 10 deletions.
1 change: 0 additions & 1 deletion airflow/ui/src/components/DagRunInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ const DagRunInfo = ({
</Text>
</VStack>
}
showArrow
>
<HStack fontSize="sm">
<Time datetime={dataIntervalStart} showTooltip={false} />
Expand Down
1 change: 0 additions & 1 deletion airflow/ui/src/components/TaskInstanceTooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ const TaskInstanceTooltip = ({ children, taskInstance }: Props) => (
},
placement: "bottom-start",
}}
showArrow
>
{children}
</Tooltip>
Expand Down
11 changes: 10 additions & 1 deletion airflow/ui/src/components/ui/Tooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,16 @@ export type TooltipProps = {
} & ChakraTooltip.RootProps;

export const Tooltip = React.forwardRef<HTMLDivElement, TooltipProps>((props, ref) => {
const { children, content, contentProps, disabled, portalled, portalRef, showArrow, ...rest } = props;
const {
children,
content,
contentProps,
disabled,
portalled,
portalRef,
showArrow = true,
...rest
} = props;

if (disabled) {
return children;
Expand Down
2 changes: 1 addition & 1 deletion airflow/ui/src/pages/Dag/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export const Header = ({
<SimpleGrid columns={4} gap={4} my={2}>
<Stat label="Schedule">
{Boolean(dag?.timetable_summary) ? (
<Tooltip content={dag?.timetable_description} showArrow>
<Tooltip content={dag?.timetable_description}>
<Text fontSize="sm">
<FiCalendar style={{ display: "inline" }} /> {dag?.timetable_summary}
</Text>
Expand Down
2 changes: 1 addition & 1 deletion airflow/ui/src/pages/DagsList/DagCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export const DagCard = ({ dag }: Props) => {
<Box borderColor="border.emphasized" borderRadius={8} borderWidth={1} overflow="hidden">
<Flex alignItems="center" bg="bg.muted" justifyContent="space-between" px={3} py={2}>
<HStack>
<Tooltip content={dag.description} disabled={!Boolean(dag.description)} showArrow>
<Tooltip content={dag.description} disabled={!Boolean(dag.description)}>
<Link asChild color="fg.info" fontWeight="bold">
<RouterLink to={`/dags/${dag.dag_id}`}>{dag.dag_display_name}</RouterLink>
</Link>
Expand Down
1 change: 0 additions & 1 deletion airflow/ui/src/pages/DagsList/DagTags.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ export const DagTags = ({ hideIcon = false, tags }: Props) =>
))}
</VStack>
}
showArrow
>
<Text>, +{tags.length - MAX_TAGS} more</Text>
</Tooltip>
Expand Down
1 change: 0 additions & 1 deletion airflow/ui/src/pages/DagsList/RecentRuns.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ export const RecentRuns = ({
},
placement: "bottom-start",
}}
showArrow
>
<Link to={`/dags/${run.dag_id}/runs/${run.dag_run_id}/`}>
<Box p={1}>
Expand Down
2 changes: 1 addition & 1 deletion airflow/ui/src/pages/DagsList/Schedule.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ type Props = {

export const Schedule = ({ dag }: Props) =>
Boolean(dag.timetable_summary) && dag.timetable_description !== "Never, external triggers only" ? (
<Tooltip content={dag.timetable_description} showArrow>
<Tooltip content={dag.timetable_description}>
<Text fontSize="sm">
<FiCalendar style={{ display: "inline" }} /> {dag.timetable_summary}
</Text>
Expand Down
1 change: 0 additions & 1 deletion airflow/ui/src/pages/Dashboard/Health/HealthSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ export const HealthSection = ({
</div>
}
disabled={!Boolean(latestHeartbeat)}
showArrow
>
<Tag
borderColor={status === "healthy" ? "success.100" : "error.100"}
Expand Down
1 change: 0 additions & 1 deletion airflow/ui/src/pages/Dashboard/Health/HealthTag.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ export const HealthTag = ({
</div>
}
disabled={!Boolean(latestHeartbeat)}
showArrow
>
<Tag borderRadius="full" colorPalette={status === "healthy" ? "green" : "red"} size="lg">
<TagLabel>{title}</TagLabel>
Expand Down

0 comments on commit df16572

Please sign in to comment.