Merge "Represent github change ID in status page by PR number" into feature/zuulv3

This commit is contained in:
Jenkins 2017-05-25 17:12:37 +00:00 committed by Gerrit Code Review
commit 79cb3f40c3
1 changed files with 10 additions and 1 deletions

View File

@ -279,7 +279,16 @@
var $change_link = $('<small />');
if (change.url !== null) {
if (/^[0-9a-f]{40}$/.test(change.id)) {
var github_id = change.id.match(/^([0-9]+),([0-9a-f]{40})$/);
if (github_id) {
$change_link.append(
$('<a />').attr('href', change.url).append(
$('<abbr />')
.attr('title', change.id)
.text('#' + github_id[1])
)
);
} else if (/^[0-9a-f]{40}$/.test(change.id)) {
var change_id_short = change.id.slice(0, 7);
$change_link.append(
$('<a />').attr('href', change.url).append(