Skip to content

Commit

Permalink
Display rerun icon for tasks (#42152)
Browse files Browse the repository at this point in the history
This will be displayed for tasks which have been ran more than once.
  • Loading branch information
atrbgithub authored Sep 13, 2024
1 parent 7d5f2ba commit bcb553a
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion airflow/www/static/js/dag/StatusBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import React from "react";
import { isEqual } from "lodash";
import { Box, useTheme, BoxProps } from "@chakra-ui/react";
import { MdRefresh } from "react-icons/md";

import { useContainerRef } from "src/context/containerRef";
import type { Task, TaskInstance, TaskState } from "src/types";
Expand All @@ -34,12 +35,14 @@ export const boxSizePx = `${boxSize}px`;

interface StatusWithNotesProps extends BoxProps {
state: TaskState;
tryNumber?: number;
containsNotes?: boolean;
}

export const StatusWithNotes = ({
state,
containsNotes,
tryNumber,
...rest
}: StatusWithNotesProps) => {
const color = state && stateColors[state] ? stateColors[state] : "white";
Expand All @@ -50,8 +53,13 @@ export const StatusWithNotes = ({
background={getStatusBackgroundColor(color, !!containsNotes)}
borderRadius="2px"
borderWidth={state ? 0 : 1}
display="flex"
alignItems="center"
justifyContent="center"
{...rest}
/>
>
{tryNumber !== undefined && tryNumber > 1 && <MdRefresh color="white" />}
</Box>
);
};

Expand Down Expand Up @@ -137,6 +145,7 @@ const StatusBox = ({
<StatusWithNotes
state={instance.state}
containsNotes={containsNotes}
tryNumber={instance.tryNumber}
onClick={onClick}
cursor="pointer"
data-testid="task-instance"
Expand Down

0 comments on commit bcb553a

Please sign in to comment.