From 9b9eb13c6313c812ebf9cc5ca50968b1cdc92e3f Mon Sep 17 00:00:00 2001 From: Yaroslav Afenkin <91559310+yaroslavafenkin@users.noreply.github.com> Date: Tue, 15 Oct 2024 16:37:58 +0300 Subject: [PATCH] [JENKINS-73896] Un-inline JavaScript in ResultAction/summary.jelly --- .../core/model/ResultAction/bind-reset-button.js | 11 +++++++++++ .../analysis/core/model/ResultAction/summary.jelly | 14 +++++++------- 2 files changed, 18 insertions(+), 7 deletions(-) create mode 100644 plugin/src/main/resources/io/jenkins/plugins/analysis/core/model/ResultAction/bind-reset-button.js diff --git a/plugin/src/main/resources/io/jenkins/plugins/analysis/core/model/ResultAction/bind-reset-button.js b/plugin/src/main/resources/io/jenkins/plugins/analysis/core/model/ResultAction/bind-reset-button.js new file mode 100644 index 0000000000..9430ba1950 --- /dev/null +++ b/plugin/src/main/resources/io/jenkins/plugins/analysis/core/model/ResultAction/bind-reset-button.js @@ -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]); + }); +}); diff --git a/plugin/src/main/resources/io/jenkins/plugins/analysis/core/model/ResultAction/summary.jelly b/plugin/src/main/resources/io/jenkins/plugins/analysis/core/model/ResultAction/summary.jelly index 12ccbeb45e..d9d7571d87 100644 --- a/plugin/src/main/resources/io/jenkins/plugins/analysis/core/model/ResultAction/summary.jelly +++ b/plugin/src/main/resources/io/jenkins/plugins/analysis/core/model/ResultAction/summary.jelly @@ -118,12 +118,12 @@ - + + +