From f41bf2d83cf81809bf5a1430d85bcddaaf98d33e Mon Sep 17 00:00:00 2001 From: Frooodle <77850077+Frooodle@users.noreply.github.com> Date: Tue, 23 Jun 2026 22:14:35 +0100 Subject: [PATCH] fix merge integration --- .../common/util/FormUtilsGapTest.java | 15 ++++++- .../common/util/FormUtilsMoreTest.java | 45 +++++++++++++++++-- frontend/editor/public/og-metadata.json | 4 +- .../src/core/tools/formFill/useFormCommit.ts | 7 ++- 4 files changed, 61 insertions(+), 10 deletions(-) diff --git a/app/common/src/test/java/stirling/software/common/util/FormUtilsGapTest.java b/app/common/src/test/java/stirling/software/common/util/FormUtilsGapTest.java index dd828327b1..adf2fa77e8 100644 --- a/app/common/src/test/java/stirling/software/common/util/FormUtilsGapTest.java +++ b/app/common/src/test/java/stirling/software/common/util/FormUtilsGapTest.java @@ -705,10 +705,19 @@ class FormUtilsGapTest { "newName", "New Label", null, // keep type (text) -> in-place path + null, + null, + null, + null, + null, Boolean.TRUE, null, null, null, + null, + null, + null, + null, null); FormUtils.modifyFormFields(doc, List.of(mod)); @@ -731,7 +740,8 @@ class FormUtilsGapTest { FormUtils.ModifyFormFieldDefinition mod = new FormUtils.ModifyFormFieldDefinition( - "missing", null, null, null, null, null, null, null, null); + "missing", null, null, null, null, null, null, null, null, null, + null, null, null, null, null, null, null, null); FormUtils.modifyFormFields(doc, List.of(mod)); @@ -754,7 +764,8 @@ class FormUtilsGapTest { mods.add(null); mods.add( new FormUtils.ModifyFormFieldDefinition( - " ", null, null, null, null, null, null, null, null)); + " ", null, null, null, null, null, null, null, null, null, null, + null, null, null, null, null, null, null)); FormUtils.modifyFormFields(doc, mods); assertEquals(1, FormUtils.extractFormFields(doc).size()); diff --git a/app/common/src/test/java/stirling/software/common/util/FormUtilsMoreTest.java b/app/common/src/test/java/stirling/software/common/util/FormUtilsMoreTest.java index f4e013e082..107ab5e02a 100644 --- a/app/common/src/test/java/stirling/software/common/util/FormUtilsMoreTest.java +++ b/app/common/src/test/java/stirling/software/common/util/FormUtilsMoreTest.java @@ -476,8 +476,17 @@ class FormUtilsMoreTest { "combobox", null, null, + null, + null, + null, + null, + null, List.of("One", "Two"), "One", + null, + null, + null, + null, null); FormUtils.modifyFormFields(doc, List.of(mod)); @@ -505,10 +514,19 @@ class FormUtilsMoreTest { null, "listbox", // same type -> in-place path null, + null, + null, + null, + null, + null, Boolean.TRUE, List.of("X", "Y", "Z"), null, - "Choose items"); + "Choose items", + null, + null, + null, + null); FormUtils.modifyFormFields(doc, List.of(mod)); @@ -529,7 +547,24 @@ class FormUtilsMoreTest { FormUtils.ModifyFormFieldDefinition mod = new FormUtils.ModifyFormFieldDefinition( - "keep", null, null, "bogusType", null, null, null, null, null); + "keep", + null, + null, + "bogusType", + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null); FormUtils.modifyFormFields(doc, List.of(mod)); // The field is preserved unchanged because the target type is unsupported. @@ -554,7 +589,8 @@ class FormUtilsMoreTest { // Rename beta -> alpha; should be uniquified to avoid the collision. FormUtils.ModifyFormFieldDefinition mod = new FormUtils.ModifyFormFieldDefinition( - "beta", "alpha", null, null, null, null, null, null, null); + "beta", "alpha", null, null, null, null, null, null, null, null, + null, null, null, null, null, null, null, null); FormUtils.modifyFormFields(doc, List.of(mod)); @@ -575,7 +611,8 @@ class FormUtilsMoreTest { doc.addPage(new PDPage()); FormUtils.ModifyFormFieldDefinition mod = new FormUtils.ModifyFormFieldDefinition( - "x", null, null, null, null, null, null, null, null); + "x", null, null, null, null, null, null, null, null, null, null, + null, null, null, null, null, null, null); FormUtils.modifyFormFields(doc, List.of(mod)); } } diff --git a/frontend/editor/public/og-metadata.json b/frontend/editor/public/og-metadata.json index e77ee18b26..37fdfa7013 100644 --- a/frontend/editor/public/og-metadata.json +++ b/frontend/editor/public/og-metadata.json @@ -257,8 +257,8 @@ }, "formFill": { "image": "/og_images/form-fill.png", - "title": "Fill Form - Stirling PDF", - "description": "Fill PDF form fields interactively with a visual editor" + "title": "Form Editor - Stirling PDF", + "description": "Fill, create, edit, and delete PDF form fields with a visual editor" }, "multiTool": { "image": "/og_images/multi-tool.png", diff --git a/frontend/editor/src/core/tools/formFill/useFormCommit.ts b/frontend/editor/src/core/tools/formFill/useFormCommit.ts index 4b01011f5a..59612eb308 100644 --- a/frontend/editor/src/core/tools/formFill/useFormCommit.ts +++ b/frontend/editor/src/core/tools/formFill/useFormCommit.ts @@ -25,8 +25,11 @@ export function useFormCommit(onApplied?: (blob: Blob) => void) { const blob = await run(); dispatchFormApply(blob); onApplied?.(blob); - } catch (err: any) { - setError(err?.message || t(errorKey, errorFallback)); + } catch (err) { + setError( + (err instanceof Error ? err.message : undefined) || + t(errorKey, errorFallback), + ); console.error("[FormFill] commit failed:", err); } finally { setCommitting(false);