From 345d58d7be628675faeeda12597682e2e3e34bf2 Mon Sep 17 00:00:00 2001 From: Timo Bejan Date: Fri, 30 Oct 2020 12:59:21 +0200 Subject: [PATCH] annotation processing --- apps/red-ui/src/app/dialogs/dialog.service.ts | 7 +++++-- .../file-preview-screen/file-preview-screen.component.ts | 5 ++++- .../app/screens/file/pdf-viewer/pdf-viewer.component.ts | 4 +--- libs/red-ui-http/src/lib/model/fileStatus.ts | 8 ++++++++ 4 files changed, 18 insertions(+), 6 deletions(-) diff --git a/apps/red-ui/src/app/dialogs/dialog.service.ts b/apps/red-ui/src/app/dialogs/dialog.service.ts index 23e535b49..d4798b319 100644 --- a/apps/red-ui/src/app/dialogs/dialog.service.ts +++ b/apps/red-ui/src/app/dialogs/dialog.service.ts @@ -117,7 +117,8 @@ export class DialogService { public rejectSuggestion( $event: MouseEvent, - annotation: AnnotationWrapper + annotation: AnnotationWrapper, + rejectCallback: () => void ): MatDialogRef { $event.stopPropagation(); @@ -128,7 +129,9 @@ export class DialogService { ref.afterClosed().subscribe((result) => { if (result) { - this._manualAnnotationService.rejectSuggestion(annotation).subscribe(() => {}); + this._manualAnnotationService.rejectSuggestion(annotation).subscribe(() => { + rejectCallback(); + }); } }); diff --git a/apps/red-ui/src/app/screens/file/file-preview-screen/file-preview-screen.component.ts b/apps/red-ui/src/app/screens/file/file-preview-screen/file-preview-screen.component.ts index 8e483ef8e..a2571f4b6 100644 --- a/apps/red-ui/src/app/screens/file/file-preview-screen/file-preview-screen.component.ts +++ b/apps/red-ui/src/app/screens/file/file-preview-screen/file-preview-screen.component.ts @@ -271,7 +271,10 @@ export class FilePreviewScreenComponent implements OnInit { public rejectSuggestion($event: MouseEvent, annotation: AnnotationWrapper) { this.ngZone.run(() => { - this._dialogRef = this._dialogService.rejectSuggestion($event, annotation); + this._dialogRef = this._dialogService.rejectSuggestion($event, annotation, () => { + console.log('Reject Callback'); + this.activeViewer.annotManager.deleteAnnotation(annotation.annotation, false, true); + }); }); } diff --git a/apps/red-ui/src/app/screens/file/pdf-viewer/pdf-viewer.component.ts b/apps/red-ui/src/app/screens/file/pdf-viewer/pdf-viewer.component.ts index 072f94464..ba1ae8cd7 100644 --- a/apps/red-ui/src/app/screens/file/pdf-viewer/pdf-viewer.component.ts +++ b/apps/red-ui/src/app/screens/file/pdf-viewer/pdf-viewer.component.ts @@ -125,9 +125,7 @@ export class PdfViewerComponent implements OnInit, AfterViewInit, OnChanges { this._configureTextPopup(); this._configureHeader(); instance.annotManager.on('annotationChanged', (annotations, action) => { - if (action === 'add') { - this._annotationEventDebouncer.next(annotations); - } + this._annotationEventDebouncer.next(annotations); }); instance.annotManager.on('annotationSelected', (annotationList, action) => { diff --git a/libs/red-ui-http/src/lib/model/fileStatus.ts b/libs/red-ui-http/src/lib/model/fileStatus.ts index 2fbac0e3a..4cc7c5c7c 100644 --- a/libs/red-ui-http/src/lib/model/fileStatus.ts +++ b/libs/red-ui-http/src/lib/model/fileStatus.ts @@ -26,6 +26,10 @@ export interface FileStatus { * The current reviewer's (if any) user id. */ currentReviewer?: string; + /** + * Shows which dictionary versions was used during the analysis. + */ + dictionaryVersion?: number; /** * The ID of the file. */ @@ -62,6 +66,10 @@ export interface FileStatus { * The ID of the project the file belongs to. */ projectId?: string; + /** + * Shows which rules versions was used during the analysis. + */ + rulesVersion?: number; /** * The status of the file with regard to its analysis an review processes. */