Pull request #75: Remove initially drawn annotation rectangle

Merge in RED/ui from RED-887 to master

* commit 'd29d29280be4fb1f9f6d4a8452e16098e9df3928':
  Remove initially drawn annotation rectangle
This commit is contained in:
Timo Bejan 2020-12-17 08:42:25 +01:00
commit 8d202b35ba
3 changed files with 5 additions and 2 deletions

View File

@ -211,6 +211,8 @@ export class FilePreviewScreenComponent implements OnInit, OnDestroy {
this.ngZone.run(() => {
this._dialogRef = this._dialogService.openManualRedactionDialog($event, async (response: ManualAnnotationResponse) => {
if (response?.annotationId) {
const annotation = this.activeViewer.annotManager.getAnnotationById(response.manualRedactionEntryWrapper.rectId);
this.activeViewer.annotManager.deleteAnnotation(annotation);
this.fileData.fileStatus = await this.appStateService.reloadActiveFile();
this._cleanupAndRedrawManualAnnotations(response.annotationId);
}

View File

@ -5,6 +5,7 @@ export class ManualRedactionEntryWrapper {
public readonly quads: any,
public readonly manualRedactionEntry: ManualRedactionEntry,
public readonly type: 'DICTIONARY' | 'REDACTION' | 'FALSE_POSITIVE',
public readonly annotationType: 'TEXT' | 'RECTANGLE' = 'TEXT'
public readonly annotationType: 'TEXT' | 'RECTANGLE' = 'TEXT',
public readonly rectId?: string
) {}
}

View File

@ -211,7 +211,7 @@ export class PdfViewerComponent implements OnInit, AfterViewInit, OnChanges {
this.instance.disableElements(['shapeToolGroupButton']);
this.instance.enableElements(['shapeToolGroupButton']);
// dispatch event
this.manualAnnotationRequested.emit(new ManualRedactionEntryWrapper([quad], mre, 'REDACTION', 'RECTANGLE'));
this.manualAnnotationRequested.emit(new ManualRedactionEntryWrapper([quad], mre, 'REDACTION', 'RECTANGLE', activeAnnotation.Id));
}
});
}