From c5e81161fa8db065ec4b030ed19ee0690c2d56b8 Mon Sep 17 00:00:00 2001 From: Nicoleta Panaghiu Date: Wed, 27 Mar 2024 16:23:29 +0200 Subject: [PATCH] RED-8870: fixed comment author displayed as unknown user. --- .../file-preview/components/comments/comments.component.html | 2 +- .../file-preview/components/comments/comments.component.ts | 2 +- apps/red-ui/src/app/services/permissions.service.ts | 2 +- libs/red-domain/src/lib/redaction-log/comment.ts | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/red-ui/src/app/modules/file-preview/components/comments/comments.component.html b/apps/red-ui/src/app/modules/file-preview/components/comments/comments.component.html index 833094349..06601b714 100644 --- a/apps/red-ui/src/app/modules/file-preview/components/comments/comments.component.html +++ b/apps/red-ui/src/app/modules/file-preview/components/comments/comments.component.html @@ -1,7 +1,7 @@
- {{ comment.user | name }} + {{ comment.userId | name }} {{ comment.date | date: 'sophisticatedDate' }}
diff --git a/apps/red-ui/src/app/modules/file-preview/components/comments/comments.component.ts b/apps/red-ui/src/app/modules/file-preview/components/comments/comments.component.ts index 62e5ea6b8..4e19920cd 100644 --- a/apps/red-ui/src/app/modules/file-preview/components/comments/comments.component.ts +++ b/apps/red-ui/src/app/modules/file-preview/components/comments/comments.component.ts @@ -55,7 +55,7 @@ export class CommentsComponent implements OnChanges { text: value, id: commentId, annotationId: this.annotation.id, - user: this.currentUser.id, + userId: this.currentUser.id, }, ]); this.input.reset(); diff --git a/apps/red-ui/src/app/services/permissions.service.ts b/apps/red-ui/src/app/services/permissions.service.ts index 0a6288aa7..456ec57a5 100644 --- a/apps/red-ui/src/app/services/permissions.service.ts +++ b/apps/red-ui/src/app/services/permissions.service.ts @@ -336,7 +336,7 @@ export class PermissionsService { canDeleteComment(comment: IComment, file: File, dossier: Dossier) { return ( this._iqserPermissionsService.has(Roles.comments.delete) && - (comment.user === this.#userId || this.isApprover(dossier)) && + (comment.userId === this.#userId || this.isApprover(dossier)) && !file.isApproved ); } diff --git a/libs/red-domain/src/lib/redaction-log/comment.ts b/libs/red-domain/src/lib/redaction-log/comment.ts index d2fb3a87e..d14fb54bc 100644 --- a/libs/red-domain/src/lib/redaction-log/comment.ts +++ b/libs/red-domain/src/lib/redaction-log/comment.ts @@ -1,6 +1,6 @@ export interface IComment { id: string; - user: string; + userId: string; date?: string; text: string; annotationId?: string;