From 04ae14c6601c6a10c921568c30285a3844c29b2c Mon Sep 17 00:00:00 2001 From: TekH Date: Mon, 20 Oct 2025 14:29:39 +0200 Subject: [PATCH] refactor(annotation): update mapSignature to handle frames and signatures separately - Modified `mapSignature` to set `name` as 'frame' for FRAME annotations and 'signature' for signature annotations. - Added processing for annotations with `isSignature` to include their `value` from attachments if present. - Ensures consistent mapping of form fields, frames, and signatures. --- EnvelopeGenerator.Web/wwwroot/js/annotation.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/EnvelopeGenerator.Web/wwwroot/js/annotation.js b/EnvelopeGenerator.Web/wwwroot/js/annotation.js index d266917b..c5383052 100644 --- a/EnvelopeGenerator.Web/wwwroot/js/annotation.js +++ b/EnvelopeGenerator.Web/wwwroot/js/annotation.js @@ -328,9 +328,16 @@ function mapSignature(iJSON) { const preElement = findNearest(annot, e => e.bbox[0], e => e.bbox[1], ...iJSON.annotations.filter(field => field.id.includes("signature"))); const idPartsOfPre = preElement.id.split('#'); annot.elementId = Number(idPartsOfPre[2]); - annot.name = annot.description.toLowerCase(); + annot.name = 'frame'; annot.value = fixBase64(iJSON.attachments[annot.imageAttachmentId]?.binary); return annot; + }), + signatures: iJSON.annotations.filter(annot => annot.isSignature).map(annot => { + if (annot.imageAttachmentId) + annot.value = iJSON.attachments[annot.imageAttachmentId]?.binary; + + annot.name = 'signature'; + return annot; }) }; } \ No newline at end of file