From 9a41df9b5922e8ffa8fda65761fdb546b5e120b8 Mon Sep 17 00:00:00 2001 From: Timo Bejan Date: Wed, 9 Feb 2022 11:11:19 +0200 Subject: [PATCH] Fixed RED-3351 and deployment issue for help --- .../resize-annotation-dialog.component.ts | 4 ++++ .../annotations-list/annotations-list.component.ts | 1 + .../services/annotation-actions.service.ts | 9 +++++++-- docker/red-ui/docker-entrypoint.sh | 2 +- 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/apps/red-ui/src/app/modules/dossier/dialogs/resize-annotation-dialog/resize-annotation-dialog.component.ts b/apps/red-ui/src/app/modules/dossier/dialogs/resize-annotation-dialog/resize-annotation-dialog.component.ts index 14b6e1b64..3c5864afd 100644 --- a/apps/red-ui/src/app/modules/dossier/dialogs/resize-annotation-dialog/resize-annotation-dialog.component.ts +++ b/apps/red-ui/src/app/modules/dossier/dialogs/resize-annotation-dialog/resize-annotation-dialog.component.ts @@ -21,6 +21,10 @@ export class ResizeAnnotationDialogComponent extends BaseDialogComponent impleme super(_injector, _dialogRef); } + get disabled(): boolean { + return !this.valid; + } + ngOnInit() { super.ngOnInit(); diff --git a/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/components/annotations-list/annotations-list.component.ts b/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/components/annotations-list/annotations-list.component.ts index 526eb3624..aab5aa212 100644 --- a/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/components/annotations-list/annotations-list.component.ts +++ b/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/components/annotations-list/annotations-list.component.ts @@ -39,6 +39,7 @@ export class AnnotationsListComponent implements OnChanges { } async annotationClicked(annotation: AnnotationWrapper, $event: MouseEvent): Promise { + console.log(annotation); if (($event?.target as IqserEventTarget)?.localName === 'input') { return; } diff --git a/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/services/annotation-actions.service.ts b/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/services/annotation-actions.service.ts index bc3598fee..b57215858 100644 --- a/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/services/annotation-actions.service.ts +++ b/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/services/annotation-actions.service.ts @@ -555,11 +555,16 @@ export class AnnotationActionsService { this._translateQuads(viewer, viewerAnnotation.getPageNumber(), quad), ); rectangles.push(rect); + + // TODO: this is an educated guess for lines that are close together + // TODO: so that we do not extract text from line above/line below + const fivePercentHeightOffset = rect.height / 20; + const pdfNetRect = new viewer.Core.PDFNet.Rect( rect.topLeft.x, - rect.topLeft.y, + rect.topLeft.y + fivePercentHeightOffset, rect.topLeft.x + rect.width, - rect.topLeft.y + rect.height, + rect.topLeft.y + rect.height - fivePercentHeightOffset, ); const quadWords = await this._extractTextFromRect(viewer, page, pdfNetRect); words.push(...quadWords); diff --git a/docker/red-ui/docker-entrypoint.sh b/docker/red-ui/docker-entrypoint.sh index 960624def..1dceb1b07 100755 --- a/docker/red-ui/docker-entrypoint.sh +++ b/docker/red-ui/docker-entrypoint.sh @@ -47,7 +47,7 @@ echo '{ "OAUTH_IDP_HINT":"'"$OAUTH_IDP_HINT"'", "OAUTH_URL":"'"$OAUTH_URL"'", "RECENT_PERIOD_IN_HOURS":'"$RECENT_PERIOD_IN_HOURS"', - "SELECTION_MODE":"'"$SELECTION_MODE"'" + "SELECTION_MODE":"'"$SELECTION_MODE"'", "MANUAL_BASE_URL":"'"$MANUAL_BASE_URL"'" }' > /usr/share/nginx/html/ui/assets/config/config.json