From 31008b15489f09e2429733674786f553b1bc9bb7 Mon Sep 17 00:00:00 2001 From: shlomomdahan <64103471+shlomomdahan@users.noreply.github.com> Date: Tue, 29 Oct 2024 15:50:57 -0400 Subject: [PATCH] fix: https://github.com/jenkinsci/build-pipeline-plugin/blob/master/src/main/resources/au/com/centrumsystems/hudson/plugin/buildpipeline/extension/BuildCardExtension/buildCardTemplate.jelly\#L109 --- .../build-card-template-onclicks.js | 30 +++++++++++++++---- .../buildCardTemplate.jelly | 11 +++---- 2 files changed, 30 insertions(+), 11 deletions(-) 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 6d72ac68..1b1a8823 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 @@ -1,21 +1,39 @@ -Behaviour.specify(".progress-console-onclick", 'progress-bar-click', 0, function (progressBarElement) { +Behaviour.specify(".bct-progress-console-onclick", 'BuildCardExtension_progressBarClick', 0, function (element) { - const dataContainer = document.querySelector(".fill-dialog-params-statusbar"); + const dataContainer = document.querySelector(".bct-progress-console-onclick-params");; const href = dataContainer.dataset.fillDialogHref; const title = dataContainer.dataset.fillDialogTitle; - progressBarElement.addEventListener('click', () => { + element.addEventListener('click', () => { buildPipeline.fillDialog(href, title); }); }); -Behaviour.specify(".console-icon-onlick", 'console-icon-click', 0, function (consoleIconElement) { +Behaviour.specify(".bct-console-icon-onclick", 'BuildCardExtension_consoleIconClick', 0, function (element) { - const dataContainer = document.querySelector(".fill-dialog-params-console-output-icon"); + const dataContainer = document.querySelector(".bct-console-icon-onclick-params"); const href = dataContainer.dataset.fillDialogHref; const title = dataContainer.dataset.fillDialogTitle; - consoleIconElement.addEventListener('click', () => { + element.addEventListener('click', () => { buildPipeline.fillDialog(href, title); }); }); + +Behaviour.specify(".bct-rerun-success-icon-onclick", 'BuildCardExtension_successRerunClick', 0, function(element) { + + const dataContainer = document.querySelector(".bct-rerun-success-icon-onclick-params"); + const id = parseInt(dataContainer.dataset.showSpinnerId, 10); + const buildExtId = dataContainer.dataset.rerunBuildExtId; + const dependencyIds = dataContainer.dataset.rerunBuildDependencyIds + .split(',') + .filter(Boolean) + .map(id => parseInt(id, 10)); + + element.addEventListener('click', () => { + buildPipeline.showSpinner(id); + buildPipeline.rerunBuild(id, buildExtId, dependencyIds); + }); +}); + + diff --git a/src/main/resources/au/com/centrumsystems/hudson/plugin/buildpipeline/extension/BuildCardExtension/buildCardTemplate.jelly b/src/main/resources/au/com/centrumsystems/hudson/plugin/buildpipeline/extension/BuildCardExtension/buildCardTemplate.jelly index 3b96b954..c484961f 100644 --- a/src/main/resources/au/com/centrumsystems/hudson/plugin/buildpipeline/extension/BuildCardExtension/buildCardTemplate.jelly +++ b/src/main/resources/au/com/centrumsystems/hudson/plugin/buildpipeline/extension/BuildCardExtension/buildCardTemplate.jelly @@ -61,8 +61,8 @@ {{#unless project.disabled}}
{{#if build.isBuilding}} -