Merge branch 'RED-8870' into 'master'

RED-8870: fixed comment author displayed as unknown user.

See merge request redactmanager/red-ui!368
This commit is contained in:
Dan Percic 2024-03-27 15:24:45 +01:00
commit 9d858bfe39
4 changed files with 4 additions and 4 deletions

View File

@ -1,7 +1,7 @@
<div *ngFor="let comment of comments(); trackBy: trackBy" class="comment">
<div class="comment-details-wrapper">
<div [matTooltipPosition]="'above'" [matTooltip]="comment.date | date: 'exactDate'" class="small-label">
<strong> {{ comment.user | name }} </strong>
<strong> {{ comment.userId | name }} </strong>
{{ comment.date | date: 'sophisticatedDate' }}
</div>

View File

@ -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();

View File

@ -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
);
}

View File

@ -1,6 +1,6 @@
export interface IComment {
id: string;
user: string;
userId: string;
date?: string;
text: string;
annotationId?: string;