summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Edel <felix.edel@bmw.de>2021-10-20 09:38:32 +0200
committerFelix Edel <felix.edel@bmw.de>2021-10-20 09:38:32 +0200
commitfa8e1a7c95b038cfda93b6507813b27c438759a2 (patch)
tree453aee9fe9375b3d72a7fac4f757671c2be42f7e
parent55242af7cbb7a81aab1a16760b114c876083d7fa (diff)
downloadzuul-fa8e1a7c95b038cfda93b6507813b27c438759a2.tar.gz
UI: Fix gant chart on buildset page for missing timestamps
Currently, the "Builds Timeline" gant chart on the buildset result page is broken when at least one build doesn't provide the required time information (e.g. SKIPPED builds). index.js:1 Warning: Received NaN for the `x1` attribute. If this is expected, cast the value to a string. in line (created by Line) in Line in LineSegment in g in g in VictoryAxis (created by ChartAxis) in ChartAxis (at GanttChart.jsx:88) ... To fix this, we fill the missing timestamp information with 0 values. Change-Id: I3ec6a36a3cfcf818127b827543fd7b8ecf5d785a
-rw-r--r--web/src/containers/charts/GanttChart.jsx4
1 files changed, 2 insertions, 2 deletions
diff --git a/web/src/containers/charts/GanttChart.jsx b/web/src/containers/charts/GanttChart.jsx
index dfbf3b6aa..5ac065fce 100644
--- a/web/src/containers/charts/GanttChart.jsx
+++ b/web/src/containers/charts/GanttChart.jsx
@@ -43,8 +43,8 @@ function BuildsetGanttChart(props) {
const data = sortedByStartTime.map((build) => {
return {
x: build.job_name,
- y0: (moment.utc(build.start_time).tz(timezone) - origin) / 1000,
- y: (moment.utc(build.end_time).tz(timezone) - origin) / 1000,
+ y0: build.start_time ? (moment.utc(build.start_time).tz(timezone) - origin) / 1000 : 0,
+ y: build.end_time ? (moment.utc(build.end_time).tz(timezone) - origin) / 1000 : 0,
result: build.result,
started: moment.utc(build.start_time).tz(timezone).format('YYYY-MM-DD HH:mm:ss'),
ended: moment.utc(build.end_time).tz(timezone).format('YYYY-MM-DD HH:mm:ss'),