Skip to content
This repository was archived by the owner on Jun 9, 2021. It is now read-only.

Commit c253934

Browse files
committed
Sorting buttons #91
1 parent 17f50cb commit c253934

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
Changelog of Pull Request Notifier for Bitbucket.
44

5+
## 2.15
6+
* Organizing buttons in a dropdown. Making it more compact when having alot of buttons.
7+
58
## 2.14
69
* Bugfix: Fixing IndexOutOfBoundsException if no reviewers and using reviewers variable
710

src/main/java/se/bjurr/prnfb/ManualResource.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import static com.atlassian.bitbucket.permission.Permission.ADMIN;
44
import static com.google.common.collect.Iterables.find;
55
import static com.google.common.collect.Lists.newArrayList;
6+
import static com.google.common.collect.Ordering.usingToString;
67
import static java.lang.Boolean.FALSE;
78
import static java.lang.Boolean.TRUE;
89
import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
@@ -106,6 +107,7 @@ && triggeredByAction(clientKeyStore, settings, pullRequestAction, pullRequest, v
106107
buttons.add(candidate);
107108
}
108109
}
110+
buttons = usingToString().sortedCopy(buttons);
109111
return ok(gson.toJson(buttons), APPLICATION_JSON).build();
110112
}
111113

src/main/java/se/bjurr/prnfb/settings/PrnfbButton.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,9 @@ public BUTTON_VISIBILITY getVisibility() {
2525
public String getFormIdentifier() {
2626
return formIdentifier;
2727
}
28+
29+
@Override
30+
public String toString() {
31+
return "Title: " + title;
32+
}
2833
}

0 commit comments

Comments
 (0)