diff --git a/apps/OpenSign/public/locales/de/translation.json b/apps/OpenSign/public/locales/de/translation.json index 019dbd7ed0..e72a6d6b4e 100644 --- a/apps/OpenSign/public/locales/de/translation.json +++ b/apps/OpenSign/public/locales/de/translation.json @@ -284,6 +284,7 @@ "make-template-public": "Vorlage öffentlich machen", "make-template-private": "Vorlage privat machen", "make-template-public-alert": "Sind Sie sicher, dass Sie diese Vorlage öffentlich machen möchten?", + "make-template-private-alert-non": "Sind Sie sicher, dass Sie diese Vorlage privat machen möchten?", "make-template-private-alert": "Sind Sie sicher, dass Sie diese Vorlage privat machen möchten? Dadurch wird sie aus Ihrem öffentlichen Profil entfernt.", "public-role": "Öffentliche Rolle", "public-url": "Öffentliches Profil", @@ -873,5 +874,12 @@ "document-has-been-signed": "Das Dokument wurde erfolgreich unterschrieben!", "document-has-been-signed-by-you": "Das Dokument wurde erfolgreich von Ihnen unterschrieben!", "participant-completed-signing": "Alle Teilnehmer haben den Signaturprozess abgeschlossen.", - "you-will-receive-email-shortly": "✅ Das war's! Sie erhalten in Kürze eine Bestätigungs-E-Mail." + "you-will-receive-email-shortly": "✅ Das war's! Sie erhalten in Kürze eine Bestätigungs-E-Mail.", + "please-provide-templateid": "Bitte geben Sie templateid an", + "this-template-is-not-public": "Dieses template ist nicht öffentlich", + "invalid-templateid": "Ungültige templateid", + "contact-billing-at-opensign": "Um weitere Plätze hinzuzufügen, kontaktieren Sie bitte OpenSign™ unter <1>billing@opensignlabs.com für Unterstützung.", + "title-length-alert": "Der Titel darf höchstens 250 Zeichen lang sein.", + "note-length-alert": "Die Notiz darf höchstens 200 Zeichen lang sein.", + "description-length-alert": "Die Beschreibung darf höchstens 500 Zeichen lang sein." } diff --git a/apps/OpenSign/public/locales/en/translation.json b/apps/OpenSign/public/locales/en/translation.json index 1140b25b98..2b2c3cd8e5 100644 --- a/apps/OpenSign/public/locales/en/translation.json +++ b/apps/OpenSign/public/locales/en/translation.json @@ -284,11 +284,12 @@ "make-template-public": "Make template public", "make-template-private": "Make template private", "make-template-public-alert": "Are you sure you want to make this template public?", + "make-template-private-alert-non": "Are you sure you want to make this template private?", "make-template-private-alert": "Are you sure you want to make this template private? This will remove it from your public profile.", "public-role": "Public role", "public-url": "Public profile", "embed-template": "Embed template", - "public-url-copy": "Here’s your public URL: ", + "public-url-copy": "Here's your public URL: ", "public-url-copy-mssg": "Copy it or share it with the signer, and you will be able to see all your publicly set templates.", "add-public-url-alert": "You can generate your {{appName}} public profile", "share-with-alert": "You cannot share a template if any roles already have contacts assigned. Please remove all contact assignments from the roles before sharing the template.", @@ -314,7 +315,7 @@ "body": "Body", "add-contact": "Add contact", "edit-contact": "Edit contact", - "add-signer-alert": "Contact already exist! Please select it from ‘Signers’ dropdown", + "add-signer-alert": "Contact already exist! Please select it from 'Signers' dropdown", "record-delete-alert": "Record deleted successfully!", "record-revoke-alert": "Record revoked successfully!", "mail-sent-alert": "Mail sent successfully.", @@ -586,7 +587,7 @@ }, "tour-mssg": { "home-layout-1": "You have logged in successfully! Let's take a look.", - "home-layout-2": "To upload documents for self-signing or to request others’ signatures, simply select the respective buttons.", + "home-layout-2": "To upload documents for self-signing or to request others' signatures, simply select the respective buttons.", "home-layout-3": "You are ready to start using {{appName}}! If you need support feel free to contact us.", "generate-token": "Upgrade now to generate production API token.", "opensign-drive-1": "Click on the breadcrumb links to easily navigate through the folder hierarchy and view the documents within each folder.", @@ -595,7 +596,7 @@ "opensign-drive-4": "Click on this menu to display the documents in list view.", "opensign-drive-5": "The document list is displayed according to the selected sorting option. Icons next to each document indicate its current status.", "opensign-drive-6": "Right-click on a document to see options such as Download, Rename, Move, and Delete. Click on the document to open it.", - "opensign-drive-7": "Right-click on any folder to see options. Choose ‘Rename’ to change the folder’s name or click on the folder to navigate through its contents.", + "opensign-drive-7": "Right-click on any folder to see options. Choose 'Rename' to change the folder's name or click on the folder to navigate through its contents.", "pdf-request-file-1": "List of signers who still need to sign the document .", "pdf-request-file-2": "Click any of the placeholders appearing on the document to sign. You will then see options to draw your signature, type it, or upload an image .", "pdf-request-file-3": "Click Decline, or Finish buttons to navigate your document. Use the ellipsis menu for additional options, including the Download button .", @@ -608,24 +609,24 @@ "placeholder-sign-4": "Drag or click on a field to add it to the document.", "placeholder-sign-5": "The PDF content area already displays the template's existing placeholders. For your convenience, these placeholders will match the color of the recipient's name, making them easily identifiable.", "placeholder-sign-6": "Clicking 'Next' will save the document. In the next step you can customize the emails to be sent out to the recipients or copy the signing links and share those with the recipients yourself.", - "report-1": "Click the 'Add' button to create a new template. Templates are reusable documents designed to quickly generate new documents with the same structure and varying signers. For example, an HR template for onboarding could have predefined roles like ‘HR Manager’ and ‘New Employee’. Each time you use the template, you can assign the ‘New Employee’ role to different incoming staff members, while the ‘HR Manager’ role remains constant, facilitating a seamless onboarding process for each recruit. ", + "report-1": "Click the 'Add' button to create a new template. Templates are reusable documents designed to quickly generate new documents with the same structure and varying signers. For example, an HR template for onboarding could have predefined roles like 'HR Manager' and 'New Employee'. Each time you use the template, you can assign the 'New Employee' role to different incoming staff members, while the 'HR Manager' role remains constant, facilitating a seamless onboarding process for each recruit. ", "redirect": "Click the 'Use' button to create a new document from an existing template.", "bulksend": "To quickly send multiple documents using an existing template by just creating the recipient email addresses, click the 'Bulk Send' button.", - "option": "This menu reveals more options such as Edit & Delete. Use the 'Edit' button to add signer roles, modify fields, and update your template. Changes will apply to all future documents created from this template but won’t affect existing documents.Use the Delete button you can delete template. ", + "option": "This menu reveals more options such as Edit & Delete. Use the 'Edit' button to add signer roles, modify fields, and update your template. Changes will apply to all future documents created from this template but won't affect existing documents.Use the Delete button you can delete template. ", "signyour-self-1": "Select and drag your preferred widgets onto the PDF to customize your document before signing. Choose the perfect spots for each modification to tailor the document to your needs.", "signyour-self-2": "Drag and drop anywhere in this area. You can resize and move it later.", "template-placeholder-1": "Clicking 'Add role' button will allow you to add various signer roles. You can attach users to each role in subsequent steps.", "template-placeholder-2": "Once roles are added, select a role from list to add a place-holder where he is supposed to sign. The placeholder will appear in the same colour as the role name once you drop it on the document.", "template-placeholder-3": "Drag or click on a field to add it to the document.", "template-placeholder-4": "Drag the placeholder for a role anywhere on the document.Remember, it will appear in the same colour as the name of the recipient for easy reference.", - "template-placeholder-5": "Clicking 'Next' will store the current template. After saving, you’ll be prompted to create a new document from this template if you wish.", + "template-placeholder-5": "Clicking 'Next' will store the current template. After saving, you'll be prompted to create a new document from this template if you wish.", "webhook-1": "Upgrade now to set webhook", "Need your Signature": "Clicking on this card will take you to the list of documents awaiting your review.", "Out for signatures": "Clicking on this card will take you to a list of documents awaiting signature.", "Recent signature requests": "This is a list of documents that are waiting for your signature.", "Recently sent for signatures": "This is a list of documents you've sent to other parties for signature.", "Drafts": "This are documents you have started but have not finalized for sending.", - "public-template": "This video demonstrates how to set up your personalized public profile, such as ‘https://opensign.me/your-username’. You’ll also learn how to customize your tagline and make your templates available for public signing.", + "public-template": "This video demonstrates how to set up your personalized public profile, such as 'https://opensign.me/your-username'. You'll also learn how to customize your tagline and make your templates available for public signing.", "allowModify-widgets": "You can drag and drop any of these fields onto the document, in addition to the fields already designated for you by the document creator." }, "enter-email-plaholder": "Add an email address and hit enter", @@ -659,13 +660,13 @@ "bulk-send-subcription-alert": "Please upgrade to Professional or Team plan to use bulk send.", "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-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.", "reason": "Reason", "decline-by": "Declined/revoked by", "document-declined": "Document declined", "public-template-mssg-1": "To integrate OpenSign into your React or Next.js project, simply run the following command:", - "public-template-mssg-2": "Ensure you have npm or yarn set up in your project. If you’re using Yarn, you can replace npm install with yarn add @opensign/react.", + "public-template-mssg-2": "Ensure you have npm or yarn set up in your project. If you're using Yarn, you can replace npm install with yarn add @opensign/react.", "public-template-mssg-3": "Need more details or examples?", "public-template-mssg-4": "Visit the", "public-template-mssg-5": " npm for the latest updates, detailed documentation, and version history.", @@ -793,7 +794,7 @@ "term-cond-p22": "Understand that {{appName}} is a platform facilitating the transaction and is not a party to the agreement.", "term-cond-h7": "7. Legal Effect", "term-cond-p23": "Your electronic signature facilitated through {{appName}}:", - "term-cond-p24": "Complies with applicable electronic signature laws, including but not limited to the E-SIGN Act in the United States, the EU eIDAS Regulation, and India’s Information Technology Act.", + "term-cond-p24": "Complies with applicable electronic signature laws, including but not limited to the E-SIGN Act in the United States, the EU eIDAS Regulation, and India's Information Technology Act.", "term-cond-p25": "Is legally binding between You and the Sender for the signed document(s).", "term-cond-h8": "8. Platform Role and Limitation of Liability", "term-cond-p26": "{{appName}} serves as a platform to facilitate electronic transactions. It is not responsible for the content, validity, or enforceability of the documents sent by the Sender. Any disputes or issues related to the document or its signing must be resolved directly between You and the Sender.", @@ -853,7 +854,7 @@ "draft-template-info-p1": "To make your template public, it must either contain a single role, or, if it includes multiple roles, all additional roles must already be assigned to signers. The unassigned public role should remain empty and must be placed in the first position.", "visit-below-link": "Visit below link to know more -", "storage-help": "Enabling BYOC lets you connect your own S3 storage so your files remain entirely under your control—no external copies retained. If data autonomy matters to you, consider upgrading to Teams to unlock this feature.", - "daily-quota-reached": "You’ve reached your daily quota. For assistance, please contact quotas@opensignlabs.com.", + "daily-quota-reached": "You've reached your daily quota. For assistance, please contact quotas@opensignlabs.com.", "enabled-signature-type": "Enabled Signature Types", "enabled-signature-type-help": "The 'Enabled Signature Types' setting determines which signature options are available across your organization. For example, if you disable the 'Draw' option, members of your organization will not see it in the signature widget, while the other three options will remain accessible.", "indexing-public-profile": "Allow indexing of public profile by search engines", @@ -873,5 +874,12 @@ "document-has-been-signed": "The document has been signed successfully!", "document-has-been-signed-by-you": "The document has been successfully signed by you!", "participant-completed-signing": "All participants have completed the signing process.", - "you-will-receive-email-shortly": "✅ That's it! You'll receive a confirmation email shortly." + "you-will-receive-email-shortly": "✅ That's it! You'll receive a confirmation email shortly.", + "please-provide-templateid": "Please provide templateid", + "this-template-is-not-public": "This template is not public", + "invalid-templateid": "Invaldi templateid", + "contact-billing-at-opensign": "To add more seats, please contact OpenSign™ at <1>billing@opensignlabs.com for assistance", + "title-length-alert": "Title must be at most 250 characters long.", + "note-length-alert": "Note must be at most 200 characters long.", + "description-length-alert": "Description must be at most 500 characters long." } diff --git a/apps/OpenSign/public/locales/es/translation.json b/apps/OpenSign/public/locales/es/translation.json index 93cd2bcfef..c9605eb4b3 100644 --- a/apps/OpenSign/public/locales/es/translation.json +++ b/apps/OpenSign/public/locales/es/translation.json @@ -285,6 +285,7 @@ "make-template-public": "Convertir la plantilla en pública", "make-template-private": "Convertir la plantilla en privada", "make-template-public-alert": "¿En definitiva quieres convertir esta plantilla en pública?", + "make-template-private-alert-non": "¿Está seguro de que desea hacer este plantilla privado?", "make-template-private-alert": "¿En definitiva quieres convertir esta plantilla en privada? Esto lo removerá de tu perfil público.", "public-role": "Rol público", "public-url": "Perfil publico", @@ -873,5 +874,12 @@ "document-has-been-signed": "¡El documento ha sido firmado con éxito!", "document-has-been-signed-by-you": "¡El documento ha sido firmado con éxito por usted!", "participant-completed-signing": "Todos los participantes han completado el proceso de firma.", - "you-will-receive-email-shortly": "✅ ¡Eso es todo! Recibirá un correo de confirmación en breve." + "you-will-receive-email-shortly": "✅ ¡Eso es todo! Recibirá un correo de confirmación en breve.", + "please-provide-templateid": "Por favor, proporcione templateid", + "this-template-is-not-public": "Esta template no es pública", + "invalid-templateid": "templateid no válida", + "contact-billing-at-opensign": "Para agregar más asientos, comuníquese con OpenSign™ a <1>billing@opensignlabs.com para obtener ayuda.", + "title-length-alert": "El título debe tener como máximo 250 caracteres.", + "note-length-alert": "La nota debe tener como máximo 200 caracteres.", + "description-length-alert": "La descripción debe tener como máximo 500 caracteres." } diff --git a/apps/OpenSign/public/locales/fr/translation.json b/apps/OpenSign/public/locales/fr/translation.json index 54ef4ab4b1..7459aa7d92 100644 --- a/apps/OpenSign/public/locales/fr/translation.json +++ b/apps/OpenSign/public/locales/fr/translation.json @@ -201,7 +201,7 @@ "send-in-order-help": { "p1": "Choisissez la manière dont vous souhaitez que les demandes de signature soient envoyées aux signataires du document :", "p2": "La sélection de cette option enverra initialement la demande de signature au premier signataire. Une fois que le premier signataire a terminé sa partie, le prochain signataire de la séquence recevra la demande. Ce processus se poursuit jusqu'à ce que tous les signataires aient signé le document. Cette méthode garantit que le document est signé dans un ordre spécifique.", - "p3": "La sélection de cette option enverra les liens de signature à tous les signataires simultanément. Chaque signataire peut signer le document à sa convenance, que d'autres signataires aient ou non complété leur signature. Cette méthode est plus rapide mais n’impose aucun ordre de signature entre les participants.", + "p3": "La sélection de cette option enverra les liens de signature à tous les signataires simultanément. Chaque signataire peut signer le document à sa convenance, que d'autres signataires aient ou non complété leur signature. Cette méthode est plus rapide mais n'impose aucun ordre de signature entre les participants.", "p4": "Sélectionnez l'option qui correspond le mieux aux besoins de votre traitement de documents." }, "no": "Non", @@ -227,7 +227,7 @@ "create": "Créer", "signers": "Signataires", "signers-help": "Commencez à saisir le nom d'un contact pour voir les signataires suggérés par vos contacts enregistrés ou en ajouter de nouveaux. Organisez l'ordre de signature en ajoutant des signataires dans l'ordre souhaité. Utilisez le bouton « + » pour inclure les signataires et le « x » pour les supprimer. Chaque signataire recevra un e-mail invité à signer le document dans l'ordre indiqué.", - "bcc-help": "Commencez à taper le nom d’un contact pour voir les suggestions parmi vos contacts enregistrés ou en ajouter de nouveaux. Utilisez le bouton '+' pour ajouter un utilisateur et le bouton 'x' pour le supprimer. L’adresse e-mail de l’utilisateur sélectionné sera ajoutée en Bcc (copie carbone invisible). Chaque utilisateur recevra une notification par e-mail une fois le document terminé.", + "bcc-help": "Commencez à taper le nom d'un contact pour voir les suggestions parmi vos contacts enregistrés ou en ajouter de nouveaux. Utilisez le bouton '+' pour ajouter un utilisateur et le bouton 'x' pour le supprimer. L'adresse e-mail de l'utilisateur sélectionné sera ajoutée en Bcc (copie carbone invisible). Chaque utilisateur recevra une notification par e-mail une fois le document terminé.", "add-signer": "Ajouter un signataire", "contact-not-found": "Contact introuvable", "add-yourself": "Ajoutez-vous", @@ -284,6 +284,7 @@ "make-template-public": "Rendre le modèle public", "make-template-private": "Rendre le modèle privé", "make-template-public-alert": "Êtes-vous sûr de vouloir rendre ce modèle public ?", + "make-template-private-alert-non": "Êtes-vous sûr de vouloir rendre ce modèle privé ?", "make-template-private-alert": "Êtes-vous sûr de vouloir rendre ce modèle privé ? Cela le supprimera de votre profil public.", "public-role": "Rôle public", "public-url": "Profil public", @@ -659,7 +660,7 @@ "bulk-send-subcription-alert": "Veuillez passer au forfait Professionnel ou Équipe pour utiliser Quicksend.", "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-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.", "reason": "Raison", "decline-by": "Refusé/révoqué par", @@ -873,5 +874,12 @@ "document-has-been-signed": "Le document a été signé avec succès !", "document-has-been-signed-by-you": "Le document a été signé avec succès par vous !", "participant-completed-signing": "Tous les participants ont terminé le processus de signature.", - "you-will-receive-email-shortly": "✅ Voilà, c'est fait ! Vous recevrez un e-mail de confirmation sous peu." + "you-will-receive-email-shortly": "✅ Voilà, c'est fait ! Vous recevrez un e-mail de confirmation sous peu.", + "please-provide-templateid": "Veuillez fournir templateid", + "this-template-is-not-public": "Ce template n'est pas public", + "invalid-templateid": "templateid invalide", + "contact-billing-at-opensign": "Pour ajouter plus de places, veuillez contacter OpenSign™ à l'adresse <1>billing@opensignlabs.com pour obtenir de l'aide.", + "title-length-alert": "Le titre doit comporter au maximum 250 caractères.", + "note-length-alert": "La note doit comporter au maximum 200 caractères.", + "description-length-alert": "La description doit comporter au maximum 500 caractères" } diff --git a/apps/OpenSign/public/locales/it/translation.json b/apps/OpenSign/public/locales/it/translation.json index 4e124db7e9..ea2f9e4dfc 100644 --- a/apps/OpenSign/public/locales/it/translation.json +++ b/apps/OpenSign/public/locales/it/translation.json @@ -284,6 +284,7 @@ "make-template-public": "Rendi il modello pubblico", "make-template-private": "Rendi il modello privato", "make-template-public-alert": "Sei sicuro di voler rendere pubblico questo modello?", + "make-template-private-alert-non": "Sei sicuro di voler rendere privato questo modello?", "make-template-private-alert": "Sei sicuro di voler rendere privato questo modello? Questo lo rimuoverà dal tuo profilo pubblico.", "public-role": "Ruolo pubblico", "public-url": "Profilo pubblico", @@ -314,7 +315,7 @@ "body": "Corpo del messaggio", "add-contact": "Aggiungi contatto", "edit-contact": "Modifica contatto", - "add-signer-alert": "Il contatto esiste già! Selezionalo dal menu a tendina ‘Firmatari’.", + "add-signer-alert": "Il contatto esiste già! Selezionalo dal menu a tendina 'Firmatari'.", "record-delete-alert": "Record eliminato con successo!", "record-revoke-alert": "Record revocato con successo!", "mail-sent-alert": "Email inviata con successo.", @@ -608,7 +609,7 @@ "placeholder-sign-4": "Trascina o fai clic su un campo per aggiungerlo al documento.", "placeholder-sign-5": "L'area del contenuto PDF visualizza già i segnaposti esistenti del modello. Per tua comodità, questi segnaposti corrisponderanno al colore del nome del destinatario, rendendoli facilmente identificabili.", "placeholder-sign-6": "Facendo clic su 'Invia' il documento verrà salvato. Nel passaggio successivo potrai personalizzare le email da inviare ai destinatari o copiare i link di firma e condividerli direttamente con i destinatari.", - "report-1": "Fai clic sul pulsante 'Aggiungi' per creare un nuovo modello. I modelli sono documenti riutilizzabili progettati per generare rapidamente nuovi documenti con la stessa struttura e firmatari diversi. Ad esempio, un modello HR per l'onboarding potrebbe avere ruoli predefinita come ‘Responsabile HR’ e ‘Nuovo Dipendente’. Ogni volta che usi il modello, puoi assegnare il ruolo ‘Nuovo Dipendente’ a membri dello staff in arrivo, mentre il ruolo ‘Responsabile HR’ rimane costante, facilitando un processo di onboarding fluido per ogni nuovo assunto.", + "report-1": "Fai clic sul pulsante 'Aggiungi' per creare un nuovo modello. I modelli sono documenti riutilizzabili progettati per generare rapidamente nuovi documenti con la stessa struttura e firmatari diversi. Ad esempio, un modello HR per l'onboarding potrebbe avere ruoli predefinita come 'Responsabile HR' e 'Nuovo Dipendente'. Ogni volta che usi il modello, puoi assegnare il ruolo 'Nuovo Dipendente' a membri dello staff in arrivo, mentre il ruolo 'Responsabile HR' rimane costante, facilitando un processo di onboarding fluido per ogni nuovo assunto.", "redirect": "Fai clic sul pulsante 'Usa' per creare un nuovo documento da un modello esistente.", "bulksend": "Per inviare rapidamente più documenti utilizzando un modello esistente creando semplicemente gli indirizzi e-mail dei destinatari, fai clic sul pulsante 'Invio Multiplo'.", "option": "Questo menu rivela altre opzioni come Modifica ed Elimina. Usa il pulsante 'Modifica' per aggiungere ruoli di firmatari, modificare i campi e aggiornare il modello. Le modifiche si applicheranno a tutti i futuri documenti creati da questo modello ma non influiranno sui documenti esistenti. Usa il pulsante Elimina per eliminare il modello.", @@ -625,7 +626,7 @@ "Recent signature requests": "Questo è un elenco di documenti che aspettano la tua firma.", "Recently sent for signatures": "Questo è un elenco di documenti che hai inviato ad altre parti per la firma.", "Drafts": "Questi sono documenti che hai iniziato ma non hai finalizzato per l'invio.", - "public-template": "Questo video dimostra come configurare il tuo profilo pubblico personalizzato, come ‘https://opensign.me/tuo-username’. Imparerai anche come personalizzare il tuo slogan e rendere i tuoi modelli disponibili per la firma pubblica.", + "public-template": "Questo video dimostra come configurare il tuo profilo pubblico personalizzato, come 'https://opensign.me/tuo-username'. Imparerai anche come personalizzare il tuo slogan e rendere i tuoi modelli disponibili per la firma pubblica.", "allowModify-widgets": "È possibile trascinare e rilasciare uno qualsiasi di questi campi nel documento, oltre ai campi già designati dal creatore del documento." }, "enter-email-plaholder": "Aggiungi un indirizzo email e premi invio", @@ -873,5 +874,12 @@ "document-has-been-signed": "Il documento è stato firmato con successo!", "document-has-been-signed-by-you": "Il documento è stato firmato con successo da lei!", "participant-completed-signing": "Tutti i partecipanti hanno completato il processo di firma.", - "you-will-receive-email-shortly": "✅ È tutto! Riceverà a breve un'e-mail di conferma." + "you-will-receive-email-shortly": "✅ È tutto! Riceverà a breve un'e-mail di conferma.", + "please-provide-templateid": "Si prega di fornire templateid", + "this-template-is-not-public": "Questo template non è pubblico", + "invalid-templateid": "templateid non valido", + "contact-billing-at-opensign": " Per aggiungere altri posti, contattare OpenSign™ all'indirizzo <1>billing@opensignlabs.com per assistenza.", + "title-length-alert": "Il titolo può contenere al massimo 250 caratteri.", + "note-length-alert": "La nota può contenere al massimo 200 caratteri.", + "description-length-alert": " La descrizione può contenere al massimo 500 caratteri." } diff --git a/apps/OpenSign/src/components/BulkSendUi.js b/apps/OpenSign/src/components/BulkSendUi.js index 58874d02e2..9a9af3bd1b 100644 --- a/apps/OpenSign/src/components/BulkSendUi.js +++ b/apps/OpenSign/src/components/BulkSendUi.js @@ -3,9 +3,7 @@ import axios from "axios"; import SuggestionInput from "./shared/fields/SuggestionInput"; import Loader from "../primitives/Loader"; import { useTranslation } from "react-i18next"; -import { - emailRegex, -} from "../constant/const"; +import { emailRegex } from "../constant/const"; const BulkSendUi = (props) => { const { t } = useTranslation(); const [forms, setForms] = useState([]); @@ -22,15 +20,15 @@ const BulkSendUi = (props) => { //function to check atleast one signature field exist const signatureExist = async () => { - setIsDisableBulkSend(false); - const getPlaceholder = props?.Placeholders; - const checkIsSignatureExistt = getPlaceholder?.every((placeholderObj) => - placeholderObj?.placeHolder?.some((holder) => - holder?.pos?.some((posItem) => posItem?.type === "signature") - ) - ); - setIsSignatureExist(checkIsSignatureExistt); - setIsLoader(false); + setIsDisableBulkSend(false); + const getPlaceholder = props?.Placeholders; + const checkIsSignatureExistt = getPlaceholder?.every((placeholderObj) => + placeholderObj?.placeHolder?.some((holder) => + holder?.pos?.some((posItem) => posItem?.type === "signature") + ) + ); + setIsSignatureExist(checkIsSignatureExistt); + setIsLoader(false); }; useEffect(() => { if (scrollOnNextUpdate && formRef.current) { @@ -74,7 +72,6 @@ const BulkSendUi = (props) => { setForms(newForms); }; - const handleRemoveForm = (index) => { const updatedForms = forms.filter((_, i) => i !== index); setForms(updatedForms); @@ -95,82 +92,83 @@ const BulkSendUi = (props) => { const handleSubmit = async (e) => { e.preventDefault(); e.stopPropagation(); - setIsSubmit(true); - if (validateEmails(forms)) { - // Create a copy of Placeholders array from props.item - let Placeholders = [...props.Placeholders]; - // Initialize an empty array to store updated documents - let Documents = []; - // Loop through each form - forms.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 values - const updatedPlaceholders = Placeholders.map((placeholder) => { - // Find the field in the current form that matches the placeholder Id - const field = form.fields.find( - (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 : ""; - if (field) { - if (signer) { - return { - ...placeholder, - signerObjId: field?.signer?.objectId || "", - signerPtr: signer - }; - } else { - return { - ...placeholder, - email: field.email, - signerObjId: field?.signer?.objectId || "", - signerPtr: signer - }; - } + setIsSubmit(true); + if (validateEmails(forms)) { + // Create a copy of Placeholders array from props.item + let Placeholders = [...props.Placeholders]; + // Initialize an empty array to store updated documents + let Documents = []; + // Loop through each form + forms.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 values + const updatedPlaceholders = Placeholders.map((placeholder) => { + // Find the field in the current form that matches the placeholder Id + const field = form.fields.find( + (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 : ""; + if (field) { + 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 is - return placeholder; - }); - - // Push a new document object with updated Placeholders into the Documents array - 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, - SignatureType: props.signatureType - }); } + // If no matching field is found, keep the placeholder as is + return placeholder; }); - await batchQuery(Documents); - } else { - setIsSubmit(false); - } + + // Push a new document object with updated Placeholders into the Documents array + 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, + SignatureType: props.signatureType + }); + } + }); + await batchQuery(Documents); + } else { + setIsSubmit(false); + } }; const batchQuery = async (Documents) => { - const token = - { "X-Parse-Session-Token": localStorage.getItem("accesstoken") }; + const token = { + "X-Parse-Session-Token": localStorage.getItem("accesstoken") + }; const functionsUrl = `${localStorage.getItem( "baseUrl" )}functions/batchdocuments`; const headers = { "Content-Type": "application/json", "X-Parse-Application-Id": localStorage.getItem("parseAppId"), - ...token, + ...token }; const params = { Documents: JSON.stringify(Documents) }; try { @@ -218,7 +216,9 @@ const BulkSendUi = (props) => { className="flex flex-col" key={field.fieldId} > - + { )} ) : ( - <> - + <> )} )} diff --git a/apps/OpenSign/src/components/pdf/EditTemplate.js b/apps/OpenSign/src/components/pdf/EditTemplate.js index b97b3b7d55..9fd9660d5b 100644 --- a/apps/OpenSign/src/components/pdf/EditTemplate.js +++ b/apps/OpenSign/src/components/pdf/EditTemplate.js @@ -1,5 +1,10 @@ import React, { useState } from "react"; import { getFileName } from "../../constant/Utils"; +import { + maxDescriptionLength, + maxNoteLength, + maxTitleLength +} from "../../constant/const"; import { useTranslation } from "react-i18next"; import { Tooltip } from "react-tooltip"; import SignersInput from "../shared/fields/SignersInput"; @@ -50,6 +55,18 @@ const EditTemplate = ({ template, onSuccess }) => { alert(t("invalid-redirect-url")); return; } + if (formData?.Name?.length > maxTitleLength) { + alert(t("title-length-alert")); + return; + } + if (formData?.Note?.length > maxNoteLength) { + alert(t("note-length-alert")); + return; + } + if (formData?.Description?.length > maxDescriptionLength) { + alert(t("description-length-alert")); + return; + } const isChecked = formData.SendinOrder === "true" ? true : false; const isTourEnabled = formData?.IsTourEnabled === "false" ? false : true; const AutoReminder = formData?.AutomaticReminders || false; diff --git a/apps/OpenSign/src/constant/Utils.js b/apps/OpenSign/src/constant/Utils.js index 3e211de208..2bbd854d77 100644 --- a/apps/OpenSign/src/constant/Utils.js +++ b/apps/OpenSign/src/constant/Utils.js @@ -643,6 +643,15 @@ export const createDocument = async ( const RedirectUrl = Doc?.RedirectUrl ? { RedirectUrl: Doc?.RedirectUrl } : {}; + const TemplateId = Doc?.objectId + ? { + TemplateId: { + __type: "Pointer", + className: "contracts_Template", + objectId: Doc?.objectId + } + } + : {}; const data = { Name: Doc.Name, URL: pdfUrl, @@ -672,7 +681,8 @@ export const createDocument = async ( ...SignatureType, ...NotifyOnSignatures, ...Bcc, - ...RedirectUrl + ...RedirectUrl, + ...TemplateId }; const remindOnceInEvery = Doc?.RemindOnceInEvery; const TimeToCompleteDays = parseInt(Doc?.TimeToCompleteDays); diff --git a/apps/OpenSign/src/constant/const.js b/apps/OpenSign/src/constant/const.js index f6b6198b78..2a21fb6156 100644 --- a/apps/OpenSign/src/constant/const.js +++ b/apps/OpenSign/src/constant/const.js @@ -5,3 +5,6 @@ export const themeColor = "#47a3ad"; export const iconColor = "#686968"; export const emailRegex = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/; export const maxFileSize = 10; // 10MB +export const maxTitleLength = 250; // 250 characters +export const maxNoteLength = 200; // 200 characters +export const maxDescriptionLength = 500; // 500 characters diff --git a/apps/OpenSign/src/pages/ForgetPassword.js b/apps/OpenSign/src/pages/ForgetPassword.js index 51474cf127..8c11b978d4 100644 --- a/apps/OpenSign/src/pages/ForgetPassword.js +++ b/apps/OpenSign/src/pages/ForgetPassword.js @@ -7,17 +7,17 @@ import Alert from "../primitives/Alert"; import { appInfo } from "../constant/appinfo"; import { useDispatch } from "react-redux"; import { fetchAppInfo } from "../redux/reducers/infoReducer"; -import { - emailRegex, -} from "../constant/const"; +import { emailRegex } from "../constant/const"; import { useTranslation } from "react-i18next"; +import Loader from "../primitives/Loader"; function ForgotPassword() { const { t } = useTranslation(); const dispatch = useDispatch(); const navigate = useNavigate(); const [state, setState] = useState({ email: "", password: "", hideNav: "" }); - const [sentStatus, setSentStatus] = useState(""); + const [toast, setToast] = useState({ type: "", message: "" }); + const [isLoading, setIsLoading] = useState(false); const [image, setImage] = useState(); const handleChange = (event) => { @@ -40,18 +40,23 @@ function ForgotPassword() { if (!emailRegex.test(state.email)) { alert("Please enter a valid email address."); } else { + setIsLoading(true); localStorage.setItem("appLogo", appInfo.applogo); localStorage.setItem("userSettings", JSON.stringify(appInfo.settings)); if (state.email) { const username = state.email; try { await Parse.User.requestPasswordReset(username); - setSentStatus("success"); + setToast({ type: "success", message: t("reset-password-alert-1") }); } catch (err) { console.log("err ", err.code); - setSentStatus("failed"); + setToast({ + type: "danger", + message: err.message || t("reset-password-alert-2") + }); } finally { - setTimeout(() => setSentStatus(""), 1000); + setIsLoading(false); + setTimeout(() => setToast({ type: "", message: "" }), 1000); } } } @@ -71,17 +76,17 @@ function ForgotPassword() { } catch (err) { console.log("err while logging out ", err); } - setImage(appInfo?.applogo || undefined); + setImage(appInfo?.applogo || undefined); }; return (
- - {sentStatus === "success" && ( - <Alert type="success">{t("reset-password-alert-1")}</Alert> - )} - {sentStatus === "failed" && ( - <Alert type={"danger"}>{t("reset-password-alert-2")}</Alert> + {isLoading && ( + <div className="fixed w-full h-full flex justify-center items-center bg-black bg-opacity-30 z-50"> + <Loader /> + </div> )} + <Title title="Forgot password" /> + {toast?.message && <Alert type={toast.type}>{toast.message}</Alert>} <div className="md:p-10 lg:p-16"> <div className="md:p-4 lg:p-10 p-4 bg-base-100 text-base-content op-card"> <div className="w-[250px] h-[66px] inline-block overflow-hidden"> diff --git a/apps/OpenSign/src/pages/Form.js b/apps/OpenSign/src/pages/Form.js index c34b51d757..0960756033 100644 --- a/apps/OpenSign/src/pages/Form.js +++ b/apps/OpenSign/src/pages/Form.js @@ -18,7 +18,12 @@ import { } from "../constant/Utils"; import { PDFDocument } from "pdf-lib"; import axios from "axios"; -import { maxFileSize } from "../constant/const"; +import { + maxFileSize, + maxDescriptionLength, + maxNoteLength, + maxTitleLength +} from "../constant/const"; import ModalUi from "../primitives/ModalUi"; import { Tooltip } from "react-tooltip"; import Loader from "../primitives/Loader"; @@ -354,6 +359,18 @@ const Forms = (props) => { e.preventDefault(); e.stopPropagation(); if (fileupload) { + if (formData?.Name?.length > maxTitleLength) { + alert(t("title-length-alert")); + return; + } + if (formData?.Note?.length > maxNoteLength) { + alert(t("note-length-alert")); + return; + } + if (formData?.Description?.length > maxDescriptionLength) { + alert(t("description-length-alert")); + return; + } if (formData.RedirectUrl && !isValidURL(formData?.RedirectUrl)) { alert(t("invalid-redirect-url")); return; diff --git a/apps/OpenSign/src/pages/GuestLogin.js b/apps/OpenSign/src/pages/GuestLogin.js index 37469e5074..8ff60c92fe 100644 --- a/apps/OpenSign/src/pages/GuestLogin.js +++ b/apps/OpenSign/src/pages/GuestLogin.js @@ -15,7 +15,9 @@ function GuestLogin() { const { t, i18n } = useTranslation(); const { id, userMail, contactBookId, base64url } = useParams(); const navigate = useNavigate(); - const [email, setEmail] = useState(userMail); + const [email, setEmail] = useState( + userMail?.toLowerCase()?.replace(/\s/g, "") + ); const [OTP, setOTP] = useState(""); const [EnterOTP, setEnterOtp] = useState(false); const [loading, setLoading] = useState(false); @@ -76,12 +78,18 @@ function GuestLogin() { //split url in array from '/' const checkSplit = decodebase64.split("/"); setDocumentId(checkSplit[0]); - setContact((prev) => ({ ...prev, email: checkSplit[1] })); - setEmail(checkSplit[1]); + setContact((prev) => ({ + ...prev, + email: checkSplit[1]?.toLowerCase()?.replace(/\s/g, "") + })); + setEmail(checkSplit[1]?.toLowerCase()?.replace(/\s/g, "")); const contactId = checkSplit?.[2]; setSendmail(checkSplit[3]); if (!contactId) { - const params = { email: checkSplit[1], docId: checkSplit[0] }; + const params = { + email: checkSplit[1]?.toLowerCase()?.replace(/\s/g, ""), + docId: checkSplit[0] + }; try { const linkContactRes = await Parse.Cloud.run( "linkcontacttodoc", @@ -103,10 +111,10 @@ function GuestLogin() { //send email OTP function const SendOtp = async () => { setLoading(true); - setEmail(email); + setEmail(email?.toLowerCase()?.replace(/\s/g, "")); try { const params = { - email: email.toString(), + email: email?.toLowerCase()?.replace(/\s/g, "")?.toString(), docId: documentId }; const Otp = await Parse.Cloud.run("SendOTPMailV1", params); @@ -139,7 +147,10 @@ function GuestLogin() { "Content-Type": "application/json", "X-Parse-Application-Id": parseId }; - let body = { email: email, otp: OTP }; + let body = { + email: email?.toLowerCase()?.replace(/\s/g, ""), + otp: OTP + }; let user = await axios.post(url, body, { headers: headers }); if (user.data.result === "Invalid Otp") { alert(t("invalid-otp")); @@ -184,7 +195,7 @@ function GuestLogin() { }; const handleUserData = async (e) => { e.preventDefault(); - if (!emailRegex.test(contact.email)) { + if (!emailRegex.test(contact.email?.toLowerCase()?.replace(/\s/g, ""))) { alert("Please enter a valid email address."); } else { const params = { ...contact, docId: documentId }; diff --git a/apps/OpenSign/src/pages/PlaceHolderSign.js b/apps/OpenSign/src/pages/PlaceHolderSign.js index fa8ba5d115..a42d1ad703 100644 --- a/apps/OpenSign/src/pages/PlaceHolderSign.js +++ b/apps/OpenSign/src/pages/PlaceHolderSign.js @@ -3,6 +3,7 @@ import axios from "axios"; import Parse from "parse"; import "../styles/signature.css"; import { PDFDocument } from "pdf-lib"; +import { maxTitleLength } from "../constant/const"; import { DndProvider } from "react-dnd"; import { HTML5Backend } from "react-dnd-html5-backend"; import { useDrop } from "react-dnd"; @@ -164,6 +165,7 @@ function PlaceHolderSign() { const [isAttchSignerModal, setIsAttchSignerModal] = useState(false); const [isNewContact, setIsNewContact] = useState({ status: false, id: "" }); const [owner, setOwner] = useState({}); + const [docTitle, setDocTitle] = useState(""); const isMobile = window.innerWidth < 767; const [, drop] = useDrop({ accept: "BOX", @@ -243,6 +245,7 @@ function PlaceHolderSign() { //getting document details const documentData = await contractDocument(documentId); if (documentData && documentData.length > 0) { + setDocTitle(documentData?.[0]?.Name); if (documentData[0]?.Placeholders?.length > 0) { const signerNotExist = documentData[0]?.Placeholders.some( (data) => !data.signerObjId && data.Role !== "prefill" @@ -1010,6 +1013,7 @@ function PlaceHolderSign() { const saveDocumentDetails = async () => { setIsUiLoading(true); let signerMail = signersdata.slice(); + // For "Send in order", only consider the first signer if (pdfDetails?.[0]?.SendinOrder && pdfDetails?.[0]?.SendinOrder === true) { signerMail.splice(1); } @@ -1022,7 +1026,7 @@ function PlaceHolderSign() { objectId: x.objectId }; }); - const addExtraDays = pdfDetails[0]?.TimeToCompleteDays + const addExtraDays = pdfDetails?.[0]?.TimeToCompleteDays ? pdfDetails[0].TimeToCompleteDays : 15; const currentUser = signersdata.find((x) => x.Email === currentId); @@ -1037,22 +1041,22 @@ function PlaceHolderSign() { } else { setIsCurrUser(currentUser?.objectId ? true : false); } - let updateExpiryDate, data; - updateExpiryDate = new Date(); + // Compute expiry date with extra days + let updateExpiryDate = new Date(); updateExpiryDate.setDate(updateExpiryDate.getDate() + addExtraDays); - //filter label widgets after add label widgets data on pdf + + // Filter out prefill roles const filterPrefill = signerPos.filter((data) => data.Role !== "prefill"); try { - data = { + const data = { + Name: docTitle || pdfDetails?.[0]?.Name, Placeholders: filterPrefill, SignedUrl: pdfUrl, Signers: signers, SentToOthers: true, - SignatureType: pdfDetails?.[0]?.SignatureType + SignatureType: pdfDetails?.[0]?.SignatureType, + ExpiryDate: { iso: updateExpiryDate, __type: "Date" } }; - if (updateExpiryDate) { - data["ExpiryDate"] = { iso: updateExpiryDate, __type: "Date" }; - } await axios.put( `${localStorage.getItem( "baseUrl" @@ -1071,6 +1075,11 @@ function PlaceHolderSign() { setIsUiLoading(false); setSignerPos([]); setIsSendAlert({ mssg: "confirm", alert: true }); + if (docTitle) { + const updatedPdfDetails = [...pdfDetails]; + updatedPdfDetails[0].Name = docTitle; + setPdfDetails(updatedPdfDetails); + } } catch (e) { console.log("error", e); alert(t("something-went-wrong-mssg")); @@ -1844,6 +1853,10 @@ function PlaceHolderSign() { setPdfBase64Url(urlDetails.base64); }; const handleSendDoc = () => { + if (docTitle?.length > maxTitleLength) { + alert(t("title-length-alert")); + return; + } setIsAttchSignerModal(false); setCheckTourStatus(true); alertSendEmail(); @@ -1906,6 +1919,10 @@ function PlaceHolderSign() { return isAllSigner; }; const handleCloseAttachSigner = () => { + if (docTitle?.length > maxTitleLength) { + alert(t("title-length-alert")); + return; + } setIsAttchSignerModal(false); }; return ( @@ -2180,24 +2197,45 @@ function PlaceHolderSign() { </ModalUi> <ModalUi isOpen={isAttchSignerModal} - title={t("add-signer")} + title={t("create-document")} handleClose={() => handleCloseAttachSigner()} > - <div className="h-[100%] p-[20px]"> + <div className="h-[100%] px-[20px] py-[10px]"> + <div> + <label + htmlFor="doctitle" + className="block text-xs font-semibold" + > + Title + </label> + <input + type="text" + name="doctitle" + value={docTitle} + onChange={(e) => setDocTitle(e.target.value)} + required + onInvalid={(e) => + e.target.setCustomValidity(t("input-required")) + } + onInput={(e) => e.target.setCustomValidity("")} + className="op-input op-input-bordered op-input-sm focus:outline-none hover:border-base-content w-full text-[11px] py-[18px]" + /> + </div> {pdfDetails[0].Placeholders?.some( (x) => !x.signerObjId ) && ( <> - {/* grid grid-cols-1 md:grid-cols-2 */} <div className="min-h-max max-h-[250px] overflow-y-auto"> - <div className="py-3 px-[10px] op-card border-[1px] border-gray-400 mt-3 md:mx-3 mb-4 bg-base-200 text-base-content flex flex-col gap-2 relative"> + <div className="py-2 text-base-content flex flex-col gap-2 relative"> {forms?.map((field, id) => { return ( <div className="flex flex-col" key={field?.value} > - <label>{field?.role}</label> + <label className="block text-xs font-semibold"> + {field?.role} + </label> <div className="flex justify-between items-center gap-1"> <div className="flex-1"> <AsyncSelect @@ -2240,7 +2278,7 @@ function PlaceHolderSign() { onClick={(e) => handleCreateNew(e, field.value) } - className="op-btn op-btn-accent op-btn-outline op-btn-sm " + className="op-btn op-btn-accent op-btn-outline op-btn-sm" > <i className="fa-light fa-plus"></i> </button> @@ -2250,8 +2288,8 @@ function PlaceHolderSign() { })} </div> </div> - <div className="w-full h-[1px] bg-[#9f9f9f] my-[15px]"></div> - <div className="flex mx-4 mb-4 gap-3"> + <div className="w-full h-[0.5px] bg-[#9f9f9f] mt-[8px] mb-[15px]"></div> + <div className="flex mx-2 mb-2 gap-3"> <button disabled={handleDisable()} onClick={() => handleSendDoc()} diff --git a/apps/OpenSign/src/pages/UserProfile.js b/apps/OpenSign/src/pages/UserProfile.js index d738e696f9..dc5d29e043 100644 --- a/apps/OpenSign/src/pages/UserProfile.js +++ b/apps/OpenSign/src/pages/UserProfile.js @@ -1,7 +1,4 @@ -import React, { - useState, - useEffect, -} from "react"; +import React, { useState, useEffect } from "react"; import { Navigate, useNavigate } from "react-router"; import Parse from "parse"; import { SaveFileSize } from "../constant/saveFileSize"; @@ -10,10 +7,7 @@ import Title from "../components/Title"; import sanitizeFileName from "../primitives/sanitizeFileName"; import axios from "axios"; import Tooltip from "../primitives/Tooltip"; -import { - getSecureUrl, - handleSendOTP, -} from "../constant/Utils"; +import { getSecureUrl, handleSendOTP } from "../constant/Utils"; import ModalUi from "../primitives/ModalUi"; import Loader from "../primitives/Loader"; import { useTranslation } from "react-i18next"; @@ -121,13 +115,13 @@ function UserProfile() { const updateExtUser = async (obj) => { try { const extData = JSON.parse(localStorage.getItem("Extand_Class")); - const ExtUserId = extData[0].objectId; + const ExtUserId = extData?.[0]?.objectId; const body = { Phone: obj?.Phone || "", Name: obj.Name, JobTitle: jobTitle, Company: company, - Language: obj?.language || "", + Language: obj?.language || "" }; await axios.put( @@ -235,7 +229,7 @@ function UserProfile() { const handleResend = async (e) => { e.preventDefault(); setOtpLoader(true); - await handleSendOTP(); + await handleSendOTP(Parse.User.current().getEmail()); setOtpLoader(false); alert(t("otp-sent-alert")); }; @@ -412,7 +406,7 @@ function UserProfile() { <button type="button" onClick={(e) => { - editmode ? handleSubmit(e) : setEditMode(true); + editmode ? handleSubmit(e) : setEditMode(true); }} className="op-btn op-btn-primary w-[100px]" > diff --git a/apps/OpenSign/src/primitives/GetReportDisplay.js b/apps/OpenSign/src/primitives/GetReportDisplay.js index 6ad5356f99..4d320c24b9 100644 --- a/apps/OpenSign/src/primitives/GetReportDisplay.js +++ b/apps/OpenSign/src/primitives/GetReportDisplay.js @@ -82,6 +82,7 @@ const ReportTable = (props) => { const [contact, setContact] = useState({ Name: "", Email: "", Phone: "" }); const [isSuccess, setIsSuccess] = useState({}); const [templateId, setTemplateId] = useState(""); + const isTemplateReport = props.ReportName === "Templates"; const recordsPerPage = 5; const startIndex = (currentPage - 1) * props.docPerPage; const { isMoreDocs, setIsNextRecord } = props; @@ -152,7 +153,7 @@ const ReportTable = (props) => { // `fetchTeamList` is used to fetch team list for share with functionality const fetchTeamList = async () => { - if (props.ReportName === "Templates") { + if (isTemplateReport) { try { const extUser = JSON.parse(localStorage.getItem("Extand_Class"))?.[0]; if (extUser?.OrganizationId?.objectId) { @@ -225,7 +226,7 @@ const ReportTable = (props) => { // `handleURL` is used to open microapp const handleURL = async (item, act) => { - if (props.ReportName === "Templates") { + if (isTemplateReport) { if (act.hoverLabel === "Edit") { navigate(`/${act.redirectUrl}/${item.objectId}`); } else { @@ -298,6 +299,15 @@ const ReportTable = (props) => { const RedirectUrl = Doc?.RedirectUrl ? { RedirectUrl: Doc?.RedirectUrl } : {}; + const TemplateId = Doc?.objectId + ? { + TemplateId: { + __type: "Pointer", + className: "contracts_Template", + objectId: Doc?.objectId + } + } + : {}; let placeholdersArr = []; if (Doc.Placeholders?.length > 0) { placeholdersArr = Doc.Placeholders; @@ -329,7 +339,8 @@ const ReportTable = (props) => { ...SignatureType, ...NotifyOnSignatures, ...Bcc, - ...RedirectUrl + ...RedirectUrl, + ...TemplateId }; try { const res = await axios.post( @@ -656,7 +667,6 @@ const ReportTable = (props) => { signing_url: `<a href=${signPdf} target=_blank>Sign here</a>` }; const res = replaceMailVaribles(subject, "", variables); - setMail((prev) => ({ ...prev, subject: res.subject })); }; // `handlebodyChange` is used to add or change body of resend mail @@ -1235,10 +1245,9 @@ const ReportTable = (props) => { const handleRenameDoc = async (item) => { setActLoader({ [item.objectId]: true }); setIsModal({}); - const className = - props.ReportName === "Templates" - ? "contracts_Template" - : "contracts_Document"; + const className = isTemplateReport + ? "contracts_Template" + : "contracts_Document"; try { const query = new Parse.Query(className); const docObj = await query.get(item.objectId); @@ -1336,6 +1345,13 @@ const ReportTable = (props) => { showAlert("danger", t("something-went-wrong-mssg")); } }; + + const handleResendClose = () => { + setIsResendMail({}); + setIsNextStep({}); + setUserDetails({}); + }; + return ( <div className="relative"> {Object.keys(actLoader)?.length > 0 && ( @@ -1347,7 +1363,7 @@ const ReportTable = (props) => { {alertMsg.message && ( <Alert type={alertMsg.type}>{alertMsg.message}</Alert> )} - {props.tourData && props.ReportName === "Templates" && ( + {props.tourData && isTemplateReport && ( <> <Tour onRequestClose={closeTour} @@ -1384,7 +1400,7 @@ const ReportTable = (props) => { <i className="fa-light fa-square-plus text-accent text-[30px] md:text-[35px]"></i> </div> )} - {props.ReportName === "Templates" && ( + {isTemplateReport && ( <i data-tut="reactourFirst" onClick={() => navigate("/form/template")} @@ -1583,7 +1599,9 @@ const ReportTable = (props) => { </th> )} <td className="p-2 min-w-56 max-w-56"> - <div className="font-semibold">{item?.Name}</div> + <div className="font-semibold break-words"> + {item?.Name} + </div> {item?.ExpiryDate?.iso && ( <div className="text-gray-500"> Expires {formatDate(item?.ExpiryDate?.iso)} @@ -1653,7 +1671,7 @@ const ReportTable = (props) => { <div className="text-base-content min-w-max flex flex-row gap-x-2 gap-y-1 justify-start items-center"> {props.actions?.length > 0 && props.actions.map((act, index) => - props.ReportName === "Templates" ? ( + isTemplateReport ? ( <React.Fragment key={index}> {(item.ExtUserPtr?.objectId === extClass?.[0]?.objectId || @@ -1953,14 +1971,12 @@ const ReportTable = (props) => { {isViewShare[item.objectId] && ( <ModalUi isOpen - showHeader={ - props.ReportName === "Templates" && true - } + showHeader={isTemplateReport} title={t("signers")} reduceWidth={"md:max-w-[450px]"} handleClose={() => setIsViewShare({})} > - {props.ReportName !== "Templates" && ( + {!isTemplateReport && ( <div className="op-btn op-btn-sm op-btn-circle op-btn-ghost text-base-content absolute right-2 top-1 z-40" onClick={() => setIsViewShare({})} @@ -1971,13 +1987,13 @@ const ReportTable = (props) => { <table className="op-table w-full overflow-auto"> <thead className="h-[38px] sticky top-0 text-base-content text-sm pt-[15px] px-[20px]"> <tr> - {props.ReportName === "Templates" && ( + {isTemplateReport && ( <th className="p-2 pl-3 w-[30%]"> {t("roles")} </th> )} <th className="pl-3 py-2"> - {props.ReportName === "Templates" + {isTemplateReport ? t("email") : t("signers")} </th> @@ -1991,7 +2007,7 @@ const ReportTable = (props) => { key={i} className="text-sm font-medium" > - {props.ReportName === "Templates" && ( + {isTemplateReport && ( <td className="text-[12px] p-2 pl-3 w-[30%]"> {x.Role && x.Role} </td> @@ -2147,13 +2163,9 @@ const ReportTable = (props) => { <ModalUi isOpen title={t("resend-mail")} - handleClose={() => { - setIsResendMail({}); - setIsNextStep({}); - setUserDetails({}); - }} + handleClose={handleResendClose} > - <div className=" overflow-y-auto max-h-[340px] md:max-h-[400px]"> + <div className="overflow-y-auto max-h-[340px] md:max-h-[400px]"> {item?.Placeholders?.map((user) => ( <React.Fragment key={user.Id}> {isNextStep[user.Id] && ( @@ -2255,7 +2267,7 @@ const ReportTable = (props) => { isOpen={isModal["rename_" + item.objectId]} handleClose={handleCloseModal} > - <div className=" flex flex-col px-4 pb-3 pt-2 "> + <div className="flex flex-col px-4 pb-3 pt-2"> <div className="flex flex-col gap-2"> <input maxLength={200} diff --git a/apps/OpenSignServer/Utils.js b/apps/OpenSignServer/Utils.js index af86dd93e2..e4c812ac90 100644 --- a/apps/OpenSignServer/Utils.js +++ b/apps/OpenSignServer/Utils.js @@ -7,6 +7,9 @@ dotenv.config(); export const cloudServerUrl = 'http://localhost:8080/app'; export const appName = 'OpenSign™'; +export const MAX_NAME_LENGTH = 250; +export const MAX_NOTE_LENGTH = 200; +export const MAX_DESCRIPTION_LENGTH = 500; export const color = [ '#93a3db', '#e6c3db', diff --git a/apps/OpenSignServer/cloud/parsefunction/DocumentBeforesave.js b/apps/OpenSignServer/cloud/parsefunction/DocumentBeforesave.js index 75d39cc3d5..255c7b107d 100644 --- a/apps/OpenSignServer/cloud/parsefunction/DocumentBeforesave.js +++ b/apps/OpenSignServer/cloud/parsefunction/DocumentBeforesave.js @@ -1,6 +1,24 @@ +import { MAX_DESCRIPTION_LENGTH, MAX_NAME_LENGTH, MAX_NOTE_LENGTH } from '../../Utils.js'; + async function DocumentBeforesave(request) { if (!request.original) { - const TimeToCompleteDays = request.object.get('TimeToCompleteDays') || 15; + const validations = [ + { field: 'Name', max: MAX_NAME_LENGTH }, + { field: 'Note', max: MAX_NOTE_LENGTH }, + { field: 'Description', max: MAX_DESCRIPTION_LENGTH }, + ]; + + for (const { field, max } of validations) { + const value = request?.object?.get(field); + if (value && value.length > max) { + throw new Parse.Error( + Parse.Error.VALIDATION_ERROR, + `The "${field}" field must be at most ${max} characters long.` + ); + } + } + + const TimeToCompleteDays = request?.object?.get('TimeToCompleteDays') || 15; const RemindOnceInEvery = request?.object?.get('RemindOnceInEvery') || 5; const AutoReminder = request?.object?.get('AutomaticReminders') || false; const reminderCount = TimeToCompleteDays / RemindOnceInEvery; @@ -36,7 +54,6 @@ async function DocumentBeforesave(request) { } if (document?.get('Signers') && document.get('Signers').length > 0) { document.set('DocSentAt', new Date()); - document.save(null, { useMasterKey: true }); } } } catch (err) { diff --git a/apps/OpenSignServer/cloud/parsefunction/GetTemplate.js b/apps/OpenSignServer/cloud/parsefunction/GetTemplate.js index 648a927c97..f1d0f80090 100644 --- a/apps/OpenSignServer/cloud/parsefunction/GetTemplate.js +++ b/apps/OpenSignServer/cloud/parsefunction/GetTemplate.js @@ -1,112 +1,82 @@ import axios from 'axios'; -import { - cloudServerUrl, -} from '../../Utils.js'; +import { cloudServerUrl } from '../../Utils.js'; export default async function GetTemplate(request) { const serverUrl = cloudServerUrl; //process.env.SERVER_URL; const templateId = request.params.templateId; - const ispublic = request.params.ispublic; const sessiontoken = request.headers?.sessiontoken; try { - if (!ispublic) { - let userEmail; - if (sessiontoken) { - const userRes = await axios.get(serverUrl + '/users/me', { - headers: { - 'X-Parse-Application-Id': process.env.APP_ID, - 'X-Parse-Session-Token': sessiontoken, - }, - }); - userEmail = userRes.data && userRes.data.email; - } - if (templateId && userEmail) { - try { - let template = new Parse.Query('contracts_Template'); - template.equalTo('objectId', templateId); - template.include('ExtUserPtr'); - template.include('Signers'); - template.include('CreatedBy'); - template.include('ExtUserPtr.TenantId'); - template.include('Bcc'); - const extUserQuery = new Parse.Query('contracts_Users'); - extUserQuery.equalTo('Email', userEmail); - extUserQuery.include('TeamIds'); - const extUser = await extUserQuery.first({ useMasterKey: true }); - if (extUser) { - const _extUser = JSON.parse(JSON.stringify(extUser)); - if (_extUser?.TeamIds && _extUser.TeamIds?.length > 0) { - let teamsArr = []; - _extUser?.TeamIds?.forEach(x => (teamsArr = [...teamsArr, ...x.Ancestors])); - // Create the first query - const sharedWithQuery = new Parse.Query('contracts_Template'); - sharedWithQuery.containedIn('SharedWith', teamsArr); - - // Create the second query - const createdByQuery = new Parse.Query('contracts_Template'); - createdByQuery.equalTo('ExtUserPtr', { - __type: 'Pointer', - className: 'contracts_Users', - objectId: extUser.id, - }); - template = Parse.Query.or(sharedWithQuery, createdByQuery); - template.equalTo('objectId', templateId); - template.include('ExtUserPtr'); - template.include('Signers'); - template.include('CreatedBy'); - template.include('ExtUserPtr.TenantId'); - template.include('Placeholders.signerPtr'); - template.include('Bcc'); - } - } - const res = await template.first({ useMasterKey: true }); - if (res) { - const templateRes = JSON.parse(JSON.stringify(res)); - delete templateRes?.ExtUserPtr?.TenantId?.FileAdapters; - delete templateRes?.ExtUserPtr?.TenantId?.PfxFile; - return templateRes; - } else { - return { error: "You don't have access of this document!" }; - } - } catch (err) { - console.log('err', err); - return err; - } - } else { - return { error: "You don't have access of this document!" }; - } - } else if (templateId && ispublic) { + let userEmail; + if (sessiontoken) { + const userRes = await axios.get(serverUrl + '/users/me', { + headers: { + 'X-Parse-Application-Id': process.env.APP_ID, + 'X-Parse-Session-Token': sessiontoken, + }, + }); + userEmail = userRes.data && userRes.data.email; + } + if (templateId && userEmail) { try { - const template = new Parse.Query('contracts_Template'); + let template = new Parse.Query('contracts_Template'); template.equalTo('objectId', templateId); template.include('ExtUserPtr'); template.include('Signers'); template.include('CreatedBy'); template.include('ExtUserPtr.TenantId'); template.include('Bcc'); + const extUserQuery = new Parse.Query('contracts_Users'); + extUserQuery.equalTo('Email', userEmail); + extUserQuery.include('TeamIds'); + const extUser = await extUserQuery.first({ useMasterKey: true }); + if (extUser) { + const _extUser = JSON.parse(JSON.stringify(extUser)); + if (_extUser?.TeamIds && _extUser.TeamIds?.length > 0) { + let teamsArr = []; + _extUser?.TeamIds?.forEach(x => (teamsArr = [...teamsArr, ...x.Ancestors])); + // Create the first query + const sharedWithQuery = new Parse.Query('contracts_Template'); + sharedWithQuery.containedIn('SharedWith', teamsArr); + + // Create the second query + const createdByQuery = new Parse.Query('contracts_Template'); + createdByQuery.equalTo('ExtUserPtr', { + __type: 'Pointer', + className: 'contracts_Users', + objectId: extUser.id, + }); + template = Parse.Query.or(sharedWithQuery, createdByQuery); + template.equalTo('objectId', templateId); + template.include('ExtUserPtr'); + template.include('Signers'); + template.include('CreatedBy'); + template.include('ExtUserPtr.TenantId'); + template.include('Placeholders.signerPtr'); + template.include('Bcc'); + } + } const res = await template.first({ useMasterKey: true }); - // console.log("res ", res) if (res) { const templateRes = JSON.parse(JSON.stringify(res)); delete templateRes?.ExtUserPtr?.TenantId?.FileAdapters; delete templateRes?.ExtUserPtr?.TenantId?.PfxFile; return templateRes; } else { - return { error: "You don't have access of this document!" }; + return { error: "You don't have access of this template!" }; } } catch (err) { console.log('err', err); return err; } } else { - return { error: 'Please pass required parameters!' }; + return { error: "You don't have access of this template!" }; } } catch (err) { console.log('err', err); if (err?.response?.data?.code === 209 || err.code == 209) { return { error: 'Invalid session token' }; } else { - return { error: "You don't have access of this document!" }; + return { error: "You don't have access of this template!" }; } } } diff --git a/apps/OpenSignServer/cloud/parsefunction/SendMailOTPv1.js b/apps/OpenSignServer/cloud/parsefunction/SendMailOTPv1.js index e60dbafa0a..4054898226 100644 --- a/apps/OpenSignServer/cloud/parsefunction/SendMailOTPv1.js +++ b/apps/OpenSignServer/cloud/parsefunction/SendMailOTPv1.js @@ -19,7 +19,6 @@ async function getDocument(docId) { } async function sendMailOTPv1(request) { try { - //--for elearning app side let code = Math.floor(1000 + Math.random() * 9000); let email = request.params.email; let TenantId = request.params.TenantId ? request.params.TenantId : undefined; @@ -30,14 +29,14 @@ async function sendMailOTPv1(request) { const mailsender = smtpenable ? process.env.SMTP_USER_EMAIL : process.env.MAILGUN_SENDER; try { await Parse.Cloud.sendEmail({ - from: AppName + ' <' + mailsender + '>', + sender: AppName + ' <' + mailsender + '>', recipient: recipient, subject: `Your ${AppName} OTP`, - text: 'This email is a test.', + text: 'otp email', html: - `<html><head><meta http-equiv='Content-Type' content='text/html; charset=UTF-8' /></head><body><div style='background-color:#f5f5f5;padding:20px'><div style='box-shadow: rgba(0, 0, 0, 0.1) 0px 4px 12px;background-color:white;'><div style='background-color:red;padding:2px;font-family:system-ui; background-color:#47a3ad;'> <p style='font-size:20px;font-weight:400;color:white;padding-left:20px',>OTP Verification</p></div><div style='padding:20px'><p style='font-family:system-ui;font-size:14px'>Your OTP for ${AppName} verification is:</p><p style=' text-decoration: none; font-weight: bolder; color:blue;font-size:45px;margin:20px'>` + + `<html><head><meta http-equiv='Content-Type' content='text/html;charset=UTF-8' /></head><body><div style='background-color:#f5f5f5;padding:20px'><div style='background-color:white;'><div style='background-color:red;padding:2px;font-family:system-ui;background-color:#47a3ad;'><p style='font-size:20px;font-weight:400;color:white;padding-left:20px;'>OTP Verification</p></div><div style='padding:20px;'><p style='font-family:system-ui;font-size:14px;'>Your OTP for ${AppName} verification is:</p><p style='text-decoration:none;font-weight:bolder;color:blue;font-size:45px;margin:20px;'>` + code + - '</p></div> </div> </div></body></html>', + '</p></div></div></div></body></html>', }); console.log('OTP sent', code); if (request.params?.docId) { diff --git a/apps/OpenSignServer/cloud/parsefunction/TemplateBeforesave.js b/apps/OpenSignServer/cloud/parsefunction/TemplateBeforesave.js index d38175e753..d12d272497 100644 --- a/apps/OpenSignServer/cloud/parsefunction/TemplateBeforesave.js +++ b/apps/OpenSignServer/cloud/parsefunction/TemplateBeforesave.js @@ -1,5 +1,23 @@ +import { MAX_DESCRIPTION_LENGTH, MAX_NAME_LENGTH, MAX_NOTE_LENGTH } from '../../Utils.js'; + async function TemplateBeforeSave(request) { if (!request.original) { + const validations = [ + { field: 'Name', max: MAX_NAME_LENGTH }, + { field: 'Note', max: MAX_NOTE_LENGTH }, + { field: 'Description', max: MAX_DESCRIPTION_LENGTH }, + ]; + + for (const { field, max } of validations) { + const value = request.object?.get(field); + if (value && value.length > max) { + throw new Parse.Error( + Parse.Error.VALIDATION_ERROR, + `The "${field}" field must be at most ${max} characters long.` + ); + } + } + const TimeToCompleteDays = request.object.get('TimeToCompleteDays') || 15; const RemindOnceInEvery = request?.object?.get('RemindOnceInEvery') || 5; const AutoReminder = request?.object?.get('AutomaticReminders') || false; diff --git a/apps/OpenSignServer/cloud/parsefunction/createBatchDocs.js b/apps/OpenSignServer/cloud/parsefunction/createBatchDocs.js index ab280c0e53..38ba3b30ef 100644 --- a/apps/OpenSignServer/cloud/parsefunction/createBatchDocs.js +++ b/apps/OpenSignServer/cloud/parsefunction/createBatchDocs.js @@ -182,6 +182,15 @@ async function batchQuery(userId, Documents, Ip, parseConfig, type, publicUrl) { ...(x?.RedirectUrl ? { RedirectUrl: x?.RedirectUrl } : {}), ...(mailBody ? { RequestBody: mailBody } : {}), ...(mailSubject ? { RequestSubject: mailSubject } : {}), + ...(x?.objectId + ? { + TemplateId: { + __type: 'Pointer', + className: 'contracts_Template', + objectId: x?.objectId, + }, + } + : {}), }, }; }); diff --git a/apps/OpenSignServer/cloud/parsefunction/reportsJson.js b/apps/OpenSignServer/cloud/parsefunction/reportsJson.js index 4a6c2d0d82..ad1b620cc1 100644 --- a/apps/OpenSignServer/cloud/parsefunction/reportsJson.js +++ b/apps/OpenSignServer/cloud/parsefunction/reportsJson.js @@ -25,9 +25,9 @@ export default function reportJson(id, userId) { 'Signers.Phone', 'Placeholders', 'IsSignyourself', + 'TemplateId', ], }; - // Need your sign report case '4Hhwbp482K': return { @@ -61,6 +61,7 @@ export default function reportJson(id, userId) { 'AuditTrail', 'Placeholders', 'SignedUrl', + 'TemplateId', 'ExpiryDate', ], }; @@ -94,6 +95,7 @@ export default function reportJson(id, userId) { 'SendMail', 'Placeholders', 'SignedUrl', + 'TemplateId', ], }; // completed documents report @@ -140,6 +142,7 @@ export default function reportJson(id, userId) { 'Placeholders', 'IsSignyourself', 'IsCompleted', + 'TemplateId', ], }; // declined documents report @@ -164,6 +167,7 @@ export default function reportJson(id, userId) { 'Placeholders', 'DeclineReason', 'SignedUrl', + 'TemplateId', ], }; // Expired Documents report @@ -190,6 +194,7 @@ export default function reportJson(id, userId) { 'Signers.Phone', 'Placeholders', 'SignedUrl', + 'TemplateId', 'ExpiryDate', ], }; @@ -221,6 +226,7 @@ export default function reportJson(id, userId) { 'ExpiryDate', 'Placeholders', 'SignedUrl', + 'TemplateId', ], }; // Recent signature requests report show on dashboard @@ -254,6 +260,7 @@ export default function reportJson(id, userId) { 'Signers.Phone', 'Placeholders', 'SignedUrl', + 'TemplateId', 'ExpiryDate', ], }; @@ -279,6 +286,7 @@ export default function reportJson(id, userId) { 'Signers.Email', 'Signers.Phone', 'Placeholders', + 'TemplateId', ], }; // contact book report diff --git a/apps/OpenSignServer/databases/migrations/20250411095519-add_templateid_field.cjs b/apps/OpenSignServer/databases/migrations/20250411095519-add_templateid_field.cjs new file mode 100644 index 0000000000..754c72d0da --- /dev/null +++ b/apps/OpenSignServer/databases/migrations/20250411095519-add_templateid_field.cjs @@ -0,0 +1,21 @@ +/** + * + * @param {Parse} Parse + */ +exports.up = async Parse => { + const className = 'contracts_Document'; + const schema = new Parse.Schema(className); + schema.addPointer('TemplateId', 'contracts_Template'); + return schema.update(); +}; + +/** + * + * @param {Parse} Parse + */ +exports.down = async Parse => { + const className = 'contracts_Document'; + const schema = new Parse.Schema(className); + schema.deleteField('TemplateId'); + return schema.update(); +}; diff --git a/apps/OpenSignServer/index.js b/apps/OpenSignServer/index.js index 0fdd1d8f59..1575f068b7 100644 --- a/apps/OpenSignServer/index.js +++ b/apps/OpenSignServer/index.js @@ -160,7 +160,7 @@ app.use(express.json({ limit: '50mb' })); app.use(express.urlencoded({ limit: '50mb', extended: true })); app.use(function (req, res, next) { req.headers['x-real-ip'] = getUserIP(req); - const publicUrl = req.protocol + '://' + req.get('host'); + const publicUrl = req?.protocol + '://' + req?.get('host'); req.headers['public_url'] = publicUrl; // process.env.PUBLIC_URL next(); });