From 188bc434af1b93072432686871834aba63173cdd Mon Sep 17 00:00:00 2001 From: shlomomdahan <64103471+shlomomdahan@users.noreply.github.com> Date: Thu, 7 Nov 2024 14:48:15 -0500 Subject: [PATCH] select all pipeline wrappers - incase multiple builds selected --- .../buildpipeline/BuildPipelineView/bpp.jelly | 2 +- .../build-card-template-onclicks.js | 15 +++++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/main/resources/au/com/centrumsystems/hudson/plugin/buildpipeline/BuildPipelineView/bpp.jelly b/src/main/resources/au/com/centrumsystems/hudson/plugin/buildpipeline/BuildPipelineView/bpp.jelly index d50bd9e3..546e01fb 100644 --- a/src/main/resources/au/com/centrumsystems/hudson/plugin/buildpipeline/BuildPipelineView/bpp.jelly +++ b/src/main/resources/au/com/centrumsystems/hudson/plugin/buildpipeline/BuildPipelineView/bpp.jelly @@ -124,7 +124,7 @@ -
+
diff --git a/src/main/resources/au/com/centrumsystems/hudson/plugin/buildpipeline/extension/BuildCardExtension/build-card-template-onclicks.js b/src/main/resources/au/com/centrumsystems/hudson/plugin/buildpipeline/extension/BuildCardExtension/build-card-template-onclicks.js index 78d6e594..ccad37db 100644 --- a/src/main/resources/au/com/centrumsystems/hudson/plugin/buildpipeline/extension/BuildCardExtension/build-card-template-onclicks.js +++ b/src/main/resources/au/com/centrumsystems/hudson/plugin/buildpipeline/extension/BuildCardExtension/build-card-template-onclicks.js @@ -83,12 +83,15 @@ const onclickElements = { }; document.addEventListener("DOMContentLoaded", function () { - const parentElement = document.querySelector(".main-pipeline-selector"); - if (!parentElement) return; + const pipelineWrappers = document.querySelectorAll(".pipeline-wrapper"); - Object.entries(onclickElements).forEach(function(entry) { - const selector = entry[0]; - const handlerConfig = entry[1]; - createClickHandler(parentElement, selector, handlerConfig.handler); + if (!pipelineWrappers.length) return; + + pipelineWrappers.forEach(wrapper => { + Object.entries(onclickElements).forEach(function(entry) { + const selector = entry[0]; + const handlerConfig = entry[1]; + createClickHandler(wrapper, selector, handlerConfig.handler); + }); }); });