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
This commit is contained in:
Steve Kowalik 2018-09-12 09:45:06 -06:00
parent d07bc25fc2
commit 4833ea2b90
1 changed files with 6 additions and 1 deletions

View File

@ -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 = $('<small />').addClass('time')
.attr('title', 'Remaining Time').html(remainingTime)