From d73ee3b902b6e99c5635e22ac3d11a2419c4c7a7 Mon Sep 17 00:00:00 2001 From: Claudio Barril Date: Sat, 11 Apr 2015 16:09:55 -0300 Subject: [PATCH] sort collabs by id --- .../java/com/wisemapping/rest/model/RestCollaboration.java | 6 ++++++ wise-webapp/src/main/webapp/jsp/mindmapShare.jsp | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/wise-webapp/src/main/java/com/wisemapping/rest/model/RestCollaboration.java b/wise-webapp/src/main/java/com/wisemapping/rest/model/RestCollaboration.java index 47c4724f..38a965bb 100644 --- a/wise-webapp/src/main/java/com/wisemapping/rest/model/RestCollaboration.java +++ b/wise-webapp/src/main/java/com/wisemapping/rest/model/RestCollaboration.java @@ -37,10 +37,12 @@ import javax.xml.bind.annotation.XmlRootElement; isGetterVisibility = JsonAutoDetect.Visibility.PUBLIC_ONLY) public class RestCollaboration { + private long id; private String email; private String role; public RestCollaboration(@NotNull Collaboration collaboration) { + this.id = collaboration.getId(); this.email = collaboration.getCollaborator().getEmail(); this.role = collaboration.getRole().getLabel(); } @@ -59,6 +61,10 @@ public class RestCollaboration { } + public long getId() { + return id; + } + public String getRole() { return role; } diff --git a/wise-webapp/src/main/webapp/jsp/mindmapShare.jsp b/wise-webapp/src/main/webapp/jsp/mindmapShare.jsp index 0148b725..7b0eff2e 100644 --- a/wise-webapp/src/main/webapp/jsp/mindmapShare.jsp +++ b/wise-webapp/src/main/webapp/jsp/mindmapShare.jsp @@ -192,7 +192,7 @@ $(function () { success:function (data, textStatus, jqXHR) { // Owner roles is the first in the table ... var collabs = data.collaborations.sort(function (a, b) { - return a.role <= b.role; + return a.id > b.id; }); // Add all the columns in the table ...