🔥 The free & Open Source DocuSign alternative
JavaScript digital-signaturedocument-signingdocusign-alternativedocusign-freee-signatureelectronic-signatureelectronic-signaturesesignesignaturehacktoberfestjavascriptlegaltechmongodbnodejsopen-sourcepdf-signpdf-signaturereactjsself-hostedsign-pdf-files
fix: exiting user can't receive bulk emails, input widgets's size reduced in request-sign process
RaktimaNXG77622ebea9c3
diff --git a/apps/OpenSign/src/components/BulkSendUi.js b/apps/OpenSign/src/components/BulkSendUi.jsindex bd58169a3..3a737d3d9 100644--- a/apps/OpenSign/src/components/BulkSendUi.js+++ b/apps/OpenSign/src/components/BulkSendUi.js@@ -113,9 +113,15 @@ const BulkSendUi = (props) => {let Placeholders = [...props.item.Placeholders];// Initialize an empty array to store updated documentslet Documents = [];-// Loop through each formforms.forEach((form) => {+ //checking if user enter email which already exist as a signer then add user in a signers array+ let existSigner = [];+ form.fields.map((data) => {+ if (data.signer) {+ existSigner.push(data.signer);+ }+ });// Map through the copied Placeholders array to update email valuesconst updatedPlaceholders = Placeholders.map((placeholder) => {// Find the field in the current form that matches the placeholder Id@@ -123,23 +129,44 @@ const BulkSendUi = (props) => {(element) => parseInt(element.fieldId) === placeholder.Id);// If a matching field is found, update the email value in the placeholder- const signer = field?.signer?.objectId ? field.signer : {};+ const signer = field?.signer?.objectId ? field.signer : "";if (field) {- return {- ...placeholder,- email: field.email,- signerObjId: field?.signer?.objectId || "",- signerPtr: signer- };+ if (signer) {+ return {+ ...placeholder,+ signerObjId: field?.signer?.objectId || "",+ signerPtr: signer+ };+ } else {+ return {+ ...placeholder,+ email: field.email,+ signerObjId: field?.signer?.objectId || "",+ signerPtr: signer+ };+ }}// If no matching field is found, keep the placeholder as isreturn placeholder;});// Push a new document object with updated Placeholders into the Documents array- Documents.push({ ...props.item, Placeholders: updatedPlaceholders });+ if (existSigner?.length > 0) {+ Documents.push({+ ...props.item,+ Placeholders: updatedPlaceholders,+ Signers: props.item.Signers+ ? [...props.item.Signers, ...existSigner]+ : [...existSigner]+ });+ } else {+ Documents.push({+ ...props.item,+ Placeholders: updatedPlaceholders+ });+ }});- // console.log("Documents ", Documents);+ //console.log("Documents ", Documents);await batchQuery(Documents);};diff --git a/apps/OpenSign/src/components/pdf/PlaceholderType.js b/apps/OpenSign/src/components/pdf/PlaceholderType.jsindex c2c3f9fb6..815d830c0 100644--- a/apps/OpenSign/src/components/pdf/PlaceholderType.js+++ b/apps/OpenSign/src/components/pdf/PlaceholderType.js@@ -424,7 +424,7 @@ function PlaceholderType(props) {<divstyle={{color: "black",- fontSize: calculateFontSize()+ fontSize: "12px"}}><span>{type}</span>@@ -523,7 +523,7 @@ function PlaceholderType(props) {<divstyle={{color: "black",- fontSize: calculateFontSize()+ fontSize: "12px"}}><span>{type}</span>@@ -563,7 +563,7 @@ function PlaceholderType(props) {<divstyle={{color: "black",- fontSize: calculateFontSize()+ fontSize: "12px"}}><span>{type}</span>@@ -603,7 +603,7 @@ function PlaceholderType(props) {<divstyle={{color: "black",- fontSize: calculateFontSize()+ fontSize: "12px"}}><span>{type}</span>@@ -721,7 +721,7 @@ function PlaceholderType(props) {<divstyle={{color: "black",- fontSize: calculateFontSize()+ fontSize: "12px"}}><span>{type}</span>diff --git a/apps/OpenSign/src/components/pdf/WidgetComponent.js b/apps/OpenSign/src/components/pdf/WidgetComponent.jsindex 51b10c4ff..6b812bbcc 100644--- a/apps/OpenSign/src/components/pdf/WidgetComponent.js+++ b/apps/OpenSign/src/components/pdf/WidgetComponent.js@@ -355,7 +355,10 @@ function WidgetComponent({<span>Fields</span></div>- <div className="p-[15px] flex flex-col pt-4 2xl:m-5">+ <div+ className="p-[15px] flex flex-col pt-4 2xl:m-5"+ data-tut="addWidgets"+ ><WidgetListupdateWidgets={updateWidgets}handleDivClick={handleDivClick}diff --git a/apps/OpenSign/src/constant/Utils.js b/apps/OpenSign/src/constant/Utils.jsindex 720d39c36..3976d8b1c 100644--- a/apps/OpenSign/src/constant/Utils.js+++ b/apps/OpenSign/src/constant/Utils.js@@ -942,7 +942,23 @@ export const onChangeHeightOfTextArea = (setXyPostion(updatePlaceholder);}};+//calculate width and height+export const calculateInitialWidthHeight = (widgetData) => {+ const intialText = widgetData;+ const span = document.createElement("span");+ span.textContent = intialText;+ span.style.font = `14px`; // here put your text size and font family+ span.style.display = "hidden";+ document.body.appendChild(span);+ const width = span.offsetWidth;+ const height = span.offsetHeight;+ document.body.removeChild(span);+ return {+ getWidth: width,+ getHeight: height+ };+};export const addInitialData = (signerPos, setXyPostion, value, userId) => {function widgetDataValue(type) {switch (type) {@@ -991,9 +1007,13 @@ export const addInitialData = (signerPos, setXyPostion, value, userId) => {options: {...item.options,defaultValue: widgetData- },- Width: calculateInitialWidthHeight(item.type, widgetData).getWidth,- Height: calculateInitialWidthHeight(item.type, widgetData).getHeight+ }+ // Width:+ // calculateInitialWidthHeight(item.type, widgetData).getWidth ||+ // item?.Width,+ // Height:+ // calculateInitialWidthHeight(item.type, widgetData).getHeight ||+ // item?.Height};} else {return {@@ -1004,24 +1024,6 @@ export const addInitialData = (signerPos, setXyPostion, value, userId) => {});};-//calculate width and height-export const calculateInitialWidthHeight = (widgetData) => {- const intialText = widgetData;- const span = document.createElement("span");- span.textContent = intialText;- span.style.font = `14px`; // here put your text size and font family- span.style.display = "hidden";- document.body.appendChild(span);- const width = span.offsetWidth;- const height = span.offsetHeight;-- document.body.removeChild(span);- return {- getWidth: width,- getHeight: height- };-};-//function for embed document idexport const embedDocId = async (pdfDoc, documentId, allPages) => {for (let i = 0; i < allPages; i++) {diff --git a/apps/OpenSign/src/pages/PdfRequestFiles.js b/apps/OpenSign/src/pages/PdfRequestFiles.jsindex e2c21a10c..6fd6db379 100644--- a/apps/OpenSign/src/pages/PdfRequestFiles.js+++ b/apps/OpenSign/src/pages/PdfRequestFiles.js@@ -1750,7 +1750,10 @@ function PdfRequestFiles() {<div className={`max-h-screen`}>{signedSigners.length > 0 && (<>- <div className="mx-2 pr-2 pt-2 pb-1 text-[15px] text-base-content font-semibold border-b-[1px] border-base-300">+ <div+ data-tut="reactourSecond"+ className="mx-2 pr-2 pt-2 pb-1 text-[15px] text-base-content font-semibold border-b-[1px] border-base-300"+ ><span> Signed by</span></div><div className="mt-[2px]">