Skip to content
Snippets Groups Projects
Commit 308f03f0 authored by Austin Anderson's avatar Austin Anderson
Browse files

Forgive copy-pasting CLs

parent 535e039f
Branches
No related tags found
No related merge requests found
...@@ -105,7 +105,11 @@ $(function () { ...@@ -105,7 +105,11 @@ $(function () {
// If the hash is exactly 41 chars (hash sign # plus a 40-char sha hash), // If the hash is exactly 41 chars (hash sign # plus a 40-char sha hash),
// just show that modal. // just show that modal.
} else if (window.location.hash.length == 41) { } else if (window.location.hash.length == 41) {
if ($(window.location.hash).length) {
new bootstrap.Modal(window.location.hash).show() new bootstrap.Modal(window.location.hash).show()
} else {
new bootstrap.Modal("#tf-no-commit-modal").show()
}
// And if it's not a commit sha, it's either a PR or a CL, so try and find a // And if it's not a commit sha, it's either a PR or a CL, so try and find a
// modal matching that PR number if the length is short (CLs will always // modal matching that PR number if the length is short (CLs will always
// be nine or more characters) // be nine or more characters)
...@@ -114,13 +118,21 @@ $(function () { ...@@ -114,13 +118,21 @@ $(function () {
return $(this).text().indexOf("Merge pull request " + window.location.hash) >= 0; return $(this).text().indexOf("Merge pull request " + window.location.hash) >= 0;
}) })
const modal_id = "#" + pr.closest(".modal").attr('id') const modal_id = "#" + pr.closest(".modal").attr('id')
if ($(modal_id).length) {
new bootstrap.Modal(modal_id).show() new bootstrap.Modal(modal_id).show()
} else {
new bootstrap.Modal("#tf-no-pr-modal").show()
}
// And if it's neither, it's a CL, so try and find a modal // And if it's neither, it's a CL, so try and find a modal
// matching that CL number // matching that CL number
} else { } else {
const cl = window.location.hash.substring(1).replace("cl/", "") const cl = window.location.hash.substring(1).replace("cl/", "")
const modal_id = '#' + $(`.modal[data-cl=${cl}]`).attr('id') const modal_id = '#' + $(`.modal[data-cl=${cl}]`).attr('id')
if ($(modal_id).length) {
new bootstrap.Modal(modal_id).show() new bootstrap.Modal(modal_id).show()
} else {
new bootstrap.Modal("#tf-no-cl-modal").show()
}
} }
let revealed = null let revealed = null
......
...@@ -122,3 +122,18 @@ html(lang="en") ...@@ -122,3 +122,18 @@ html(lang="en")
.modal-content .modal-content
.modal-header.fw-bold Dashboard Help .modal-header.fw-bold Dashboard Help
.modal-body !{helptext} .modal-body !{helptext}
.modal.modal-lg.fade(tabindex='-1' aria-labelledby="tf-no-cl-modal" id="tf-no-cl-modal" aria-hidden='true')
.modal-dialog.modal-dialog-centered
.modal-content
.modal-header.fw-bold CL Not Found
.modal-body Sorry, that CL isn't on the dashboard. If new, it may not be on GitHub yet, or may not have any CI results yet. If it's an older CL, it may be old enough that the data window no longer includes it. The dashboard only displays the last one thousand TF commits, which is usually about two weeks of commits.
.modal.modal-lg.fade(tabindex='-1' aria-labelledby="tf-no-commit-modal" id="tf-no-commit-modal" aria-hidden='true')
.modal-dialog.modal-dialog-centered
.modal-content
.modal-header.fw-bold Commit Not Found
.modal-body Sorry, that commit isn't on the dashboard. If new, it may not have any CI results yet. If it's an older commit, it may be old enough that the data window no longer includes it. The dashboard only displays the last one thousand TF commits, which is usually about two weeks of commits.
.modal.modal-lg.fade(tabindex='-1' aria-labelledby="tf-no-pr-modal" id="tf-no-pr-modal" aria-hidden='true')
.modal-dialog.modal-dialog-centered
.modal-content
.modal-header.fw-bold PR Not Found
.modal-body Sorry, that PR isn't on the dashboard. If new, it may not have any CI results yet, or may not be merged yet. If it's an older PR, it may be old enough that the data window no longer includes it. The dashboard only displays the last one thousand TF commits, which is usually about two weeks of commits.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment