Skip to content

Commit

Permalink
Merge pull request #1862 from yaroslavafenkin/JENKINS-73896
Browse files Browse the repository at this point in the history
[JENKINS-73896] Un-inline JavaScript in ResultAction/summary.jelly
  • Loading branch information
uhafner authored Oct 16, 2024
2 parents bcdd550 + 9b9eb13 commit 8c94cd2
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
window.addEventListener("DOMContentLoaded", () => {
const dataHolders = document.querySelectorAll(".bind-reset-button-data-holder");

dataHolders.forEach(dataHolder => {
const actionId = dataHolder.getAttribute("data-action-id");
const proxyName = dataHolder.getAttribute("data-proxy-name");

const handler = new ResetQualityGateButtonHandler();
handler.bindResetButton(actionId, window[proxyName]);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,12 @@

</t:summary>

<script>
{
const proxy =<st:bind value="${it}"/>;
const handler = new ResetQualityGateButtonHandler();
handler.bindResetButton('${it.id}', proxy);
}
</script>
<j:set var="proxyId" value="${h.generateId()}" />
<st:bind value="${it}" var="bindResetButtonProxy${proxyId}"/>
<span class="bind-reset-button-data-holder"
data-action-id="${it.id}"
data-proxy-name="bindResetButtonProxy${proxyId}"
style="display:none"/>
<st:adjunct includes="io.jenkins.plugins.analysis.core.model.ResultAction.bind-reset-button" />

</j:jelly>

0 comments on commit 8c94cd2

Please sign in to comment.