refactoring
- change Color to BoardBackgroundColor - change setBoardMemberPermission to setMemberPermission
This commit is contained in:
parent
991b19a1b8
commit
f4d51da443
@ -22,7 +22,7 @@ public interface BoardService {
|
||||
Call<Void> deleteBoard(@Path("boardId") String boardId);
|
||||
|
||||
@POST("/api/boards/{boardId}/members/{memberId}")
|
||||
Call<Void> setBoardMemberPermission(
|
||||
Call<Void> setMemberPermission(
|
||||
@Path("boardId") String board,
|
||||
@Path("memberId") String member,
|
||||
@Body MemberPermission memberPermission
|
||||
|
@ -16,7 +16,8 @@ public class Board {
|
||||
// TODO list of labels
|
||||
// TODO list of members
|
||||
private Permission permission;
|
||||
private Color color;
|
||||
@SerializedName("color")
|
||||
private BoardBackgroundColor backgroundColor;
|
||||
private String description;
|
||||
private String subtasksDefaultBoardId;
|
||||
private String subtasksDefaultListId;
|
||||
@ -62,8 +63,8 @@ public class Board {
|
||||
return permission;
|
||||
}
|
||||
|
||||
public Color getColor() {
|
||||
return color;
|
||||
public BoardBackgroundColor getBackgroundColor() {
|
||||
return backgroundColor;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
@ -125,7 +126,7 @@ public class Board {
|
||||
", modifiedAt=" + modifiedAt +
|
||||
", starts=" + starts +
|
||||
", permission=" + permission +
|
||||
", color=" + color +
|
||||
", color=" + backgroundColor +
|
||||
", description='" + description + '\'' +
|
||||
", subtasksDefaultBoardId='" + subtasksDefaultBoardId + '\'' +
|
||||
", subtasksDefaultListId='" + subtasksDefaultListId + '\'' +
|
||||
|
@ -2,7 +2,7 @@ package wekan.wrapper.entity;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
public enum Color {
|
||||
public enum BoardBackgroundColor {
|
||||
@SerializedName("belize")
|
||||
BELIZE,
|
||||
@SerializedName("nephritis")
|
@ -1,5 +1,7 @@
|
||||
package wekan.wrapper.entity;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
public class BoardPrototype {
|
||||
private String title;
|
||||
private String owner;
|
||||
@ -8,7 +10,8 @@ public class BoardPrototype {
|
||||
private boolean isNoComments;
|
||||
private boolean isCommentOnly;
|
||||
private Permission permission;
|
||||
private Color color;
|
||||
@SerializedName("color")
|
||||
private BoardBackgroundColor backgroundColor;
|
||||
|
||||
private BoardPrototype(
|
||||
String title,
|
||||
@ -18,7 +21,7 @@ public class BoardPrototype {
|
||||
boolean isNoComments,
|
||||
boolean isCommentOnly,
|
||||
Permission permission,
|
||||
Color color
|
||||
BoardBackgroundColor backgroundColor
|
||||
) {
|
||||
this.title = title;
|
||||
this.owner = owner;
|
||||
@ -27,7 +30,7 @@ public class BoardPrototype {
|
||||
this.isNoComments = isNoComments;
|
||||
this.isCommentOnly = isCommentOnly;
|
||||
this.permission = permission;
|
||||
this.color = color;
|
||||
this.backgroundColor = backgroundColor;
|
||||
}
|
||||
|
||||
public static class Builder {
|
||||
@ -38,7 +41,7 @@ public class BoardPrototype {
|
||||
private boolean isNoComments = false;
|
||||
private boolean isCommentOnly = false;
|
||||
private Permission permission = Permission.PRIVATE;
|
||||
private Color color = Color.BELIZE;
|
||||
private BoardBackgroundColor backgroundColor = BoardBackgroundColor.BELIZE;
|
||||
|
||||
public Builder() {
|
||||
}
|
||||
@ -52,7 +55,7 @@ public class BoardPrototype {
|
||||
isNoComments,
|
||||
isCommentOnly,
|
||||
permission,
|
||||
color
|
||||
backgroundColor
|
||||
);
|
||||
}
|
||||
|
||||
@ -91,8 +94,8 @@ public class BoardPrototype {
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setColor(Color color) {
|
||||
this.color = color;
|
||||
public Builder setBackgroundColor(BoardBackgroundColor backgroundColor) {
|
||||
this.backgroundColor = backgroundColor;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
@ -118,7 +118,7 @@ public class BoardServiceTest {
|
||||
assertFalse(board.isArchived());
|
||||
assertEquals(0, board.getStarts());
|
||||
assertEquals(Permission.PRIVATE, board.getPermission());
|
||||
assertEquals(Color.CORTEZA, board.getColor());
|
||||
assertEquals(BoardBackgroundColor.CORTEZA, board.getBackgroundColor());
|
||||
assertTrue(board.isAllowsSubtasks());
|
||||
assertEquals(PresentParentTask.NO_PARENT, board.getPresentParentTask());
|
||||
assertEquals(0, board.getSpentTime());
|
||||
|
Loading…
Reference in New Issue
Block a user