Skip to content
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-71034] [JENKINS-71035] [JENKINS-71036] [JENKINS-71037] Improve CSP compatibility #7893

Merged
merged 6 commits into from
Jul 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions core/src/main/resources/hudson/model/Run/_delete-retry.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
document
.getElementById("delete-retry-show-error")
.addEventListener("click", function (e) {
e.preventDefault();
document.getElementById("delete-error").style.display = "block";
});
5 changes: 3 additions & 2 deletions core/src/main/resources/hudson/model/Run/delete-retry.jelly
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
</form>
</td></tr>
<tr><td>
<a onclick="document.getElementById('delete-error').style.display='block';return false" href="">${%Show reason}</a>
<a id="delete-retry-show-error" href="">${%Show reason}</a>
<st:adjunct includes="hudson.model.Run._delete-retry" />
</td></tr>
<tr><td>
<div id="delete-error" style="display: none">
Expand All @@ -26,4 +27,4 @@
</table>
</l:main-panel>
</l:layout>
</j:jelly>
</j:jelly>
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ THE SOFTWARE.
<div>
<l:icon class="icon-red icon-md"/> ${%Failure}
-
<a href="" onclick="var n=findNext(this,function(e){return e.tagName=='PRE'});
n.style.display='block';this.style.display='none';return false">${%Details}</a>
<a class="update-center-job-failure-show-details" href="">${%Details}</a>
</div>
<pre style="display:none">${it.problemStackTrace}</pre>
</j:jelly>
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ THE SOFTWARE.
<div>
<l:icon class="icon-red icon-md"/> ${%Failure}
-
<a href="" onclick="var n=findNext(this,function(e){return e.tagName=='PRE'});
n.style.display='block';this.style.display='none';return false">${%Details}</a>
<a class="update-center-job-failure-show-details" href="">${%Details}</a>
</div>
<pre style="display:none">${it.problemStackTrace}</pre>
</j:jelly>
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Behaviour.specify(
"A.update-center-job-failure-show-details",
"update-center-job-failure",
0,
function (anchor) {
anchor.onclick = function (event) {
event.preventDefault();
// eslint-disable-next-line
const n = findNext(this, function (el) {
return el.tagName === "PRE";
});
n.style.display = "block";
this.style.display = "none";
};
}
);
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ THE SOFTWARE.
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form">
<l:layout title="${%Download progress} - ${%Plugins}" permission="${app.SYSTEM_READ}">
<st:adjunct includes="hudson.model.UpdateCenter.update-center" />
<st:adjunct includes="hudson.model.UpdateCenter._download-failure" />
<st:include page="sidepanel.jelly" it="${app.pluginManager}" />
<l:main-panel>
<h1>${%Download progress}</h1>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ function refresh() {
}
var scheduleDiv = document.getElementById("scheduleRestartBlock");
scheduleDiv.innerHTML = div.lastElementChild.innerHTML;
Behaviour.applySubtree(scheduleDiv);
// we need to call applySubtree for parentNode so that click listeners for "Details"
// button in Failure/status.jelly are added as buttons get rendered
Behaviour.applySubtree(scheduleDiv.parentNode);
refresh();
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ THE SOFTWARE.
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form">
<f:entry title="${%Projects to build}">
<f:textbox name="buildTrigger.childProjects" value="${instance.childProjectsValue}"
checkUrl="'descriptorByName/hudson.tasks.BuildTrigger/check?value='+encodeURIComponent(this.value)"
checkUrl="descriptorByName/hudson.tasks.BuildTrigger/check"
checkDependsOn=""
autoCompleteDelimChar=","
field="childProjects"/>
</f:entry>
Expand Down