From d6f17ec4e84993d2a75ecf0a448dc652e505c235 Mon Sep 17 00:00:00 2001 From: TekH Date: Mon, 20 Oct 2025 10:59:57 +0200 Subject: [PATCH] feat(annotations): add mapSignature function for mapping form field data - Introduced new function `mapSignature(iJSON)` to process formFieldValues - Filters out label fields and maps form field data to include elementId and simplified name - Enhances annotation handling for signature mapping --- EnvelopeGenerator.Web/wwwroot/js/annotation.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/EnvelopeGenerator.Web/wwwroot/js/annotation.js b/EnvelopeGenerator.Web/wwwroot/js/annotation.js index 9dea0730..291b43ce 100644 --- a/EnvelopeGenerator.Web/wwwroot/js/annotation.js +++ b/EnvelopeGenerator.Web/wwwroot/js/annotation.js @@ -307,4 +307,15 @@ function markFieldAsCity(formField) { function isCityField(formField) { return cityFieldNames.includes(formField.name) +} + +function mapSignature(iJSON) { + return { + formFields: iJSON.formFieldValues.filter(field => !field.name.includes("label")).map((field) => { + const nameParts = field.name.split('#'); + field.elementId = Number(nameParts[2]); + field.name = nameParts[3]; + return field; + }) + }; } \ No newline at end of file