argos/dmp-frontend/src/app/ui/annotations/annotation-dialog-component/annotation-dialog.component...

105 lines
5.8 KiB
HTML
Raw Normal View History

2024-02-28 14:41:36 +01:00
<div class="container form-container">
2024-03-13 09:45:22 +01:00
<div class="row d-flex justify-content-between align-items-center m-0">
<!-- <div class="col-auto"><a class="logo"><img class="logo" src="../../../assets/images/new-dmp-logo.png" onerror="this.style.display='none'"></a></div> -->
<div class="col-auto ml-auto close-btn" (click)="close()">
<mat-icon class="close-icon">close</mat-icon>
</div>
</div>
2024-02-28 14:41:36 +01:00
<div class="annotation-viewer row">
<!-- Create New Thread -->
<!-- <div *ngIf="this.canEdit && !this.isDeleted" class="col-12"> -->
<div class="col-12">
<form class="row p-2 mt-2 mb-3 ml-0 pr-3 mr-0 new-thread" [formGroup]="threadFormGroup">
2024-03-13 14:01:56 +01:00
<mat-form-field class="col-6 msg-input">
2024-03-13 09:45:22 +01:00
<textarea matInput matTextareaAutosize matAutosizeMinRows="1" name="thread-text" formControlName="text" placeholder="{{'ANNOTATION-DIALOG.THREADS.NEW-THREAD' | translate}}" required></textarea>
2024-02-28 14:41:36 +01:00
<mat-error *ngIf="threadFormGroup.get('text').hasError('backendError')">{{threadFormGroup.get('text').getError('backendError')?.message}}</mat-error>
<mat-error *ngIf="threadFormGroup.get('text').hasError('required')">{{'COMMONS.VALIDATION.REQUIRED' | translate}}</mat-error>
</mat-form-field>
2024-03-13 14:01:56 +01:00
<mat-form-field class="col-6 pl-0 pr-0 protection-input">
2024-03-13 09:45:22 +01:00
<mat-label>{{'ANNOTATION-DIALOG.THREADS.PROTECTION.TITLE' | translate}}</mat-label>
<mat-select name="thread-protectionType" formControlName="protectionType" required>
2024-02-28 14:41:36 +01:00
<mat-option *ngFor="let enumValue of annotationProtectionTypeEnumValues" [value]="enumValue">{{enumUtils.toAnnotationProtectionTypeString(enumValue)}}</mat-option>
</mat-select>
2024-03-13 09:45:22 +01:00
<mat-error *ngIf="threadFormGroup.get('protectionType').hasError('backendError')">{{threadFormGroup.get('protectionType').getError('backendError')?.message}}</mat-error>
<mat-error *ngIf="threadFormGroup.get('protectionType').hasError('required')">{{'COMMONS.VALIDATION.REQUIRED' | translate}}</mat-error>
</mat-form-field>
2024-02-28 14:41:36 +01:00
<div class="col-auto send-msg">
<button mat-raised-button type="button" (click)="createThread()">
2024-03-13 09:45:22 +01:00
<i class="fa fa-paper-plane"></i> {{'ANNOTATION-DIALOG.THREADS.SEND' | translate}}
2024-02-28 14:41:36 +01:00
</button>
</div>
</form>
</div>
<div class="col-12 mb-3 pt-2 gr-color" *ngIf="threads?.size > 0">{{'ANNOTATION-DIALOG.TITLE' | translate}}</div>
2024-02-28 14:41:36 +01:00
<div class="col-12">
<div *ngFor="let thread of threads" class="row">
<!-- Parent Thread -->
<div class="col-12">
<div class="row parent-thread m-0 h-100">
<div class="col-auto pr-0 pl-0">
<div class="side-color"></div>
</div>
<div class="col">
<div class="row reply-content">
<div class="col-12">
<div class="row h-100">
<div class="col-10 annotation-time">{{getParentAnnotation(thread).timeStamp | date:'EEEE, MMMM d, y, h:mm a'}}</div>
<div class="col-auto" *ngIf="getParentAnnotation(thread).protectionType === annotationProtectionTypeEnum.Private" matTooltip="{{'ANNOTATION-DIALOG.PROTECTION.PRIVATE' | translate}}"><i class="material-icons protection-icon icon-{{getAnnotationProtectionType(thread)}}"></i>{{getAnnotationProtectionType(thread)}}</div>
<div class="col-auto" *ngIf="getParentAnnotation(thread).protectionType === annotationProtectionTypeEnum.EntityAccessors" matTooltip="{{'ANNOTATION-DIALOG.PROTECTION.ENTITY-ACCESSORS' | translate}}"><i class="material-icons protection-icon icon-{{getAnnotationProtectionType(thread)}}"></i>{{getAnnotationProtectionType(thread)}}</div>
<div class="col-md-12 annotation-full-text">{{getParentAnnotation(thread).payload}}</div>
2024-02-28 14:41:36 +01:00
<div class="col-md-12">
<em class="user">{{'ANNOTATION-DIALOG.THREADS.FROM-USER' | translate}} {{getParentAnnotation(thread).author.name}}</em>
2024-02-28 14:41:36 +01:00
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Previous Replies -->
<div class="col-12">
<div *ngFor="let annotation of annotationsPerThread[thread]; let i = index;" class="row replies">
2024-02-28 14:41:36 +01:00
<div class="col-auto pr-0">
<div class="col reply child"></div>
<div class="col reply child dummy-for-next-child" *ngIf="i != annotationsPerThread[thread].length - 1"></div>
2024-02-28 14:41:36 +01:00
</div>
<div class="col pl-0 pt-1">
<div class="parent row m-0">
<div class="col-auto pl-0 pr-0">
<div class="side-soft-color"></div>
</div>
<div class="col reply-content">
<div class="row h-100">
<div class="col-md-12 annotation-time">{{annotation.timeStamp | date:'EEEE, MMMM d, y, h:mm a'}}</div>
<div class="col-md-12 annotation-full-text">{{annotation.payload}}</div>
2024-02-28 14:41:36 +01:00
<div class="col-md-12">
2024-03-13 09:45:22 +01:00
<em class="gr-color">{{'ANNOTATION-DIALOG.THREADS.FROM-USER' | translate}}</em>
2024-02-28 14:41:36 +01:00
{{annotation.author.name}}
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Type reply in thread -->
2024-03-14 09:03:04 +01:00
<!-- <div *ngIf="this.canEdit && !this.isDeleted" class="col-12"> -->
<div class="col-12">
2024-02-28 14:41:36 +01:00
<div class="row new-reply mr-0">
<mat-form-field class="col pt-2 pb-2 pr-0">
<textarea matInput matTextareaAutosize matAutosizeMinRows="1" [formControl]="this.threadReplyTextsFG[thread.toString()].get('replyText')" placeholder="{{'ANNOTATION-DIALOG.THREADS.REPLY' | translate}}"></textarea>
<mat-error *ngIf="this.threadReplyTextsFG[thread.toString()]?.get('replyText')?.hasError('required')">{{'COMMONS.VALIDATION.REQUIRED' | translate}}</mat-error>
2024-02-28 14:41:36 +01:00
</mat-form-field>
<div class="col-auto send-msg">
<button class="form-field-margin" mat-icon-button type="button" color="accent" (click)="replyThread(thread)" matTooltip="{{'ANNOTATION-DIALOG.THREADS.REPLY' | translate}}">
2024-02-28 14:41:36 +01:00
<i class="fa fa-paper-plane"></i>
</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>