From 3e6a6c003bc494a93090c1741c2d0cd8b391097a Mon Sep 17 00:00:00 2001 From: Florian Ehrenstorfer Date: Mon, 25 Nov 2024 14:02:27 +0100 Subject: [PATCH] #144: add reviews state dto --- .../activitydashboard/ReviewActivityDto.java | 16 ++++++++-------- webapp/src/app/app.routes.ts | 6 ++---- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/activitydashboard/ReviewActivityDto.java b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/activitydashboard/ReviewActivityDto.java index 974442f3..3139123b 100644 --- a/server/application-server/src/main/java/de/tum/in/www1/hephaestus/activitydashboard/ReviewActivityDto.java +++ b/server/application-server/src/main/java/de/tum/in/www1/hephaestus/activitydashboard/ReviewActivityDto.java @@ -12,7 +12,7 @@ public record ReviewActivityDto( @NonNull Long id, @NonNull Boolean isDismissed, - @NonNull ReviewActivityState state, + @NonNull ReviewActivityStateDto state, @NonNull Integer codeComments, UserInfoDTO author, PullRequestInfoDTO pullRequest) { @@ -32,14 +32,14 @@ public static ReviewActivityDto fromPullRequest(PullRequest pullRequest) { return new ReviewActivityDto( pullRequest.getId(), false, - ReviewActivityState.REVIEW_REQUESTED, + ReviewActivityStateDto.REVIEW_REQUESTED, 0, UserInfoDTO.fromUser(pullRequest.getAuthor()), PullRequestInfoDTO.fromPullRequest(pullRequest) ); } - public enum ReviewActivityState { + public enum ReviewActivityStateDto { COMMENTED, APPROVED, CHANGES_REQUESTED, @@ -47,12 +47,12 @@ public enum ReviewActivityState { UNKNOWN; } - public static ReviewActivityState fromPullRequestReviewState(PullRequestReview.State state) { + public static ReviewActivityStateDto fromPullRequestReviewState(PullRequestReview.State state) { return switch (state) { - case COMMENTED -> ReviewActivityState.COMMENTED; - case APPROVED -> ReviewActivityState.APPROVED; - case CHANGES_REQUESTED -> ReviewActivityState.CHANGES_REQUESTED; - default -> ReviewActivityState.UNKNOWN; + case COMMENTED -> ReviewActivityStateDto.COMMENTED; + case APPROVED -> ReviewActivityStateDto.APPROVED; + case CHANGES_REQUESTED -> ReviewActivityStateDto.CHANGES_REQUESTED; + default -> ReviewActivityStateDto.UNKNOWN; }; } } \ No newline at end of file diff --git a/webapp/src/app/app.routes.ts b/webapp/src/app/app.routes.ts index b8d9318a..27318108 100644 --- a/webapp/src/app/app.routes.ts +++ b/webapp/src/app/app.routes.ts @@ -11,9 +11,7 @@ import { ImprintComponent } from '@app/legal/imprint.component'; import { PrivacyComponent } from '@app/legal/privacy.component'; import { AdminGuard } from '@app/core/security/admin.guard'; import { AuthGuard } from '@app/core/security/auth.guard'; -import { - ActivityDashboardComponent -} from '@app/home/activity-dashboard/activity-dashboard/activity-dashboard.component'; +import { ActivityDashboardComponent } from '@app/home/activity-dashboard/activity-dashboard/activity-dashboard.component'; export const routes: Routes = [ // Public routes @@ -52,7 +50,7 @@ export const routes: Routes = [ { path: 'settings', component: SettingsComponent }, { path: 'workspace', component: WorkspaceComponent, canActivate: [AdminGuard] } ] - } + }, { path: 'user/:id', component: UserProfileComponent }, { path: 'activity/:id', component: ActivityDashboardComponent } ];