Skip to content

Commit 4c56be0

Browse files
committed
fix: treat open archived issues as abandoned
Signed-off-by: Andrew Berezovskyi <andriib@kth.se>
1 parent 3bcb3ae commit 4c56be0

File tree

4 files changed

+26
-20
lines changed

4 files changed

+26
-20
lines changed

source/BugzillaLyoArchives/src/main/java/se/kth/md/it/bcm/RestDelegate.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ public BugzillaChangeRequest fromBug(Bug bug, HttpServletRequest httpServletRequ
139139
String status = bug.getStatus();
140140
if ("NEW".equals(status) || "ASSIGNED".equals(status) || "REOPENED".equals(status)) {
141141
changeRequest.setClosed(true);
142+
changeRequest.setStatus("CLOSED");
142143
changeRequest.addSubject("Status: Abandoned");
143144
}
144145
}

source/BugzillaLyoArchives/src/main/webapp/se/kth/md/it/bcm/bugzillachangerequest.jsp

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,12 @@
173173
} else {
174174
String status = aBugzillaChangeRequest.getStatus().toString();
175175
String badgeClass = "bg-secondary";
176-
if (status.equalsIgnoreCase("NEW") || status.equalsIgnoreCase("UNCONFIRMED")) badgeClass = "bg-primary";
176+
if (status.equalsIgnoreCase("NEW") || status.equalsIgnoreCase("UNCONFIRMED")) {
177+
badgeClass = "bg-primary";
178+
if (aBugzillaChangeRequest.getSubject().contains("Status: Abandoned")) {
179+
badgeClass = "bg-warning text-dark";
180+
}
181+
}
177182
else if (status.equalsIgnoreCase("RESOLVED") || status.equalsIgnoreCase("VERIFIED")) badgeClass = "bg-success";
178183
else if (status.equalsIgnoreCase("CLOSED")) badgeClass = "bg-dark";
179184
else if (status.equalsIgnoreCase("IN_PROGRESS") || status.equalsIgnoreCase("ASSIGNED")) badgeClass = "bg-info text-dark";
@@ -354,9 +359,13 @@
354359
<% method = BugzillaChangeRequest.class.getMethod("getSubject"); %>
355360
<dt class="col-sm-4 text-end"><a href="<%=method.getAnnotation(OslcPropertyDefinition.class).value() %>"><%=method.getAnnotation(OslcName.class).value()%></a></dt>
356361
<dd class="col-sm-8">
357-
<ul>
358-
<% Iterator<String> subjectItr = aBugzillaChangeRequest.getSubject().iterator(); while(subjectItr.hasNext()) { out.write("<li>" + subjectItr.next().toString() + "</li>"); } %>
359-
</ul>
362+
<%
363+
for(String next : aBugzillaChangeRequest.getSubject()) {
364+
String pillClass = "bg-secondary";
365+
if ("Status: Abandoned".equals(next)) pillClass = "bg-danger";
366+
out.write("<span class=\"badge rounded-pill " + pillClass + " me-1\">" + next + "</span>");
367+
}
368+
%>
360369
</dd>
361370
</dl>
362371
</div>

source/BugzillaLyoArchives/src/main/webapp/se/kth/md/it/bcm/bugzillachangerequestlargepreview.jsp

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -424,15 +424,13 @@
424424
<% method = BugzillaChangeRequest.class.getMethod("getSubject"); %>
425425
<dt><a href="<%=method.getAnnotation(OslcPropertyDefinition.class).value() %>"><%=method.getAnnotation(OslcName.class).value()%></a></dt>
426426
<dd>
427-
<ul>
428-
<%
429-
Iterator<String> subjectItr = aBugzillaChangeRequest.getSubject().iterator();
430-
while(subjectItr.hasNext()) {
431-
out.write("<li>" + subjectItr.next().toString() + "</li>");
432-
}
427+
<%
428+
for(String next : aBugzillaChangeRequest.getSubject()) {
429+
String pillClass = "bg-secondary";
430+
if ("Status: Abandoned".equals(next)) pillClass = "bg-danger";
431+
out.write("<span class=\"badge rounded-pill " + pillClass + " me-1\">" + next + "</span>");
432+
}
433433
%>
434-
</ul>
435-
436434
</dd>
437435
</dl>
438436
<dl class="dl-horizontal">

source/BugzillaLyoArchives/src/main/webapp/se/kth/md/it/bcm/bugzillachangerequestsmallpreview.jsp

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -424,15 +424,13 @@
424424
<% method = BugzillaChangeRequest.class.getMethod("getSubject"); %>
425425
<dt><a href="<%=method.getAnnotation(OslcPropertyDefinition.class).value() %>"><%=method.getAnnotation(OslcName.class).value()%></a></dt>
426426
<dd>
427-
<ul>
428-
<%
429-
Iterator<String> subjectItr = aBugzillaChangeRequest.getSubject().iterator();
430-
while(subjectItr.hasNext()) {
431-
out.write("<li>" + subjectItr.next().toString() + "</li>");
432-
}
427+
<%
428+
for(String next : aBugzillaChangeRequest.getSubject()) {
429+
String pillClass = "bg-secondary";
430+
if ("Status: Abandoned".equals(next)) pillClass = "bg-danger";
431+
out.write("<span class=\"badge rounded-pill " + pillClass + " me-1\">" + next + "</span>");
432+
}
433433
%>
434-
</ul>
435-
436434
</dd>
437435
</dl>
438436
<dl class="dl-horizontal">

0 commit comments

Comments
 (0)