Skip to content

Commit

Permalink
[JENKINS-74741] Migrate from FromApply#applyResponse in `ScriptlerB…
Browse files Browse the repository at this point in the history
…uilder.java`
  • Loading branch information
yaroslavafenkin authored and mtughan committed Nov 22, 2024
1 parent 5d0d63f commit d01d180
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
4 changes: 3 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@
<spotless.check.skip>false</spotless.check.skip>
<!-- https://www.jenkins.io/doc/developer/plugin-development/choosing-jenkins-baseline/ -->
<jenkins.baseline>2.479</jenkins.baseline>
<jenkins.version>${jenkins.baseline}.1</jenkins.version>
<!-- TODO: switch back to the LTS baseline once the CSP fix is in LTS -->
<!--<jenkins.version>${jenkins.baseline}.1</jenkins.version>-->
<jenkins.version>2.482</jenkins.version>
</properties>

<dependencyManagement>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -437,11 +437,10 @@ private Stream<String> buildMessages() {
public void generateResponse(StaplerRequest2 req, StaplerResponse2 rsp, Object node)
throws IOException, ServletException {
if (FormApply.isApply(req)) {
String script = buildMessages()
.map(QuotedStringTokenizer::quote)
.map(error -> "notificationBar.show(" + error + ",notificationBar.ERROR)")
.collect(Collectors.joining(""));
FormApply.applyResponse(script).generateResponse(req, rsp, node);
String script =
buildMessages().map(QuotedStringTokenizer::quote).collect(Collectors.joining(""));
FormApply.showNotification(script, FormApply.NotificationType.ERROR)
.generateResponse(req, rsp, node);
} else {
new Failure(getAggregatedMessage()).generateResponse(req, rsp, node);
}
Expand Down

0 comments on commit d01d180

Please sign in to comment.