From 4d3106308257dca7d788ce395e7ba0c70385888b Mon Sep 17 00:00:00 2001 From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Mon, 19 Oct 2026 23:07:12 -0700 Subject: [PATCH] Default to empty field --- .../ocr-template-editor/ocr-template-editor.component.html | 2 ++ .../ocr-template-editor.component.spec.ts | 1 + .../ocr-template-editor/ocr-template-editor.component.ts | 6 +----- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src-ui/src/app/components/manage/ocr-templates/ocr-template-editor/ocr-template-editor.component.html b/src-ui/src/app/components/manage/ocr-templates/ocr-template-editor/ocr-template-editor.component.html index e6b7bcc50..016a41f14 100644 --- a/src-ui/src/app/components/manage/ocr-templates/ocr-template-editor/ocr-template-editor.component.html +++ b/src-ui/src/app/components/manage/ocr-templates/ocr-template-editor/ocr-template-editor.component.html @@ -83,6 +83,8 @@ (createNew)="createField($event)" title="Field" i18n-title + placeholder="Choose a field" + i18n-placeholder hint="Where the extracted value is written." i18n-hint > diff --git a/src-ui/src/app/components/manage/ocr-templates/ocr-template-editor/ocr-template-editor.component.spec.ts b/src-ui/src/app/components/manage/ocr-templates/ocr-template-editor/ocr-template-editor.component.spec.ts index b205ed504..027b08de8 100644 --- a/src-ui/src/app/components/manage/ocr-templates/ocr-template-editor/ocr-template-editor.component.spec.ts +++ b/src-ui/src/app/components/manage/ocr-templates/ocr-template-editor/ocr-template-editor.component.spec.ts @@ -203,6 +203,7 @@ describe('OcrTemplateEditorComponent', () => { y: 100, width: 900, height: 150, + custom_field: null, }) expect(component.selectedZoneIndex).toBe(0) }) diff --git a/src-ui/src/app/components/manage/ocr-templates/ocr-template-editor/ocr-template-editor.component.ts b/src-ui/src/app/components/manage/ocr-templates/ocr-template-editor/ocr-template-editor.component.ts index 75c2d47e3..a611b643f 100644 --- a/src-ui/src/app/components/manage/ocr-templates/ocr-template-editor/ocr-template-editor.component.ts +++ b/src-ui/src/app/components/manage/ocr-templates/ocr-template-editor/ocr-template-editor.component.ts @@ -616,7 +616,7 @@ export class OcrTemplateEditorComponent implements OnInit, OnDestroy { return { name: `Zone ${this.template.zones.length + 1}`, target: DEFAULT_OCR_ZONE_TARGET, - custom_field: this.defaultCustomFieldId(), + custom_field: null, x: rect.x, y: rect.y, width: rect.w, @@ -632,10 +632,6 @@ export class OcrTemplateEditorComponent implements OnInit, OnDestroy { } } - private defaultCustomFieldId(): number | null { - return this.customFields[0]?.id ?? null - } - onOverlayPointerCancel(event: PointerEvent) { if (this.overlayInteraction.kind === 'idle') return if (this.overlayInteraction.pointerId !== event.pointerId) return