-
-
Notifications
You must be signed in to change notification settings - Fork 8.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[JENKINS-70934] Remove Prototype usages from buildListTable.jelly
#7830
Changes from all commits
1e12e4c
7aac1d1
e2eddeb
00a1245
275eebc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -122,3 +122,85 @@ function generateSVGIcon(iconName, iconSizeClass) { | |||||||||||
|
||||||||||||
return span; | ||||||||||||
} | ||||||||||||
|
||||||||||||
/** | ||||||||||||
* Public method to be called by progressiveRendering's callback | ||||||||||||
*/ | ||||||||||||
window.displayBuilds = function (data) { | ||||||||||||
var rootUrl = document.head.getAttribute("data-rooturl"); | ||||||||||||
var p = document.getElementById("projectStatus"); | ||||||||||||
p.style.display = ""; | ||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. FTR this change is an inlining of the method from prototype.js: jenkins/war/src/main/webapp/scripts/prototype.js Lines 1983 to 1987 in 38d3a27
|
||||||||||||
for (var x = 0; data.length > x; x++) { | ||||||||||||
var e = data[x]; | ||||||||||||
var tr = document.createElement("tr"); | ||||||||||||
|
||||||||||||
var td1 = document.createElement("td"); | ||||||||||||
td1.setAttribute("data", e.iconColorOrdinal); | ||||||||||||
td1.classList.add("jenkins-table__cell--tight", "jenkins-table__icon"); | ||||||||||||
var div1 = document.createElement("div"); | ||||||||||||
div1.classList.add("jenkins-table__cell__button-wrapper"); | ||||||||||||
var svg = generateSVGIcon(e.iconName, p.dataset.iconSizeClass); | ||||||||||||
div1.appendChild(svg); | ||||||||||||
td1.appendChild(div1); | ||||||||||||
tr.appendChild(td1); | ||||||||||||
|
||||||||||||
var td2 = document.createElement("td"); | ||||||||||||
var a1 = document.createElement("a"); | ||||||||||||
a1.classList.add("jenkins-table__link", "model-link"); | ||||||||||||
a1.href = rootUrl + "/" + e.parentUrl; | ||||||||||||
var span1 = document.createElement("span"); | ||||||||||||
// TODO port Functions#breakableString to JavaScript and use .textContent rather than .innerHTML | ||||||||||||
span1.innerHTML = e.parentFullDisplayName; | ||||||||||||
a1.appendChild(span1); | ||||||||||||
td2.appendChild(a1); | ||||||||||||
var a2 = document.createElement("a"); | ||||||||||||
a2.classList.add( | ||||||||||||
"jenkins-table__link", | ||||||||||||
"jenkins-table__badge", | ||||||||||||
"model-link", | ||||||||||||
"inside" | ||||||||||||
); | ||||||||||||
a2.href = rootUrl + "/" + e.url; | ||||||||||||
a2.textContent = e.displayName; | ||||||||||||
td2.appendChild(a2); | ||||||||||||
tr.appendChild(td2); | ||||||||||||
|
||||||||||||
var td3 = document.createElement("td"); | ||||||||||||
td3.setAttribute("data", e.timestampString2); | ||||||||||||
var button = document.createElement("button"); | ||||||||||||
button.classList.add("jenkins-table__link"); | ||||||||||||
button.setAttribute("tooltip", p.dataset.scrollTooltip); | ||||||||||||
button.setAttribute( | ||||||||||||
"onclick", | ||||||||||||
'javascript:tl.getBand(0).scrollToCenter(Timeline.DateTime.parseGregorianDateTime("' + | ||||||||||||
e.timestampString3 + | ||||||||||||
'"))' | ||||||||||||
); | ||||||||||||
button.textContent = e.timestampString; | ||||||||||||
td3.appendChild(button); | ||||||||||||
tr.appendChild(td3); | ||||||||||||
|
||||||||||||
var td4 = document.createElement("td"); | ||||||||||||
if (e.buildStatusSummaryWorse) { | ||||||||||||
td4.style.color = "var(--red)"; | ||||||||||||
} | ||||||||||||
td4.textContent = e.buildStatusSummaryMessage; | ||||||||||||
tr.appendChild(td4); | ||||||||||||
|
||||||||||||
var td5 = document.createElement("td"); | ||||||||||||
td5.classList.add("jenkins-table__cell--tight"); | ||||||||||||
var div2 = document.createElement("div"); | ||||||||||||
div2.classList.add("jenkins-table__cell__button-wrapper"); | ||||||||||||
var a3 = document.createElement("a"); | ||||||||||||
a3.classList.add("jenkins-table__button"); | ||||||||||||
a3.href = rootUrl + "/" + e.url + "console"; | ||||||||||||
a3.innerHTML = p.dataset.consoleOutputIcon; | ||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For future readers, just in case, the |
||||||||||||
div2.appendChild(a3); | ||||||||||||
td5.appendChild(div2); | ||||||||||||
tr.appendChild(td5); | ||||||||||||
|
||||||||||||
p.appendChild(tr); | ||||||||||||
Behaviour.applySubtree(tr); | ||||||||||||
} | ||||||||||||
ts_refresh(p); | ||||||||||||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI this is the same comment as the first method in this file, which is used for the global build trend.
Not ideal, but not blocking.