đ„ The free & Open Source DocuSign alternative
JavaScript digital-signaturedocument-signingdocusign-alternativedocusign-freee-signatureelectronic-signatureelectronic-signaturesesignesignaturehacktoberfestjavascriptlegaltechmongodbnodejsopen-sourcepdf-signpdf-signaturereactjsself-hostedsign-pdf-files
feat: display the email of the user who declined the document along with the decline reason in the document decline popup.
RaktimaNXG9675e051bd17
diff --git a/apps/OpenSign/public/locales/en/translation.json b/apps/OpenSign/public/locales/en/translation.jsonindex ee282f354..66920942a 100644--- a/apps/OpenSign/public/locales/en/translation.json+++ b/apps/OpenSign/public/locales/en/translation.json@@ -623,5 +623,10 @@"generate-test-token":"Generate Test Token","regenerate-test-token":"Regenerate Test Token","help-test-token":"This token can be used to test the APIs at the https://sandbox.opensignlabs.com/api/v1 endpoint, allowing you to conduct unlimited document signatures. Please note that the sandbox API will sign your documents with self-signed certificates, which may not be recognized as valid by Adobe. Once youâve completed your testing, you can upgrade to one of our paid plans to generate a production token.",- "help-api-token":"This token can be used to access the production APIs at the {{origin}}/api/v1 endpoint. It can only be generated on one of our paid plans."+ "help-api-token":"This token can be used to access the production APIs at the {{origin}}/api/v1 endpoint. It can only be generated on one of our paid plans.",+ "reason":"Reason",+ "decline-by":"Declined/revoked by",+ "document-declined": "Document declined"++}diff --git a/apps/OpenSign/public/locales/fr/translation.json b/apps/OpenSign/public/locales/fr/translation.jsonindex 72a30b619..20cfae993 100644--- a/apps/OpenSign/public/locales/fr/translation.json+++ b/apps/OpenSign/public/locales/fr/translation.json@@ -624,5 +624,8 @@"generate-test-token": "GĂ©nĂ©rer jeton de test","regenerate-test-token":"RĂ©gĂ©nĂ©rer le jeton de test","help-test-token":"Ce jeton peut ĂȘtre utilisĂ© pour tester les API au niveau du point de terminaison https://sandbox.opensignlabs.com/api/v1, vous permettant ainsi d'effectuer un nombre illimitĂ© de signatures de documents. Veuillez noter que l'API sandbox signera vos documents avec des certificats auto-signĂ©s, qui peuvent ne pas ĂȘtre reconnus comme valides par Adobe. Une fois vos tests terminĂ©s, vous pouvez passer Ă lâun de nos forfaits payants pour gĂ©nĂ©rer un jeton de production.",- "help-api-token":"Ce jeton peut ĂȘtre utilisĂ© pour accĂ©der aux API de production au point de terminaison {{origin}}/api/v1. Il ne peut ĂȘtre gĂ©nĂ©rĂ© que sur l'un de nos forfaits payants."+ "help-api-token":"Ce jeton peut ĂȘtre utilisĂ© pour accĂ©der aux API de production au point de terminaison {{origin}}/api/v1. Il ne peut ĂȘtre gĂ©nĂ©rĂ© que sur l'un de nos forfaits payants.",+ "reason" :"Raison",+ "decline-by" :"RefusĂ©/rĂ©voquĂ© par",+ "document-declined":"document refusĂ©"}diff --git a/apps/OpenSign/src/constant/Utils.js b/apps/OpenSign/src/constant/Utils.jsindex 08b92c975..71f7aa69d 100644--- a/apps/OpenSign/src/constant/Utils.js+++ b/apps/OpenSign/src/constant/Utils.js@@ -1411,7 +1411,7 @@ export const multiSignEmbed = async (};const color = position?.options?.fontColor;const updateColorInRgb = getWidgetsFontColor(color);- const fontSize = parseInt(position?.options?.fontSize);+ const fontSize = parseInt(position?.options?.fontSize || 13);const widgetTypeExist = [textWidget,textInputWidget,diff --git a/apps/OpenSign/src/pages/PdfRequestFiles.js b/apps/OpenSign/src/pages/PdfRequestFiles.jsindex 3dacc088e..a7586ce60 100644--- a/apps/OpenSign/src/pages/PdfRequestFiles.js+++ b/apps/OpenSign/src/pages/PdfRequestFiles.js@@ -1213,7 +1213,15 @@ function PdfRequestFiles(props) {);const jsonSender = JSON.parse(senderUser);setIsDecline({ isDeclined: false });- const data = { IsDeclined: true, DeclineReason: reason };+ const data = {+ IsDeclined: true,+ DeclineReason: reason,+ DeclineBy: {+ __type: "Pointer",+ className: "_User",+ objectId: jsonSender?.objectId+ }+ };setIsUiLoading(true);await axios@@ -1572,6 +1580,24 @@ function PdfRequestFiles(props) {const name = pdfDetails?.[0]?.Name;await fetchUrl(url, name);};+ const handleDeclineMssg = () => {+ const user = pdfDetails[0]?.DeclineBy?.email;+ return (+ <div>+ {t("decline-alert-3")}+ <div className="mt-2">+ {" "}+ <span className="font-medium">{t("reason")}</span> :{" "}+ {pdfDetails[0]?.DeclineReason}{" "}+ </div>+ <div className="mt-2">+ {" "}+ <span className="font-medium">{t("decline-by")}</span> : {user}+ </div>+ </div>+ );+ };+ console.log("signerpos", signerPos);return (<DndProvider backend={HTML5Backend}><Title title={props.templateId ? "Public Sign" : "Request Sign"} />@@ -1659,13 +1685,17 @@ function PdfRequestFiles(props) {{/* this modal is used to show decline alert */}<PdfDeclineModalshow={isDecline.isDeclined}- headMsg={t("document-decline")}+ headMsg={+ pdfDetails[0]?.IsDeclined+ ? t("document-declined")+ : t("document-decline")+ }bodyMssg={isDecline.currnt === "Sure"? t("decline-alert-1"): isDecline.currnt === "YouDeclined"? t("decline-alert-2")- : isDecline.currnt === "another" && t("decline-alert-3")+ : isDecline.currnt === "another" && handleDeclineMssg()}footerMessage={isDecline.currnt === "Sure"}declineDoc={declineDoc}diff --git a/apps/OpenSignServer/cloud/parsefunction/getDocument.js b/apps/OpenSignServer/cloud/parsefunction/getDocument.jsindex c7b2d07d2..2773f1cf1 100644--- a/apps/OpenSignServer/cloud/parsefunction/getDocument.js+++ b/apps/OpenSignServer/cloud/parsefunction/getDocument.js@@ -22,6 +22,7 @@ export default async function getDocument(request) {query.include('Signers');query.include('AuditTrail.UserPtr');query.include('Placeholders');+ query.include('DeclineBy');query.notEqualTo('IsArchive', true);const res = await query.first({ useMasterKey: true });if (res) {diff --git a/apps/OpenSignServer/databases/migrations/20240903170628-update_contracts_document_cls_cjs.cjs b/apps/OpenSignServer/databases/migrations/20240903170628-update_contracts_document_cls_cjs.cjsnew file mode 100644index 000000000..74adeda91--- /dev/null+++ b/apps/OpenSignServer/databases/migrations/20240903170628-update_contracts_document_cls_cjs.cjs@@ -0,0 +1,31 @@+/**+ *+ * @param {Parse} Parse+ */+exports.up = async Parse => {+ // TODO: set className here+ const className = 'contracts_Document';+ const schema = new Parse.Schema(className);+ schema.addPointer('DeclineBy', '_User');+ // TODO: Set the schema here+ // Example:+ // schema.addString('name').addNumber('cash');++ return schema.update();+};++/**+ *+ * @param {Parse} Parse+ */+exports.down = async Parse => {+ // TODO: set className here+ const className = 'contracts_Document';+ const schema = new Parse.Schema(className);+ schema.deleteField('DeclineBy');+ // TODO: Set the schema here+ // Example:+ // schema.deleteField('name').deleteField('cash');++ return schema.update();+};