Skip to content

Commit 2ce06ee

Browse files
authored
BoardApi fixes and group support (#1221)
1 parent 973e294 commit 2ce06ee

File tree

12 files changed

+685
-23
lines changed

12 files changed

+685
-23
lines changed

Diff for: gitlab4j-api/src/main/java/org/gitlab4j/api/BoardsApi.java

+406-11
Large diffs are not rendered by default.

Diff for: gitlab4j-models/src/main/java/org/gitlab4j/api/models/AbstractUser.java

+9
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ public abstract class AbstractUser<U extends AbstractUser<U>> implements Seriali
1717
private Long id;
1818
private String name;
1919
private String state;
20+
private Boolean locked;
2021
private String username;
2122
private String webUrl;
2223

@@ -60,6 +61,14 @@ public void setName(String name) {
6061
this.name = name;
6162
}
6263

64+
public Boolean getLocked() {
65+
return locked;
66+
}
67+
68+
public void setLocked(Boolean locked) {
69+
this.locked = locked;
70+
}
71+
6372
public String getState() {
6473
return state;
6574
}

Diff for: gitlab4j-models/src/main/java/org/gitlab4j/api/models/Board.java

+55-1
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,15 @@ public class Board implements Serializable {
1010

1111
private Long id;
1212
private String name;
13+
private Boolean hideBacklogList;
14+
private Boolean hideClosedList;
1315
private Project project;
14-
private Milestone milestone;
1516
private List<BoardList> lists;
17+
private Group group;
18+
private Milestone milestone;
19+
private Assignee assignee;
20+
private List<Label> labels;
21+
private Integer weight;
1622

1723
public Long getId() {
1824
return id;
@@ -30,6 +36,22 @@ public void setName(String name) {
3036
this.name = name;
3137
}
3238

39+
public Boolean getHideBacklogList() {
40+
return hideBacklogList;
41+
}
42+
43+
public void setHideBacklogList(Boolean hideBacklogList) {
44+
this.hideBacklogList = hideBacklogList;
45+
}
46+
47+
public Boolean getHideClosedList() {
48+
return hideClosedList;
49+
}
50+
51+
public void setHideClosedList(Boolean hideClosedList) {
52+
this.hideClosedList = hideClosedList;
53+
}
54+
3355
public Project getProject() {
3456
return project;
3557
}
@@ -54,6 +76,38 @@ public void setLists(List<BoardList> lists) {
5476
this.lists = lists;
5577
}
5678

79+
public Group getGroup() {
80+
return group;
81+
}
82+
83+
public void setGroup(Group group) {
84+
this.group = group;
85+
}
86+
87+
public Assignee getAssignee() {
88+
return assignee;
89+
}
90+
91+
public void setAssignee(Assignee assignee) {
92+
this.assignee = assignee;
93+
}
94+
95+
public List<Label> getLabels() {
96+
return labels;
97+
}
98+
99+
public void setLabels(List<Label> labels) {
100+
this.labels = labels;
101+
}
102+
103+
public Integer getWeight() {
104+
return weight;
105+
}
106+
107+
public void setWeight(Integer weight) {
108+
this.weight = weight;
109+
}
110+
57111
@Override
58112
public String toString() {
59113
return (JacksonJson.toJsonString(this));

Diff for: gitlab4j-models/src/main/java/org/gitlab4j/api/models/BoardList.java

+54
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@ public class BoardList implements Serializable {
1010
private Long id;
1111
private Label label;
1212
private Integer position;
13+
private Assignee assignee;
14+
private Milestone milestone;
15+
private Iteration iteration;
16+
private Integer maxIssueCount;
17+
private Integer maxIssueWeight;
18+
private Integer limitMetric;
1319

1420
public Long getId() {
1521
return id;
@@ -35,6 +41,54 @@ public void setPosition(Integer position) {
3541
this.position = position;
3642
}
3743

44+
public Assignee getAssignee() {
45+
return assignee;
46+
}
47+
48+
public void setAssignee(Assignee assignee) {
49+
this.assignee = assignee;
50+
}
51+
52+
public Milestone getMilestone() {
53+
return milestone;
54+
}
55+
56+
public void setMilestone(Milestone milestone) {
57+
this.milestone = milestone;
58+
}
59+
60+
public Iteration getIteration() {
61+
return iteration;
62+
}
63+
64+
public void setIteration(Iteration iteration) {
65+
this.iteration = iteration;
66+
}
67+
68+
public Integer getMaxIssueCount() {
69+
return maxIssueCount;
70+
}
71+
72+
public void setMaxIssueCount(Integer maxIssueCount) {
73+
this.maxIssueCount = maxIssueCount;
74+
}
75+
76+
public Integer getMaxIssueWeight() {
77+
return maxIssueWeight;
78+
}
79+
80+
public void setMaxIssueWeight(Integer maxIssueWeight) {
81+
this.maxIssueWeight = maxIssueWeight;
82+
}
83+
84+
public Integer getLimitMetric() {
85+
return limitMetric;
86+
}
87+
88+
public void setLimitMetric(Integer limitMetric) {
89+
this.limitMetric = limitMetric;
90+
}
91+
3892
@Override
3993
public String toString() {
4094
return (JacksonJson.toJsonString(this));

Diff for: gitlab4j-models/src/main/java/org/gitlab4j/api/models/Iteration.java

+6
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
import com.fasterxml.jackson.annotation.JsonCreator;
99
import com.fasterxml.jackson.annotation.JsonValue;
10+
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
1011

1112
public class Iteration implements Serializable {
1213
private static final long serialVersionUID = 1L;
@@ -52,8 +53,13 @@ public String toString() {
5253
private IterationState state;
5354
private Date createdAt;
5455
private Date updatedAt;
56+
57+
@JsonSerialize(using = JacksonJson.DateOnlySerializer.class)
5558
private Date startDate;
59+
60+
@JsonSerialize(using = JacksonJson.DateOnlySerializer.class)
5661
private Date dueDate;
62+
5763
private String webUrl;
5864

5965
public Long getId() {

Diff for: gitlab4j-models/src/main/java/org/gitlab4j/api/models/Label.java

+9
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ public class Label implements Serializable {
1515
private String color;
1616
private String description;
1717
private String descriptionHtml;
18+
private String textColor;
1819
private Integer openIssuesCount;
1920
private Integer closedIssuesCount;
2021
private Integer openMergeRequestsCount;
@@ -77,6 +78,14 @@ public void setDescriptionHtml(String descriptionHtml) {
7778
this.descriptionHtml = descriptionHtml;
7879
}
7980

81+
public String getTextColor() {
82+
return textColor;
83+
}
84+
85+
public void setTextColor(String textColor) {
86+
this.textColor = textColor;
87+
}
88+
8089
public Integer getOpenIssuesCount() {
8190
return openIssuesCount;
8291
}

Diff for: gitlab4j-models/src/test/java/org/gitlab4j/models/TestGitLabApiBeans.java

+7-1
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,17 @@ public void testBlame() throws Exception {
7878
}
7979

8080
@Test
81-
public void testBoard() throws Exception {
81+
public void testProjectBoard() throws Exception {
8282
List<Board> boards = unmarshalResourceList(Board.class, "project-board.json");
8383
assertTrue(compareJson(boards, "project-board.json"));
8484
}
8585

86+
@Test
87+
public void testGroupBoard() throws Exception {
88+
List<Board> boards = unmarshalResourceList(Board.class, "group-board.json");
89+
assertTrue(compareJson(boards, "group-board.json"));
90+
}
91+
8692
@Test
8793
public void testBranch() throws Exception {
8894

Diff for: gitlab4j-models/src/test/resources/org/gitlab4j/models/epic-issue.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@
7171
"state": 3,
7272
"created_at": "2023-08-07T00:05:06.739Z",
7373
"updated_at": "2023-09-04T00:05:06.612Z",
74-
"start_date": "2023-09-04T00:00:00Z",
75-
"due_date": "2023-09-10T00:00:00Z",
74+
"start_date": "2023-09-04",
75+
"due_date": "2023-09-10",
7676
"web_url": "http://example.com/example/-/iterations/158"
7777
}
7878
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
[
2+
{
3+
"id": 70,
4+
"name": "Development",
5+
"hide_backlog_list": false,
6+
"hide_closed_list": false,
7+
"lists": [],
8+
"group": {
9+
"id": 1474,
10+
"web_url": "https://example.gitlab.com/groups/a-group/main",
11+
"name": "Main"
12+
},
13+
"labels": [],
14+
"weight": 4
15+
},
16+
{
17+
"id": 71,
18+
"name": "uSlots",
19+
"hide_backlog_list": true,
20+
"hide_closed_list": true,
21+
"lists": [
22+
{
23+
"id": 360,
24+
"label": {
25+
"id": 13640,
26+
"name": "a-label",
27+
"description": "desc",
28+
"description_html": "desc",
29+
"text_color": "#FFFFFF",
30+
"color": "#9400d3"
31+
},
32+
"position": 0,
33+
"max_issue_count": 0,
34+
"max_issue_weight": 0
35+
},
36+
{
37+
"id": 361,
38+
"label": {
39+
"id": 13641,
40+
"name": "b-label",
41+
"description": "desc2",
42+
"description_html": "desc2",
43+
"text_color": "#FFFFFF",
44+
"color": "#9400d3"
45+
},
46+
"position": 1,
47+
"max_issue_count": 0,
48+
"max_issue_weight": 0
49+
},
50+
{
51+
"id": 362,
52+
"position": 2,
53+
"assignee": {
54+
"id": 61,
55+
"username": "john.smith",
56+
"name": "John Smith"
57+
},
58+
"max_issue_count": 0,
59+
"max_issue_weight": 0
60+
},
61+
{
62+
"id": 363,
63+
"position": 3,
64+
"assignee": {
65+
"id": 26,
66+
"username": "alice.johnson",
67+
"name": "Alice Johnson"
68+
},
69+
"max_issue_count": 0,
70+
"max_issue_weight": 0
71+
}
72+
],
73+
"group": {
74+
"id": 1474,
75+
"web_url": "https://example.gitlab.com/groups/a-group/main",
76+
"name": "Main"
77+
},
78+
"milestone": {
79+
"title": "Started"
80+
},
81+
"assignee": {
82+
"id": 37,
83+
"username": "bob.martin",
84+
"name": "Bob Martin",
85+
"state": "active",
86+
"locked": false,
87+
"avatar_url": "https://example.gitlab.com/uploads/-/system/user/avatar/37/avatar.png",
88+
"web_url": "https://example.gitlab.com/bob.martin"
89+
},
90+
"labels": [
91+
{
92+
"id": 116,
93+
"name": "Abc",
94+
"description": "",
95+
"description_html": "",
96+
"text_color": "#FFFFFF",
97+
"color": "#6699cc"
98+
}
99+
],
100+
"weight": 3
101+
}
102+
]

Diff for: gitlab4j-models/src/test/resources/org/gitlab4j/models/issue.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@
8484
"state": 1,
8585
"created_at": "2023-08-07T00:05:06.739Z",
8686
"updated_at": "2023-09-04T00:05:06.612Z",
87-
"start_date": "2023-09-04T00:00:00Z",
88-
"due_date": "2023-09-10T00:00:00Z",
87+
"start_date": "2023-09-04",
88+
"due_date": "2023-09-10",
8989
"web_url": "http://example.com/example/-/iterations/158"
9090
},
9191
"health_status": "needs_attention"

Diff for: gitlab4j-models/src/test/resources/org/gitlab4j/models/iteration.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"state": 2,
99
"created_at": "2022-03-14T05:21:11.929Z",
1010
"updated_at": "2022-03-14T05:21:11.929Z",
11-
"start_date": "2022-03-08T00:00:00Z",
12-
"due_date": "2022-03-14T00:00:00Z",
11+
"start_date": "2022-03-08",
12+
"due_date": "2022-03-14",
1313
"web_url": "https://gitlab.com/groups/my-group/-/iterations/90"
1414
}

0 commit comments

Comments
 (0)