From 270b216cc9584d3f2722cc6bf9a1056e21d9d1e7 Mon Sep 17 00:00:00 2001 From: Timo Bejan Date: Mon, 19 Oct 2020 12:54:47 +0300 Subject: [PATCH] linked some APIs --- .../file-preview-screen.component.html | 2 +- .../file-preview-screen/file-preview-screen.component.ts | 5 ++++- .../manual-redaction-dialog.component.ts | 3 +++ .../app/screens/file/pdf-viewer/pdf-viewer.component.ts | 8 ++++++-- 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/apps/red-ui/src/app/screens/file/file-preview-screen/file-preview-screen.component.html b/apps/red-ui/src/app/screens/file/file-preview-screen/file-preview-screen.component.html index 7da724bd3..92f683077 100644 --- a/apps/red-ui/src/app/screens/file/file-preview-screen/file-preview-screen.component.html +++ b/apps/red-ui/src/app/screens/file/file-preview-screen/file-preview-screen.component.html @@ -129,7 +129,7 @@
-
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 56a9b3d12..cd7b047d2 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 @@ -257,9 +257,12 @@ export class FilePreviewScreenComponent implements OnInit { maxWidth: '90vw' }); + const parts = annotation.Id.split(':'); + const annotationId = parts[parts.length-1]; + dialogRef.afterClosed().subscribe(result => { if (result) { - this._manualRedactionControllerService.undo(this.appStateService.activeProjectId, this.appStateService.activeFile.fileId, annotation.Id).subscribe(ok => { + this._manualRedactionControllerService.undo(this.appStateService.activeProjectId, this.appStateService.activeFile.fileId, annotationId).subscribe(ok => { this._notificationService.showToastNotification(this._translateService.instant('manual-redaction.remove-annotation.success.label'), null, NotificationType.SUCCESS); }, (err) => { this._notificationService.showToastNotification(this._translateService.instant('manual-redaction.remove-annotation.failed.label', err), null, NotificationType.ERROR); diff --git a/apps/red-ui/src/app/screens/file/manual-redaction-dialog/manual-redaction-dialog.component.ts b/apps/red-ui/src/app/screens/file/manual-redaction-dialog/manual-redaction-dialog.component.ts index a9c0cf5cf..e306af777 100644 --- a/apps/red-ui/src/app/screens/file/manual-redaction-dialog/manual-redaction-dialog.component.ts +++ b/apps/red-ui/src/app/screens/file/manual-redaction-dialog/manual-redaction-dialog.component.ts @@ -49,6 +49,9 @@ export class ManualRedactionDialogComponent implements OnInit { saveManualRedaction() { const mre = Object.assign({}, this.addRedactionRequest); this._enhanceManualRedaction(mre); + // mre.comment = { + // text: 'Lorem ipsum' + // }; this._manualRedactionControllerService.addRedaction(mre, this._appStateService.activeProject.project.projectId, this._appStateService.activeFile.fileId).subscribe(ok => { this._notificationService.showToastNotification(this._translateService.instant('manual-redaction.dialog.add-redaction.success.label'), null, NotificationType.SUCCESS); this.dialogRef.close(); 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 4d8ec5b40..d8d5dbe5c 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 @@ -143,13 +143,17 @@ export class PdfViewerComponent implements OnInit, AfterViewInit, OnDestroy { } private toPosition(page: number, selectedQuad: any): Rectangle { + console.log(selectedQuad); + + const pageHeight = this.wvInstance.docViewer.getPageHeight(page); + const height = selectedQuad.y2 - selectedQuad.y4; return { page: page, topLeft: { x: selectedQuad.x4, - y: selectedQuad.y4 + y: pageHeight - (selectedQuad.y4 + height) }, - height: selectedQuad.y2 - selectedQuad.y4, + height: height, width: selectedQuad.x3 - selectedQuad.x4 } }