From 4833ea2b90df83a38cb05ec5bd27e5170ed5795b Mon Sep 17 00:00:00 2001 From: Steve Kowalik Date: Wed, 12 Sep 2018 09:45:06 -0600 Subject: [PATCH] Correctly show remaining time as unknown The Python set of calculating the remaining time deals with the fact that if not all jobs are queued, the remaining time is None. The JS deals with this by rendering a time of 'null' as 0 minutes, which is false. Check for this case, and set the remaining time to 'unknown' if the job's remaining time is null. Change-Id: I3e1ea00084a0dc9497b9678b816883d9b984312b --- web/status/jquery.zuul.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/web/status/jquery.zuul.js b/web/status/jquery.zuul.js index c07084ff32..777d48f5f2 100644 --- a/web/status/jquery.zuul.js +++ b/web/status/jquery.zuul.js @@ -340,7 +340,12 @@ import LineTImage from '../images/line-t.png'; .addClass('col-xs-8') .append($projectSpan, $changeProgressRow) - let remainingTime = this.time(change.remaining_time, true) + let remainingTime + if (change.remaining_time === null) { + remainingTime = 'unknown' + } else { + remainingTime = this.time(change.remaining_time, true) + } let enqueueTime = this.enqueueTime(change.enqueue_time) let $remainingTime = $('').addClass('time') .attr('title', 'Remaining Time').html(remainingTime)