Don't show a revision when it's "None"

This occurs for the periodic jobs, instead of displaying the revision
as "None", simply omit it from the UI.

Change-Id: I9253720caaa5137b7e3b1b9bce5e75e34d574450
This commit is contained in:
Alex Gaynor 2013-09-13 23:15:59 -07:00
parent ec7f93862a
commit fb92c55b75

View File

@ -151,19 +151,21 @@ function format_pipeline(data) {
function format_change(change) { function format_change(change) {
var html = '<div class="change"><div class="header">'; var html = '<div class="change"><div class="header">';
html += '<span class="project">'+change['project']+'</span>'; html += '<span class="project">' + change['project'] + '</span>';
var id = change['id']; var id = change['id'];
var url = change['url']; var url = change['url'];
if (id.length == 40) { if (id !== "None") {
id = id.substr(0,7); if (id.length == 40) {
} id = id.substr(0,7);
html += '<span class="changeid">'; }
if (url != null) { html += '<span class="changeid">';
html += '<a href="'+url+'">'; if (url !== null) {
} html += '<a href="'+url+'">';
html += id; }
if (url != null) { html += id;
html += '</a>'; if (url !== null) {
html += '</a>';
}
} }
html += '</span><span class="time">'; html += '</span><span class="time">';
@ -173,8 +175,8 @@ function format_change(change) {
$.each(change['jobs'], function(i, job) { $.each(change['jobs'], function(i, job) {
result = job['result']; result = job['result'];
var result_class = "result"; var result_class = "result";
if (result == null) { if (result === null) {
if (job['url'] != null) { if (job['url'] !== null) {
result = 'in progress'; result = 'in progress';
} else { } else {
result = 'queued'; result = 'queued';
@ -189,15 +191,15 @@ function format_change(change) {
result_class += " result_unstable"; result_class += " result_unstable";
} }
html += '<span class="job">'; html += '<span class="job">';
if (job['url'] != null) { if (job['url'] !== null) {
html += '<a href="'+job['url']+'">'; html += '<a href="'+job['url']+'">';
} }
html += job['name']; html += job['name'];
if (job['url'] != null) { if (job['url'] !== null) {
html += '</a>'; html += '</a>';
} }
html += ': '; html += ': ';
if (job['result'] == null && job['url'] != null) { if (job['result'] === null && job['url'] !== null) {
html += format_progress(job['elapsed_time'], job['remaining_time']); html += format_progress(job['elapsed_time'], job['remaining_time']);
} else { } else {
html += '<span class="result '+result_class+'">'+result+'</span>'; html += '<span class="result '+result_class+'">'+result+'</span>';