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

This commit is contained in:
Nicoleta Panaghiu 2024-03-27 16:23:29 +02:00
parent a2b8541e8e
commit 7fbe0f8398
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 *ngFor="let comment of comments(); trackBy: trackBy" class="comment">
<div class="comment-details-wrapper"> <div class="comment-details-wrapper">
<div [matTooltipPosition]="'above'" [matTooltip]="comment.date | date: 'exactDate'" class="small-label"> <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' }} {{ comment.date | date: 'sophisticatedDate' }}
</div> </div>

View File

@ -55,7 +55,7 @@ export class CommentsComponent implements OnChanges {
text: value, text: value,
id: commentId, id: commentId,
annotationId: this.annotation.id, annotationId: this.annotation.id,
user: this.currentUser.id, userId: this.currentUser.id,
}, },
]); ]);
this.input.reset(); this.input.reset();

View File

@ -338,7 +338,7 @@ export class PermissionsService {
canDeleteComment(comment: IComment, file: File, dossier: Dossier) { canDeleteComment(comment: IComment, file: File, dossier: Dossier) {
return ( return (
this._iqserPermissionsService.has(Roles.comments.delete) && this._iqserPermissionsService.has(Roles.comments.delete) &&
(comment.user === this.#userId || this.isApprover(dossier)) && (comment.userId === this.#userId || this.isApprover(dossier)) &&
!file.isApproved !file.isApproved
); );
} }

View File

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