Skip to content

Commit

Permalink
improve grid date tick spacing (#24849)
Browse files Browse the repository at this point in the history
(cherry picked from commit 6caaf47)
  • Loading branch information
bbovenzi authored and ephraimbuddy committed Jul 5, 2022
1 parent efc3c67 commit eea449e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions airflow/www/static/js/grid/dagRuns/Bar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,9 @@ const DagRunBar = ({
};

// show the tick on the 4th DagRun and then every 10th tick afterwards
const shouldShowTick = index === totalRuns - 4
|| (index < totalRuns - 4 && (index + 4) % 10 === 0);
const inverseIndex = totalRuns - index;
const shouldShowTick = inverseIndex === 4
|| (inverseIndex > 4 && (inverseIndex - 4) % 10 === 0);

return (
<Box
Expand Down
2 changes: 1 addition & 1 deletion airflow/www/static/js/grid/dagRuns/index.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ describe('Test DagRuns', () => {
test('Show 1 date tick when there are less than 14 runs', () => {
const data = {
groups: {},
dagRuns: generateRuns(8),
dagRuns: generateRuns(11),
};
const spy = jest.spyOn(useGridDataModule, 'default').mockImplementation(() => ({
data,
Expand Down

0 comments on commit eea449e

Please sign in to comment.