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-74056] Extract JS in PipelineHeaderExtension/columnHeader.jelly #148

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,9 @@
<td id="project-${project.getId()}"></td>
</j:otherwise>
</j:choose>
<script>
//save project proxies for future reference (being able to refresh project cards)
buildPipeline.projectProxies[${project.getId()}] = <st:bind value="${project}" />;
jQuery("#project-${project.getId()}").append(buildPipeline.projectCardTemplate(${project.asJSON()}));
</script>
<st:adjunct includes="au.com.centrumsystems.hudson.plugin.buildpipeline.extension.PipelineHeaderExtension.pipeline-column-headers"/>
<st:bind value="${project}" var="projectProxy${project.getId()}"/>
shlomomdahan marked this conversation as resolved.
Show resolved Hide resolved
<span class="ch-project-data-holder" data-project-id="${project.getId()}" data-project-json="${project.asJSON()}" style="display:none"/>
<j:if test="${(y + 1 != buildPipelineForm.getGridWidth())}">
<td class="next">
<!-- Changing length to size() to get rid of arrows when there are no more child jobs.-->
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
document.addEventListener("DOMContentLoaded", () => {
const projectDataHolders = document.querySelectorAll(".ch-project-data-holder");

projectDataHolders.forEach(dataHolder => {
const { projectId, projectJson } = dataHolder.dataset;

buildPipeline.projectProxies[projectId] = window["projectProxy" + projectId];

const projectElement = document.getElementById("project-" + projectId);
const projectData = JSON.parse(projectJson);
projectElement.innerHTML = buildPipeline.projectCardTemplate(projectData);
shlomomdahan marked this conversation as resolved.
Show resolved Hide resolved
});
});
Loading