Skip to content

Commit 4ab974a

Browse files
authored
apply-button and minor UI enhancements (#469)
- add an apply-button - remove the side-panel, that only had back to dashboard - use app-bar
1 parent cf247f0 commit 4ab974a

2 files changed

Lines changed: 11 additions & 25 deletions

File tree

src/main/java/jenkins/advancedqueue/PriorityConfiguration.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
import hudson.model.View;
3939
import hudson.model.ViewGroup;
4040
import hudson.security.ACL;
41+
import hudson.util.FormApply;
4142
import hudson.util.FormValidation;
4243
import hudson.util.ListBoxModel;
4344
import jakarta.servlet.ServletException;
@@ -186,7 +187,7 @@ public void doPriorityConfigSubmit(StaplerRequest2 req, StaplerResponse2 rsp) th
186187
id2jobGroup.put(jobGroup.getId(), jobGroup);
187188
}
188189
save();
189-
rsp.sendRedirect(Jenkins.get().getRootUrl());
190+
FormApply.success("..").generateResponse(req, rsp, this);
190191
}
191192

192193
public FormValidation doCheckJobPattern(@QueryParameter String value) throws IOException, ServletException {

src/main/resources/jenkins/advancedqueue/PriorityConfiguration/index.jelly

Lines changed: 9 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,11 @@
11
<?jelly escape-by-default='true'?>
22
<j:jelly xmlns:j="jelly:core" xmlns:f="/lib/form" xmlns:l="/lib/layout" xmlns:st="jelly:stapler">
3-
<l:layout norefresh="true" title="${%Job_Priorities}">
4-
<l:side-panel>
5-
<l:tasks>
6-
<l:task icon="icon-up icon-md" href="${rootURL}/" title="${%Back_to_Dashboard}"/>
7-
</l:tasks>
8-
</l:side-panel>
3+
<l:layout norefresh="true" title="${%Job_Priorities}" type="one-column">
94
<l:main-panel>
105
<!-- make the page not so wide on large screens -->
116
<div class="col-xlg-14 col-lg-20 col-md-24">
12-
<div>
13-
<h2>${%Job_Priorities}</h2>
14-
<p>${%Assign_priorities_by_creating_job_groups}</p>
15-
</div>
7+
<l:app-bar title="${%Job_Priorities}"/>
8+
${%Assign_priorities_by_creating_job_groups}
169
<f:form method="post" name="priorityConfigSubmit" action="priorityConfigSubmit">
1710
<f:entry>
1811
<f:repeatable var="jobGroup" items="${it.jobGroups}" header="${%Job_group}">
@@ -58,27 +51,19 @@
5851
<st:include it="${descriptor}" page="${descriptor.configPage}" />
5952
</f:entry>
6053
</j:if>
61-
<f:entry>
62-
<div align="right">
63-
<f:repeatableDeleteButton />
64-
</div>
65-
</f:entry>
54+
<f:repeatableDeleteButton />
6655
</div>
6756
</f:repeatable>
6857
</f:entry>
6958
</f:optionalBlock>
70-
<f:entry>
71-
<div align="right">
72-
<f:repeatableDeleteButton />
73-
</div>
74-
</f:entry>
59+
<f:repeatableDeleteButton />
7560
</div>
7661
</f:repeatable>
77-
<br/>
78-
<br/>
79-
<f:entry>
62+
<br/>
63+
<f:bottomButtonBar>
8064
<f:submit value="${%Save}" />
81-
</f:entry>
65+
<f:apply/>
66+
</f:bottomButtonBar>
8267
</f:entry>
8368
</f:form>
8469
</div>

0 commit comments

Comments
 (0)