This commit is contained in:
Timo Bejan 2021-08-05 15:29:59 +03:00
parent cd6613214e
commit 1ae6e42b54
6 changed files with 47 additions and 86 deletions

View File

@ -190,6 +190,9 @@ export class AnnotationWrapper {
}
static fromData(redactionLogEntry?: RedactionLogEntryWrapper) {
if (redactionLogEntry.status === 'REQUESTED') {
console.log(redactionLogEntry);
}
const annotationWrapper = new AnnotationWrapper();
annotationWrapper._origin = redactionLogEntry;

View File

@ -28,7 +28,7 @@
<div class="right-content">
<div *ngIf="isReadOnly" [class.justify-center]="!isProcessing" class="read-only d-flex">
<div *ngIf="isProcessing" class="flex-align-items-center">
<span [translate]="'filestatus.processing'" class="read-only-text"></span>
<span [translate]="'file-status.processing'" class="read-only-text"></span>
<mat-progress-bar [mode]="'indeterminate'" class="w-100"></mat-progress-bar>
</div>
<div class="flex-center">
@ -176,51 +176,49 @@
>
<div class="active-bar-marker"></div>
<div [class.removed]="annotation.isChangeLogRemoved" class="annotation">
<redaction-hidden-action (action)="logAnnotation(annotation)" [requiredClicks]="2">
<div [matTooltip]="annotation.content" class="details" matTooltipPosition="above">
<redaction-type-annotation-icon [annotation]="annotation"></redaction-type-annotation-icon>
<div class="flex-1">
<div>
<strong>{{ annotation.typeLabel | translate }}</strong>
</div>
<div *ngIf="annotation?.dictionary !== 'manual'">
<strong>
<span>{{ annotation.descriptor | translate }}</span
>: </strong
>{{ annotation.dictionary | humanize: false }}
</div>
<div *ngIf="annotation.shortContent && !annotation.isHint">
<strong><span translate="content"></span>: </strong>{{ annotation.shortContent }}
</div>
<div [matTooltip]="annotation.content" class="details" matTooltipPosition="above">
<redaction-type-annotation-icon [annotation]="annotation"></redaction-type-annotation-icon>
<div class="flex-1">
<div>
<strong>{{ annotation.typeLabel | translate }}</strong>
</div>
<div class="active-icon-marker-container">
<iqser-round-checkbox
*ngIf="multiSelectActive && isSelected(annotation)"
[active]="true"
></iqser-round-checkbox>
<div *ngIf="annotation?.dictionary !== 'manual'">
<strong>
<span>{{ annotation.descriptor | translate }}</span
>: </strong
>{{ annotation.dictionary | humanize: false }}
</div>
<div *ngIf="annotation.shortContent && !annotation.isHint">
<strong><span translate="content"></span>: </strong>{{ annotation.shortContent }}
</div>
</div>
<div class="actions-wrapper">
<div
(click)="toggleExpandComments(annotation, $event)"
[matTooltip]="'comments.comments' | translate: { count: annotation.comments?.length }"
class="comments-counter"
matTooltipPosition="above"
>
<mat-icon svgIcon="red:comment"></mat-icon>
{{ annotation.comments.length }}
</div>
<div *ngIf="!multiSelectActive" class="actions">
<ng-container
[ngTemplateOutletContext]="{ annotation: annotation }"
[ngTemplateOutlet]="annotationActionsTemplate"
></ng-container>
</div>
<div class="active-icon-marker-container">
<iqser-round-checkbox
*ngIf="multiSelectActive && isSelected(annotation)"
[active]="true"
></iqser-round-checkbox>
</div>
<redaction-comments [annotation]="annotation"></redaction-comments>
</redaction-hidden-action>
</div>
<div class="actions-wrapper">
<div
(click)="toggleExpandComments(annotation, $event)"
[matTooltip]="'comments.comments' | translate: { count: annotation.comments?.length }"
class="comments-counter"
matTooltipPosition="above"
>
<mat-icon svgIcon="red:comment"></mat-icon>
{{ annotation.comments.length }}
</div>
<div *ngIf="!multiSelectActive" class="actions">
<ng-container
[ngTemplateOutletContext]="{ annotation: annotation }"
[ngTemplateOutlet]="annotationActionsTemplate"
></ng-container>
</div>
</div>
<redaction-comments [annotation]="annotation"></redaction-comments>
</div>
</div>
</div>

View File

@ -156,6 +156,7 @@ export class FileWorkloadComponent {
annotationClicked(annotation: AnnotationWrapper, $event: MouseEvent) {
this.pagesPanelActive = false;
this.logAnnotation(annotation);
if (this.isSelected(annotation)) {
this.deselectAnnotations.emit([annotation]);
} else {

View File

@ -24,6 +24,7 @@ export class AnnotationActionsService {
acceptSuggestion($event: MouseEvent, annotations: AnnotationWrapper[], annotationsChanged: EventEmitter<AnnotationWrapper>) {
$event?.stopPropagation();
annotations.forEach(annotation => {
console.log('Accept ', annotation);
this._processObsAndEmit(
this._manualAnnotationService.approveRequest(annotation.id, annotation.isModifyDictionary),
annotation,

View File

@ -80,50 +80,6 @@ export class DossiersDialogService extends DialogService<DialogType> {
return ref;
}
openAcceptSuggestionModal(
$event: MouseEvent,
annotation: AnnotationWrapper,
callback?: Function
): MatDialogRef<ConfirmationDialogComponent> {
$event?.stopPropagation();
const ref = this._dialog.open(ConfirmationDialogComponent, dialogConfig);
ref.afterClosed().subscribe(result => {
if (result) {
this._manualAnnotationService.approveRequest(annotation.id).subscribe(acceptResult => {
if (callback) {
callback(acceptResult);
}
});
}
});
return ref;
}
openRejectSuggestionModal(
$event: MouseEvent,
annotation: AnnotationWrapper,
rejectCallback: () => void
): MatDialogRef<ConfirmationDialogComponent> {
$event?.stopPropagation();
const ref = this._dialog.open(ConfirmationDialogComponent, {
width: '400px',
maxWidth: '90vw'
});
ref.afterClosed().subscribe(result => {
if (result) {
this._manualAnnotationService.declineOrRemoveRequest(annotation).subscribe(() => {
rejectCallback();
});
}
});
return ref;
}
openForceRedactionDialog($event: MouseEvent, cb?: Function): MatDialogRef<ForceRedactionDialogComponent> {
$event?.stopPropagation();
const ref = this._dialog.open(ForceRedactionDialogComponent, {

View File

@ -34,7 +34,9 @@ export class PdfViewerDataService {
const dossierId = this._appStateService.activeDossierId;
const fileId = this._appStateService.activeFileId;
this._man.getManualRedaction(dossierId, fileId).subscribe();
this._man.getManualRedaction(dossierId, fileId).subscribe(mr => {
console.log(mr);
});
const file$ = this.downloadOriginalFile(this._appStateService.activeFile);
const reactionLog$ = this._redactionLogControllerService.getRedactionLog(dossierId, fileId).pipe(catchError(() => of({})));