Skip to content

Commit 25f8976

Browse files
committed
Adding temporary fix for the new nightly status
1 parent 8afb444 commit 25f8976

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

static/js/dashboard.v2.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -324,14 +324,18 @@ function renderSingleBadge (key, field, envLabel, envLink, branchLink, badge_url
324324
var json_obj = JSON.parse(this.responseText)
325325
var branchLabel = json_obj.message
326326
var color = json_obj.color
327+
var nightlyLabel = ""
327328
if (badge_url.endsWith("stable-badge.json") ) {
328329
var badgeClass = "ci-label-environment-stable";
329330
} else if (badge_url.endsWith("prerelease-badge.json") ) {
330331
var badgeClass = "ci-label-environment-prerelease";
332+
} else if (badge_url.endsWith("nightly-badge.json") ) {
333+
var badgeClass = "ci-label-environment-prerelease";
334+
nightlyLabel = "(nightly build)"
331335
}
332336
badgeText = '<span class="ci-label">'
333337
if (envLink != null) {
334-
badgeText += '<a href="' + envLink + '"><span class="' + badgeClass + '"><i class="ci-icon fas fa-fw fa-brands fa-git-alt" aria-hidden="true"></i>' + envLabel + '</span></a>'
338+
badgeText += '<a href="' + envLink + '"><span class="' + badgeClass + '"><i class="ci-icon fas fa-fw fa-brands fa-git-alt" aria-hidden="true"></i>' + envLabel + ' ' + nightlyLabel + '</span></a>'
335339
} else {
336340
badgeText += '<span class="' + badgeClass + '"><i class="ci-icon fas fa-fw fa-brands fa-git-alt" aria-hidden="true"></i>' + envLabel + '</span>'
337341
}
@@ -461,12 +465,12 @@ function getBadges (xmlText, bucket_url, badge_set) {
461465
key = entries[i].childNodes[0].nodeValue
462466
if (badge_set == "GA" && key.endsWith("stable-badge.json") ) {
463467
badges.push(new Badge(bucket_url, key, getBadgeDate(entries[i])));
464-
} else if (badge_set == "early" && key.endsWith("prerelease-badge.json") ) {
468+
} else if (badge_set == "early" && (key.endsWith("prerelease-badge.json") || key.endsWith("nightly-badge.json")) ) {
465469
badges.push(new Badge(bucket_url, key, getBadgeDate(entries[i])));
466-
} else if (badge_set == "all" && key.endsWith("-badge.json") ) {
470+
} else if (badge_set == "all" && key.endsWith("-badge.json") ) {
467471
badges.push(new Badge(bucket_url, key, getBadgeDate(entries[i])));
468472
} else {
469-
console.log("Skipping: " + key + " - "+badge_set);
473+
console.log("Skipping: " + key);
470474
}
471475
}
472476

0 commit comments

Comments
 (0)