Skip to content

Commit 3c16200

Browse files
committed
Tidy
1 parent 735a938 commit 3c16200

File tree

4 files changed

+24
-24
lines changed

4 files changed

+24
-24
lines changed

core/src/main/java/hudson/model/Actionable.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -121,12 +121,9 @@ public final List<? extends Action> getAllActions() {
121121

122122
/**
123123
* TODO
124+
* @since TODO
124125
*/
125-
public List<Action> getMagic() {
126-
// How does this differ from getActions?
127-
// How does this differ from getAllActions?
128-
// TODO - Think of an appropriate name for this and see if we can combine the functions
129-
126+
public List<Action> getAppBarActions() {
130127
return getAllActions().stream()
131128
.filter(e -> !(e instanceof Tab))
132129
.filter(e -> {

core/src/main/java/jenkins/model/ModelObjectWithContextMenu.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ public ContextMenu from(ModelObjectWithContextMenu self, StaplerRequest2 request
298298
public ContextMenu from(ModelObjectWithContextMenu self, StaplerRequest2 request, StaplerResponse2 response, String view) throws JellyException, IOException {
299299
// TODO - refactor this
300300
if (self instanceof Run) {
301-
this.addAll(((Actionable) self).getMagic());
301+
this.addAll(((Actionable) self).getAppBarActions());
302302
return this;
303303
}
304304

core/src/main/resources/lib/layout/app-bar-controls.jelly

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -23,25 +23,28 @@ THE SOFTWARE.
2323
-->
2424

2525
<?jelly escape-by-default='true'?>
26-
<j:jelly xmlns:j="jelly:core">
26+
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler">
27+
<st:documentation>
28+
Generates a strip of controls based on the given actions parameter.
2729

28-
<!-- The point of this component is to generate the top right app bar controls/overflow menu -->
30+
<st:attribute name="actions">
31+
The actions to show.
32+
</st:attribute>
33+
</st:documentation>
2934

30-
<j:set var="actions" value="${it.object.magic}" />
3135
<j:if test="${actions != null}">
32-
<!-- <div class="jenkins-app-bar__controls">-->
33-
<button id="auto-overflow" class="jenkins-button"
34-
tooltip="${%More actions}"
35-
type="button">
36-
<div class="jenkins-overflow-button__ellipsis">
37-
<span />
38-
<span />
39-
<span />
40-
</div>
41-
</button>
42-
<template>
43-
${h.convertActionsToJson(actions)}
44-
</template>
45-
<!-- </div>-->
36+
<button id="auto-overflow"
37+
class="jenkins-button"
38+
tooltip="${%More actions}"
39+
type="button">
40+
<div class="jenkins-overflow-button__ellipsis">
41+
<span />
42+
<span />
43+
<span />
44+
</div>
45+
</button>
46+
<template>
47+
${h.convertActionsToJson(actions)}
48+
</template>
4649
</j:if>
4750
</j:jelly>

core/src/main/resources/lib/layout/run-subpage.jelly

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ THE SOFTWARE.
6868
</div>
6969

7070
<div class="app-build-bar__controls">
71-
<l:app-bar-controls />
71+
<l:app-bar-controls actions="${it.object.appBarActions}" />
7272
</div>
7373
</div>
7474

0 commit comments

Comments
 (0)