diff --git a/src/main/resources/com/sonyericsson/jenkins/plugins/bfa/CauseManagement/remove.groovy b/src/main/resources/com/sonyericsson/jenkins/plugins/bfa/CauseManagement/remove.groovy index 15e6b0e5..70856fee 100644 --- a/src/main/resources/com/sonyericsson/jenkins/plugins/bfa/CauseManagement/remove.groovy +++ b/src/main/resources/com/sonyericsson/jenkins/plugins/bfa/CauseManagement/remove.groovy @@ -31,6 +31,7 @@ import hudson.Functions def f = namespace(lib.FormTagLib) def l = namespace(lib.LayoutTagLib) def j = namespace(lib.JenkinsTagLib) +def st = namespace("jelly:stapler") l.layout(permission: PluginImpl.REMOVE_PERMISSION) { l.header(title: _("Failure Cause Management - Confirm Remove")) @@ -60,17 +61,18 @@ l.layout(permission: PluginImpl.REMOVE_PERMISSION) { + "background-image: url(\'" + imageUrl + "');") {} h1(_("Failure Cause - Confirm Remove")) div(style: "width: 70%") { + st.adjunct(includes: "com.sonyericsson.jenkins.plugins.bfa.CauseManagement.resource") if (cause != null) { form(method: "POST", action: "removeConfirm") { p(_("removeQuestion", cause.getName())) input(type: "hidden", value: cause.getId(), name: "id") f.submit(value: _("Yes")) raw("  "); - input(type: "button", value:_("Back"), onClick: "history.back(1)", class: "yui-button") + button(type: "button", class: "jenkins-button bfa-cause-management-back-button", _("Back")) } } else { p(_("Not a valid cause id")) - input(type: "button", value:_("Back"), onClick: "history.back(1)", class: "yui-button") + button(class: "jenkins-button bfa-cause-management-back-button", _("Back")) } } diff --git a/src/main/resources/com/sonyericsson/jenkins/plugins/bfa/CauseManagement/resource.js b/src/main/resources/com/sonyericsson/jenkins/plugins/bfa/CauseManagement/resource.js new file mode 100644 index 00000000..a4496085 --- /dev/null +++ b/src/main/resources/com/sonyericsson/jenkins/plugins/bfa/CauseManagement/resource.js @@ -0,0 +1,5 @@ +document.addEventListener("DOMContentLoaded", () => { + document.querySelector(".bfa-cause-management-back-button").addEventListener("click", () => { + history.back(1); + }); +}); diff --git a/src/main/resources/com/sonyericsson/jenkins/plugins/bfa/sod/ScanOnDemandBaseAction/ScanMode/index.groovy b/src/main/resources/com/sonyericsson/jenkins/plugins/bfa/sod/ScanOnDemandBaseAction/ScanMode/index.groovy index f8faa717..577d8ce8 100644 --- a/src/main/resources/com/sonyericsson/jenkins/plugins/bfa/sod/ScanOnDemandBaseAction/ScanMode/index.groovy +++ b/src/main/resources/com/sonyericsson/jenkins/plugins/bfa/sod/ScanOnDemandBaseAction/ScanMode/index.groovy @@ -44,14 +44,15 @@ l.layout(title: _("Failure Scan Options"), norefresh: true) { } st.include(it: mode.parent.project, page: "sidepanel.jelly") l.'main-panel' { + st.adjunct(includes: "com.sonyericsson.jenkins.plugins.bfa.sod.ScanOnDemandBaseAction.ScanMode.resource") f.form { f.section(title: _("Select the option and scan the builds")) { ScanOnDemandBaseAction.ScanMode.all().each { ScanOnDemandBaseAction.ScanMode option -> - f.entry(field: option.urlName, + f.entry(field: option.urlName, class: "bfa-scan-mode-build-type-radio-entry", help: "/plugin/build-failure-analyzer/help/sod/${option.urlName}.html") { + span(class: "bfa-entry-data-holder", "data-root-url": "${rootURL}", "data-option-full-url": "${option.getFullUrl()}") f.radio(name: "buildType", value: option.urlName, - onclick: "document.location='${rootURL}/${option.getFullUrl()}';", checked: option == mode, title: option.displayName) } diff --git a/src/main/resources/com/sonyericsson/jenkins/plugins/bfa/sod/ScanOnDemandBaseAction/ScanMode/resource.js b/src/main/resources/com/sonyericsson/jenkins/plugins/bfa/sod/ScanOnDemandBaseAction/ScanMode/resource.js new file mode 100644 index 00000000..23afff06 --- /dev/null +++ b/src/main/resources/com/sonyericsson/jenkins/plugins/bfa/sod/ScanOnDemandBaseAction/ScanMode/resource.js @@ -0,0 +1,9 @@ +document.addEventListener("DOMContentLoaded", () => { + document.querySelectorAll(".bfa-scan-mode-build-type-radio-entry").forEach((entry) => { + const { rootUrl, optionFullUrl } = entry.querySelector(".bfa-entry-data-holder").dataset; + + entry.querySelector(".jenkins-radio").addEventListener("click", () => { + document.location = `${rootURL}/${optionFullUrl}`; + }); + }) +});