From 35f3ca2fd4210fe73a8a72c5700ebdbfd51bd336 Mon Sep 17 00:00:00 2001 From: Nicoleta Panaghiu Date: Mon, 15 Jan 2024 11:09:30 +0200 Subject: [PATCH 1/4] RED-7316: fixed imported redaction draw bug. --- .../modules/pdf-viewer/services/annotation-draw.service.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/red-ui/src/app/modules/pdf-viewer/services/annotation-draw.service.ts b/apps/red-ui/src/app/modules/pdf-viewer/services/annotation-draw.service.ts index 85a4da5ac..d68109a51 100644 --- a/apps/red-ui/src/app/modules/pdf-viewer/services/annotation-draw.service.ts +++ b/apps/red-ui/src/app/modules/pdf-viewer/services/annotation-draw.service.ts @@ -37,7 +37,7 @@ export class AnnotationDrawService { async draw(annotations: List, hideSkipped: boolean, dossierTemplateId: string) { try { - return this._pdf.runWithCleanup(() => this.#draw(annotations, hideSkipped, dossierTemplateId)); + await this.#draw(annotations, hideSkipped, dossierTemplateId); } catch (e) { console.error(e); } @@ -165,6 +165,7 @@ export class AnnotationDrawService { annotation.setCustomData('redact-manager', 'true'); annotation.setCustomData('redaction', String(annotationWrapper.isRedacted)); annotation.setCustomData('skipped', String(annotationWrapper.isSkipped)); + annotation.setCustomData('imported', String(annotationWrapper.imported)); annotation.setCustomData('changeLog', String(annotationWrapper.isChangeLogEntry)); annotation.setCustomData('changeLogRemoved', String(annotationWrapper.isRemoved)); annotation.setCustomData('opacity', String(annotation.Opacity)); @@ -175,12 +176,13 @@ export class AnnotationDrawService { const appliedRedactionColor = this._defaultColorsService.getColor(dossierTemplateId, 'appliedRedactionColor'); annotation.setCustomData('appliedRedactionColor', String(appliedRedactionColor)); - + console.log(annotation); return annotation; } #rectanglesToQuads(positions: IRectangle[], pageNumber: number): Quad[] { const pageHeight = this._documentViewer.getHeight(pageNumber); + console.log(pageHeight); return positions.map(p => this.#rectangleToQuad(p, pageHeight)); } From bf1eb887bbdc5f29ef69f742e7c6c0eaa84edb6c Mon Sep 17 00:00:00 2001 From: Nicoleta Panaghiu Date: Mon, 15 Jan 2024 11:10:28 +0200 Subject: [PATCH 2/4] RED-7316: no need for explicit initialization inside runWithCleanup. --- .../app/modules/pdf-viewer/services/pdf-viewer.service.ts | 7 ------- 1 file changed, 7 deletions(-) diff --git a/apps/red-ui/src/app/modules/pdf-viewer/services/pdf-viewer.service.ts b/apps/red-ui/src/app/modules/pdf-viewer/services/pdf-viewer.service.ts index 7d1384d75..c42037705 100644 --- a/apps/red-ui/src/app/modules/pdf-viewer/services/pdf-viewer.service.ts +++ b/apps/red-ui/src/app/modules/pdf-viewer/services/pdf-viewer.service.ts @@ -151,13 +151,6 @@ export class PdfViewer { } await this.runWithCleanup(async () => { - try { - await this.PDFNet.initialize(this.#licenseKey); - } catch (e) { - this._errorService.set(e); - throw e; - } - this.#instance.UI.setTheme(this._userPreferenceService.getTheme()); this._logger.info('[PDF] Initialized'); From c0413f1fd90ea45943087df3bca3dcc18ec2cdd2 Mon Sep 17 00:00:00 2001 From: Nicoleta Panaghiu Date: Mon, 15 Jan 2024 11:20:40 +0200 Subject: [PATCH 3/4] RED-7316: cleanup. --- .../app/modules/pdf-viewer/services/annotation-draw.service.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/apps/red-ui/src/app/modules/pdf-viewer/services/annotation-draw.service.ts b/apps/red-ui/src/app/modules/pdf-viewer/services/annotation-draw.service.ts index d68109a51..ecfde97ac 100644 --- a/apps/red-ui/src/app/modules/pdf-viewer/services/annotation-draw.service.ts +++ b/apps/red-ui/src/app/modules/pdf-viewer/services/annotation-draw.service.ts @@ -165,7 +165,6 @@ export class AnnotationDrawService { annotation.setCustomData('redact-manager', 'true'); annotation.setCustomData('redaction', String(annotationWrapper.isRedacted)); annotation.setCustomData('skipped', String(annotationWrapper.isSkipped)); - annotation.setCustomData('imported', String(annotationWrapper.imported)); annotation.setCustomData('changeLog', String(annotationWrapper.isChangeLogEntry)); annotation.setCustomData('changeLogRemoved', String(annotationWrapper.isRemoved)); annotation.setCustomData('opacity', String(annotation.Opacity)); @@ -176,7 +175,6 @@ export class AnnotationDrawService { const appliedRedactionColor = this._defaultColorsService.getColor(dossierTemplateId, 'appliedRedactionColor'); annotation.setCustomData('appliedRedactionColor', String(appliedRedactionColor)); - console.log(annotation); return annotation; } From 1979a9f55d33bd926e72f7b4abe74405e00eb71e Mon Sep 17 00:00:00 2001 From: Nicoleta Panaghiu Date: Mon, 15 Jan 2024 11:27:23 +0200 Subject: [PATCH 4/4] RED-7316: remove last console.log, hopefully --- .../app/modules/pdf-viewer/services/annotation-draw.service.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/apps/red-ui/src/app/modules/pdf-viewer/services/annotation-draw.service.ts b/apps/red-ui/src/app/modules/pdf-viewer/services/annotation-draw.service.ts index ecfde97ac..5c3a677b6 100644 --- a/apps/red-ui/src/app/modules/pdf-viewer/services/annotation-draw.service.ts +++ b/apps/red-ui/src/app/modules/pdf-viewer/services/annotation-draw.service.ts @@ -180,7 +180,6 @@ export class AnnotationDrawService { #rectanglesToQuads(positions: IRectangle[], pageNumber: number): Quad[] { const pageHeight = this._documentViewer.getHeight(pageNumber); - console.log(pageHeight); return positions.map(p => this.#rectangleToQuad(p, pageHeight)); }