Remove initially drawn annotation rectangle

This commit is contained in:
Adina Țeudan 2020-12-16 20:52:16 +02:00
parent 5c17e7727e
commit d29d29280b
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));
}
});
}