Skip to content

Commit

Permalink
[23945] Icons in grid view for different dag types
Browse files Browse the repository at this point in the history
  • Loading branch information
dskoda1 committed May 27, 2022
1 parent 9216489 commit 7822ada
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 4 deletions.
4 changes: 3 additions & 1 deletion airflow/www/static/js/grid/dagRuns/Bar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ import {
VStack,
useTheme,
} from '@chakra-ui/react';
import { MdPlayArrow } from 'react-icons/md';
import { MdPlayArrow, MdOutlineSchedule } from 'react-icons/md';
import { RiArrowGoBackFill } from 'react-icons/ri';

import DagRunTooltip from './Tooltip';
import { useContainerRef } from '../context/containerRef';
Expand Down Expand Up @@ -101,6 +102,7 @@ const DagRunBar = ({
data-testid="run"
>
{run.runType === 'manual' && <MdPlayArrow size="8px" color="white" data-testid="manual-run" />}
{run.runType === 'backfill' && <RiArrowGoBackFill size="8px" color="white" data-testid="backfill-run" />}
</Flex>
</Tooltip>
</Flex>
Expand Down
7 changes: 6 additions & 1 deletion airflow/www/static/js/grid/dagRuns/Tooltip.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import Time from '../components/Time';

const DagRunTooltip = ({
dagRun: {
state, duration, dataIntervalStart, executionDate,
state, duration, dataIntervalStart, executionDate, runType,
},
}) => (
<Box py="2px">
Expand All @@ -44,6 +44,11 @@ const DagRunTooltip = ({
{' '}
{formatDuration(duration)}
</Text>
<Text>
Type:
{' '}
{runType}
</Text>
</Box>
);

Expand Down
17 changes: 16 additions & 1 deletion airflow/www/static/js/grid/details/Header.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ import {
Heading,
Text,
} from '@chakra-ui/react';
import { MdPlayArrow } from 'react-icons/md';
import { MdPlayArrow, MdOutlineSchedule } from 'react-icons/md';
import { RiArrowGoBackFill } from 'react-icons/ri';

import { getMetaValue } from '../../utils';
import useSelection from '../utils/useSelection';
Expand Down Expand Up @@ -71,6 +72,20 @@ const Header = () => {
{runLabel}
</>
);
} else if (dagRun.runType === 'backfill') {
runLabel = (
<>
<RiArrowGoBackFill style={{ display: 'inline' }} />
{runLabel}
</>
);
} else if (dagRun.runType === 'scheduled') {
runLabel = (
<>
<MdOutlineSchedule style={{ display: 'inline' }} />
{runLabel}
</>
);
}
}

Expand Down
6 changes: 5 additions & 1 deletion airflow/www/static/js/grid/details/content/dagRun/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ import {
Link,
Divider,
} from '@chakra-ui/react';
import { MdPlayArrow, MdOutlineAccountTree } from 'react-icons/md';

import { MdPlayArrow, MdOutlineSchedule, MdOutlineAccountTree } from 'react-icons/md';
import { RiArrowGoBackFill } from 'react-icons/ri';

import { SimpleStatus } from '../../../components/StatusBox';
import { ClipboardText } from '../../../components/Clipboard';
Expand Down Expand Up @@ -97,6 +99,8 @@ const DagRun = ({ runId }) => {
Run Type:
{' '}
{runType === 'manual' && <MdPlayArrow style={{ display: 'inline' }} />}
{runType === 'backfill' && <RiArrowGoBackFill style={{ display: 'inline' }} />}
{runType === 'scheduled' && <MdOutlineSchedule style={{ display: 'inline' }} />}
{runType}
</Text>
<Text>
Expand Down

0 comments on commit 7822ada

Please sign in to comment.