diff --git a/server/application-server/openapi.yaml b/server/application-server/openapi.yaml index 1e0fb315..f5844f74 100644 --- a/server/application-server/openapi.yaml +++ b/server/application-server/openapi.yaml @@ -468,6 +468,9 @@ components: numberOfReviewedPRs: type: integer format: int32 + numberOfReviews: + type: integer + format: int32 changesRequested: type: array items: diff --git a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/leaderboard/LeaderboardEntry.java b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/leaderboard/LeaderboardEntry.java index a0dafb54..8ce067cc 100644 --- a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/leaderboard/LeaderboardEntry.java +++ b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/leaderboard/LeaderboardEntry.java @@ -22,6 +22,7 @@ public class LeaderboardEntry { private int score; private int rank; private int numberOfReviewedPRs; + private int numberOfReviews; private PullRequestReviewDTO[] changesRequested; private PullRequestReviewDTO[] approvals; private PullRequestReviewDTO[] comments; diff --git a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/leaderboard/LeaderboardService.java b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/leaderboard/LeaderboardService.java index a031c407..5be7e4df 100644 --- a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/leaderboard/LeaderboardService.java +++ b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/leaderboard/LeaderboardService.java @@ -57,6 +57,7 @@ public List createLeaderboard(Optional after, Optio } AtomicInteger score = new AtomicInteger(0); Set reviewedPRs = new HashSet<>(); + AtomicInteger numberOfReviews = new AtomicInteger(0); Set changesRequestedSet = new HashSet<>(); Set approvedSet = new HashSet<>(); Set commentSet = new HashSet<>(); @@ -71,6 +72,7 @@ public List createLeaderboard(Optional after, Optio review.getUpdatedAt(), review.getSubmittedAt(), review.getState()); reviewedPRs.add(review.getPullRequest().getNumber()); + numberOfReviews.incrementAndGet(); switch (review.getState()) { case CHANGES_REQUESTED: changesRequestedSet.add(reviewDTO); @@ -91,6 +93,7 @@ public List createLeaderboard(Optional after, Optio score.get(), 0, // preliminary rank reviewedPRs.size(), + numberOfReviews.get(), changesRequestedSet.toArray(new PullRequestReviewDTO[changesRequestedSet.size()]), approvedSet.toArray(new PullRequestReviewDTO[approvedSet.size()]), commentSet.toArray(new PullRequestReviewDTO[commentSet.size()])); diff --git a/webapp/src/app/core/modules/openapi/model/leaderboard-entry.ts b/webapp/src/app/core/modules/openapi/model/leaderboard-entry.ts index e65a9c77..89008e67 100644 --- a/webapp/src/app/core/modules/openapi/model/leaderboard-entry.ts +++ b/webapp/src/app/core/modules/openapi/model/leaderboard-entry.ts @@ -20,6 +20,7 @@ export interface LeaderboardEntry { score?: number; rank?: number; numberOfReviewedPRs?: number; + numberOfReviews?: number; changesRequested?: Array; approvals?: Array; comments?: Array; diff --git a/webapp/src/app/home/leaderboard/leaderboard.component.html b/webapp/src/app/home/leaderboard/leaderboard.component.html index 59cd9368..cc606655 100644 --- a/webapp/src/app/home/leaderboard/leaderboard.component.html +++ b/webapp/src/app/home/leaderboard/leaderboard.component.html @@ -25,7 +25,11 @@ {{ entry.score }}
-
+
+ + {{ entry.numberOfReviews }} +
+
{{ entry.numberOfReviewedPRs }}
diff --git a/webapp/src/app/home/leaderboard/leaderboard.component.ts b/webapp/src/app/home/leaderboard/leaderboard.component.ts index 5a05d903..6bed9fd9 100644 --- a/webapp/src/app/home/leaderboard/leaderboard.component.ts +++ b/webapp/src/app/home/leaderboard/leaderboard.component.ts @@ -1,6 +1,6 @@ import { Component, input } from '@angular/core'; import { NgIconComponent } from '@ng-icons/core'; -import { octFileDiff, octCheck, octComment, octGitPullRequest, octChevronRight } from '@ng-icons/octicons'; +import { octFileDiff, octCheck, octComment, octGitPullRequest, octChevronRight, octEye } from '@ng-icons/octicons'; import { LeaderboardEntry } from 'app/core/modules/openapi'; import { AvatarFallbackComponent } from 'app/ui/avatar/avatar-fallback.component'; import { AvatarImageComponent } from 'app/ui/avatar/avatar-image.component'; @@ -39,6 +39,7 @@ export class LeaderboardComponent { protected octComment = octComment; protected octGitPullRequest = octGitPullRequest; protected octChevronRight = octChevronRight; + protected octEye = octEye; leaderboard = input(); }