Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/main/java/org/keycloak/dashboard/beans/PR.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,17 @@ public PR(GitHubData data, Teams teams) {

for (String team : teams.keySet()) {
int teamCount = (int) prs.stream().filter(i -> i.hasLabel(team) && i.isOpen()).count();
int teamOverdueCount = (int) prs.stream().filter(i -> i.hasLabel(team) && i.isOpen() && i.getCreatedAt().before(DateUtil.MINUS_30_DAYS)).count();
if (teamCount > 0) {
teamStats.add(new PRStat(team.replace("team/", ""), teamCount, 25, 50, "is:open label:" + team));
teamStats.add(new PRStat(team.replace("team/", ""), teamCount, 25, 50, "is:open label:" + team, teamOverdueCount, 1, 5, "is:open label:" + team + " created:<=" + DateUtil.MINUS_30_DAYS_STRING));
}
}

int noTeamStat = (int) prs.stream().filter(i -> i.isOpen() && !i.hasLabel(teams.keySet().toArray(new String[0]))).count();
int noTeamOverDueStat = (int) prs.stream().filter(i -> i.isOpen() && !i.hasLabel(teams.keySet().toArray(new String[0])) && i.getCreatedAt().before(DateUtil.MINUS_30_DAYS)).count();
String noTeamQuery = "is:open -label:" + String.join(",", teams.keySet());
teamStats.add(new PRStat("No team", noTeamStat, 5, 10, noTeamQuery));
String noTeamQueryOverDue = noTeamQuery + " created:<=" + DateUtil.MINUS_30_DAYS_STRING;
teamStats.add(new PRStat("No team", noTeamStat, 5, 10, noTeamQuery, noTeamOverDueStat, 1, 5, noTeamQueryOverDue));

}

Expand Down
6 changes: 6 additions & 0 deletions src/main/resources/module-prs-teams.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,17 @@
<tr>
<th>Description</th>
<th class="center">Open</th>
<th class="center">Overdue</th>
</tr>
<#list prTeamStats as prStat>
<tr>
<td class="title"><a href="${prStat.openGhLink}">${prStat.title}</a></td>
<td class="count ${prStat.openCssClasses} center"><a href="${prStat.openGhLink}">${prStat.openCount}</a></td>
<#if prStat.closedCount?has_content>
<td class="closedCount ${prStat.closedCssClasses} center"><a href="${prStat.closedGhLink}">${prStat.closedCount}</a></td>
<#else>
<td class="count"></td>
</#if>
</tr>
</#list>
</table>
Expand Down
Loading