You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by ep...@apache.org on 2022/07/05 18:02:23 UTC
[airflow] branch main updated: improve grid date tick spacing (#24849)
This is an automated email from the ASF dual-hosted git repository.
ephraimanierobi pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new 6caaf476d3 improve grid date tick spacing (#24849)
6caaf476d3 is described below
commit 6caaf476d3ca53f2e53701b21de1d4f828e8b8b1
Author: Brent Bovenzi <br...@gmail.com>
AuthorDate: Tue Jul 5 14:01:54 2022 -0400
improve grid date tick spacing (#24849)
---
airflow/www/static/js/grid/dagRuns/Bar.tsx | 5 +++--
airflow/www/static/js/grid/dagRuns/index.test.tsx | 2 +-
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/airflow/www/static/js/grid/dagRuns/Bar.tsx b/airflow/www/static/js/grid/dagRuns/Bar.tsx
index 7e9b2ef353..660619f5b7 100644
--- a/airflow/www/static/js/grid/dagRuns/Bar.tsx
+++ b/airflow/www/static/js/grid/dagRuns/Bar.tsx
@@ -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
diff --git a/airflow/www/static/js/grid/dagRuns/index.test.tsx b/airflow/www/static/js/grid/dagRuns/index.test.tsx
index 612c96eb27..c91e15f59f 100644
--- a/airflow/www/static/js/grid/dagRuns/index.test.tsx
+++ b/airflow/www/static/js/grid/dagRuns/index.test.tsx
@@ -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,