Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve grid date tick spacing #24849

Merged
merged 1 commit into from
Jul 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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