mirror of
https://github.com/OpenSignLabs/OpenSign.git
synced 2026-09-03 08:18:50 +02:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8a2329dd60 | ||
|
|
75a40fbf43 | ||
|
|
334edb3c0c | ||
|
|
6465aa7c2c | ||
|
|
4593ce7fec | ||
|
|
b4ffdf0dc9 | ||
|
|
3c8b8835c7 | ||
|
|
20752161d3 | ||
|
|
002b0d5277 | ||
|
|
47348b990e | ||
|
|
ac86b6ef61 | ||
|
|
7894a6edb8 | ||
|
|
dac8957904 | ||
|
|
ef686aec6a | ||
|
|
f31155e0b4 | ||
|
|
78e4857d1a | ||
|
|
c3144366d9 | ||
|
|
f00a7c9e50 | ||
|
|
803d25e9d1 | ||
|
|
ca1b87309f | ||
|
|
0b4548130d | ||
|
|
e8b3c7fed8 | ||
|
|
2ce43ec2c8 | ||
|
|
a878ca1a96 |
@@ -241,6 +241,15 @@
|
||||
"contributions": [
|
||||
"translation"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "ehowe",
|
||||
"name": "Eugene Howe",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/756984?v=4",
|
||||
"profile": "https://github.com/ehowe",
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -21,34 +21,46 @@ jobs:
|
||||
dockerfile: apps/OpenSign/Dockerhubfile
|
||||
- image: opensign/opensignserver
|
||||
dockerfile: apps/OpenSignServer/Dockerhubfile
|
||||
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
-
|
||||
name: Login to Docker Hub
|
||||
|
||||
# 👇 Enable emulation so we can build for arm64 on amd64 runners
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v2
|
||||
with:
|
||||
platforms: linux/amd64,linux/arm64
|
||||
|
||||
# 👇 Enable Buildx for multi-arch builds
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v2
|
||||
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
-
|
||||
name: Extract metadata (tags, labels) for Docker
|
||||
|
||||
- name: Extract metadata (tags, labels) for Docker
|
||||
id: meta
|
||||
uses: docker/metadata-action@v4
|
||||
with:
|
||||
images: ${{ matrix.image }}
|
||||
-
|
||||
name: Debug - List files opensign
|
||||
|
||||
- name: Debug - List files opensign
|
||||
run: ls -R apps/OpenSign/ # Adjust the path as needed
|
||||
-
|
||||
name: Debug - List files opensignserver
|
||||
|
||||
- name: Debug - List files opensignserver
|
||||
run: ls -R apps/OpenSignServer/ # Adjust the path as needed
|
||||
-
|
||||
name: Build and push
|
||||
|
||||
- name: Build and push (multi-arch)
|
||||
uses: docker/build-push-action@v4
|
||||
with:
|
||||
context: .
|
||||
file: ${{ matrix.dockerfile }}
|
||||
push: true
|
||||
# 👇 Build for both AMD64 & ARM64
|
||||
platforms: linux/amd64,linux/arm64
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
|
||||
@@ -60,7 +60,7 @@ Welcome to OpenSign, the premier open source docusign alternative - document e-s
|
||||
- **PDF Template Creation:** OpenSign™ allows you to create and store PDF document templates for repeated use thereby saving you a lot of time & collect e-signatures seamlessly.
|
||||
- **OpenSign™ Drive:** It is a centralised secure vault for your digital documents that makes storing, signing, organizing, sharing & archieving your docs a breeze.
|
||||
- **Audit Trails & completion certificate:** Being a security focused solution, OpenSign™ makes it a top priority to save detailed logs for tracking document activities along with time-stamps, IP addresses, email IDs & phone numbers. A completion certificate is generated as soon as document is completed which contains all the document related logs for added safety.
|
||||
- **API Support:** OpenSign™ API allows seamless integration into existing systems and software. You can generate an API key from the app and refer the [official API docs](https://docs.opensignlabs.com/docs/API-docs/opensign-api-v-1) to start integrating it in your existing applications.
|
||||
- **API Support:** OpenSign™ API allows seamless integration into existing systems and software. You can generate an API key from the app and refer the [official API docs](https://docs.opensignlabs.com/docs/API-docs/v1.1) to start integrating it in your existing applications.
|
||||
- **Integrations:** The open source document signing experience becomes even more seamless because of integrations with various Cloud storage systems, CRMs & enterprise platforms. We also have a Zapier integration that allows you to integrate it with virtually any application.
|
||||
<img alt="Login page" src="https://github.com/OpenSignLabs/OpenSign/assets/171803164/8016edb6-7d6e-4185-ab72-82d2c4a16032" height='200' >
|
||||
<img alt="Dash_board" src="https://github.com/OpenSignLabs/OpenSign/assets/171803164/6e7b96f7-3154-4c25-bc1e-caf33925cc47" height='200'>
|
||||
@@ -165,6 +165,7 @@ We would like to thank all our contributors and users for their support and feed
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://github.com/daniel-mutwiri"><img src="https://avatars.githubusercontent.com/u/8936960?v=4?s=100" width="100px;" alt="Daniel Mutwiri"/><br /><sub><b>Daniel Mutwiri</b></sub></a><br /><a href="#code-daniel-mutwiri" title="Code">💻</a></td>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://github.com/Zathiel"><img src="https://avatars.githubusercontent.com/u/26553418?v=4?s=100" width="100px;" alt="Zathiel"/><br /><sub><b>Zathiel</b></sub></a><br /><a href="#code-Zathiel" title="Code">💻</a></td>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://github.com/1024mb"><img src="https://avatars.githubusercontent.com/u/9301204?v=4?s=100" width="100px;" alt="1024mb"/><br /><sub><b>1024mb</b></sub></a><br /><a href="#translation-1024mb" title="Translation">🌍</a></td>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://github.com/ehowe"><img src="https://avatars.githubusercontent.com/u/756984?v=4?s=100" width="100px;" alt="Eugene Howe"/><br /><sub><b>Eugene Howe</b></sub></a><br /><a href="#code-ehowe" title="Code">💻</a></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
@@ -21,9 +21,7 @@ const DisabledButtonExamples = () => {
|
||||
|
||||
{/* Option C: Conditional styling */}
|
||||
<button
|
||||
className={`op-btn op-btn-primary ${
|
||||
isDisabled ? "op-btn-vscode-disabled" : ""
|
||||
}`}
|
||||
className={`op-btn op-btn-primary ${isDisabled ? "op-btn-vscode-disabled" : ""}`}
|
||||
disabled={isDisabled}
|
||||
>
|
||||
Conditional Button
|
||||
|
||||
+27
-23
@@ -1,26 +1,26 @@
|
||||
{
|
||||
"name": "open_sign",
|
||||
"version": "2.26.0",
|
||||
"version": "2.32.0",
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@formkit/auto-animate": "^0.9.0",
|
||||
"@imgly/background-removal": "^1.7.0",
|
||||
"@lottiefiles/dotlottie-react": "^0.16.2",
|
||||
"@lottiefiles/dotlottie-react": "^0.17.8",
|
||||
"@pdf-lib/fontkit": "^1.1.1",
|
||||
"@radix-ui/themes": "^3.2.1",
|
||||
"@reduxjs/toolkit": "^2.8.2",
|
||||
"axios": "^1.12.2",
|
||||
"@reduxjs/toolkit": "^2.11.0",
|
||||
"axios": "^1.13.2",
|
||||
"date-fns-tz": "^3.2.0",
|
||||
"file-saver": "^2.0.5",
|
||||
"i18next": "^25.4.0",
|
||||
"i18next": "^25.7.1",
|
||||
"i18next-browser-languagedetector": "^8.2.0",
|
||||
"i18next-http-backend": "^3.0.2",
|
||||
"jszip": "^3.10.1",
|
||||
"jwt-decode": "^4.0.0",
|
||||
"moment": "^2.30.1",
|
||||
"parse": "^6.1.1",
|
||||
"parse": "^7.1.2",
|
||||
"pdf-lib": "^1.17.1",
|
||||
"pkijs": "^3.0.8",
|
||||
"pkijs": "^3.3.3",
|
||||
"print-js": "^1.6.0",
|
||||
"prismjs": "^1.30.0",
|
||||
"quill-html-edit-button": "^3.0.0",
|
||||
@@ -28,26 +28,26 @@
|
||||
"react": "^18.3.1",
|
||||
"react-bootstrap": "^2.10.10",
|
||||
"react-confetti": "^6.4.0",
|
||||
"react-datepicker": "^8.7.0",
|
||||
"react-datepicker": "^8.10.0",
|
||||
"react-dnd": "^16.0.1",
|
||||
"react-dnd-html5-backend": "^16.0.1",
|
||||
"react-dnd-multi-backend": "^9.0.0",
|
||||
"react-dnd-touch-backend": "^16.0.1",
|
||||
"react-dom": "^18.3.1",
|
||||
"react-gtm-module": "^2.0.11",
|
||||
"react-helmet": "^6.1.0",
|
||||
"react-i18next": "^15.7.4",
|
||||
"react-i18next": "^16.3.5",
|
||||
"react-konva": "^18.2.12",
|
||||
"react-pdf": "^9.2.1",
|
||||
"react-quill-new": "^3.6.0",
|
||||
"react-redux": "^9.2.0",
|
||||
"react-rnd": "^10.5.2",
|
||||
"react-router": "^7.9.3",
|
||||
"react-router": "^7.10.0",
|
||||
"react-scrollbars-custom": "^4.1.1",
|
||||
"react-select": "^5.10.2",
|
||||
"react-signature-canvas": "^1.1.0-alpha.2",
|
||||
"react-timezone-select": "^3.2.8",
|
||||
"react-tooltip": "^5.29.1",
|
||||
"react-to-print": "^3.2.0",
|
||||
"react-tooltip": "^5.30.0",
|
||||
"reactour": "^1.19.4",
|
||||
"redux": "^5.0.1",
|
||||
"regex-parser": "^2.3.1",
|
||||
@@ -96,34 +96,38 @@
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.28.3",
|
||||
"@babel/preset-env": "^7.28.3",
|
||||
"@babel/preset-react": "^7.27.1",
|
||||
"@babel/preset-react": "^7.28.5",
|
||||
"@babel/runtime-corejs2": "^7.28.3",
|
||||
"@testing-library/jest-dom": "^6.8.0",
|
||||
"@testing-library/react": "^16.3.0",
|
||||
"@testing-library/user-event": "^14.6.1",
|
||||
"@types/react": "^19.1.13",
|
||||
"@vitejs/plugin-react": "^4.7.0",
|
||||
"@vitest/ui": "^3.2.4",
|
||||
"autoprefixer": "^10.4.21",
|
||||
"@types/react": "^19.2.7",
|
||||
"@vitejs/plugin-react": "^5.1.1",
|
||||
"@vitest/ui": "^4.0.15",
|
||||
"autoprefixer": "^10.4.22",
|
||||
"babel-loader": "^10.0.0",
|
||||
"commitizen": "^4.3.1",
|
||||
"concurrently": "^9.2.1",
|
||||
"css-loader": "^7.1.2",
|
||||
"daisyui": "^4.12.24",
|
||||
"eslint": "^9.34.0",
|
||||
"eslint": "^9.39.1",
|
||||
"eslint-plugin-prettier": "^5.5.4",
|
||||
"eslint-plugin-react": "^7.37.5",
|
||||
"jsdom": "^27.0.0",
|
||||
"lint-staged": "^16.1.6",
|
||||
"jsdom": "^27.2.0",
|
||||
"lint-staged": "^16.2.7",
|
||||
"postcss": "^8.5.6",
|
||||
"prettier": "^3.6.2",
|
||||
"prettier": "^3.7.4",
|
||||
"pretty-quick": "^4.2.2",
|
||||
"rollup-plugin-node-polyfills": "^0.2.1",
|
||||
"tailwindcss": "^3.4.17",
|
||||
"vite": "^7.1.4",
|
||||
"tmp": "^0.2.5",
|
||||
"vite": "^7.2.6",
|
||||
"vite-plugin-svgr": "^4.5.0",
|
||||
"vite-tsconfig-paths": "^5.1.4",
|
||||
"vitest": "^3.2.4"
|
||||
"vitest": "^4.0.15"
|
||||
},
|
||||
"overrides": {
|
||||
"tmp": "$tmp"
|
||||
},
|
||||
"engines": {
|
||||
"node": "18 || 20 || 22"
|
||||
|
||||
@@ -71,6 +71,7 @@
|
||||
"login-page": "Anmeldeseite",
|
||||
"or": "ODER",
|
||||
"signup-page": "Registrierungsseite",
|
||||
"password-match-length": "Neues Passwort und Bestätigungspasswort sollten übereinstimmen",
|
||||
"password-length": "Das Passwort sollte 8 Zeichen lang sein",
|
||||
"password-case": "Das Passwort sollte einen Großbuchstaben, einen Kleinbuchstaben und eine Zahl enthalten",
|
||||
"password-special-char": "Das Passwort sollte ein Sonderzeichen enthalten",
|
||||
@@ -120,7 +121,8 @@
|
||||
"Teams": "Teams",
|
||||
"Team-update-successfully": "Team erfolgreich aktualisiert.",
|
||||
"Users": "Benutzer"
|
||||
}
|
||||
},
|
||||
"Global SMTP": "Globales SMTP"
|
||||
},
|
||||
"dashboard-card": {
|
||||
"Need your Signature": "Benötigt Ihre Unterschrift",
|
||||
@@ -166,7 +168,10 @@
|
||||
"Save as template": "Als Vorlage speichern",
|
||||
"Fix & resend": "Korrigieren und erneut senden",
|
||||
"Kiosk Mode": "Kiosk Modus",
|
||||
"Reset password": "Passwort zurücksetzen"
|
||||
"Reset password": "Passwort zurücksetzen",
|
||||
"View formdata": "Formulardaten ansehen",
|
||||
"Download all formdata": "Alle Formulardaten herunterladen",
|
||||
"API credits": "API-Credits"
|
||||
},
|
||||
"report-heading": {
|
||||
"Sr.No": "Nr.",
|
||||
@@ -201,7 +206,8 @@
|
||||
"Redirect url": "Weiterleitungs-URL",
|
||||
"Created Date": "Erstellungsdatum",
|
||||
"Updated Date": "Aktualisierungsdatum",
|
||||
"Expiry Date": "Ablaufdatum"
|
||||
"Expiry Date": "Ablaufdatum",
|
||||
"Sent Date": "Sendedatum"
|
||||
},
|
||||
"report-help": {
|
||||
"Draft Documents": "Dies sind Dokumente, die Sie begonnen, aber noch nicht zum Versenden fertiggestellt haben.",
|
||||
@@ -386,7 +392,8 @@
|
||||
"dropdown": "Dropdown",
|
||||
"radio button": "Radiobutton",
|
||||
"image": "Bild",
|
||||
"email": "E-Mail"
|
||||
"email": "E-Mail",
|
||||
"number": "Zahl"
|
||||
},
|
||||
"fields": "Felder",
|
||||
"recipients": "Empfänger",
|
||||
@@ -439,10 +446,23 @@
|
||||
"Next to current widget": "Neben dem aktuellen Widget"
|
||||
},
|
||||
"options": "Optionen",
|
||||
"minimun-check": "Minimale Anzahl",
|
||||
"minimum-check": "Minimale Anzahl",
|
||||
"maximum-check": "Maximale Anzahl",
|
||||
"cell-count": "Zellzahl",
|
||||
"default-value": "Standardwert",
|
||||
"formula": "Formel",
|
||||
"formula-placeholder": "Erstellen Sie eine Formel mit Zahlen-Widgets",
|
||||
"formula-no-widgets": "Für diesen Unterzeichner sind noch keine weiteren Zahlen-Widgets vorhanden.",
|
||||
"supported-operators": "Unterstützte Operatoren:",
|
||||
"formula-helper": "Klicken Sie auf einen Zahlen-Widget-Chip, um ihn einzufügen (z. B. {{number-1}} + {{number-2}}).",
|
||||
"formula-error-letter": "Widget-Namen müssen in doppelte geschweifte Klammern gesetzt werden (z. B. {{number-1}}).",
|
||||
"formula-error-characters": "Außerhalb der Klammern sind nur Zahlen sowie +, -, *, /, (, ) erlaubt.",
|
||||
"formula-error-braces": "Jede öffnende {{ muss eine passende }} haben.",
|
||||
"formula-error-operators": "Verwenden Sie bei Operatoren oder Klammern mindestens zwei Werte.",
|
||||
"formula-error-leading-operator": "Formeln dürfen nicht mit Operatoren beginnen.",
|
||||
"decimal-places": "Dezimalstellen",
|
||||
"number-of-decimal-places": "Anzahl der Dezimalstellen",
|
||||
"decimal-places-helper": "Auf 0 setzen für ganze Zahlen",
|
||||
"select": "Auswählen",
|
||||
"read-only": "Ist schreibgeschützt",
|
||||
"hide-labels": "Labels ausblenden",
|
||||
@@ -684,7 +704,7 @@
|
||||
"select-date-format": "Wählen Sie ein Datumsformat",
|
||||
"quantity-of-credits": "Anzahl der Premium-Credits",
|
||||
"remaining-credits": "Verfügbare Premium-Credits:",
|
||||
"remaining-credits-help": "Verwenden Sie Premium-Credits für API-Dokumentensignaturen, Massenversand oder die Einbettung der OpenSign-Integration auf Ihrer Website. Sie haben {{allowedcredits}} enthaltene Credits und {{addoncredits}} zusätzlich gekaufte Credits übrig.",
|
||||
"remaining-credits-help": "Verwenden Sie Premium-Credits für die API-Dokumentensignatur, den Massenversand oder die Einbettung der OpenSign-Integration auf Ihrer Website. Sie haben noch {{allowedcredits}} inkludierte Credits und {{addoncredits}} zusätzlich gekaufte Credits übrig. Wenn Sie einen Teams- oder Enterprise-Plan nutzen, können diese Credits von allen Benutzern in Ihrem Unternehmen gemeinsam verwendet werden, sofern der Kontoadministrator für Ihr Konto kein Limit festgelegt hat.",
|
||||
"additional-credits": "Bitte kaufen Sie Premium-Credits hinzu",
|
||||
"quota-err-quicksend": "Kontingent erreicht, Sie haben nicht genügend Credits.",
|
||||
"buy-credits": "Premium-Credits kaufen",
|
||||
@@ -1242,5 +1262,51 @@
|
||||
"Please provide required parameters.": "Bitte geben Sie die erforderlichen Parameter an.",
|
||||
"reset-password": "Benutzerpasswort zurücksetzen",
|
||||
"enter-strong-password": "Geben Sie ein sicheres Passwort ein oder generieren Sie eines automatisch.",
|
||||
"autogenerate": "Automatisch generieren"
|
||||
"autogenerate": "Automatisch generieren",
|
||||
"extend": "Verlängern",
|
||||
"console-general-help": "Um einzelnen Benutzern zu ermöglichen, ihre eigenen E-Mail-Vorlagen anzupassen, navigieren Sie zu",
|
||||
"console-mail-help": "Um unternehmensweite E-Mail-Vorlagen zu aktualisieren, gehen Sie zu",
|
||||
"admin-setting-disabled": "Diese Einstellung ist deaktiviert. Bitte wenden Sie sich für Unterstützung an den Administrator.",
|
||||
"company-email-settings": "Unternehmens-E-Mail-Einstellungen",
|
||||
"allow-email-template-individually": "E-Mail-Vorlagenanpassung für Benutzer individuell erlauben ",
|
||||
"user-email-template-general-help": "Wenn diese Option deaktiviert ist, können Benutzer ihre E-Mail-Vorlagen nicht mehr anpassen.",
|
||||
"disable-individual-user-smtp": "individuelle benutzer-smtp-einstellungen deaktivieren",
|
||||
"enable-individual-user-smtp": "individuelle benutzer-smtp-einstellungen aktivieren",
|
||||
"user-smtp-general-help": "Wenn deaktiviert, können Benutzer ihre eigenen SMTP-Einstellungen nicht konfigurieren. Alle E-Mails verwenden dann die globale SMTP-Konfiguration.",
|
||||
"global-smtp-settings": "Globale SMTP-Einstellungen",
|
||||
"global-smtp-settings-help-p1": "Diese Einstellungen gelten global für Ihr gesamtes {{appName}}-Konto. Wenn ein Benutzer keine eigenen E-Mail-Zustellungseinstellungen konfiguriert hat, verwendet das System automatisch die hier definierten globalen SMTP-Einstellungen.",
|
||||
"global-smtp-settings-help-p2": "Um eine bessere Zustellbarkeit aller Signaturanfragen sicherzustellen, können Sie Ihren bevorzugten E-Mail-Anbieter verbinden. Wählen Sie eine der folgenden Optionen:",
|
||||
"global-connect-to-gmail-help": "Verwenden Sie ein Gmail-Konto, um Signaturanfragen direkt aus dem Posteingang Ihrer Organisation zu senden. Dies verbessert die Zustellrate, Reputation und Zuverlässigkeit.",
|
||||
"global-connect-to-smtp-help": "Verwenden Sie Ihren eigenen SMTP-Server, um E-Mails über Ihre Domain zu senden. Dies bietet volle Kontrolle über Ihre E-Mail-Infrastruktur, verbessert die Zustellbarkeit und sorgt für konsistentes Branding.",
|
||||
"global-smtp-settings-help-p3": "Wenn keine individuellen Benutzereinstellungen konfiguriert sind, werden automatisch diese globalen Einstellungen angewendet.",
|
||||
"hide-text-with-asterisks": "Text mit Sternchen ausblenden",
|
||||
"hide-text-with-asterisks-help": "Der Text im unterzeichneten Dokument wird ausgeblendet, bleibt jedoch für den Dokumentabsender (Eigentümer) über sein {{appName}}-Konto zugänglich.",
|
||||
"document-id": "Dokument-ID",
|
||||
"sent-date": "Sendedatum",
|
||||
"status": "Status",
|
||||
"signer-form-data-for": "Formulardaten für Unterzeichner: {{signerName}} <{{signerEmail}}>",
|
||||
"widget-name": "Widget-Name",
|
||||
"widget-responses": "Widget-Antworten",
|
||||
"formdata-download-note": "Hinweis: Signaturen, Stempel, Initialen und Bilder werden nicht exportiert.",
|
||||
"export-all-formdata-error": "Sie können die Formulardaten nicht exportieren, da die Vorlage doppelte Widget-Namen enthält. Bitte erstellen Sie eine neue Vorlage, um Formulardaten exportieren zu können.",
|
||||
"export-formdata-error": "Sie können die Formulardaten nicht exportieren, da das Dokument doppelte Widget-Namen enthält. Bitte erstellen Sie ein neues Dokument ohne doppelte Widget-Namen, um Formulardaten exportieren zu können.",
|
||||
"duplicate-widget-name-error": "Dieser Widget-Name ist bereits einem anderen Unterzeichner zugewiesen. Bitte wählen Sie einen anderen Namen.",
|
||||
"duplicate-template-widget-error": "Sie können diese Vorlage nicht duplizieren, da sie doppelte Widget-Namen enthält.",
|
||||
"credit-alert": "Kreditwarnung",
|
||||
"document-form-data": "Dokumenten-Formulardaten",
|
||||
"view-formdata-paid-title-error": "Die Funktion 'Formulardaten anzeigen' ermöglicht es Ihnen, die von Unterzeichnern ausgefüllten Widget-Daten auszudrucken und herunterzuladen.",
|
||||
"view-formdata-paid-error": "Hinweis: Die Funktion 'Formulardaten anzeigen' ist nur für Dokumente verfügbar, die ab Version v2.32.0 erstellt wurden und keine doppelten Widget-Namen enthalten.",
|
||||
"download-all-formdata-paid-title-error": "Die Funktion 'Alle Formulardaten herunterladen' ermöglicht es Ihnen, die von Unterzeichnern ausgefüllten Widget-Daten für alle aus der Vorlage erstellten Dokumente herunterzuladen.",
|
||||
"download-all-formdata-paid-error": "Hinweis: Die Funktion 'Alle Formulardaten herunterladen' ist nur für Vorlagen verfügbar, die ab Version v2.32.0 erstellt wurden und keine doppelten Widget-Namen enthalten.",
|
||||
"api-token-not-found": "API-Token nicht gefunden.",
|
||||
"sub-head-api-credits": "Legen Sie die maximale Anzahl von API-Credits fest, die dieser Benutzer verbrauchen darf.",
|
||||
"consumed-credits": "Verbrauchte Credits",
|
||||
"allowed-api-credits": "Zulässige API-Credits",
|
||||
"allowed-api-credits-help": "Die zulässigen Credits sollten größer oder gleich den verbrauchten Credits sein.",
|
||||
"Enter-allowed-api-credits": "Zulässige API-Credits eingeben",
|
||||
"login-to-sandbox": "Im Sandbox-Modus anmelden",
|
||||
"your-credits-usage": "Ihr Kreditverbrauch",
|
||||
"remaining": "verbleibend",
|
||||
"used": "verwendet",
|
||||
"your-credits-usage-help": "Dies ist die Anzahl der Credits, die mit Ihrem API-Schlüssel verbraucht wurden."
|
||||
}
|
||||
@@ -71,6 +71,7 @@
|
||||
"login-page": "Login P+age",
|
||||
"or": "OR",
|
||||
"signup-page": "Signup page",
|
||||
"password-match-length": "New password and confirmation password should match",
|
||||
"password-length": "Password should be 8 characters long",
|
||||
"password-case": "Password should contain uppercase letter, lowercase letter, digit",
|
||||
"password-special-char": " Password should contain special character",
|
||||
@@ -120,7 +121,8 @@
|
||||
"Teams": "Teams",
|
||||
"Team-update-successfully": "Team Updated successfully.",
|
||||
"Users": "Users"
|
||||
}
|
||||
},
|
||||
"Global SMTP": "Global SMTP"
|
||||
},
|
||||
"dashboard-card": {
|
||||
"Need your Signature": "Need your signature",
|
||||
@@ -166,7 +168,10 @@
|
||||
"Save as template": "Save as template",
|
||||
"Fix & resend": "Fix & Resend",
|
||||
"Kiosk Mode": "Kiosk Mode",
|
||||
"Reset password": "Reset password"
|
||||
"Reset password": "Reset password",
|
||||
"View formdata": "View formdata",
|
||||
"Download all formdata": "Download all formdata",
|
||||
"API credits": "API credits"
|
||||
},
|
||||
"report-heading": {
|
||||
"Sr.No": "Sr.No",
|
||||
@@ -201,7 +206,8 @@
|
||||
"Redirect url": "Redirect url",
|
||||
"Created Date": "Created Date",
|
||||
"Updated Date": "Updated Date",
|
||||
"Expiry Date": "Expiry Date"
|
||||
"Expiry Date": "Expiry Date",
|
||||
"Sent Date": "Sent Date"
|
||||
},
|
||||
"report-help": {
|
||||
"Draft Documents": "These are documents you have started but have not finalized for sending.",
|
||||
@@ -386,7 +392,8 @@
|
||||
"dropdown": "dropdown",
|
||||
"radio button": "radio button",
|
||||
"image": "image",
|
||||
"email": "email"
|
||||
"email": "email",
|
||||
"number": "number"
|
||||
},
|
||||
"fields": "Fields",
|
||||
"recipients": "Recipients",
|
||||
@@ -440,10 +447,23 @@
|
||||
"Next to current widget": "Next to current widget"
|
||||
},
|
||||
"options": "Options",
|
||||
"minimun-check": "Minimun check",
|
||||
"minimum-check": "Minimum check",
|
||||
"maximum-check": "Maximum check",
|
||||
"cell-count": "Cell count",
|
||||
"default-value": "Default value",
|
||||
"formula": "Formula",
|
||||
"formula-placeholder": "Build a formula using number widgets",
|
||||
"formula-no-widgets": "No other number widgets are assigned to this signer yet.",
|
||||
"supported-operators": "Supported operators:",
|
||||
"formula-helper": "Click a number widget chip to insert it (e.g. {{number-1}} + {{number-2}}).",
|
||||
"formula-error-letter": "Wrap widget names in double curly braces (e.g. {{number-1}}).",
|
||||
"formula-error-characters": "Only numbers and +, -, *, /, (, ) are allowed outside of braces.",
|
||||
"formula-error-braces": "Each opening {{ must have a matching }}.",
|
||||
"formula-error-operators": "Add at least two values when using operators or parentheses.",
|
||||
"formula-error-leading-operator": "Formulas cannot start with operators.",
|
||||
"decimal-places": "Decimal Places",
|
||||
"number-of-decimal-places": "Number of decimal places",
|
||||
"decimal-places-helper": "Set to 0 for whole numbers",
|
||||
"select": "Select",
|
||||
"read-only": "read only",
|
||||
"hide-labels": "Hide labels",
|
||||
@@ -685,7 +705,7 @@
|
||||
"select-date-format": "Select a date format",
|
||||
"quantity-of-credits": "Quantity of premium credits",
|
||||
"remaining-credits": "Premium credits available:",
|
||||
"remaining-credits-help": "Use premium credits for API document signing, bulk sending, or embedding OpenSign integration on your website. You have {{allowedcredits}} included credits and {{addoncredits}} additional purchased credits remaining.",
|
||||
"remaining-credits-help": "Use premium credits for API document signing, bulk sending, or embedding OpenSign integration on your website. You have {{allowedcredits}} included credits and {{addoncredits}} additional purchased credits remaining. If you are on Teams or enterprise plan these are the credits that could be shared across all users in your company unless there is a limit set by the account admin for your account.",
|
||||
"additional-credits": "Please purchase premium credits",
|
||||
"quota-err-quicksend": "Quota reached, you don't have enough credits.",
|
||||
"buy-credits": "Buy premium credits",
|
||||
@@ -1243,5 +1263,51 @@
|
||||
"Please provide required parameters.": "Please provide required parameters.",
|
||||
"reset-password": "Reset User Password",
|
||||
"enter-strong-password": "Enter a strong password or auto-generate one.",
|
||||
"autogenerate": "Autogenerate"
|
||||
"autogenerate": "Autogenerate",
|
||||
"extend": "Extend",
|
||||
"console-general-help": "To let individual users customize their own email templates, navigate to",
|
||||
"console-mail-help": "To update company-wide email templates, go to",
|
||||
"admin-setting-disabled": "This setting is disabled. Please contact admin for assistance.",
|
||||
"company-email-settings": "Company email settings",
|
||||
"allow-email-template-individually": "Allow email template customization for users individually ",
|
||||
"user-email-template-general-help": "Disabling this will prevent users from customizing their email templates.",
|
||||
"disable-individual-user-smtp": "Disable individual user smtp settings",
|
||||
"enable-individual-user-smtp": "Enable individual user smtp settings",
|
||||
"user-smtp-general-help": "When disabled, users will not be able to configure their own SMTP settings. All emails will use the global SMTP configuration instead.",
|
||||
"global-smtp-settings": "Global SMTP Settings",
|
||||
"global-smtp-settings-help-p1": "These settings apply globally across your entire {{appName}} account. If an individual user has not configured their own email delivery settings, the system will automatically use the Global SMTP Settings defined here.",
|
||||
"global-smtp-settings-help-p2": "To ensure better inbox deliverability for all signature request emails, you can connect your preferred email provider. Choose one of the following options:",
|
||||
"global-connect-to-gmail-help": "Use a Gmail account to send signature request emails directly from your organization's inbox. This improves delivery rates, reputation, and overall reliability.",
|
||||
"global-connect-to-smtp-help": "Use your own SMTP server to send emails through your domain. This provides full control over your email infrastructure, enhances deliverability, and maintains consistent branding.",
|
||||
"global-smtp-settings-help-p3": "If no individual user-level settings are configured, these global settings will be applied automatically.",
|
||||
"hide-text-with-asterisks": "Hide text with asterisks",
|
||||
"hide-text-with-asterisks-help": "The text on the signed document will be concealed from view but remain accessible to the document sender (owner) from their {{appName}} account.",
|
||||
"document-id": "Document ID",
|
||||
"sent-date": "Sent Date",
|
||||
"status": "Status",
|
||||
"signer-form-data-for": "Signer Form data for: {{signerName}} <{{signerEmail}}>",
|
||||
"widget-name": "Widget Name",
|
||||
"widget-responses": "Widget Responses",
|
||||
"formdata-download-note": "Note: Signatures, stamps, initials and images wont be exported.",
|
||||
"export-all-formdata-error": "You can/t export form data because the template contains duplicate widget names. Please create a fresh template to be able to export form data.",
|
||||
"export-formdata-error": "You can't export form data because the document contains duplicate widget names. Please create a fresh document without duplicate widget names to be able to export form data.",
|
||||
"duplicate-widget-name-error": "This widget name is already assigned to another signer. Please choose a different name.",
|
||||
"duplicate-template-widget-error": "You can't duplicate this template because it contains duplicate widget names.",
|
||||
"credit-alert": "Credit Alert",
|
||||
"document-form-data": "Document Form Data",
|
||||
"view-formdata-paid-title-error": "The View Form Data feature lets you print and download the widget data filled in by signers while signing.",
|
||||
"view-formdata-paid-error": "Note: 'View Formdata' feature is only available for documents created on or after v2.32.0 that do not contain duplicate widget names.",
|
||||
"download-all-formdata-paid-title-error": "The Download All Form Data feature lets you download widget data filled in by signers for all documents created from the template.",
|
||||
"download-all-formdata-paid-error": "Note: 'Download All Formdata' feature is only available for templates created on or after v2.32.0 that do not contain duplicate widget names.",
|
||||
"api-token-not-found": "API token not found.",
|
||||
"sub-head-api-credits": " Define the maximum number of API credits this user is allowed to consume.",
|
||||
"consumed-credits": "Consumed credits",
|
||||
"allowed-api-credits": "Allowed API credits",
|
||||
"allowed-api-credits-help": "The allowed credits should be greater than or equal to the consumed credits.",
|
||||
"Enter-allowed-api-credits": "Enter allowed API credits",
|
||||
"login-to-sandbox": "Login to sandbox",
|
||||
"your-credits-usage": "Your credits usage",
|
||||
"remaining": "remaining",
|
||||
"used": "used",
|
||||
"your-credits-usage-help": "This is the number of credits consumed with your API key."
|
||||
}
|
||||
@@ -71,6 +71,7 @@
|
||||
"login-page": "Página de inicio de sesión",
|
||||
"or": "O",
|
||||
"signup-page": "Página de registro",
|
||||
"password-match-length": "La nueva contraseña y la confirmación deben coincidir",
|
||||
"password-length": "La contraseña debe tener 8 caracteres",
|
||||
"password-case": "La contraseña debe incluir mayúsculas, minúsculas y números",
|
||||
"password-special-char": " La contraseña debe incluir caracteres especiales",
|
||||
@@ -120,7 +121,8 @@
|
||||
"Teams": "Equipos",
|
||||
"Team-update-successfully": "Equipo actualizado correctamente.",
|
||||
"Users": "Usuarios"
|
||||
}
|
||||
},
|
||||
"Global SMTP": "SMTP Global"
|
||||
},
|
||||
"dashboard-card": {
|
||||
"Need your Signature": "Necesitan tu firma",
|
||||
@@ -166,7 +168,10 @@
|
||||
"Save as template": "Guardar como plantilla",
|
||||
"Fix & resend": "Corregir y reenviar",
|
||||
"Kiosk Mode": "Modo Kiosco",
|
||||
"Reset password": "Restablecer contraseña"
|
||||
"Reset password": "Restablecer contraseña",
|
||||
"View formdata": "Ver datos del formulario",
|
||||
"Download all formdata": "Descargar todos los datos del formulario",
|
||||
"API credits": "Créditos de API"
|
||||
},
|
||||
"report-heading": {
|
||||
"Sr.No": "Nº",
|
||||
@@ -201,7 +206,8 @@
|
||||
"Redirect url": "URL de redirección",
|
||||
"Created Date": "Fecha de creación",
|
||||
"Updated Date": "Fecha de actualización",
|
||||
"Expiry Date": "Fecha de vencimiento"
|
||||
"Expiry Date": "Fecha de vencimiento",
|
||||
"Sent Date": "Fecha de envío"
|
||||
},
|
||||
"report-help": {
|
||||
"Draft Documents": "Estos son documentos que has iniciado pero no has finalizado para su envío.",
|
||||
@@ -386,7 +392,8 @@
|
||||
"dropdown": "desplegable",
|
||||
"radio button": "botón de radio",
|
||||
"image": "imagen",
|
||||
"email": "correo"
|
||||
"email": "correo",
|
||||
"number": "número"
|
||||
},
|
||||
"fields": "Campos",
|
||||
"recipients": "Destinatarios",
|
||||
@@ -440,10 +447,23 @@
|
||||
"Next to current widget": "Junto al widget actual"
|
||||
},
|
||||
"options": "Opciones",
|
||||
"minimun-check": "Chequeo mínimo",
|
||||
"minimum-check": "Chequeo mínimo",
|
||||
"maximum-check": "Chequeo máximo",
|
||||
"cell-count": "recuento de células",
|
||||
"default-value": "Valor por defecto",
|
||||
"formula": "Fórmula",
|
||||
"formula-placeholder": "Crea una fórmula utilizando widgets numéricos",
|
||||
"formula-no-widgets": "Todavía no hay otros widgets numéricos asignados a este firmante.",
|
||||
"supported-operators": "Operadores compatibles:",
|
||||
"formula-helper": "Haz clic en una ficha de widget numérico para insertarla (p. ej. {{number-1}} + {{number-2}}).",
|
||||
"formula-error-letter": "Envuelve los nombres de los widgets entre dobles llaves (p. ej. {{number-1}}).",
|
||||
"formula-error-characters": "Fuera de las llaves solo se permiten números y +, -, *, /, (, ).",
|
||||
"formula-error-braces": "Cada {{ de apertura debe tener una }} correspondiente.",
|
||||
"formula-error-operators": "Cuando uses operadores o paréntesis, agrega al menos dos valores.",
|
||||
"formula-error-leading-operator": "Las fórmulas no pueden comenzar con operadores.",
|
||||
"decimal-places": "Decimales",
|
||||
"number-of-decimal-places": "Número de decimales",
|
||||
"decimal-places-helper": "Establecer en 0 para números enteros",
|
||||
"select": "Seleccionar",
|
||||
"read-only": "Es de solo lectura",
|
||||
"hide-labels": "Esconder etiquetas",
|
||||
@@ -685,7 +705,7 @@
|
||||
"select-date-format": "Selecciona un formato de fecha",
|
||||
"quantity-of-credits": "Cantidad de créditos premium",
|
||||
"remaining-credits": "Créditos premium disponibles:",
|
||||
"remaining-credits-help": "Usa créditos premium para la API para la firma de documentos, envío en masa, o para incorporar la integración de OpenSign en tu página web. Te quedan {{allowedcredits}} créditos incluidos y {{addoncredits}} créditos comprados adicionalmente.",
|
||||
"remaining-credits-help": "Utilice créditos premium para la firma de documentos mediante API, el envío masivo o para integrar OpenSign en su sitio web. Le quedan {{allowedcredits}} créditos incluidos y {{addoncredits}} créditos adicionales comprados. Si está en un plan Teams o Enterprise, estos créditos pueden compartirse entre todos los usuarios de su empresa, a menos que el administrador de la cuenta haya establecido un límite para su cuenta.",
|
||||
"additional-credits": "Por favor, compra créditos premium",
|
||||
"quota-err-quicksend": "Cuota alcanzada, no tienes créditos suficientes.",
|
||||
"buy-credits": "Comprar créditos premium",
|
||||
@@ -1243,5 +1263,51 @@
|
||||
"Please provide required parameters.": "Por favor, proporcione los parámetros requeridos.",
|
||||
"reset-password": "Restablecer contraseña de usuario",
|
||||
"enter-strong-password": "Ingrese una contraseña segura o genere una automáticamente.",
|
||||
"autogenerate": "Generar automáticamente"
|
||||
"autogenerate": "Generar automáticamente",
|
||||
"extend": "Extender",
|
||||
"console-general-help": "Para permitir que los usuarios individuales personalicen sus propias plantillas de correo electrónico, vaya a",
|
||||
"console-mail-help": "Para actualizar las plantillas de correo electrónico de toda la empresa, vaya a",
|
||||
"admin-setting-disabled": "Esta configuración está deshabilitada. Comuníquese con el administrador para obtener ayuda.",
|
||||
"company-email-settings": "Configuración de correo electrónico de la empresa",
|
||||
"allow-email-template-individually": "Permitir la personalización individual de plantillas de correo electrónico para los usuarios ",
|
||||
"user-email-template-general-help": "Si se desactiva, los usuarios no podrán personalizar sus plantillas de correo electrónico.",
|
||||
"disable-individual-user-smtp": "desactivar la configuración smtp individual del usuario",
|
||||
"enable-individual-user-smtp": "activar la configuración smtp individual del usuario",
|
||||
"user-smtp-general-help": "Cuando está desactivado, los usuarios no podrán configurar su propio SMTP. Todos los correos utilizarán la configuración SMTP global.",
|
||||
"global-smtp-settings": "Configuración SMTP Global",
|
||||
"global-smtp-settings-help-p1": "Estas configuraciones se aplican globalmente en toda su cuenta de {{appName}}. Si un usuario no ha configurado sus propios ajustes de entrega de correo, el sistema utilizará automáticamente la configuración SMTP global definida aquí.",
|
||||
"global-smtp-settings-help-p2": "Para garantizar una mejor entregabilidad de todos los correos de solicitud de firma, puede conectar su proveedor de correo preferido. Elija una de las siguientes opciones:",
|
||||
"global-connect-to-gmail-help": "Use una cuenta de Gmail para enviar correos de solicitud de firma directamente desde la bandeja de entrada de su organización. Esto mejora la entregabilidad, la reputación y la fiabilidad.",
|
||||
"global-connect-to-smtp-help": "Use su propio servidor SMTP para enviar correos a través de su dominio. Esto proporciona control total sobre su infraestructura de correo, mejora la entregabilidad y mantiene la coherencia de marca.",
|
||||
"global-smtp-settings-help-p3": "Si no se configuran ajustes a nivel de usuario, se aplicarán automáticamente estos ajustes globales.",
|
||||
"hide-text-with-asterisks": "Ocultar texto con asteriscos",
|
||||
"hide-text-with-asterisks-help": "El texto en el documento firmado se ocultará, pero seguirá siendo accesible para el remitente (propietario) desde su cuenta de {{appName}}.",
|
||||
"document-id": "ID del documento",
|
||||
"sent-date": "Fecha de envío",
|
||||
"status": "Estado",
|
||||
"signer-form-data-for": "Datos del formulario para el firmante: {{signerName}} <{{signerEmail}}>",
|
||||
"widget-name": "Nombre del widget",
|
||||
"widget-responses": "Respuestas del widget",
|
||||
"formdata-download-note": "Nota: Las firmas, sellos, iniciales e imágenes no se exportarán.",
|
||||
"export-all-formdata-error": "No puede exportar los datos del formulario porque la plantilla contiene nombres de widgets duplicados. Cree una nueva plantilla para poder exportar los datos.",
|
||||
"export-formdata-error": "No puede exportar los datos del formulario porque el documento contiene nombres de widgets duplicados. Cree un documento nuevo sin nombres duplicados para poder exportar los datos.",
|
||||
"duplicate-widget-name-error": "Este nombre de widget ya está asignado a otro firmante. Por favor elija un nombre diferente.",
|
||||
"duplicate-template-widget-error": "No puede duplicar esta plantilla porque contiene nombres de widgets duplicados.",
|
||||
"credit-alert": "Alerta de crédito",
|
||||
"document-form-data": "Datos del formulario del documento",
|
||||
"view-formdata-paid-title-error": "La función 'Ver datos del formulario' le permite imprimir y descargar los datos de los widgets completados por los firmantes durante la firma.",
|
||||
"view-formdata-paid-error": "Nota: La función 'Ver datos del formulario' solo está disponible para documentos creados en o después de la versión v2.32.0 que no contengan nombres de widgets duplicados.",
|
||||
"download-all-formdata-paid-title-error": "La función 'Descargar todos los datos del formulario' le permite descargar los datos de los widgets completados por los firmantes para todos los documentos creados a partir de la plantilla.",
|
||||
"download-all-formdata-paid-error": "Nota: La función 'Descargar todos los datos del formulario' solo está disponible para plantillas creadas en o después de la versión v2.32.0 que no contengan nombres de widgets duplicados.",
|
||||
"api-token-not-found": "Token de API no encontrado.",
|
||||
"sub-head-api-credits": "Defina la cantidad máxima de créditos API que este usuario puede consumir.",
|
||||
"consumed-credits": "Créditos consumidos",
|
||||
"allowed-api-credits": "Créditos API permitidos",
|
||||
"allowed-api-credits-help": "Los créditos permitidos deben ser mayores o iguales a los créditos consumidos.",
|
||||
"Enter-allowed-api-credits": "Ingrese los créditos API permitidos",
|
||||
"login-to-sandbox": "Iniciar sesión en sandbox",
|
||||
"your-credits-usage": "Uso de sus créditos",
|
||||
"remaining": "restantes",
|
||||
"used": "usados",
|
||||
"your-credits-usage-help": "Esta es la cantidad de créditos consumidos con su clave API."
|
||||
}
|
||||
@@ -71,6 +71,7 @@
|
||||
"login-page": "Page de connexion",
|
||||
"or": "OU",
|
||||
"signup-page": "Page d'inscription",
|
||||
"password-match-length": "Le nouveau mot de passe et la confirmation doivent correspondre",
|
||||
"password-length": "Le mot de passe doit être de plus de 8 caractères",
|
||||
"password-case": "Le mot de passe doit contenir une lettre majuscule, minuscule et un chiffre ",
|
||||
"password-special-char": "Le mot de passe doit contenir un caractère spécial",
|
||||
@@ -120,7 +121,8 @@
|
||||
"Teams": "Équipe",
|
||||
"Team-update-successfully": "Équipe mise à jour avec succès.",
|
||||
"Users": "Utilisateurs"
|
||||
}
|
||||
},
|
||||
"Global SMTP": "SMTP Global"
|
||||
},
|
||||
"dashboard-card": {
|
||||
"Need your Signature": "Besoin de votre signature",
|
||||
@@ -174,7 +176,8 @@
|
||||
"Redirect url": "URL de redirection",
|
||||
"Created Date": "Date de création",
|
||||
"Updated Date": "Date de mise à jour",
|
||||
"Expiry Date": "Date d'expiration"
|
||||
"Expiry Date": "Date d'expiration",
|
||||
"Sent Date": "Date d'envoi"
|
||||
},
|
||||
"btnLabel": {
|
||||
"sign": "Signer",
|
||||
@@ -201,7 +204,10 @@
|
||||
"Save as template": "Enregistrer comme modèle",
|
||||
"Fix & resend": "Corriger et renvoyer",
|
||||
"Kiosk Mode": "Mode Kiosque",
|
||||
"Reset password": "Réinitialiser le mot de passe"
|
||||
"Reset password": "Réinitialiser le mot de passe",
|
||||
"View formdata": "Voir les données du formulaire",
|
||||
"Download all formdata": "Télécharger toutes les données du formulaire",
|
||||
"API credits": "Crédits API"
|
||||
},
|
||||
"report-help": {
|
||||
"Draft Documents": "Il s'agit de documents que vous avez commencés mais que vous n'avez pas finalisés pour envoi.",
|
||||
@@ -386,7 +392,8 @@
|
||||
"dropdown": "dérouler",
|
||||
"radio button": "bouton radio",
|
||||
"image": "image",
|
||||
"email": "e-mail"
|
||||
"email": "e-mail",
|
||||
"number": "nombre"
|
||||
},
|
||||
"fields": "Des champs",
|
||||
"recipients": "Destinataires",
|
||||
@@ -439,10 +446,23 @@
|
||||
"Next to current widget": "À côté du widget actuel"
|
||||
},
|
||||
"options": "Possibilités",
|
||||
"minimun-check": "Vérification minimale",
|
||||
"minimum-check": "Vérification minimale",
|
||||
"maximum-check": "Contrôle maximum",
|
||||
"cell-count": "numération cellulaire",
|
||||
"default-value": "Valeur par défaut",
|
||||
"formula": "Formule",
|
||||
"formula-placeholder": "Créez une formule à l'aide des widgets numériques",
|
||||
"formula-no-widgets": "Aucun autre widget numérique n'est encore attribué à ce signataire.",
|
||||
"supported-operators": "Opérateurs pris en charge :",
|
||||
"formula-helper": "Cliquez sur une puce de widget numérique pour l'insérer (ex. {{number-1}} + {{number-2}}).",
|
||||
"formula-error-letter": "Encadrez les noms de widget avec des doubles accolades (ex. {{number-1}}).",
|
||||
"formula-error-characters": "En dehors des accolades, seuls les chiffres et +, -, *, /, (, ) sont autorisés.",
|
||||
"formula-error-braces": "Chaque {{ ouvrante doit avoir une }} correspondante.",
|
||||
"formula-error-operators": "Lorsque vous utilisez des opérateurs ou des parenthèses, ajoutez au moins deux valeurs.",
|
||||
"formula-error-leading-operator": "Les formules ne peuvent pas commencer par des opérateurs.",
|
||||
"decimal-places": "Décimales",
|
||||
"number-of-decimal-places": "Nombre de décimales",
|
||||
"decimal-places-helper": "Définir sur 0 pour les nombres entiers",
|
||||
"select": "Sélectionner",
|
||||
"read-only": "Est en lecture seule",
|
||||
"hide-labels": "Masquer les étiquettes",
|
||||
@@ -685,7 +705,7 @@
|
||||
"quantity-of-credits": "Quantité de crédits de prime",
|
||||
"remaining-credits": "Crédits premium disponibles :",
|
||||
"additional-credits": "Veuillez acheter des crédits premium",
|
||||
"remaining-credits-help": "Utilisez des crédits premium pour la signature de documents API, l'envoi groupé ou l'intégration d'OpenSign sur votre site Web. Il vous reste {{allowedcredits}} crédits inclus et {{addoncredits}} crédits achetés supplémentaires.",
|
||||
"remaining-credits-help": "Utilisez des crédits premium pour la signature de documents via l'API, l'envoi groupé ou l'intégration d'OpenSign sur votre site Web. Il vous reste {{allowedcredits}} crédits inclus et {{addoncredits}} crédits supplémentaires achetés. Si vous êtes sur un plan Teams ou Enterprise, ces crédits peuvent être partagés entre tous les utilisateurs de votre entreprise, sauf si l'administrateur du compte a défini une limite pour votre compte.",
|
||||
"quota-err-quicksend": "Quota atteint, vous n'avez pas assez de crédits.",
|
||||
"buy-credits": "Acheter des crédits premium",
|
||||
"rotate-right": "Faire pivoter à droite",
|
||||
@@ -1242,5 +1262,51 @@
|
||||
"Please provide required parameters.": "Veuillez fournir les paramètres requis.",
|
||||
"reset-password": "Réinitialiser le mot de passe utilisateur",
|
||||
"enter-strong-password": "Entrez un mot de passe sécurisé ou générez-en un automatiquement.",
|
||||
"autogenerate": "Générer automatiquement"
|
||||
"autogenerate": "Générer automatiquement",
|
||||
"extend": "Prolonger",
|
||||
"console-general-help": "Pour permettre aux utilisateurs individuels de personnaliser leurs propres modèles d'e-mails, accédez à",
|
||||
"console-mail-help": "Pour mettre à jour les modèles d'e-mails à l'échelle de l'entreprise, allez dans",
|
||||
"admin-setting-disabled": "Ce paramètre est désactivé. Veuillez contacter l'administrateur pour obtenir de l'aide.",
|
||||
"company-email-settings": "Paramètres de messagerie de l'entreprise",
|
||||
"allow-email-template-individually": "Autoriser la personnalisation individuelle des modèles d'e-mails pour chaque utilisateur ",
|
||||
"user-email-template-general-help": "Si cette option est désactivée, les utilisateurs ne pourront plus personnaliser leurs modèles d'e-mails.",
|
||||
"disable-individual-user-smtp": "désactiver les paramètres smtp individuels de l'utilisateur",
|
||||
"enable-individual-user-smtp": "activer les paramètres smtp individuels de l'utilisateur",
|
||||
"user-smtp-general-help": "Lorsqu'elle est désactivée, les utilisateurs ne pourront pas configurer leur propre SMTP. Tous les e-mails utiliseront la configuration SMTP globale.",
|
||||
"global-smtp-settings": "Paramètres SMTP globaux",
|
||||
"global-smtp-settings-help-p1": "Ces paramètres s'appliquent globalement à l'ensemble de votre compte {{appName}}. Si un utilisateur n'a pas configuré ses propres paramètres de messagerie, le système utilisera automatiquement les paramètres SMTP globaux définis ici.",
|
||||
"global-smtp-settings-help-p2": "Pour assurer une meilleure délivrabilité de toutes les demandes de signature, vous pouvez connecter votre fournisseur de messagerie préféré. Choisissez l'une des options suivantes :",
|
||||
"global-connect-to-gmail-help": "Utilisez un compte Gmail pour envoyer des demandes de signature directement depuis la boîte de réception de votre organisation. Cela améliore la délivrabilité, la réputation et la fiabilité.",
|
||||
"global-connect-to-smtp-help": "Utilisez votre propre serveur SMTP pour envoyer des e-mails via votre domaine. Cela offre un contrôle total sur votre infrastructure de messagerie, améliore la délivrabilité et garantit une cohérence de marque.",
|
||||
"global-smtp-settings-help-p3": "Si aucun paramètre utilisateur individuel n'est configuré, ces paramètres globaux seront appliqués automatiquement.",
|
||||
"hide-text-with-asterisks": "Masquer le texte avec des astérisques",
|
||||
"hide-text-with-asterisks-help": "Le texte sur le document signé sera masqué, mais restera accessible à l'expéditeur du document (propriétaire) depuis son compte {{appName}}.",
|
||||
"document-id": "ID du document",
|
||||
"sent-date": "Date d'envoi",
|
||||
"status": "Statut",
|
||||
"signer-form-data-for": "Données du formulaire pour le signataire : {{signerName}} <{{signerEmail}}>",
|
||||
"widget-name": "Nom du widget",
|
||||
"widget-responses": "Réponses du widget",
|
||||
"formdata-download-note": "Remarque : Les signatures, tampons, initiales et images ne seront pas exportés.",
|
||||
"export-all-formdata-error": "Vous ne pouvez pas exporter les données du formulaire car le modèle contient des noms de widgets en double. Veuillez créer un nouveau modèle pour pouvoir exporter les données.",
|
||||
"export-formdata-error": "Vous ne pouvez pas exporter les données du formulaire car le document contient des noms de widgets en double. Veuillez créer un nouveau document sans doublons pour pouvoir exporter les données.",
|
||||
"duplicate-widget-name-error": "Ce nom de widget est déjà attribué à un autre signataire. Veuillez choisir un autre nom.",
|
||||
"duplicate-template-widget-error": "Vous ne pouvez pas dupliquer ce modèle car il contient des noms de widgets en double.",
|
||||
"credit-alert": "Alerte de crédit",
|
||||
"document-form-data": "Données du formulaire du document",
|
||||
"view-formdata-paid-title-error": "La fonction 'Afficher les données du formulaire' vous permet d'imprimer et de télécharger les données des widgets remplies par les signataires lors de la signature.",
|
||||
"view-formdata-paid-error": "Remarque : La fonction 'Afficher les données du formulaire' est uniquement disponible pour les documents créés à partir de la version v2.32.0 et ne contenant pas de noms de widgets en double.",
|
||||
"download-all-formdata-paid-title-error": "La fonction 'Télécharger toutes les données du formulaire' vous permet de télécharger les données des widgets remplies par les signataires pour tous les documents créés à partir du modèle.",
|
||||
"download-all-formdata-paid-error": "Remarque : La fonction 'Télécharger toutes les données du formulaire' est uniquement disponible pour les modèles créés à partir de la version v2.32.0 et ne contenant pas de noms de widgets en double.",
|
||||
"api-token-not-found": "Jeton API introuvable.",
|
||||
"sub-head-api-credits": "Définissez le nombre maximal de crédits API que cet utilisateur est autorisé à consommer.",
|
||||
"consumed-credits": "Crédits consommés",
|
||||
"allowed-api-credits": "Crédits API autorisés",
|
||||
"allowed-api-credits-help": "Les crédits autorisés doivent être supérieurs ou égaux aux crédits consommés.",
|
||||
"Enter-allowed-api-credits": "Saisissez les crédits API autorisés",
|
||||
"login-to-sandbox": "Se connecter au sandbox",
|
||||
"your-credits-usage": "Votre utilisation des crédits",
|
||||
"remaining": "restants",
|
||||
"used": "utilisés",
|
||||
"your-credits-usage-help": "Ceci est le nombre de crédits consommés avec votre clé API."
|
||||
}
|
||||
@@ -71,6 +71,7 @@
|
||||
"login-page": "लॉगिन पृष्ठ",
|
||||
"or": "या",
|
||||
"signup-page": "साइनअप पृष्ठ",
|
||||
"password-match-length": "नया पासवर्ड और पुष्टि पासवर्ड मेल खाना चाहिए",
|
||||
"password-length": "पासवर्ड 8 वर्ण लंबा होना चाहिए",
|
||||
"password-case": "पासवर्ड में अपरकेस अक्षर, लोअरकेस अक्षर, अंक होना चाहिए",
|
||||
"password-special-char": " पासवर्ड में विशेष वर्ण होना चाहिए",
|
||||
@@ -120,7 +121,8 @@
|
||||
"Teams": "टीमें",
|
||||
"Team-update-successfully": "टीम सफलतापूर्वक अपडेट की गई।",
|
||||
"Users": "उपयोगकर्ता"
|
||||
}
|
||||
},
|
||||
"Global SMTP": "ग्लोबल SMTP"
|
||||
},
|
||||
"dashboard-card": {
|
||||
"Need your Signature": "आपके हस्ताक्षर की आवश्यकता है",
|
||||
@@ -166,7 +168,10 @@
|
||||
"Save as template": "टेम्पलेट के रूप में सहेजें",
|
||||
"Fix & resend": "ठीक करें और पुनः भेजें",
|
||||
"Kiosk Mode": "कियोस्क मोड",
|
||||
"Reset password": "पासवर्ड रीसेट करें"
|
||||
"Reset password": "पासवर्ड रीसेट करें",
|
||||
"View formdata": "फॉर्म डेटा देखें",
|
||||
"Download all formdata": "सभी फॉर्म डेटा डाउनलोड करें",
|
||||
"API credits": "API क्रेडिट्स"
|
||||
},
|
||||
"report-heading": {
|
||||
"Sr.No": "क्रमांक",
|
||||
@@ -201,7 +206,8 @@
|
||||
"Redirect url": "रीडायरेक्ट URL",
|
||||
"Created Date": "निर्माण तिथि",
|
||||
"Updated Date": "अद्यतन तिथि",
|
||||
"Expiry Date": "समाप्ति तिथि"
|
||||
"Expiry Date": "समाप्ति तिथि",
|
||||
"Sent Date": "भेजे जाने की तिथि"
|
||||
},
|
||||
"report-help": {
|
||||
"Draft Documents": "ये वे दस्तावेज़ हैं जिन्हें आपने शुरू तो किया है लेकिन भेजने के लिए अंतिम रूप नहीं दिया है।",
|
||||
@@ -386,7 +392,8 @@
|
||||
"dropdown": "ड्रॉपडाउन",
|
||||
"radio button": "रेडियो बटन",
|
||||
"image": "छवि",
|
||||
"email": "ईमेल"
|
||||
"email": "ईमेल",
|
||||
"number": "संख्या"
|
||||
},
|
||||
"fields": "क्षेत्र",
|
||||
"recipients": "प्राप्तकर्ता",
|
||||
@@ -439,10 +446,23 @@
|
||||
"Next to current widget": "वर्तमान विजेट के आगे"
|
||||
},
|
||||
"options": "विकल्प",
|
||||
"minimun-check": "न्यूनतम जाँच",
|
||||
"minimum-check": "न्यूनतम जाँच",
|
||||
"maximum-check": "अधिकतम जाँच",
|
||||
"cell-count": "सेल्स संख्या",
|
||||
"default-value": "डिफ़ॉल्ट मान",
|
||||
"formula": "सूत्र",
|
||||
"formula-placeholder": "संख्या विजेट्स का उपयोग करके एक सूत्र बनाएं",
|
||||
"formula-no-widgets": "इस हस्ताक्षरकर्ता को अभी तक कोई अन्य संख्या विजेट असाइन नहीं किया गया है।",
|
||||
"supported-operators": "समर्थित ऑपरेटर:",
|
||||
"formula-helper": "सूची में से संख्या विजेट चिप पर क्लिक करके उसे जोड़ें (उदा. {{number-1}} + {{number-2}})।",
|
||||
"formula-error-letter": "विजेट नामों को दोहरी घुंघराली ब्रैकेट में रखें (उदा. {{number-1}})।",
|
||||
"formula-error-characters": "ब्रैकेट के बाहर केवल संख्याएँ और +, -, *, /, (, ) की अनुमति है।",
|
||||
"formula-error-braces": "हर खुलने वाली {{ के लिए एक मिलान करने वाली }} होना चाहिए।",
|
||||
"formula-error-operators": "ऑपरेटर या कोष्ठक का उपयोग करते समय कम से कम दो मान जोड़ें।",
|
||||
"formula-error-leading-operator": "सूत्र ऑपरेटर से शुरू नहीं हो सकते।",
|
||||
"decimal-places": "दशमलव स्थान",
|
||||
"number-of-decimal-places": "दशमलव स्थानों की संख्या",
|
||||
"decimal-places-helper": "पूर्णांक के लिए 0 पर सेट करें",
|
||||
"select": "चुनें",
|
||||
"read-only": "सिर्फ पढ़ने के लिए है",
|
||||
"hide-labels": "लेबल छिपाएँ",
|
||||
@@ -684,7 +704,7 @@
|
||||
"select-date-format": "एक दिनांक प्रारूप चुनें",
|
||||
"quantity-of-credits": "प्रीमियम क्रेडिट की मात्रा",
|
||||
"remaining-credits": "प्रीमियम क्रेडिट उपलब्ध:",
|
||||
"remaining-credits-help": "अपनी वेबसाइट पर एपीआई दस्तावेज़ हस्ताक्षर, थोक भेजने या OpenSign एकीकरण को एम्बेड करने के लिए प्रीमियम क्रेडिट का उपयोग करें। आपके पास {{allowedcredits}} शामिल क्रेडिट और {{addoncredits}} अतिरिक्त खरीदे गए क्रेडिट शेष हैं।",
|
||||
"remaining-credits-help": "API दस्तावेज़ साइनिंग, बल्क सेंडिंग या अपनी वेबसाइट पर OpenSign इंटीग्रेशन एम्बेड करने के लिए प्रीमियम क्रेडिट का उपयोग करें। आपके पास {{allowedcredits}} शामिल क्रेडिट और {{addoncredits}} अतिरिक्त खरीदे हुए क्रेडिट शेष हैं। यदि आप Teams या Enterprise प्लान पर हैं, तो ये क्रेडिट आपकी कंपनी के सभी उपयोगकर्ताओं के बीच साझा किए जा सकते हैं, जब तक कि आपके खाते के लिए अकाउंट एडमिन ने कोई सीमा निर्धारित न की हो।",
|
||||
"additional-credits": "कृपया प्रीमियम क्रेडिट खरीदें",
|
||||
"quota-err-quicksend": "कोटा पहुँच गया, आपके पास पर्याप्त क्रेडिट नहीं हैं।",
|
||||
"buy-credits": "प्रीमियम क्रेडिट खरीदें",
|
||||
@@ -1242,5 +1262,51 @@
|
||||
"Please provide required parameters.": "कृपया आवश्यक पैरामीटर प्रदान करें।",
|
||||
"reset-password": "उपयोगकर्ता पासवर्ड रीसेट करें",
|
||||
"enter-strong-password": "एक मज़बूत पासवर्ड दर्ज करें या स्वचालित रूप से उत्पन्न करें।",
|
||||
"autogenerate": "स्वतः उत्पन्न करें"
|
||||
"autogenerate": "स्वतः उत्पन्न करें",
|
||||
"extend": "बढ़ाएँ",
|
||||
"console-general-help": "व्यक्तिगत उपयोगकर्ताओं को अपनी स्वयं की ईमेल टेम्पलेट्स अनुकूलित करने की अनुमति देने के लिए, जाएँ",
|
||||
"console-mail-help": "कंपनी-व्यापी ईमेल टेम्पलेट्स अपडेट करने के लिए, जाएँ",
|
||||
"admin-setting-disabled": "यह सेटिंग अक्षम है। सहायता के लिए कृपया व्यवस्थापक से संपर्क करें।",
|
||||
"company-email-settings": "कंपनी ईमेल सेटिंग्स",
|
||||
"allow-email-template-individually": "उपयोगकर्ताओं को व्यक्तिगत रूप से ईमेल टेम्पलेट अनुकूलित करने की अनुमति दें ",
|
||||
"user-email-template-general-help": "इसे निष्क्रिय करने पर उपयोगकर्ता अपनी ईमेल टेम्पलेट्स को अनुकूलित नहीं कर पाएंगे।",
|
||||
"disable-individual-user-smtp": "व्यक्तिगत उपयोगकर्ता SMTP सेटिंग्स अक्षम करें",
|
||||
"enable-individual-user-smtp": "व्यक्तिगत उपयोगकर्ता SMTP सेटिंग्स सक्षम करें",
|
||||
"user-smtp-general-help": "जब यह निष्क्रिय हो, तो उपयोगकर्ता अपनी स्वयं की SMTP सेटिंग्स कॉन्फ़िगर नहीं कर पाएंगे। सभी ईमेल ग्लोबल SMTP कॉन्फ़िगरेशन का उपयोग करेंगे।",
|
||||
"global-smtp-settings": "ग्लोबल SMTP सेटिंग्स",
|
||||
"global-smtp-settings-help-p1": "ये सेटिंग्स आपके पूरे {{appName}} खाते में वैश्विक रूप से लागू होती हैं। यदि किसी उपयोगकर्ता ने अपनी स्वयं की ईमेल डिलीवरी सेटिंग्स कॉन्फ़िगर नहीं की हैं, तो सिस्टम स्वचालित रूप से यहाँ परिभाषित ग्लोबल SMTP सेटिंग्स का उपयोग करेगा।",
|
||||
"global-smtp-settings-help-p2": "सभी हस्ताक्षर अनुरोध ईमेल की बेहतर इनबॉक्स डिलीवरी सुनिश्चित करने के लिए, आप अपना पसंदीदा ईमेल प्रदाता जोड़ सकते हैं। निम्न विकल्पों में से एक चुनें:",
|
||||
"global-connect-to-gmail-help": "अपनी संस्था की इनबॉक्स से सीधे हस्ताक्षर अनुरोध ईमेल भेजने के लिए Gmail खाते का उपयोग करें। यह डिलीवरी दर, प्रतिष्ठा और विश्वसनीयता में सुधार करता है।",
|
||||
"global-connect-to-smtp-help": "अपने डोमेन के माध्यम से ईमेल भेजने के लिए अपना स्वयं का SMTP सर्वर उपयोग करें। यह आपकी ईमेल संरचना पर पूर्ण नियंत्रण प्रदान करता है, डिलीवरी को बेहतर बनाता है और ब्रांड की निरंतरता बनाए रखता है।",
|
||||
"global-smtp-settings-help-p3": "यदि कोई व्यक्तिगत उपयोगकर्ता-स्तरीय सेटिंग्स कॉन्फ़िगर नहीं की गई हैं, तो ये वैश्विक सेटिंग्स स्वचालित रूप से लागू होंगी।",
|
||||
"hide-text-with-asterisks": "टेक्स्ट को तारांकन (*) के साथ छुपाएँ",
|
||||
"hide-text-with-asterisks-help": "हस्ताक्षरित दस्तावेज़ पर टेक्स्ट दृश्य से छिपा रहेगा, लेकिन दस्तावेज़ भेजने वाले (मालिक) के लिए उनके {{appName}} खाते से सुलभ रहेगा।",
|
||||
"document-id": "दस्तावेज़ ID",
|
||||
"sent-date": "भेजे जाने की तिथि",
|
||||
"status": "स्थिति",
|
||||
"signer-form-data-for": "हस्ताक्षरकर्ता के लिए फ़ॉर्म डेटा: {{signerName}} <{{signerEmail}}>",
|
||||
"widget-name": "विजेट नाम",
|
||||
"widget-responses": "विजेट प्रतिक्रियाएँ",
|
||||
"formdata-download-note": "नोट: हस्ताक्षर, स्टैम्प, प्रारंभिक अक्षर और छवियाँ निर्यात नहीं की जाएँगी।",
|
||||
"export-all-formdata-error": "आप फ़ॉर्म डेटा निर्यात नहीं कर सकते क्योंकि टेम्पलेट में डुप्लिकेट विजेट नाम हैं। कृपया नया टेम्पलेट बनाएं ताकि आप फ़ॉर्म डेटा निर्यात कर सकें।",
|
||||
"export-formdata-error": "आप फ़ॉर्म डेटा निर्यात नहीं कर सकते क्योंकि दस्तावेज़ में डुप्लिकेट विजेट नाम हैं। कृपया नया दस्तावेज़ बनाएं जिसमें डुप्लिकेट विजेट नाम न हों।",
|
||||
"duplicate-widget-name-error": "यह विजेट नाम पहले से ही किसी अन्य साइनर को सौंपा गया है। कृपया कोई दूसरा नाम चुनें।",
|
||||
"duplicate-template-widget-error": "आप इस टेम्पलेट को डुप्लिकेट नहीं कर सकते क्योंकि इसमें डुप्लिकेट विजेट नाम हैं।",
|
||||
"credit-alert": "क्रेडिट अलर्ट",
|
||||
"document-form-data": "दस्तावेज़ फ़ॉर्म डेटा",
|
||||
"view-formdata-paid-title-error": "'फ़ॉर्म डेटा देखें' सुविधा आपको हस्ताक्षर करते समय साइनरों द्वारा भरे गए विजेट डेटा को प्रिंट और डाउनलोड करने की सुविधा देती है.",
|
||||
"view-formdata-paid-error": "नोट: 'फ़ॉर्म डेटा देखें' सुविधा केवल उन दस्तावेज़ों के लिए उपलब्ध है जो v2.32.0 या उसके बाद बनाए गए हों और जिनमें डुप्लिकेट विजेट नाम न हों.",
|
||||
"download-all-formdata-paid-title-error": "'सभी फ़ॉर्म डेटा डाउनलोड करें' सुविधा आपको टेम्पलेट से बनाए गए सभी दस्तावेज़ों के लिए साइनरों द्वारा भरे गए विजेट डेटा को डाउनलोड करने देती है.",
|
||||
"download-all-formdata-paid-error": "नोट: 'सभी फ़ॉर्म डेटा डाउनलोड करें' सुविधा केवल उन टेम्पलेट्स के लिए उपलब्ध है जो v2.32.0 या उसके बाद बनाए गए हों और जिनमें डुप्लिकेट विजेट नाम न हों.",
|
||||
"api-token-not-found": "API टोकन नहीं मिला।",
|
||||
"sub-head-api-credits": "इस उपयोगकर्ता द्वारा उपभोग किए जाने वाले API क्रेडिट की अधिकतम संख्या निर्धारित करें।",
|
||||
"consumed-credits": "उपयोग किए गए क्रेडिट",
|
||||
"allowed-api-credits": "अनुमत API क्रेडिट",
|
||||
"allowed-api-credits-help": "अनुमत क्रेडिट उपयोग किए गए क्रेडिट के बराबर या उससे अधिक होने चाहिए।",
|
||||
"Enter-allowed-api-credits": "अनुमत API क्रेडिट दर्ज करें",
|
||||
"login-to-sandbox": "सैंडबॉक्स में लॉगिन करें",
|
||||
"your-credits-usage": "आपके क्रेडिट उपयोग",
|
||||
"remaining": "शेष",
|
||||
"used": "उपयोग किए गए",
|
||||
"your-credits-usage-help": "यह आपके API कुंजी द्वारा उपभोग किए गए क्रेडिट की संख्या है।"
|
||||
}
|
||||
@@ -71,6 +71,7 @@
|
||||
"login-page": "Pagina di accesso",
|
||||
"or": "O",
|
||||
"signup-page": "Pagina di registrazione",
|
||||
"password-match-length": "La nuova password e la conferma devono corrispondere",
|
||||
"password-length": "La password deve contenere almeno 8 caratteri",
|
||||
"password-case": "La password deve contenere una lettera maiuscola, una minuscola e un numero",
|
||||
"password-special-char": "La password deve contenere un carattere speciale",
|
||||
@@ -120,7 +121,8 @@
|
||||
"Teams": "Team",
|
||||
"Team-update-successfully": "Team aggiornato con successo.",
|
||||
"Users": "Utenti"
|
||||
}
|
||||
},
|
||||
"Global SMTP": "SMTP Globale"
|
||||
},
|
||||
"dashboard-card": {
|
||||
"Need your Signature": "Necessita della tua firma",
|
||||
@@ -166,7 +168,10 @@
|
||||
"Save as template": "Salva come modello",
|
||||
"Fix & resend": "Correggi e reinvia",
|
||||
"Kiosk Mode": "Modalità Kiosk",
|
||||
"Reset password": "Reimposta password"
|
||||
"Reset password": "Reimposta password",
|
||||
"View formdata": "Visualizza i dati del modulo",
|
||||
"Download all formdata": "Scarica tutti i dati del modulo",
|
||||
"API credits": "Crediti API"
|
||||
},
|
||||
"report-heading": {
|
||||
"Sr.No": "Nr.",
|
||||
@@ -201,7 +206,8 @@
|
||||
"Redirect url": "URL di reindirizzamento",
|
||||
"Created Date": "Data di creazione",
|
||||
"Updated Date": "Data di aggiornamento",
|
||||
"Expiry Date": "Data di scadenza"
|
||||
"Expiry Date": "Data di scadenza",
|
||||
"Sent Date": "Data di invio"
|
||||
},
|
||||
"report-help": {
|
||||
"Draft Documents": "Questi sono documenti che hai iniziato ma non hai ancora finalizzato per l'invio.",
|
||||
@@ -263,7 +269,7 @@
|
||||
"my-signature": "La mia firma",
|
||||
"signature": "Firma",
|
||||
"upload-image": "Carica immagine",
|
||||
"clear": "Chiara",
|
||||
"clear": "Cancella",
|
||||
"upload-signature/Image": "Carica firma/immagine",
|
||||
"initials": "Iniziali",
|
||||
"API": "API",
|
||||
@@ -386,7 +392,8 @@
|
||||
"dropdown": "menu a tendina",
|
||||
"radio button": "pulsante di opzione",
|
||||
"image": "immagine",
|
||||
"email": "email"
|
||||
"email": "email",
|
||||
"number": "numero"
|
||||
},
|
||||
"fields": "Campi",
|
||||
"recipients": "Destinatari",
|
||||
@@ -439,10 +446,23 @@
|
||||
"Next to current widget": "Accanto al widget corrente"
|
||||
},
|
||||
"options": "Opzioni",
|
||||
"minimun-check": "Controllo minimo",
|
||||
"minimum-check": "Controllo minimo",
|
||||
"maximum-check": "Controllo massimo",
|
||||
"cell-count": "conteggio delle cellule",
|
||||
"default-value": "Valore predefinita",
|
||||
"formula": "Formula",
|
||||
"formula-placeholder": "Crea una formula utilizzando i widget numerici",
|
||||
"formula-no-widgets": "Non ci sono ancora altri widget numerici assegnati a questo firmatario.",
|
||||
"supported-operators": "Operatori supportati:",
|
||||
"formula-helper": "Fai clic su una chip di widget numerico per inserirla (es. {{number-1}} + {{number-2}}).",
|
||||
"formula-error-letter": "Racchiudi i nomi dei widget tra doppie parentesi graffe (es. {{number-1}}).",
|
||||
"formula-error-characters": "Al di fuori delle parentesi sono consentiti solo numeri e +, -, *, /, (, ).",
|
||||
"formula-error-braces": "Ogni {{ di apertura deve avere una }} corrispondente.",
|
||||
"formula-error-operators": "Quando usi operatori o parentesi, aggiungi almeno due valori.",
|
||||
"formula-error-leading-operator": "Le formule non possono iniziare con operatori.",
|
||||
"decimal-places": "Cifre decimali",
|
||||
"number-of-decimal-places": "Numero di cifre decimali",
|
||||
"decimal-places-helper": "Imposta su 0 per numeri interi",
|
||||
"select": "Seleziona",
|
||||
"read-only": "È di sola lettura",
|
||||
"hide-labels": "Nascondi etichette",
|
||||
@@ -684,7 +704,7 @@
|
||||
"select-date-format": "Seleziona un formato data",
|
||||
"quantity-of-credits": "Quantità di crediti premium",
|
||||
"remaining-credits": "Crediti premium disponibili:",
|
||||
"remaining-credits-help": "Usa i crediti premium per firmare documenti API, invii in massa o per integrare OpenSign nel tuo sito web. Hai a disposizione {{allowedcredits}} crediti inclusi e {{addoncredits}} crediti acquistati aggiuntivi rimanenti.",
|
||||
"remaining-credits-help": "Usa i crediti premium per la firma di documenti tramite API, l'invio massivo o per integrare OpenSign nel tuo sito web. Hai ancora {{allowedcredits}} crediti inclusi e {{addoncredits}} crediti aggiuntivi acquistati. Se sei in un piano Teams o Enterprise, questi crediti possono essere condivisi tra tutti gli utenti della tua azienda, a meno che l'amministratore dell'account non abbia impostato un limite specifico per il tuo account.",
|
||||
"additional-credits": "Acquista crediti premium",
|
||||
"quota-err-quicksend": "Quota raggiunta, non hai abbastanza crediti.",
|
||||
"buy-credits": "Acquista Crediti Premium",
|
||||
@@ -1242,5 +1262,51 @@
|
||||
"Please provide required parameters.": "Fornisci i parametri richiesti.",
|
||||
"reset-password": "Reimposta password utente",
|
||||
"enter-strong-password": "Inserisci una password sicura o generane una automaticamente.",
|
||||
"autogenerate": "Genera automaticamente"
|
||||
"autogenerate": "Genera automaticamente",
|
||||
"extend": "Estendi",
|
||||
"console-general-help": "Per consentire ai singoli utenti di personalizzare i propri modelli di e-mail, vai a",
|
||||
"console-mail-help": "Per aggiornare i modelli di e-mail aziendali, vai a",
|
||||
"admin-setting-disabled": "Questa impostazione è disabilitata. Contatta l'amministratore per assistenza.",
|
||||
"company-email-settings": "Impostazioni e-mail aziendali",
|
||||
"allow-email-template-individually": "Consenti la personalizzazione individuale dei modelli di e-mail per gli utenti ",
|
||||
"user-email-template-general-help": "Disabilitando questa opzione, gli utenti non potranno più personalizzare i loro modelli di e-mail.",
|
||||
"disable-individual-user-smtp": "disabilita le impostazioni smtp individuali dell'utente",
|
||||
"enable-individual-user-smtp": "abilita le impostazioni smtp individuali dell'utente",
|
||||
"user-smtp-general-help": "Quando disattivato, gli utenti non potranno configurare il proprio SMTP. Tutte le e-mail utilizzeranno la configurazione SMTP globale.",
|
||||
"global-smtp-settings": "Impostazioni SMTP Globali",
|
||||
"global-smtp-settings-help-p1": "Queste impostazioni si applicano globalmente all'intero account {{appName}}. Se un utente non ha configurato le proprie impostazioni di consegna e-mail, il sistema utilizzerà automaticamente le impostazioni SMTP globali definite qui.",
|
||||
"global-smtp-settings-help-p2": "Per garantire una migliore consegna delle e-mail di richiesta firma, puoi collegare il tuo provider di posta preferito. Scegli una delle seguenti opzioni:",
|
||||
"global-connect-to-gmail-help": "Utilizza un account Gmail per inviare e-mail di richiesta firma direttamente dalla casella di posta della tua organizzazione. Migliora la consegna, la reputazione e l'affidabilità.",
|
||||
"global-connect-to-smtp-help": "Utilizza il tuo server SMTP per inviare e-mail tramite il tuo dominio. Questo offre pieno controllo sulla tua infrastruttura e-mail, migliora la consegna e mantiene la coerenza del marchio.",
|
||||
"global-smtp-settings-help-p3": "Se non sono configurate impostazioni a livello utente, verranno applicate automaticamente queste impostazioni globali.",
|
||||
"hide-text-with-asterisks": "Nascondi il testo con asterischi",
|
||||
"hide-text-with-asterisks-help": "Il testo nel documento firmato sarà nascosto dalla visualizzazione ma rimarrà accessibile al mittente (proprietario) tramite il suo account {{appName}}.",
|
||||
"document-id": "ID documento",
|
||||
"sent-date": "Data di invio",
|
||||
"status": "Stato",
|
||||
"signer-form-data-for": "Dati del modulo per il firmatario: {{signerName}} <{{signerEmail}}>",
|
||||
"widget-name": "Nome del widget",
|
||||
"widget-responses": "Risposte del widget",
|
||||
"formdata-download-note": "Nota: Firme, timbri, iniziali e immagini non verranno esportati.",
|
||||
"export-all-formdata-error": "Non è possibile esportare i dati del modulo perché il modello contiene nomi di widget duplicati. Creare un nuovo modello per poter esportare i dati.",
|
||||
"export-formdata-error": "Non è possibile esportare i dati del modulo perché il documento contiene nomi di widget duplicati. Creare un nuovo documento senza nomi duplicati per poter esportare i dati.",
|
||||
"duplicate-widget-name-error": "Questo nome di widget è già assegnato a un altro firmatario. Scegli un nome diverso.",
|
||||
"duplicate-template-widget-error": "Non è possibile duplicare questo modello perché contiene nomi di widget duplicati.",
|
||||
"credit-alert": "Avviso di credito",
|
||||
"document-form-data": "Dati del modulo del documento",
|
||||
"view-formdata-paid-title-error": "La funzione 'Visualizza dati del modulo' consente di stampare e scaricare i dati dei widget compilati dai firmatari durante la firma.",
|
||||
"view-formdata-paid-error": "Nota: La funzione 'Visualizza dati del modulo' è disponibile solo per documenti creati dalla versione v2.32.0 in poi che non contengono nomi di widget duplicati.",
|
||||
"download-all-formdata-paid-title-error": "La funzione 'Scarica tutti i dati del modulo' consente di scaricare i dati dei widget compilati dai firmatari per tutti i documenti creati dal modello.",
|
||||
"download-all-formdata-paid-error": "Nota: La funzione 'Scarica tutti i dati del modulo' è disponibile solo per modelli creati dalla versione v2.32.0 in poi che non contengano nomi di widget duplicati.",
|
||||
"api-token-not-found": "Token API non trovato.",
|
||||
"sub-head-api-credits": "Definisci il numero massimo di crediti API che questo utente può consumare.",
|
||||
"consumed-credits": "Crediti consumati",
|
||||
"allowed-api-credits": "Crediti API consentiti",
|
||||
"allowed-api-credits-help": "I crediti consentiti devono essere maggiori o uguali ai crediti consumati.",
|
||||
"Enter-allowed-api-credits": "Inserisci i crediti API consentiti",
|
||||
"login-to-sandbox": "Accedi alla sandbox",
|
||||
"your-credits-usage": "Utilizzo dei tuoi crediti",
|
||||
"remaining": "rimanenti",
|
||||
"used": "usati",
|
||||
"your-credits-usage-help": "Questo è il numero di crediti consumati con la tua chiave API."
|
||||
}
|
||||
Binary file not shown.
@@ -1,302 +0,0 @@
|
||||
import React, { useState, useEffect } from "react";
|
||||
import Parse from "parse";
|
||||
import Loader from "../primitives/Loader";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { emailRegex } from "../constant/const";
|
||||
|
||||
const AddSigner = (props) => {
|
||||
const { t } = useTranslation();
|
||||
const [name, setName] = useState("");
|
||||
const [phone, setPhone] = useState("");
|
||||
const [email, setEmail] = useState("");
|
||||
const [addYourself, setAddYourself] = useState(false);
|
||||
const [isLoader, setIsLoader] = useState(false);
|
||||
const [isUserExist, setIsUserExist] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
checkUserExist();
|
||||
}, []);
|
||||
// Load user details from localStorage when the component mounts
|
||||
useEffect(() => {
|
||||
const savedUserDetails = JSON.parse(
|
||||
localStorage.getItem("UserInformation")
|
||||
);
|
||||
if (savedUserDetails && addYourself) {
|
||||
setName(savedUserDetails.name);
|
||||
setPhone(savedUserDetails?.phone || "");
|
||||
setEmail(savedUserDetails.email?.toLowerCase()?.replace(/\s/g, ""));
|
||||
}
|
||||
}, [addYourself]);
|
||||
|
||||
const checkUserExist = async () => {
|
||||
const user = Parse.User.current();
|
||||
try {
|
||||
const query = new Parse.Query("contracts_Contactbook");
|
||||
query.equalTo("CreatedBy", user);
|
||||
query.notEqualTo("IsDeleted", true);
|
||||
query.equalTo("Email", user.getEmail());
|
||||
const res = await query.first();
|
||||
// console.log(res);
|
||||
if (!res) {
|
||||
setIsUserExist(true);
|
||||
}
|
||||
} catch (err) {
|
||||
console.log("err", err);
|
||||
}
|
||||
};
|
||||
// Define a function to handle form submission
|
||||
const handleSubmit = async (e) => {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
if (!emailRegex.test(email)) {
|
||||
alert(t("valid-email-alert"));
|
||||
} else {
|
||||
setIsLoader(true);
|
||||
if (localStorage.getItem("TenantId")) {
|
||||
try {
|
||||
const user = Parse.User.current();
|
||||
const query = new Parse.Query("contracts_Contactbook");
|
||||
query.equalTo("CreatedBy", user);
|
||||
query.notEqualTo("IsDeleted", true);
|
||||
query.equalTo("Email", email);
|
||||
const res = await query.first();
|
||||
// console.log(res);
|
||||
if (!res) {
|
||||
const contactQuery = new Parse.Object("contracts_Contactbook");
|
||||
contactQuery.set("Name", name);
|
||||
if (phone) {
|
||||
contactQuery.set("Phone", phone);
|
||||
}
|
||||
contactQuery.set("Email", email);
|
||||
contactQuery.set("UserRole", "contracts_Guest");
|
||||
|
||||
contactQuery.set("TenantId", {
|
||||
__type: "Pointer",
|
||||
className: "partners_Tenant",
|
||||
objectId: localStorage.getItem("TenantId")
|
||||
});
|
||||
|
||||
try {
|
||||
const _users = Parse.Object.extend("User");
|
||||
const _user = new _users();
|
||||
_user.set("name", name);
|
||||
_user.set("username", email);
|
||||
_user.set("email", email);
|
||||
_user.set("password", email);
|
||||
if (phone) {
|
||||
_user.set("phone", phone);
|
||||
}
|
||||
const user = await _user.save();
|
||||
if (user) {
|
||||
const currentUser = Parse.User.current();
|
||||
contactQuery.set(
|
||||
"CreatedBy",
|
||||
Parse.User.createWithoutData(currentUser.id)
|
||||
);
|
||||
|
||||
contactQuery.set("UserId", user);
|
||||
const acl = new Parse.ACL();
|
||||
acl.setPublicReadAccess(true);
|
||||
acl.setPublicWriteAccess(true);
|
||||
acl.setReadAccess(currentUser.id, true);
|
||||
acl.setWriteAccess(currentUser.id, true);
|
||||
|
||||
contactQuery.setACL(acl);
|
||||
|
||||
const res = await contactQuery.save();
|
||||
|
||||
const parseData = JSON.parse(JSON.stringify(res));
|
||||
if (props.details) {
|
||||
props.details({
|
||||
value: parseData[props.valueKey],
|
||||
label: parseData[props.displayKey],
|
||||
email: parseData?.Email
|
||||
});
|
||||
}
|
||||
if (props.closePopup) {
|
||||
props.closePopup();
|
||||
}
|
||||
if (props.handleUserData) {
|
||||
props.handleUserData(parseData);
|
||||
}
|
||||
|
||||
setIsLoader(false);
|
||||
// Reset the form fields
|
||||
setAddYourself(false);
|
||||
setName("");
|
||||
setPhone("");
|
||||
setEmail("");
|
||||
}
|
||||
} catch (err) {
|
||||
console.log("err ", err);
|
||||
if (err.code === 202) {
|
||||
const params = { email: email };
|
||||
const userRes = await Parse.Cloud.run("getUserId", params);
|
||||
const currentUser = Parse.User.current();
|
||||
contactQuery.set(
|
||||
"CreatedBy",
|
||||
Parse.User.createWithoutData(currentUser.id)
|
||||
);
|
||||
|
||||
contactQuery.set("UserId", {
|
||||
__type: "Pointer",
|
||||
className: "_User",
|
||||
objectId: userRes.id
|
||||
});
|
||||
const acl = new Parse.ACL();
|
||||
acl.setPublicReadAccess(true);
|
||||
acl.setPublicWriteAccess(true);
|
||||
acl.setReadAccess(currentUser.id, true);
|
||||
acl.setWriteAccess(currentUser.id, true);
|
||||
|
||||
contactQuery.setACL(acl);
|
||||
const res = await contactQuery.save();
|
||||
|
||||
const parseData = JSON.parse(JSON.stringify(res));
|
||||
if (props.details) {
|
||||
props.details({
|
||||
value: parseData[props.valueKey],
|
||||
label: parseData[props.displayKey],
|
||||
email: parseData?.Email
|
||||
});
|
||||
}
|
||||
if (props.closePopup) {
|
||||
props.closePopup();
|
||||
}
|
||||
if (props.handleUserData) {
|
||||
props.handleUserData(parseData);
|
||||
}
|
||||
setIsLoader(false);
|
||||
// Reset the form fields
|
||||
setAddYourself(false);
|
||||
setName("");
|
||||
setPhone("");
|
||||
setEmail("");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
alert(t("add-signer-alert"));
|
||||
setIsLoader(false);
|
||||
}
|
||||
} catch (err) {
|
||||
console.log("err in fetch contact", err);
|
||||
setIsLoader(false);
|
||||
alert(t("something-went-wrong-mssg"));
|
||||
}
|
||||
} else {
|
||||
setIsLoader(false);
|
||||
alert(t("something-went-wrong-mssg"));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// Define a function to handle the "add yourself" checkbox
|
||||
const handleAddYourselfChange = () => {
|
||||
if (addYourself) {
|
||||
setAddYourself(false);
|
||||
setName("");
|
||||
setPhone("");
|
||||
setEmail("");
|
||||
} else {
|
||||
setAddYourself(true);
|
||||
}
|
||||
};
|
||||
const handleReset = () => {
|
||||
setAddYourself(false);
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="h-full p-[20px]">
|
||||
{isLoader && (
|
||||
<div className="fixed inset-0 flex justify-center items-center bg-black bg-opacity-30">
|
||||
<Loader />
|
||||
</div>
|
||||
)}
|
||||
<div className="w-full mx-auto p-2 text-base-content">
|
||||
<p className="mb-3 text-xs text-gray-500">{t("add-signer-note")}</p>
|
||||
{isUserExist && (
|
||||
<div className="mb-3 flex items-center">
|
||||
<input
|
||||
type="checkbox"
|
||||
id="addYourself"
|
||||
checked={addYourself}
|
||||
onChange={handleAddYourselfChange}
|
||||
className="op-checkbox op-checkbox-sm"
|
||||
/>
|
||||
<label htmlFor="addYourself" className="ml-2 mb-0">
|
||||
{t("add-yourself")}
|
||||
</label>
|
||||
</div>
|
||||
)}
|
||||
<form onSubmit={handleSubmit}>
|
||||
<div className="mb-3">
|
||||
<label htmlFor="name" className="block text-xs font-semibold">
|
||||
{t("name")}
|
||||
<span className="text-[red] text-[13px]"> *</span>
|
||||
</label>
|
||||
<input
|
||||
type="text"
|
||||
id="name"
|
||||
value={name}
|
||||
onChange={(e) => setName(e.target.value)}
|
||||
required
|
||||
disabled={addYourself}
|
||||
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-xs"
|
||||
placeholder={t("enter-name")}
|
||||
/>
|
||||
</div>
|
||||
<div className="mb-3">
|
||||
<label htmlFor="email" className="block text-xs font-semibold">
|
||||
{t("email")}
|
||||
<span className="text-[red] text-[13px]"> *</span>
|
||||
</label>
|
||||
<input
|
||||
type="email"
|
||||
id="email"
|
||||
value={email}
|
||||
onChange={(e) =>
|
||||
setEmail(e.target.value?.toLowerCase()?.replace(/\s/g, ""))
|
||||
}
|
||||
required
|
||||
onInvalid={(e) => e.target.setCustomValidity(t("input-required"))}
|
||||
onInput={(e) => e.target.setCustomValidity("")}
|
||||
disabled={addYourself}
|
||||
className="op-input op-input-bordered op-input-sm focus:outline-none hover:border-base-content w-full text-xs"
|
||||
placeholder={t("enter-email")}
|
||||
/>
|
||||
</div>
|
||||
<div className="mb-3">
|
||||
<label htmlFor="phone" className="block text-xs font-semibold">
|
||||
{t("phone")}
|
||||
</label>
|
||||
<input
|
||||
type="text"
|
||||
id="phone"
|
||||
value={phone}
|
||||
onChange={(e) => setPhone(e.target.value)}
|
||||
disabled={addYourself}
|
||||
className="op-input op-input-bordered op-input-sm focus:outline-none hover:border-base-content w-full text-xs"
|
||||
placeholder={t("phone-optional")}
|
||||
/>
|
||||
</div>
|
||||
<div className="mt-4 flex gap-x-2 justify-start">
|
||||
<button type="submit" className="op-btn op-btn-primary">
|
||||
{t("submit")}
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => handleReset()}
|
||||
className="op-btn op-btn-secondary"
|
||||
>
|
||||
{t("reset")}
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default AddSigner;
|
||||
@@ -225,7 +225,6 @@ const AddUser = (props) => {
|
||||
className="block text-xs font-semibold"
|
||||
>
|
||||
{t("phone")}
|
||||
{/* <span className="text-[red] text-[13px]"> *</span> */}
|
||||
</label>
|
||||
<input
|
||||
type="text"
|
||||
|
||||
@@ -25,13 +25,16 @@ const BulkSendUi = (props) => {
|
||||
|
||||
//function to check at least one signature field exist
|
||||
const signatureExist = async () => {
|
||||
const isPrefill = props?.Placeholders.some((x) => x?.Role === "prefill");
|
||||
const isPrefill =
|
||||
props?.Placeholders?.some((x) => x?.Role === "prefill") || false;
|
||||
if (isPrefill) {
|
||||
setIsPrefillExist(isPrefill);
|
||||
}
|
||||
setIsDisableBulkSend(false);
|
||||
const getPlaceholder = props?.Placeholders;
|
||||
const removePrefill = getPlaceholder.filter((x) => x?.Role !== "prefill");
|
||||
const removePrefill = getPlaceholder?.filter(
|
||||
(x) => x?.Role !== "prefill"
|
||||
);
|
||||
const checkIsSignatureExistt = removePrefill?.every((placeholderObj) =>
|
||||
placeholderObj?.placeHolder?.some((holder) =>
|
||||
holder?.pos?.some((posItem) => posItem?.type === "signature")
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import React, { useState, useEffect } from "react";
|
||||
import { useState, useEffect } from "react";
|
||||
import ModalUi from "../primitives/ModalUi";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
@@ -7,7 +7,6 @@ const ColumnSelector = ({
|
||||
allColumns = [],
|
||||
visibleColumns = [],
|
||||
columnLabels = {},
|
||||
defaultColumns = [],
|
||||
onApply,
|
||||
onClose
|
||||
}) => {
|
||||
@@ -42,7 +41,7 @@ const ColumnSelector = ({
|
||||
type="checkbox"
|
||||
checked={selected.includes(col)}
|
||||
onChange={() => handleChange(col)}
|
||||
className="mb-0"
|
||||
className="mb-0 cursor-pointer"
|
||||
/>
|
||||
<span className="whitespace-nowrap ml-1">
|
||||
{t(`report-heading.${col}`, { defaultValue: col })}
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
import { HTML5Backend } from "react-dnd-html5-backend";
|
||||
import { TouchBackend } from "react-dnd-touch-backend";
|
||||
import {
|
||||
DndProvider,
|
||||
TouchTransition,
|
||||
MouseTransition,
|
||||
Preview
|
||||
MouseTransition
|
||||
} from "react-dnd-multi-backend";
|
||||
import DragElement from "./pdf/DragElement";
|
||||
import LazyPage from "../primitives/LazyPage";
|
||||
import { GuidelinesProvider } from "../context/GuidelinesContext";
|
||||
|
||||
@@ -16,33 +12,13 @@ const HTML5toTouch = {
|
||||
id: "html5",
|
||||
backend: HTML5Backend,
|
||||
transition: MouseTransition
|
||||
},
|
||||
{
|
||||
id: "touch",
|
||||
backend: TouchBackend,
|
||||
options: { enableMouseEvents: true },
|
||||
preview: true,
|
||||
transition: TouchTransition
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
/* This handling in only for devices which support touch */
|
||||
const generatePreview = (props) => {
|
||||
const { item, style } = props;
|
||||
const newStyle = { ...style };
|
||||
|
||||
return (
|
||||
<div style={newStyle}>
|
||||
<DragElement {...item} />
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default function DragProvider({ Page, lazy = false }) {
|
||||
return (
|
||||
<DndProvider options={HTML5toTouch}>
|
||||
<Preview>{generatePreview}</Preview>
|
||||
<GuidelinesProvider>
|
||||
{lazy ? <LazyPage Page={Page} /> : <Page />}
|
||||
</GuidelinesProvider>
|
||||
|
||||
@@ -13,8 +13,8 @@ import {
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { appInfo } from "../constant/appinfo";
|
||||
import { useDispatch } from "react-redux";
|
||||
import { toggleSidebar } from "../redux/reducers/sidebarReducer.js";
|
||||
import { sessionStatus } from "../redux/reducers/userReducer.js";
|
||||
import { toggleSidebar } from "../redux/reducers/sidebarReducer";
|
||||
import { sessionStatus } from "../redux/reducers/userReducer";
|
||||
|
||||
const Header = ({ isConsole, setIsLoggingOut }) => {
|
||||
const { t, i18n } = useTranslation();
|
||||
@@ -60,7 +60,6 @@ const Header = ({ isConsole, setIsLoggingOut }) => {
|
||||
setAppLogo(logo);
|
||||
}
|
||||
}
|
||||
|
||||
const handleLogout = async () => {
|
||||
setIsOpen(false);
|
||||
setIsLoggingOut(true);
|
||||
@@ -141,7 +140,10 @@ const Header = ({ isConsole, setIsLoggingOut }) => {
|
||||
</button>
|
||||
</div>
|
||||
<div className="flex-1 ml-2">
|
||||
<div className="h-[25px] md:h-[40px] w-auto overflow-hidden">
|
||||
<div
|
||||
onClick={() => navigate("/dashboard/35KBoSgoAK")}
|
||||
className="h-[25px] md:h-[40px] w-auto overflow-hidden cursor-pointer"
|
||||
>
|
||||
{applogo && (
|
||||
<img
|
||||
className="object-contain h-full w-auto"
|
||||
|
||||
@@ -7,7 +7,6 @@ import Loader from "../../primitives/Loader";
|
||||
import { useTranslation } from "react-i18next";
|
||||
function DashboardReport(props) {
|
||||
const { t } = useTranslation();
|
||||
// console.log("props ", props)
|
||||
const [List, setList] = useState([]);
|
||||
const [isLoader, setIsLoader] = useState(true);
|
||||
const [reportName, setReportName] = useState("");
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import React, { Suspense } from "react";
|
||||
import { useState, useEffect, Suspense } from "react";
|
||||
import { lazyWithRetry } from "../../utils";
|
||||
import { useTranslation } from "react-i18next";
|
||||
const DashboardButton = lazyWithRetry(() => import("./DashboardButton"));
|
||||
@@ -20,6 +20,7 @@ const buttonList = [
|
||||
];
|
||||
const GetDashboard = (props) => {
|
||||
const { t } = useTranslation();
|
||||
|
||||
const Button = ({ label, redirectId, redirectType, icon }) => (
|
||||
<DashboardButton
|
||||
Icon={icon}
|
||||
@@ -59,7 +60,9 @@ const GetDashboard = (props) => {
|
||||
<div data-tut={col.widget.data.tourSection}>
|
||||
<Suspense fallback={<div>please wait</div>}>
|
||||
<div className="mb-3 md:mb-0">
|
||||
<DashboardReport Record={col.widget} />
|
||||
<DashboardReport
|
||||
Record={col.widget}
|
||||
/>
|
||||
</div>
|
||||
</Suspense>
|
||||
</div>
|
||||
@@ -93,7 +96,9 @@ const GetDashboard = (props) => {
|
||||
return (
|
||||
<Suspense fallback={<div>please wait</div>}>
|
||||
<div className="mb-3 md:mb-0">
|
||||
<DashboardReport Record={col.widget} />
|
||||
<DashboardReport
|
||||
Record={col.widget}
|
||||
/>
|
||||
</div>
|
||||
</Suspense>
|
||||
);
|
||||
|
||||
@@ -71,11 +71,9 @@ function DriveBody(props) {
|
||||
});
|
||||
props.setPdfData(updatedData);
|
||||
props.sortingData(null, null, updatedData);
|
||||
await axios
|
||||
.put(
|
||||
`${localStorage.getItem(
|
||||
"baseUrl"
|
||||
)}classes/contracts_Document/${docId}`,
|
||||
try {
|
||||
await axios.put(
|
||||
`${localStorage.getItem("baseUrl")}classes/contracts_Document/${docId}`,
|
||||
updateName,
|
||||
{
|
||||
headers: {
|
||||
@@ -84,18 +82,14 @@ function DriveBody(props) {
|
||||
"X-Parse-Session-Token": localStorage.getItem("accesstoken")
|
||||
}
|
||||
}
|
||||
)
|
||||
.then(() => {
|
||||
// const res = result.data;
|
||||
// console.log("res", res);
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log("Err ", err);
|
||||
props.setIsAlert({
|
||||
isShow: true,
|
||||
alertMessage: t("something-went-wrong-mssg")
|
||||
});
|
||||
);
|
||||
} catch (err) {
|
||||
console.log("Err ", err);
|
||||
props.setIsAlert({
|
||||
isShow: true,
|
||||
alertMessage: t("something-went-wrong-mssg")
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -245,7 +239,6 @@ function DriveBody(props) {
|
||||
)
|
||||
|
||||
.then((Listdata) => {
|
||||
// console.log("Listdata ", Listdata);
|
||||
const res = Listdata.data;
|
||||
if (res) {
|
||||
const updatedData = props.pdfData.filter(
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import React, { useState, useEffect } from "react";
|
||||
import { useState, useEffect } from "react";
|
||||
import ModalUi from "../../primitives/ModalUi";
|
||||
import { fontsizeArr, fontColorArr } from "../../constant/Utils";
|
||||
import { useTranslation } from "react-i18next";
|
||||
@@ -7,7 +7,7 @@ export default function CellsSettingModal({
|
||||
isOpen,
|
||||
handleClose,
|
||||
defaultData,
|
||||
handleSave
|
||||
handleSave,
|
||||
}) {
|
||||
const { t } = useTranslation();
|
||||
const [name, setName] = useState("");
|
||||
@@ -31,13 +31,16 @@ export default function CellsSettingModal({
|
||||
name,
|
||||
cellCount: parseInt(cellCount, 10),
|
||||
fontSize,
|
||||
fontColor
|
||||
fontColor,
|
||||
});
|
||||
};
|
||||
|
||||
return (
|
||||
<ModalUi isOpen={isOpen} handleClose={handleClose} title={t("widget-info")}>
|
||||
<form onSubmit={onSubmit} className="p-[20px] text-base-content flex flex-col gap-3">
|
||||
<ModalUi isOpen={isOpen} handleClose={handleClose} title={t("widget-info")}>
|
||||
<form
|
||||
onSubmit={onSubmit}
|
||||
className="p-[20px] text-base-content flex flex-col gap-3"
|
||||
>
|
||||
<div>
|
||||
<label htmlFor="name" className="text-[13px]">
|
||||
{t("name")} <span className="text-[red]">*</span>
|
||||
@@ -91,7 +94,10 @@ export default function CellsSettingModal({
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
<span className="w-5 h-[19px] ml-1" style={{ background: fontColor }} />
|
||||
<span
|
||||
className="w-5 h-[19px] ml-1"
|
||||
style={{ background: fontColor }}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div className="h-[1px] w-full bg-[#b7b3b3] my-[16px]"></div>
|
||||
|
||||
@@ -3,6 +3,8 @@ import ModalUi from "../../primitives/ModalUi";
|
||||
import { EmailBody } from "./EmailBody";
|
||||
import {
|
||||
contractDocument,
|
||||
defaultMailBody,
|
||||
defaultMailSubject,
|
||||
sendEmailToSigners
|
||||
} from "../../constant/Utils";
|
||||
import { useTranslation } from "react-i18next";
|
||||
@@ -101,7 +103,10 @@ function CustomizeMail(props) {
|
||||
<div
|
||||
className="flex justify-end items-center gap-1 mt-2 op-link op-link-primary"
|
||||
onClick={() => {
|
||||
props?.setCustomizeMail(props?.defaultMail);
|
||||
props?.setCustomizeMail({
|
||||
subject: defaultMailSubject,
|
||||
body: defaultMailBody
|
||||
});
|
||||
}}
|
||||
>
|
||||
<span>{t("reset-to-default")}</span>
|
||||
|
||||
@@ -0,0 +1,76 @@
|
||||
import { useDragLayer } from "react-dnd";
|
||||
import { defaultWidthHeight } from "../../constant/Utils";
|
||||
import { useEffect, useRef } from "react";
|
||||
|
||||
function DragGuideLinesLayer(props) {
|
||||
const { showGuidelines } = props;
|
||||
const prevDragState = useRef({ isDragging: false, x: 0, y: 0 });
|
||||
const { isDraggingWidgets, offset, itemType } = useDragLayer((monitor) => ({
|
||||
isDraggingWidgets: monitor.isDragging(),
|
||||
offset: monitor.getClientOffset(),
|
||||
itemType: monitor.getItem()
|
||||
}));
|
||||
useEffect(() => {
|
||||
if (!offset) return;
|
||||
//getting container by id
|
||||
const container = document.getElementById("container");
|
||||
if (!container) return;
|
||||
if (itemType?.text) {
|
||||
// Calculate the position of the dragged element relative to the container
|
||||
// Get the container's bounding rectangle (position and size in the viewport)
|
||||
const containerRect = container.getBoundingClientRect();
|
||||
|
||||
// Compute the X and Y coordinates of the dragged item inside the container
|
||||
// by subtracting the container's top-left offset from the current drag offset
|
||||
const x = offset.x - containerRect.left;
|
||||
const y = offset.y - containerRect.top;
|
||||
|
||||
// Check if there’s any change in the dragging state or the dragged element’s position
|
||||
// Compare the current drag state with the previously stored one
|
||||
const hasStateChanged =
|
||||
prevDragState.current.isDragging !== isDraggingWidgets || // Drag started or stopped
|
||||
prevDragState.current.x !== x || // X position changed
|
||||
prevDragState.current.y !== y; // Y position changed
|
||||
|
||||
if (hasStateChanged) {
|
||||
// Update the previous drag state with the latest values
|
||||
prevDragState.current = { isDragging: isDraggingWidgets, x, y };
|
||||
|
||||
if (isDraggingWidgets) {
|
||||
// Adjust the current drag coordinates relative to the initial widgets button position
|
||||
const getXPosition = props?.signBtnPosition?.[0]
|
||||
? x - props.signBtnPosition[0].xPos
|
||||
: x;
|
||||
const getYPosition = props?.signBtnPosition?.[0]
|
||||
? y - props.signBtnPosition[0].yPos
|
||||
: y;
|
||||
|
||||
// Get the default width and height of the dragged checkbox/radio widget type
|
||||
const el = document.getElementById("checkbox&radio-preview");
|
||||
let rect;
|
||||
if (el) {
|
||||
rect = el.getBoundingClientRect();
|
||||
}
|
||||
const widget = {
|
||||
type: itemType?.text,
|
||||
width: defaultWidthHeight(itemType?.text).width,
|
||||
height: defaultWidthHeight(itemType?.text).height
|
||||
};
|
||||
|
||||
const getWidth =
|
||||
rect?.width || props?.posWidth(widget, props?.isSignYourself);
|
||||
const getHeight =
|
||||
rect?.height || props?.posHeight(widget, props?.isSignYourself);
|
||||
|
||||
// Display the alignment guidelines based on the current drag position and widget size
|
||||
showGuidelines(true, getXPosition, getYPosition, getWidth, getHeight);
|
||||
} else {
|
||||
// Hide guidelines when dragging stops
|
||||
showGuidelines(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}, [isDraggingWidgets, offset, itemType, showGuidelines]);
|
||||
}
|
||||
|
||||
export default DragGuideLinesLayer;
|
||||
@@ -31,7 +31,6 @@ function EmailComponent({
|
||||
setIsLoading(true);
|
||||
const params = { docId: pdfDetails?.[0]?.objectId, recipients: emailList };
|
||||
const sendmail = await Parse.Cloud.run("forwarddoc", params);
|
||||
console.log("sendmail ", sendmail);
|
||||
if (sendmail?.status === "success") {
|
||||
setSuccessEmail(true);
|
||||
setIsEmail(false);
|
||||
|
||||
@@ -7,7 +7,6 @@ import {
|
||||
fontColorArr,
|
||||
fontsizeArr,
|
||||
getContainerScale,
|
||||
handleCopyNextToWidget,
|
||||
handleHeighlightWidget,
|
||||
onChangeInput,
|
||||
radioButtonWidget,
|
||||
@@ -15,24 +14,21 @@ import {
|
||||
cellsWidget,
|
||||
textWidget,
|
||||
selectFormat,
|
||||
randomId,
|
||||
getYear,
|
||||
getMonth,
|
||||
months,
|
||||
years,
|
||||
getDefaultDate,
|
||||
getDefaultFormat
|
||||
getDefaultFormat,
|
||||
handleBackground
|
||||
} from "../../constant/Utils";
|
||||
import PlaceholderType from "./PlaceholderType";
|
||||
import moment from "moment";
|
||||
import "../../styles/opensigndrive.css";
|
||||
import ModalUi from "../../primitives/ModalUi";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { useDispatch, useSelector } from "react-redux";
|
||||
import {
|
||||
setIsShowModal,
|
||||
setPrefillImg
|
||||
} from "../../redux/reducers/widgetSlice";
|
||||
import { useDispatch } from "react-redux";
|
||||
import { setIsShowModal } from "../../redux/reducers/widgetSlice";
|
||||
import { themeColor } from "../../constant/const";
|
||||
import { useGuidelinesContext } from "../../context/GuidelinesContext";
|
||||
import DatePicker from "react-datepicker";
|
||||
@@ -40,7 +36,6 @@ import DatePicker from "react-datepicker";
|
||||
function Placeholder(props) {
|
||||
const { t } = useTranslation();
|
||||
const dispatch = useDispatch();
|
||||
const prefillImg = useSelector((state) => state.widget.prefillImg);
|
||||
const { showGuidelines } = useGuidelinesContext();
|
||||
const statusArr = ["Required", "Optional"];
|
||||
const widgetData =
|
||||
@@ -221,16 +216,17 @@ function Placeholder(props) {
|
||||
//placeholder, template flow
|
||||
else if (props.isPlaceholder && !props.isDragging) {
|
||||
props.setCurrWidgetsDetails && props.setCurrWidgetsDetails(props.pos);
|
||||
if (
|
||||
props.pos.key === props?.currWidgetsDetails?.key &&
|
||||
props?.data?.Role !== "prefill"
|
||||
) {
|
||||
props.handleLinkUser(props.data.Id);
|
||||
if (props?.data?.Role !== "prefill") {
|
||||
//this condition is used open signers attach modal but it should only open when widgets already selected
|
||||
if (props?.currWidgetsDetails?.key === props.pos?.key) {
|
||||
props.handleLinkUser(props.data.Id);
|
||||
}
|
||||
props.setUniqueId(props.data.Id);
|
||||
const checkIndex = props.xyPosition.findIndex(
|
||||
(data) => data.Id === props.data.Id
|
||||
);
|
||||
props.setIsSelectId(checkIndex || 0);
|
||||
props?.setRoleName("");
|
||||
} else if (props?.data?.Role === "prefill") {
|
||||
dispatch(setIsShowModal({ [props.pos.key]: true }));
|
||||
props.setUniqueId(props?.data?.Id);
|
||||
@@ -267,7 +263,8 @@ function Placeholder(props) {
|
||||
(props.isSignYourself || props.isSelfSign)
|
||||
) {
|
||||
props.handleTextSettingModal(true);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
props?.handleNameModal && props?.handleNameModal(true);
|
||||
}
|
||||
|
||||
@@ -305,37 +302,8 @@ function Placeholder(props) {
|
||||
) {
|
||||
props.setUniqueId(props?.data?.Id);
|
||||
}
|
||||
|
||||
//checking widget's type and open widget copy modal for required widgets
|
||||
if (
|
||||
["signature", textInputWidget, textWidget, "stamp", "initials"].includes(
|
||||
props.pos.type
|
||||
)
|
||||
) {
|
||||
props.setIsPageCopy(true);
|
||||
props.setCurrWidgetsDetails(props.pos);
|
||||
} else {
|
||||
const newId = randomId();
|
||||
//function to create new widget next to just widget
|
||||
handleCopyNextToWidget(
|
||||
newId,
|
||||
props.pos,
|
||||
props.xyPosition,
|
||||
props.index,
|
||||
props.setXyPosition,
|
||||
props.data && props.data?.Id
|
||||
);
|
||||
//condiiton is used to store copied prefill image base64 url in redux for display image
|
||||
if (props?.data?.Role === "prefill") {
|
||||
const getPrefillImg = prefillImg?.find((x) => x.id === props.pos.key);
|
||||
dispatch(
|
||||
setPrefillImg({
|
||||
id: newId,
|
||||
base64: getPrefillImg?.base64
|
||||
})
|
||||
);
|
||||
}
|
||||
}
|
||||
props.setIsPageCopy(true);
|
||||
props.setCurrWidgetsDetails(props.pos);
|
||||
};
|
||||
|
||||
const setCellCount = (key, newCount) => {
|
||||
@@ -599,7 +567,7 @@ function Placeholder(props) {
|
||||
}
|
||||
}
|
||||
};
|
||||
//function to calculate font size
|
||||
// function to calculate font size
|
||||
const calculateFont = (size, isMinHeight) => {
|
||||
const containerScale = getContainerScale(
|
||||
props.pdfOriginalWH,
|
||||
@@ -607,7 +575,7 @@ function Placeholder(props) {
|
||||
props.containerWH
|
||||
);
|
||||
const fontSize = (size || 12) * containerScale * props.scale;
|
||||
//isMinHeight to set text box minimum height
|
||||
// isMinHeight to set text box minimum height
|
||||
if (isMinHeight) {
|
||||
return fontSize * 1.5 + "px";
|
||||
} else {
|
||||
@@ -629,22 +597,6 @@ function Placeholder(props) {
|
||||
}
|
||||
};
|
||||
|
||||
//function to handle widget background color
|
||||
const handleBackground = () => {
|
||||
if (props.data) {
|
||||
if (props.isNeedSign) {
|
||||
if (props.data?.Id === props?.uniqueId) {
|
||||
return props.data?.blockColor + "b0";
|
||||
} else {
|
||||
return "#dedddc";
|
||||
}
|
||||
} else {
|
||||
return props.data?.blockColor + "b0";
|
||||
}
|
||||
} else {
|
||||
return "rgba(203, 233, 237, 0.69)";
|
||||
}
|
||||
};
|
||||
const fontSize = calculateFont(props.pos.options?.fontSize);
|
||||
const fontColor = props.pos.options?.fontColor || "black";
|
||||
|
||||
@@ -695,10 +647,7 @@ function Placeholder(props) {
|
||||
};
|
||||
const handleClearDate = () => {
|
||||
setIsToday(false);
|
||||
setSelectDate((prev) => ({
|
||||
...prev,
|
||||
date: ""
|
||||
}));
|
||||
setSelectDate((prev) => ({ ...prev, date: "" }));
|
||||
};
|
||||
return (
|
||||
<>
|
||||
@@ -710,18 +659,24 @@ function Placeholder(props) {
|
||||
onClick={() => {
|
||||
props.setCurrWidgetsDetails &&
|
||||
props.setCurrWidgetsDetails(props.pos);
|
||||
props?.setRoleName("prefill");
|
||||
props.setUniqueId(props?.data?.Id);
|
||||
}}
|
||||
style={{
|
||||
fontFamily: "Arial, sans-serif",
|
||||
position: "absolute",
|
||||
left: xPos(props.pos, props.isSignYourself),
|
||||
top: yPos(props.pos, props.isSignYourself),
|
||||
...(props.pos?.Width ? { width: props.pos?.Width - 5 } : {}),
|
||||
...(props.pos?.Height ? { height: props.pos?.Height } : {}),
|
||||
fontSize: fontSize,
|
||||
color: fontColor,
|
||||
zIndex: 99
|
||||
}}
|
||||
>
|
||||
{props.pos?.options?.response}
|
||||
{
|
||||
props.pos?.options?.response
|
||||
}
|
||||
</span>
|
||||
) : (
|
||||
<Rnd
|
||||
@@ -778,7 +733,11 @@ function Placeholder(props) {
|
||||
background:
|
||||
props?.data?.Role === "prefill"
|
||||
? "transparent"
|
||||
: handleBackground() //handle block color of widget for
|
||||
: handleBackground(
|
||||
props?.data,
|
||||
props?.isNeedSign,
|
||||
props?.uniqueId
|
||||
) //handle block color of widget for
|
||||
}}
|
||||
onDrag={(_, d) => {
|
||||
props?.handleTabDrag?.(props.pos.key);
|
||||
@@ -1039,10 +998,7 @@ function Placeholder(props) {
|
||||
type="checkbox"
|
||||
className="op-checkbox op-checkbox-xs"
|
||||
onClick={() => {
|
||||
setSelectDate((prev) => ({
|
||||
...prev,
|
||||
date: ""
|
||||
}));
|
||||
setSelectDate((prev) => ({ ...prev, date: "" }));
|
||||
setIsToday(!isToday);
|
||||
}}
|
||||
/>
|
||||
@@ -1151,9 +1107,7 @@ function Placeholder(props) {
|
||||
<button
|
||||
type="button"
|
||||
className="op-btn op-btn-primary"
|
||||
onClick={() => {
|
||||
saveDateSetting(selectDate);
|
||||
}}
|
||||
onClick={() => saveDateSetting(selectDate)}
|
||||
>
|
||||
{t("save")}
|
||||
</button>
|
||||
|
||||
@@ -2,9 +2,12 @@ import { useState } from "react";
|
||||
import ModalUi from "../../primitives/ModalUi";
|
||||
import { handleCopyNextToWidget, randomId } from "../../constant/Utils";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { setPrefillImg } from "../../redux/reducers/widgetSlice";
|
||||
import { useDispatch } from "react-redux";
|
||||
|
||||
function PlaceholderCopy(props) {
|
||||
const { t } = useTranslation();
|
||||
const dispatch = useDispatch();
|
||||
const copyType = [
|
||||
{ id: 1, type: "All pages" },
|
||||
{ id: 2, type: "All pages but last" },
|
||||
@@ -121,7 +124,7 @@ function PlaceholderCopy(props) {
|
||||
);
|
||||
for (let i = 0; i < props.allPages; i++) {
|
||||
const newId = randomId();
|
||||
const nameId = randomId(2)
|
||||
const nameId = randomId(2);
|
||||
const widgetName = `${currentPlaceholder?.options?.name}${nameId}`;
|
||||
const newPlaceholder = {
|
||||
...currentPlaceholder,
|
||||
@@ -134,7 +137,6 @@ function PlaceholderCopy(props) {
|
||||
);
|
||||
const existPlaceholderPosition =
|
||||
existPlaceholder[0] && existPlaceholder[0].pos;
|
||||
|
||||
//function for get copy to requested location of placeholder position
|
||||
const getPlaceholderObj = getCopyPlaceholderPosition(
|
||||
type,
|
||||
@@ -146,6 +148,18 @@ function PlaceholderCopy(props) {
|
||||
newPlaceholderPosition.push(getPlaceholderObj);
|
||||
}
|
||||
newPageNumber++;
|
||||
if (
|
||||
filterSignerPosition[0]?.Role === "prefill" &&
|
||||
currentPlaceholder?.options?.response &&
|
||||
currentPlaceholder?.type === "image"
|
||||
) {
|
||||
dispatch(
|
||||
setPrefillImg({
|
||||
id: newId,
|
||||
base64: currentPlaceholder?.options?.response
|
||||
})
|
||||
);
|
||||
}
|
||||
}
|
||||
let updatedSignerPlaceholder;
|
||||
if (props?.signerObjId) {
|
||||
@@ -240,6 +254,18 @@ function PlaceholderCopy(props) {
|
||||
props.setXyPosition,
|
||||
props?.Id
|
||||
);
|
||||
if (
|
||||
filterSignerPosition[0]?.Role === "prefill" &&
|
||||
currentXYposition?.options?.response &&
|
||||
currentXYposition?.type === "image"
|
||||
) {
|
||||
dispatch(
|
||||
setPrefillImg({
|
||||
id: newId,
|
||||
base64: currentXYposition?.options?.response
|
||||
})
|
||||
);
|
||||
}
|
||||
} else {
|
||||
const getIndex = props?.xyPosition.findIndex(
|
||||
(data) => data.pageNumber === props.pageNumber
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { useEffect, useState, forwardRef } from "react";
|
||||
import { useEffect, useMemo, useState, forwardRef } from "react";
|
||||
import {
|
||||
getMonth,
|
||||
getYear,
|
||||
@@ -10,7 +10,8 @@ import {
|
||||
years,
|
||||
selectCheckbox,
|
||||
checkRegularExpress,
|
||||
isBase64
|
||||
isBase64,
|
||||
getSignerPages
|
||||
} from "../../constant/Utils";
|
||||
import DatePicker from "react-datepicker";
|
||||
import "react-datepicker/dist/react-datepicker.css";
|
||||
@@ -19,6 +20,7 @@ import { useTranslation } from "react-i18next";
|
||||
import CellsWidget from "./CellsWidget";
|
||||
import { useSelector } from "react-redux";
|
||||
import Loader from "../../primitives/Loader";
|
||||
|
||||
const textWidgetCls =
|
||||
"w-full h-full md:min-w-full md:min-h-full z-[999] text-[12px] overflow-hidden resize-none outline-none text-base-content item-center whitespace-pre-wrap";
|
||||
const widgetCls =
|
||||
@@ -40,10 +42,10 @@ function PlaceholderType(props) {
|
||||
// prefer the latest response value over any default value
|
||||
const widgetData =
|
||||
props.pos?.options?.response ?? props.pos?.options?.defaultValue ?? "";
|
||||
const widgetTypeTranslation = t(`widgets-name.${props?.pos?.type}`);
|
||||
// const widgetTypeTranslation = t(`widgets-name.${props?.pos?.type}`);
|
||||
const [widgetValue, setwidgetValue] = useState();
|
||||
const [selectedCheckbox, setSelectedCheckbox] = useState([]);
|
||||
const [hint, setHint] = useState("");
|
||||
// const [hint, setHint] = useState("");
|
||||
const [imgUrl, setImgUrl] = useState("");
|
||||
const fontSize = props.calculateFont(props.pos.options?.fontSize);
|
||||
const fontColor = props.pos.options?.fontColor || "black";
|
||||
@@ -65,18 +67,21 @@ function PlaceholderType(props) {
|
||||
props?.pos?.options?.defaultValue ||
|
||||
[]
|
||||
);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
// keep displayed value in sync with the stored response
|
||||
setwidgetValue(widgetData);
|
||||
}
|
||||
if (props.pos?.options?.hint) {
|
||||
setHint(props.pos?.options.hint);
|
||||
} else if (props.pos?.options?.validation?.type) {
|
||||
checkRegularExpress(props.pos?.options?.validation?.type, setHint);
|
||||
}
|
||||
// if (props.pos?.options?.hint) {
|
||||
// setHint(props.pos?.options.hint);
|
||||
// } else if (props.pos?.options?.validation?.type) {
|
||||
// checkRegularExpress(props.pos?.options?.validation?.type, setHint);
|
||||
// }
|
||||
}
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [props.pos]);
|
||||
}, [props.pos, widgetData, type]);
|
||||
|
||||
|
||||
const ExampleCustomInput = forwardRef(({ value, onClick }, ref) => (
|
||||
<div
|
||||
style={{
|
||||
@@ -125,6 +130,14 @@ function PlaceholderType(props) {
|
||||
loadImage();
|
||||
}, [props.pos.SignUrl]);
|
||||
|
||||
const formatWidgetName = () => {
|
||||
const widgetName = props?.pos?.options?.name;
|
||||
const name = widgetName ? widgetName?.split(`-`) : ["-", "-", "-"];
|
||||
const lastWord = name.length > 1 ? `-${name[name.length - 1]}` : "";
|
||||
const title =
|
||||
props?.pos?.type === name[0] ? `${name[0]}${lastWord}` : widgetName;
|
||||
return props?.pos?.options?.hint || title;
|
||||
};
|
||||
switch (type) {
|
||||
case "signature":
|
||||
return props.pos.SignUrl ? (
|
||||
@@ -145,7 +158,7 @@ function PlaceholderType(props) {
|
||||
}}
|
||||
className="font-medium"
|
||||
>
|
||||
{hint || widgetTypeTranslation}
|
||||
{formatWidgetName()}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
@@ -169,7 +182,7 @@ function PlaceholderType(props) {
|
||||
}}
|
||||
className="font-medium"
|
||||
>
|
||||
{hint || widgetTypeTranslation}
|
||||
{formatWidgetName()}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
@@ -216,9 +229,11 @@ function PlaceholderType(props) {
|
||||
case textInputWidget:
|
||||
return props.isSignYourself || iswidgetEnable ? (
|
||||
<textarea
|
||||
placeholder={hint || t("widgets-name.text")}
|
||||
placeholder={formatWidgetName()}
|
||||
rows={1}
|
||||
value={widgetValue}
|
||||
value={
|
||||
widgetValue
|
||||
}
|
||||
className={`${textWidgetCls} ${isReadOnly ? "select-none" : ""}`}
|
||||
style={{
|
||||
fontSize: fontSize,
|
||||
@@ -232,7 +247,7 @@ function PlaceholderType(props) {
|
||||
/>
|
||||
) : (
|
||||
<div style={textWidgetStyle} className="select-none-cls">
|
||||
<span>{hint || widgetTypeTranslation}</span>
|
||||
<span className="ml-0.5">{formatWidgetName()}</span>
|
||||
</div>
|
||||
);
|
||||
case cellsWidget: {
|
||||
@@ -251,12 +266,14 @@ function PlaceholderType(props) {
|
||||
isEnabled={iswidgetEnable}
|
||||
count={count}
|
||||
height={height}
|
||||
value={cells.join("")}
|
||||
value={
|
||||
cells.join("")
|
||||
}
|
||||
editable={isEditable}
|
||||
resizable={props?.isAllowModify}
|
||||
fontSize={fontSize}
|
||||
fontColor={fontColor}
|
||||
hint={hint}
|
||||
hint={formatWidgetName()}
|
||||
onCellCountChange={handleCellResize}
|
||||
/>
|
||||
);
|
||||
@@ -290,7 +307,7 @@ function PlaceholderType(props) {
|
||||
}}
|
||||
className="font-medium text-center"
|
||||
>
|
||||
{hint || widgetTypeTranslation}
|
||||
{formatWidgetName()}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
@@ -299,9 +316,11 @@ function PlaceholderType(props) {
|
||||
return iswidgetEnable ? (
|
||||
<textarea
|
||||
readOnly
|
||||
placeholder={hint || widgetTypeTranslation}
|
||||
placeholder={formatWidgetName()}
|
||||
rows={1}
|
||||
value={widgetValue}
|
||||
value={
|
||||
widgetValue
|
||||
}
|
||||
className={`${textWidgetCls} ${isReadOnly ? "select-none" : ""}`}
|
||||
style={{
|
||||
fontSize: fontSize,
|
||||
@@ -314,16 +333,18 @@ function PlaceholderType(props) {
|
||||
/>
|
||||
) : (
|
||||
<div className="flex h-full select-none-cls" style={textWidgetStyle}>
|
||||
<span> {props.pos?.options?.hint || widgetTypeTranslation}</span>
|
||||
<span className="ml-0.5">{formatWidgetName()}</span>
|
||||
</div>
|
||||
);
|
||||
case "company":
|
||||
return iswidgetEnable ? (
|
||||
<textarea
|
||||
readOnly
|
||||
placeholder={hint || widgetTypeTranslation}
|
||||
placeholder={formatWidgetName()}
|
||||
rows={1}
|
||||
value={widgetValue}
|
||||
value={
|
||||
widgetValue
|
||||
}
|
||||
className={`${textWidgetCls} ${isReadOnly ? "select-none" : ""}`}
|
||||
style={{
|
||||
fontSize: fontSize,
|
||||
@@ -336,16 +357,18 @@ function PlaceholderType(props) {
|
||||
/>
|
||||
) : (
|
||||
<div style={textWidgetStyle} className="select-none-cls">
|
||||
<span>{hint || widgetTypeTranslation}</span>
|
||||
<span className="ml-0.5">{formatWidgetName()}</span>
|
||||
</div>
|
||||
);
|
||||
case "job title":
|
||||
return iswidgetEnable ? (
|
||||
<textarea
|
||||
readOnly
|
||||
placeholder={hint || widgetTypeTranslation}
|
||||
placeholder={formatWidgetName()}
|
||||
rows={1}
|
||||
value={widgetValue}
|
||||
value={
|
||||
widgetValue
|
||||
}
|
||||
className={`${textWidgetCls} ${isReadOnly ? "select-none" : ""}`}
|
||||
style={{
|
||||
fontSize: fontSize,
|
||||
@@ -358,7 +381,7 @@ function PlaceholderType(props) {
|
||||
/>
|
||||
) : (
|
||||
<div style={textWidgetStyle} className="select-none-cls">
|
||||
<span>{hint || widgetTypeTranslation}</span>
|
||||
<span className="ml-0.5">{formatWidgetName()}</span>
|
||||
</div>
|
||||
);
|
||||
case "date":
|
||||
@@ -439,7 +462,7 @@ function PlaceholderType(props) {
|
||||
}}
|
||||
className="font-medium text-center"
|
||||
>
|
||||
{hint || widgetTypeTranslation}
|
||||
{formatWidgetName()}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
@@ -448,9 +471,11 @@ function PlaceholderType(props) {
|
||||
return iswidgetEnable ? (
|
||||
<textarea
|
||||
readOnly
|
||||
placeholder={hint || widgetTypeTranslation}
|
||||
placeholder={formatWidgetName()}
|
||||
rows={1}
|
||||
value={widgetValue}
|
||||
value={
|
||||
widgetValue
|
||||
}
|
||||
className={`${textWidgetCls} ${isReadOnly ? "select-none" : ""}`}
|
||||
style={{
|
||||
fontSize: fontSize,
|
||||
@@ -463,7 +488,7 @@ function PlaceholderType(props) {
|
||||
/>
|
||||
) : (
|
||||
<div style={textWidgetStyle} className="select-none-cls">
|
||||
<span>{hint || widgetTypeTranslation}</span>
|
||||
<span className="ml-0.5">{formatWidgetName()}</span>
|
||||
</div>
|
||||
);
|
||||
case radioButtonWidget:
|
||||
@@ -508,7 +533,9 @@ function PlaceholderType(props) {
|
||||
readOnly
|
||||
placeholder={t("widgets-name.text")}
|
||||
rows={1}
|
||||
value={widgetValue}
|
||||
value={
|
||||
widgetValue
|
||||
}
|
||||
className={textWidgetCls}
|
||||
style={{
|
||||
fontFamily: "Arial, sans-serif",
|
||||
@@ -541,7 +568,7 @@ function PlaceholderType(props) {
|
||||
}}
|
||||
className="font-medium"
|
||||
>
|
||||
{hint || widgetTypeTranslation}
|
||||
{formatWidgetName()}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
@@ -28,6 +28,8 @@ import {
|
||||
} from "../../redux/reducers/widgetSlice";
|
||||
import * as utils from "../../utils";
|
||||
|
||||
const widgetTitle = "font-medium";
|
||||
|
||||
const ShowTextWidget = ({ position, handleWidgetDetails }) => {
|
||||
const inputRef = useRef(null);
|
||||
const [inputValue, setInputValue] = useState(position.options.response || "");
|
||||
@@ -46,13 +48,77 @@ const ShowTextWidget = ({ position, handleWidgetDetails }) => {
|
||||
);
|
||||
};
|
||||
|
||||
const ImageComponent = (props) => {
|
||||
const { t } = useTranslation();
|
||||
const prefillImg = useSelector((state) => state.widget.prefillImg);
|
||||
const imageRefs = useRef({});
|
||||
|
||||
let imgUrl = "";
|
||||
const isBase64Url = isBase64(props?.position?.SignUrl);
|
||||
if (isBase64Url) {
|
||||
imgUrl = props?.position?.SignUrl;
|
||||
} else {
|
||||
const getPrefillImg = prefillImg?.find(
|
||||
(x) => x.id === props?.position?.key
|
||||
);
|
||||
imgUrl = getPrefillImg?.base64;
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<span className={widgetTitle}>{props?.position.options?.name}</span>
|
||||
{imgUrl ? (
|
||||
<>
|
||||
<div className="cursor-pointer op-card border-[1px] border-gray-400 flex flex-col w-full h-full justify-center items-center ">
|
||||
<img
|
||||
alt="print img"
|
||||
ref={(el) => (imageRefs.current[props?.position.key] = el)} // Assign ref dynamicallys
|
||||
src={imgUrl}
|
||||
draggable="false"
|
||||
className="object-contain h-full w-full aspect-[5/2]"
|
||||
onLoad={() => props?.handleImageLoaded?.(props?.position.key)}
|
||||
onError={() => props?.handleImageLoaded?.(props?.position.key)}
|
||||
/>
|
||||
</div>
|
||||
<span
|
||||
onClick={() => props?.handleClearImage(props?.position)}
|
||||
className="flex justify-start text-blue-500 underline cursor-pointer"
|
||||
>
|
||||
{t("clear")}
|
||||
</span>
|
||||
</>
|
||||
) : (
|
||||
<div
|
||||
className="cursor-pointer op-card border-[1px] op-border-hover flex flex-col overflow-hidden w-full h-full aspect-[5/2] justify-center items-center"
|
||||
onClick={() => imageRefs.current[props?.position.key]?.click()}
|
||||
>
|
||||
{props?.imageLoaders[props?.position?.key] && (
|
||||
<div className="absolute w-full h-full inset-0 flex justify-center items-center bg-white/30 z-50">
|
||||
<Loader />
|
||||
</div>
|
||||
)}
|
||||
<input
|
||||
type="file"
|
||||
onChange={(e) => props?.onImageChange?.(e, props?.position)}
|
||||
className="filetype"
|
||||
accept="image/png,image/jpeg"
|
||||
ref={(el) => (imageRefs.current[props?.position.key] = el)} // Assign ref dynamically
|
||||
hidden
|
||||
/>
|
||||
<i className="fa-light text-base-content fa-cloud-upload-alt text-[25px]"></i>
|
||||
<div className="text-[10px] text-base-content">{t("upload")}</div>
|
||||
</div>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
function PrefillWidgetModal(props) {
|
||||
const { t } = useTranslation();
|
||||
const dispatch = useDispatch();
|
||||
// Track already loaded image keys so they don't increment multiple times
|
||||
const loadedSet = useRef(new Set());
|
||||
const initializedRef = useRef(false); // prevent rerun on state updates
|
||||
const prefillImg = useSelector((state) => state.widget.prefillImg);
|
||||
const [image, setImage] = useState(null);
|
||||
const [imageLoaders, setImageLoaders] = useState({});
|
||||
const [currentWidget, setCurrentWidget] = useState("");
|
||||
@@ -61,7 +127,6 @@ function PrefillWidgetModal(props) {
|
||||
const [loadedImages, setLoadedImages] = useState(0);
|
||||
const [loading, setLoading] = useState(false);
|
||||
const years = range(1950, getYear(new Date()) + 16, 1);
|
||||
const widgetTitle = "font-medium";
|
||||
const isAnyLoaderActive = Object.values(imageLoaders).some(
|
||||
(val) => val === true
|
||||
);
|
||||
@@ -93,6 +158,7 @@ function PrefillWidgetModal(props) {
|
||||
|
||||
return flatArray || [];
|
||||
}, [props.prefillData]);
|
||||
|
||||
useEffect(() => {
|
||||
dispatch(resetWidgetState([]));
|
||||
}, []);
|
||||
@@ -163,67 +229,7 @@ function PrefillWidgetModal(props) {
|
||||
}
|
||||
return date;
|
||||
};
|
||||
const ImageComponent = (props) => {
|
||||
const imageRefs = useRef([]);
|
||||
let imgUrl = "";
|
||||
const isBase64Url = isBase64(props?.position?.SignUrl);
|
||||
if (isBase64Url) {
|
||||
imgUrl = props?.position?.SignUrl;
|
||||
} else {
|
||||
const getPrefillImg = prefillImg?.find(
|
||||
(x) => x.id === props?.position?.key
|
||||
);
|
||||
imgUrl = getPrefillImg?.base64;
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<span className={widgetTitle}>{props?.position.options?.name}</span>
|
||||
{imgUrl ? (
|
||||
<>
|
||||
<div className="cursor-pointer op-card border-[1px] border-gray-400 flex flex-col w-full h-full justify-center items-center ">
|
||||
<img
|
||||
alt="print img"
|
||||
ref={(el) => (imageRefs.current[props?.position.key] = el)} // Assign ref dynamicallys
|
||||
src={imgUrl}
|
||||
draggable="false"
|
||||
className="object-contain h-full w-full aspect-[5/2]"
|
||||
onLoad={() => handleImageLoaded?.(props?.position.key)}
|
||||
onError={() => handleImageLoaded?.(props?.position.key)}
|
||||
/>
|
||||
</div>
|
||||
<span
|
||||
onClick={() => handleClearImage(props?.position)}
|
||||
className="flex justify-start text-blue-500 underline cursor-pointer"
|
||||
>
|
||||
{t("clear")}
|
||||
</span>
|
||||
</>
|
||||
) : (
|
||||
<div
|
||||
className="cursor-pointer op-card border-[1px] op-border-hover flex flex-col overflow-hidden w-full h-full aspect-[5/2] justify-center items-center"
|
||||
onClick={() => imageRefs.current[props?.position.key]?.click()}
|
||||
>
|
||||
{imageLoaders[props?.position?.key] && (
|
||||
<div className="absolute w-full h-full inset-0 flex justify-center items-center bg-white/30 z-50">
|
||||
<Loader />
|
||||
</div>
|
||||
)}
|
||||
<input
|
||||
type="file"
|
||||
onChange={(e) => onImageChange(e, props?.position)}
|
||||
className="filetype"
|
||||
accept="image/png,image/jpeg"
|
||||
ref={(el) => (imageRefs.current[props?.position.key] = el)} // Assign ref dynamically
|
||||
hidden
|
||||
/>
|
||||
<i className="fa-light text-base-content fa-cloud-upload-alt text-[25px]"></i>
|
||||
<div className="text-[10px] text-base-content">{t("upload")}</div>
|
||||
</div>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
};
|
||||
const ExampleCustomInput = forwardRef(({ value, onClick }, ref) => (
|
||||
<div
|
||||
style={{ fontFamily: "Arial, sans-serif" }}
|
||||
@@ -273,7 +279,6 @@ function PrefillWidgetModal(props) {
|
||||
image.src,
|
||||
image.imgType
|
||||
);
|
||||
setImageLoaders({});
|
||||
if (imageUrl) {
|
||||
return imageUrl;
|
||||
}
|
||||
@@ -414,6 +419,7 @@ function PrefillWidgetModal(props) {
|
||||
// (tracks how many images have finished loading)
|
||||
setLoadedImages((prev) => prev + 1);
|
||||
}
|
||||
setImageLoaders({});
|
||||
};
|
||||
const handleWidgetType = (position) => {
|
||||
switch (position?.type) {
|
||||
@@ -432,9 +438,9 @@ function PrefillWidgetModal(props) {
|
||||
className="mt-[2px] op-checkbox op-checkbox-xs"
|
||||
type="checkbox"
|
||||
checked={selectCheckbox(ind, position)}
|
||||
onChange={(e) => {
|
||||
handleCheckboxValue(e.target.checked, ind, position);
|
||||
}}
|
||||
onChange={(e) =>
|
||||
handleCheckboxValue(e.target.checked, ind, position)
|
||||
}
|
||||
/>
|
||||
<label
|
||||
htmlFor={`checkbox-${position.key + ind}`}
|
||||
@@ -467,9 +473,7 @@ function PrefillWidgetModal(props) {
|
||||
value={
|
||||
position?.options?.response || position?.options?.defaultValue
|
||||
}
|
||||
onChange={(e) => {
|
||||
handleWidgetDetails(position, e.target.value);
|
||||
}}
|
||||
onChange={(e) => handleWidgetDetails(position, e.target.value)}
|
||||
>
|
||||
{/* Default/Title option */}
|
||||
<option value="" disabled hidden>
|
||||
@@ -519,9 +523,7 @@ function PrefillWidgetModal(props) {
|
||||
)}
|
||||
closeOnScroll={true}
|
||||
selected={handleDate(position)}
|
||||
onChange={(date) => {
|
||||
handleOnDateChange(date, position);
|
||||
}}
|
||||
onChange={(date) => handleOnDateChange(date, position)}
|
||||
customInput={<ExampleCustomInput />}
|
||||
dateFormat={position?.options?.validation?.format || "MM/dd/yyyy"}
|
||||
/>
|
||||
@@ -531,7 +533,10 @@ function PrefillWidgetModal(props) {
|
||||
return (
|
||||
<ImageComponent
|
||||
position={position}
|
||||
docId={props?.docId}
|
||||
imageLoaders={imageLoaders}
|
||||
onImageChange={onImageChange}
|
||||
handleImageLoaded={handleImageLoaded}
|
||||
handleClearImage={handleClearImage}
|
||||
/>
|
||||
);
|
||||
case radioButtonWidget:
|
||||
@@ -549,9 +554,7 @@ function PrefillWidgetModal(props) {
|
||||
className="mt-[2px] op-radio op-radio-xs"
|
||||
type="radio"
|
||||
checked={handleRadioCheck(data, position)}
|
||||
onChange={() => {
|
||||
handleWidgetDetails(position, data);
|
||||
}}
|
||||
onChange={() => handleWidgetDetails(position, data)}
|
||||
/>
|
||||
<label
|
||||
htmlFor={`radio-${position.key + ind}`}
|
||||
@@ -697,9 +700,9 @@ function PrefillWidgetModal(props) {
|
||||
multiValueLabel: () => "mb-[2px]",
|
||||
menu: () =>
|
||||
"mt-1 shadow-md rounded-lg bg-base-200 text-base-content absolute z-9999",
|
||||
menuList: () => "shadow-md rounded-lg ",
|
||||
menuList: () => "shadow-md rounded-lg",
|
||||
option: () =>
|
||||
"bg-base-200 text-base-content rounded-lg m-1 hover:bg-base-300 p-2 ",
|
||||
"bg-base-200 text-base-content rounded-lg m-1 hover:bg-base-300 p-2",
|
||||
noOptionsMessage: () =>
|
||||
"p-2 bg-base-200 rounded-lg m-1 p-2"
|
||||
}}
|
||||
@@ -710,7 +713,7 @@ function PrefillWidgetModal(props) {
|
||||
</div>
|
||||
<button
|
||||
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>
|
||||
|
||||
@@ -22,19 +22,25 @@ import { useDispatch, useSelector } from "react-redux";
|
||||
import Guidelines from "./Guidelines";
|
||||
import { useGuidelinesContext } from "../../context/GuidelinesContext";
|
||||
import { toggleSidebar } from "../../redux/reducers/sidebarReducer";
|
||||
import DragGuidelinesLayer from "./DragGridLinesLayer";
|
||||
import { useDrop } from "react-dnd";
|
||||
import WidgetsDragPreview from "./WidgetsDragPreview";
|
||||
|
||||
function RenderPdf(props) {
|
||||
const { t } = useTranslation();
|
||||
const dispatch = useDispatch();
|
||||
const [, drop] = useDrop({
|
||||
accept: "BOX",
|
||||
drop: (item, monitor) => props?.addPositionOfSignature(item, monitor)
|
||||
});
|
||||
const [scaledHeight, setScaledHeight] = useState();
|
||||
const { guideline } = useGuidelinesContext();
|
||||
const { guideline, showGuidelines } = useGuidelinesContext();
|
||||
//check isGuestSigner is present in local if yes than handle login flow header in mobile view
|
||||
const isGuestSigner = localStorage.getItem("isGuestSigner");
|
||||
const scrollTriggerId = useSelector((state) => state.widget.scrollTriggerId);
|
||||
const isOpen = useSelector((state) => state.sidebar.isOpen);
|
||||
const scrollRef = useRef(null);
|
||||
const pdfContainerRef = useRef(null);
|
||||
|
||||
useEffect(() => {
|
||||
dispatch(toggleSidebar(false));
|
||||
return () => {
|
||||
@@ -271,6 +277,7 @@ function RenderPdf(props) {
|
||||
setIsReqSignTourDisabled={props.setIsReqSignTourDisabled}
|
||||
calculateFontsize={calculateFontsize}
|
||||
currWidgetsDetails={props?.currWidgetsDetails}
|
||||
handleNameModal={props?.handleNameModal}
|
||||
/>
|
||||
</React.Fragment>
|
||||
)
|
||||
@@ -334,7 +341,7 @@ function RenderPdf(props) {
|
||||
}}
|
||||
ref={(node) => {
|
||||
pdfContainerRef.current = node;
|
||||
props.drop && props.drop(node);
|
||||
drop && drop(node);
|
||||
}}
|
||||
id="container"
|
||||
>
|
||||
@@ -484,6 +491,8 @@ function RenderPdf(props) {
|
||||
setIsReqSignTourDisabled={
|
||||
props.setIsReqSignTourDisabled
|
||||
}
|
||||
unSignedWidgetId={props.unSignedWidgetId}
|
||||
handleNameModal={props.handleNameModal}
|
||||
/>
|
||||
)
|
||||
)}
|
||||
@@ -529,6 +538,25 @@ function RenderPdf(props) {
|
||||
y2={guideline.y2}
|
||||
/>
|
||||
)}
|
||||
<DragGuidelinesLayer
|
||||
signBtnPosition={props.signBtnPosition}
|
||||
showGuidelines={showGuidelines}
|
||||
posWidth={posWidth}
|
||||
posHeight={posHeight}
|
||||
isSignYourself={props.signerPos?.length > 0 ? true : false}
|
||||
/>
|
||||
<WidgetsDragPreview
|
||||
posWidth={posWidth}
|
||||
posHeight={posHeight}
|
||||
isSignYourself={props.signerPos?.length > 0 ? true : false}
|
||||
uniqueId={props?.uniqueId}
|
||||
data={props?.signerPos?.find((x) => x.Id === props?.uniqueId)}
|
||||
isNeedSign={props?.pdfRequest}
|
||||
pdfOriginalWH={props.pdfOriginalWH}
|
||||
pageNumber={props.pageNumber}
|
||||
containerWH={props.containerWH}
|
||||
scale={props?.scale}
|
||||
/>
|
||||
</div>
|
||||
</RSC>
|
||||
</>
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import React from "react";
|
||||
import ModalUi from "../../primitives/ModalUi";
|
||||
import { fontColorArr, fontsizeArr } from "../../constant/Utils";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import React, { useState, useRef, useEffect } from "react";
|
||||
import { useState, useRef, useEffect } from "react";
|
||||
import ModalUi from "../../primitives/ModalUi";
|
||||
import RecipientList from "./RecipientList";
|
||||
import { useDrag } from "react-dnd";
|
||||
import WidgetList from "./WidgetList";
|
||||
import {
|
||||
isMobile,
|
||||
@@ -11,106 +10,54 @@ import {
|
||||
textWidget,
|
||||
widgets
|
||||
} from "../../constant/Utils";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { useWidgetDrag } from "../../hook/useWidgetDrag";
|
||||
|
||||
function WidgetComponent(props) {
|
||||
const { t } = useTranslation();
|
||||
const signRef = useRef(null);
|
||||
const userInformation = localStorage.getItem("UserInformation");
|
||||
const [isSignersModal, setIsSignersModal] = useState(false);
|
||||
const [, signature] = useDrag({
|
||||
type: "BOX",
|
||||
item: { type: "BOX", id: 1, text: "signature" }
|
||||
});
|
||||
const [, stamp] = useDrag({
|
||||
type: "BOX",
|
||||
item: { type: "BOX", id: 2, text: "stamp" }
|
||||
});
|
||||
const [, dropdown] = useDrag({
|
||||
type: "BOX",
|
||||
item: { type: "BOX", id: 5, text: "dropdown" }
|
||||
});
|
||||
const [, checkbox] = useDrag({
|
||||
type: "BOX",
|
||||
item: { type: "BOX", id: 6, text: "checkbox" }
|
||||
});
|
||||
const [, textInput] = useDrag({
|
||||
type: "BOX",
|
||||
item: { type: "BOX", id: 7, text: textInputWidget }
|
||||
});
|
||||
const [, cells] = useDrag({
|
||||
type: "BOX",
|
||||
item: { type: "BOX", id: 17, text: cellsWidget }
|
||||
});
|
||||
const [, initials] = useDrag({
|
||||
type: "BOX",
|
||||
item: { type: "BOX", id: 8, text: "initials" }
|
||||
});
|
||||
const [, name] = useDrag({
|
||||
type: "BOX",
|
||||
item: { type: "BOX", id: 9, text: "name" }
|
||||
});
|
||||
const [, company] = useDrag({
|
||||
type: "BOX",
|
||||
item: { type: "BOX", id: 10, text: "company" }
|
||||
});
|
||||
const [, jobTitle] = useDrag({
|
||||
type: "BOX",
|
||||
item: { type: "BOX", id: 11, text: "job title" }
|
||||
});
|
||||
const [, date] = useDrag({
|
||||
type: "BOX",
|
||||
item: { type: "BOX", id: 12, text: "date" }
|
||||
});
|
||||
const [, image] = useDrag({
|
||||
type: "BOX",
|
||||
item: { type: "BOX", id: 13, text: "image" }
|
||||
});
|
||||
const [, email] = useDrag({
|
||||
type: "BOX",
|
||||
item: { type: "BOX", id: 14, text: "email" }
|
||||
});
|
||||
const [, radioButton] = useDrag({
|
||||
type: "BOX",
|
||||
item: { type: "BOX", id: 15, text: radioButtonWidget }
|
||||
});
|
||||
const [, text] = useDrag({
|
||||
type: "BOX",
|
||||
item: { type: "BOX", id: 16, text: textWidget }
|
||||
});
|
||||
const [widget, setWidget] = useState([]);
|
||||
// Define all draggable widget configurations
|
||||
const draggableItems = [
|
||||
{ id: 1, text: "signature" },
|
||||
{ id: 2, text: "stamp" },
|
||||
{ id: 3, text: "initials" },
|
||||
{ id: 4, text: textInputWidget },
|
||||
{ id: 6, text: "name" },
|
||||
{ id: 7, text: "job title" },
|
||||
{ id: 8, text: "company" },
|
||||
{ id: 9, text: "email" },
|
||||
{ id: 10, text: "date" },
|
||||
{ id: 11, text: textWidget },
|
||||
{ id: 12, text: cellsWidget },
|
||||
{ id: 13, text: "checkbox" },
|
||||
{ id: 14, text: "dropdown" },
|
||||
{ id: 15, text: radioButtonWidget },
|
||||
{ id: 16, text: "image" }
|
||||
];
|
||||
|
||||
// Create all drag refs in one go
|
||||
const widgetRefs = draggableItems.map((item) =>
|
||||
useWidgetDrag({ type: "BOX", ...item })
|
||||
);
|
||||
|
||||
// Map your widgets with the generated dragRefs
|
||||
const [widgetList, setWidgetList] = useState([]);
|
||||
const handleModal = () => {
|
||||
setIsSignersModal(!isSignersModal);
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
const widgetRef = [
|
||||
signature,
|
||||
stamp,
|
||||
initials,
|
||||
textInput,
|
||||
name,
|
||||
jobTitle,
|
||||
company,
|
||||
date,
|
||||
text,
|
||||
cells,
|
||||
checkbox,
|
||||
dropdown,
|
||||
radioButton,
|
||||
image,
|
||||
email
|
||||
];
|
||||
const getWidgetArray = widgets;
|
||||
const newUpdateSigner = getWidgetArray.map((obj, ind) => {
|
||||
return { ...obj, ref: widgetRef[ind] };
|
||||
});
|
||||
|
||||
setWidget(newUpdateSigner);
|
||||
const updated = widgets.map((obj, index) => ({
|
||||
...obj,
|
||||
ref: widgetRefs[index]?.dragRef || null
|
||||
}));
|
||||
setWidgetList(updated);
|
||||
// eslint-disable-next-line
|
||||
}, []);
|
||||
|
||||
//allow only (signature,stamp,initials,text,name, job title, company,email) widget when isAllowModification true and user have session token
|
||||
const modifiedWidgets = widget.filter(
|
||||
// allow only (signature, stamp, initials, text, name, job title, company, email, cells) widget when isAllowModification true and user have session token
|
||||
const modifiedWidgets = widgetList.filter(
|
||||
(data) =>
|
||||
![
|
||||
"dropdown",
|
||||
@@ -121,8 +68,8 @@ function WidgetComponent(props) {
|
||||
"checkbox"
|
||||
].includes(data.type)
|
||||
);
|
||||
//allow only (signature,stamp,initials,text) widget when isAllowModification true and user does not have session token
|
||||
const unlogedInUserWidgets = widget.filter(
|
||||
// allow only (signature, stamp, initials, text, cells) widget when isAllowModification true and user does not have session token
|
||||
const unlogedInUserWidgets = widgetList.filter(
|
||||
(data) =>
|
||||
![
|
||||
"dropdown",
|
||||
@@ -137,13 +84,13 @@ function WidgetComponent(props) {
|
||||
"company"
|
||||
].includes(data.type)
|
||||
);
|
||||
const selfSignWidgets = widget.filter(
|
||||
const selfSignWidgets = widgetList.filter(
|
||||
(data) =>
|
||||
!["dropdown", radioButtonWidget, textInputWidget].includes(data.type)
|
||||
);
|
||||
//if user select prefill role then allow only date,image,text,checkbox,radio,dropdownAdd commentMore actions
|
||||
//dropdown widget should only be show in template flow
|
||||
const prefillAllowWidgets = widget.filter((data) =>
|
||||
const prefillAllowWidgets = widgetList.filter((data) =>
|
||||
(props.isPrefillDropdown ? ["dropdown"] : [])
|
||||
.concat([radioButtonWidget, textWidget, "date", "image", "checkbox"])
|
||||
.includes(data.type)
|
||||
@@ -161,7 +108,7 @@ function WidgetComponent(props) {
|
||||
return unlogedInUserWidgets;
|
||||
}
|
||||
} else if (props?.roleName !== "prefill") {
|
||||
return widget.filter((data) => ![textWidget].includes(data.type));
|
||||
return widgetList.filter((data) => ![textWidget].includes(data.type));
|
||||
}
|
||||
};
|
||||
const handleSelectRecipient = () => {
|
||||
@@ -263,7 +210,12 @@ function WidgetComponent(props) {
|
||||
)}
|
||||
</span>
|
||||
</div>
|
||||
<div className="p-[15px] flex flex-col pt-4" data-tut="addWidgets">
|
||||
<div
|
||||
className="p-[12px] grid lg:grid-cols-2 gap-x-2 lg:gap-y-1.5 pt-3"
|
||||
data-tut="addWidgets"
|
||||
role="list"
|
||||
aria-label="Add widgets"
|
||||
>
|
||||
<WidgetList
|
||||
updateWidgets={handleWidgetType}
|
||||
handleDivClick={props.handleDivClick}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import React, { useEffect, useState } from "react";
|
||||
import { useEffect, useMemo, useState } from "react";
|
||||
import ModalUi from "../../primitives/ModalUi";
|
||||
import "../../styles/AddUser.css";
|
||||
import RegexParser from "regex-parser";
|
||||
@@ -8,12 +8,16 @@ import {
|
||||
cellsWidget,
|
||||
textWidget
|
||||
} from "../../constant/Utils";
|
||||
import {
|
||||
widgetNamesArr
|
||||
} from "../../utils";
|
||||
import { fontColorArr, fontsizeArr } from "../../constant/Utils";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
const WidgetNameModal = (props) => {
|
||||
const { t } = useTranslation();
|
||||
const signTypes = props?.signatureType || signatureTypes;
|
||||
const [lastSubmittedName, setLastSubmittedName] = useState("");
|
||||
const [formdata, setFormdata] = useState({
|
||||
name: "",
|
||||
defaultValue: "",
|
||||
@@ -21,13 +25,32 @@ const WidgetNameModal = (props) => {
|
||||
hint: "",
|
||||
textvalidate: "",
|
||||
isReadOnly: false,
|
||||
cellCount: 5
|
||||
cellCount: 5,
|
||||
});
|
||||
const [isValid, setIsValid] = useState(true);
|
||||
const statusArr = ["Required", "Optional"];
|
||||
const [signatureType, setSignatureType] = useState([]);
|
||||
const type = props?.defaultdata?.type;
|
||||
const isCellWidget = useMemo(() => type === cellsWidget, [type]);
|
||||
const isSignOrInitials = useMemo(
|
||||
() => ["signature", "initials"].includes(type),
|
||||
[type]
|
||||
);
|
||||
const showFontControls = useMemo(
|
||||
() =>
|
||||
[
|
||||
textInputWidget,
|
||||
textWidget,
|
||||
cellsWidget,
|
||||
"name",
|
||||
"company",
|
||||
"job title",
|
||||
"email"
|
||||
].includes(props.defaultdata?.type),
|
||||
[type]
|
||||
);
|
||||
|
||||
const handleHint = () => {
|
||||
const handleHintPlaceholder = () => {
|
||||
const type = props.defaultdata?.type;
|
||||
|
||||
if (type === "signature") {
|
||||
@@ -48,32 +71,48 @@ const WidgetNameModal = (props) => {
|
||||
name: props.defaultdata?.options?.name || "",
|
||||
defaultValue: props.defaultdata?.options?.defaultValue || "",
|
||||
status: props.defaultdata?.options?.status || "required",
|
||||
hint: props.defaultdata?.options?.hint || handleHint(),
|
||||
hint: props.defaultdata?.options?.hint || "",
|
||||
textvalidate:
|
||||
props.defaultdata?.options?.validation?.type === "regex"
|
||||
? props.defaultdata?.options?.validation?.pattern
|
||||
: props.defaultdata?.options?.validation?.type || "",
|
||||
isReadOnly: props.defaultdata?.options?.isReadOnly || false,
|
||||
cellCount: props.defaultdata?.options?.cellCount || 5
|
||||
cellCount: props.defaultdata?.options?.cellCount || 5,
|
||||
});
|
||||
setLastSubmittedName(props.defaultdata?.options?.name || "");
|
||||
} else {
|
||||
setFormdata({
|
||||
...formdata,
|
||||
name: props.defaultdata?.options?.name || "",
|
||||
cellCount: props.defaultdata?.options?.cellCount || 5
|
||||
cellCount: props.defaultdata?.options?.cellCount || 5,
|
||||
});
|
||||
setLastSubmittedName(props.defaultdata?.options?.name || "");
|
||||
}
|
||||
|
||||
if (signTypes.length > 0) {
|
||||
const defaultSignatureType = signTypes || [];
|
||||
setSignatureType(defaultSignatureType);
|
||||
}
|
||||
// eslint-disable-next-line
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [props.defaultdata]);
|
||||
|
||||
const handleSubmit = (e) => {
|
||||
e.preventDefault();
|
||||
if (props.handleData) {
|
||||
if (["signature", "initials"].includes(props.defaultdata?.type)) {
|
||||
const widgetNames = widgetNamesArr(
|
||||
props.widgetsSource,
|
||||
props?.activeSignerId
|
||||
);
|
||||
if (lastSubmittedName && lastSubmittedName !== formdata.name) {
|
||||
const widgetNameExist = widgetNames?.find(
|
||||
(widget) => widget === formdata.name
|
||||
);
|
||||
if (widgetNameExist) {
|
||||
alert(t("duplicate-widget-name-error"));
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (isSignOrInitials) {
|
||||
const enabledSignTypes = signatureType?.filter((x) => x.enabled);
|
||||
const isDefaultSignTypeOnly =
|
||||
enabledSignTypes?.length === 1 &&
|
||||
@@ -87,9 +126,11 @@ const WidgetNameModal = (props) => {
|
||||
props.handleData(data, props.defaultdata?.type);
|
||||
}
|
||||
} else {
|
||||
const isTextInput = [textInputWidget, cellsWidget].includes(
|
||||
props.defaultdata?.type
|
||||
);
|
||||
|
||||
const isTextInput = [
|
||||
textInputWidget,
|
||||
cellsWidget,
|
||||
].includes(props.defaultdata?.type);
|
||||
const { isReadOnly, defaultValue, status } = formdata;
|
||||
// If it’s a text‐input widget, enforce that read-only fields have
|
||||
// either a defaultValue or an "optional" status.
|
||||
@@ -110,7 +151,7 @@ const WidgetNameModal = (props) => {
|
||||
status: "required",
|
||||
hint: "",
|
||||
textvalidate: "",
|
||||
cellCount: 5
|
||||
cellCount: 5,
|
||||
});
|
||||
setSignatureType(signTypes);
|
||||
}
|
||||
@@ -148,10 +189,11 @@ const WidgetNameModal = (props) => {
|
||||
} else {
|
||||
setIsValid(true);
|
||||
}
|
||||
const val =
|
||||
props.defaultdata?.type === cellsWidget
|
||||
? e.target.value.slice(0, formdata.cellCount)
|
||||
: e.target.value;
|
||||
|
||||
const val = isCellWidget
|
||||
? e.target.value.slice(0, formdata.cellCount)
|
||||
: e.target.value;
|
||||
|
||||
setFormdata({ ...formdata, [e.target.name]: val });
|
||||
};
|
||||
|
||||
@@ -160,7 +202,7 @@ const WidgetNameModal = (props) => {
|
||||
case "email":
|
||||
return "/^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+.[a-zA-Z]{2,}$/";
|
||||
case "number":
|
||||
return "/^\\d+$/";
|
||||
return "^\\d+(?:\\.\\d+)?$"; // "/^\\d+$/";
|
||||
case "text":
|
||||
//allow space in text regex
|
||||
return "/^[a-zA-Z ]+$/";
|
||||
@@ -184,23 +226,19 @@ const WidgetNameModal = (props) => {
|
||||
<ModalUi
|
||||
isOpen={props.isOpen}
|
||||
handleClose={props.handleClose && props.handleClose}
|
||||
title={
|
||||
["signature", "initials"].includes(props.defaultdata?.type)
|
||||
? t("signature-setting")
|
||||
: t("widget-info")
|
||||
}
|
||||
title={isSignOrInitials ? t("signature-setting") : t("widget-info")}
|
||||
>
|
||||
<form
|
||||
onSubmit={handleSubmit}
|
||||
className={`${
|
||||
[textInputWidget, cellsWidget].includes(props.defaultdata?.type)
|
||||
? "pt-0"
|
||||
: ["signature", "initials"].includes(props.defaultdata?.type)
|
||||
: isSignOrInitials
|
||||
? "pt-2"
|
||||
: ""
|
||||
} p-[20px] text-base-content`}
|
||||
>
|
||||
{!["signature", "initials"].includes(props.defaultdata?.type) && (
|
||||
{!isSignOrInitials && (
|
||||
<div className="mb-[0.75rem] text-[13px]">
|
||||
<label htmlFor="name">
|
||||
{t("name")}
|
||||
@@ -217,7 +255,7 @@ const WidgetNameModal = (props) => {
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
{props.defaultdata?.type === cellsWidget && (
|
||||
{isCellWidget && (
|
||||
<div className="mb-[0.75rem] text-[13px]">
|
||||
<label htmlFor="cellCount">{t("cell-count")}</label>
|
||||
<input
|
||||
@@ -231,7 +269,10 @@ const WidgetNameModal = (props) => {
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
{[textInputWidget, cellsWidget].includes(props.defaultdata?.type) &&
|
||||
{[
|
||||
textInputWidget,
|
||||
cellsWidget,
|
||||
].includes(props.defaultdata?.type) &&
|
||||
props?.roleName !== "prefill" && (
|
||||
<>
|
||||
<div className="mb-[0.75rem]">
|
||||
@@ -244,11 +285,7 @@ const WidgetNameModal = (props) => {
|
||||
value={formdata.defaultValue}
|
||||
onChange={(e) => handledefaultChange(e)}
|
||||
autoComplete="off"
|
||||
maxLength={
|
||||
props.defaultdata?.type === cellsWidget
|
||||
? formdata.cellCount
|
||||
: undefined
|
||||
}
|
||||
maxLength={isCellWidget ? formdata.cellCount : undefined}
|
||||
onBlur={() => {
|
||||
if (isValid === false) {
|
||||
setFormdata({ ...formdata, defaultValue: "" });
|
||||
@@ -262,7 +299,7 @@ const WidgetNameModal = (props) => {
|
||||
style={{ fontSize: 12 }}
|
||||
>
|
||||
<i
|
||||
className="fa-light fa-exclamation-circle text-[15px]"
|
||||
className="fa-light fa-exclamation-circle text-[15px] mr-1"
|
||||
style={{ color: "#fab005" }}
|
||||
></i>
|
||||
{t("invalid-default-value")}
|
||||
@@ -271,9 +308,10 @@ const WidgetNameModal = (props) => {
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
{!["signature", "initials"].includes(props.defaultdata?.type) &&
|
||||
{!props?.isSelfSign &&
|
||||
!isSignOrInitials &&
|
||||
props?.roleName !== "prefill" && (
|
||||
<div className="mb-[0.75rem]">
|
||||
<div className={showFontControls ? "mb-[0.5rem]" : "mb-[0.75rem]"}>
|
||||
<div className="flex flex-row gap-[10px] mb-[0.5rem]">
|
||||
{statusArr.map((data, ind) => {
|
||||
return (
|
||||
@@ -302,35 +340,35 @@ const WidgetNameModal = (props) => {
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
{[textInputWidget, cellsWidget].includes(
|
||||
props.defaultdata?.type
|
||||
) &&
|
||||
props?.roleName !== "prefill" && (
|
||||
<div className="flex items-center">
|
||||
<input
|
||||
id="isReadOnly"
|
||||
name="isReadOnly"
|
||||
type="checkbox"
|
||||
checked={formdata.isReadOnly}
|
||||
className="op-checkbox op-checkbox-xs"
|
||||
onChange={() =>
|
||||
setFormdata((prev) => ({
|
||||
...formdata,
|
||||
isReadOnly: !prev.isReadOnly
|
||||
}))
|
||||
}
|
||||
/>
|
||||
<label
|
||||
className="ml-1.5 mb-0 capitalize text-[13px]"
|
||||
htmlFor="isreadonly"
|
||||
>
|
||||
{t("read-only")}
|
||||
</label>
|
||||
</div>
|
||||
)}
|
||||
{[
|
||||
textInputWidget,
|
||||
cellsWidget,
|
||||
].includes(props.defaultdata?.type) && (
|
||||
<div className="flex items-center">
|
||||
<input
|
||||
id="isReadOnly"
|
||||
name="isReadOnly"
|
||||
type="checkbox"
|
||||
checked={formdata.isReadOnly}
|
||||
className="op-checkbox op-checkbox-xs"
|
||||
onChange={() =>
|
||||
setFormdata((prev) => ({
|
||||
...formdata,
|
||||
isReadOnly: !prev.isReadOnly
|
||||
}))
|
||||
}
|
||||
/>
|
||||
<label
|
||||
className="ml-1.5 mb-0 capitalize text-[13px]"
|
||||
htmlFor="isreadonly"
|
||||
>
|
||||
{t("read-only")}
|
||||
</label>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
{["signature", "initials"].includes(props.defaultdata?.type) && (
|
||||
{isSignOrInitials && (
|
||||
<div className="mb-[0.75rem]">
|
||||
<label htmlFor="signaturetype" className="text-[14px] mb-[0.7rem]">
|
||||
{t("allowed-signature-types")}
|
||||
@@ -358,7 +396,7 @@ const WidgetNameModal = (props) => {
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
{props?.roleName !== "prefill" && (
|
||||
{!props?.isSelfSign && props?.roleName !== "prefill" && (
|
||||
<div className="mb-[0.75rem]">
|
||||
<label htmlFor="hint" className="text-[13px]">
|
||||
{t("hint")}
|
||||
@@ -367,20 +405,13 @@ const WidgetNameModal = (props) => {
|
||||
maxLength={40}
|
||||
className="op-input op-input-bordered op-input-sm focus:outline-none hover:border-base-content w-full text-xs"
|
||||
name="hint"
|
||||
placeholder={handleHintPlaceholder()}
|
||||
value={formdata.hint}
|
||||
onChange={(e) => handleChange(e)}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
{[
|
||||
textInputWidget,
|
||||
textWidget,
|
||||
cellsWidget,
|
||||
"name",
|
||||
"company",
|
||||
"job title",
|
||||
"email"
|
||||
].includes(props.defaultdata?.type) && (
|
||||
{showFontControls && (
|
||||
<div className="flex flex-col md:flex-row md:items-center gap-3 mb-3">
|
||||
<div className="flex items-center gap-2 ">
|
||||
<span className="whitespace-nowrap">{t("font-size")}: </span>
|
||||
|
||||
@@ -0,0 +1,105 @@
|
||||
import { useDragLayer } from "react-dnd";
|
||||
import {
|
||||
defaultWidthHeight,
|
||||
getContainerScale,
|
||||
handleBackground,
|
||||
radioButtonWidget
|
||||
} from "../../constant/Utils";
|
||||
|
||||
export default function WidgetsDragPreview(props) {
|
||||
const { widgetType, isDragging, initialOffset, currentOffset } = useDragLayer(
|
||||
(monitor) => ({
|
||||
widgetType: monitor.getItem(),
|
||||
isDragging: monitor.isDragging(),
|
||||
initialOffset: monitor.getInitialSourceClientOffset(),
|
||||
currentOffset: monitor.getSourceClientOffset()
|
||||
})
|
||||
);
|
||||
const options = [{ name: "Option-1" }, { name: "Option-2" }];
|
||||
if (!isDragging) return null;
|
||||
|
||||
if (!initialOffset || !currentOffset) return null;
|
||||
|
||||
const { x, y } = currentOffset;
|
||||
const getWidgetDetails = defaultWidthHeight(widgetType?.text);
|
||||
const widget = {
|
||||
type: widgetType?.text,
|
||||
width: getWidgetDetails?.width,
|
||||
height: getWidgetDetails?.height
|
||||
};
|
||||
const calculateFont = () => {
|
||||
const containerScale = getContainerScale(
|
||||
props.pdfOriginalWH,
|
||||
props.pageNumber,
|
||||
props.containerWH
|
||||
);
|
||||
const fontSize = 12 * containerScale * props.scale;
|
||||
return fontSize;
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="fixed inset-0 pointer-events-none z-[9999]">
|
||||
<div
|
||||
className="absolute"
|
||||
style={{
|
||||
transform: `translate(${x}px, ${y}px)`
|
||||
}}
|
||||
>
|
||||
{widgetType.text === "checkbox" ||
|
||||
widgetType.text === radioButtonWidget ? (
|
||||
<div
|
||||
id="checkbox&radio-preview"
|
||||
style={{
|
||||
background: handleBackground(
|
||||
props?.data,
|
||||
props?.isNeedSign,
|
||||
props?.uniqueId
|
||||
)
|
||||
}}
|
||||
className="border-red-600 rounded-[2px] border-[1px]"
|
||||
>
|
||||
{options.map((x, id) => {
|
||||
return (
|
||||
<div key={id}>
|
||||
<label
|
||||
style={{ fontSize: calculateFont(), color: "black" }}
|
||||
className={`mb-0 flex items-center gap-1`}
|
||||
>
|
||||
<input
|
||||
style={{
|
||||
width: calculateFont(),
|
||||
height: calculateFont()
|
||||
}}
|
||||
className={`${widgetType.text === "checkbox" ? "op-checkbox" : "op-radio rounded-full border-black appearance-none bg-white inline-block align-middle relative"} rounded-[1px]`}
|
||||
type={
|
||||
widgetType.text === "checkbox" ? "checkbox" : "radio"
|
||||
}
|
||||
/>
|
||||
<span>{x?.name}</span>
|
||||
</label>
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
) : (
|
||||
<div
|
||||
style={{
|
||||
width: props?.posWidth(widget, props?.isSignYourself),
|
||||
height: props?.posHeight(widget, props?.isSignYourself),
|
||||
background: handleBackground(
|
||||
props?.data,
|
||||
props?.isNeedSign,
|
||||
props?.uniqueId
|
||||
)
|
||||
}}
|
||||
className="border-red-600 rounded-[2px] border-[1px] flex items-center justify-center"
|
||||
>
|
||||
<span className="text-center text-[10px] font-medium">
|
||||
{widgetType?.text}
|
||||
</span>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
import { forwardRef, useEffect, useRef, useState } from "react";
|
||||
import { forwardRef, useEffect, useMemo, useRef, useState } from "react";
|
||||
import ModalUi from "../../primitives/ModalUi";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { removeBackground } from "@imgly/background-removal";
|
||||
@@ -23,7 +23,8 @@ import {
|
||||
convertBase64ToFile,
|
||||
generatePdfName,
|
||||
getDefaultDate,
|
||||
getDefaultFormat
|
||||
getDefaultFormat,
|
||||
getSignerPages
|
||||
} from "../../constant/Utils";
|
||||
import CellsWidget from "./CellsWidget";
|
||||
import DatePicker from "react-datepicker";
|
||||
@@ -45,7 +46,9 @@ import { useDispatch, useSelector } from "react-redux";
|
||||
import Loader from "../../primitives/Loader";
|
||||
import { emailRegex } from "../../constant/const";
|
||||
import RegexParser from "regex-parser";
|
||||
import { saveToMySign } from "../../utils/widgetUtils";
|
||||
import {
|
||||
saveToMySign
|
||||
} from "../../utils/widgetUtils";
|
||||
|
||||
const fontOptions = [
|
||||
{ value: "Fasthand" },
|
||||
@@ -111,12 +114,28 @@ function WidgetsValueModal(props) {
|
||||
props?.kiosk_signer || JSON.parse(localStorage.getItem("kiosk_signer"));
|
||||
const jsonSender = senderUser && JSON.parse(senderUser);
|
||||
const currentUserName = jsonSender && jsonSender?.name;
|
||||
const type = currWidgetsDetails?.type;
|
||||
const widgetTypeTranslation = t(`widgets-name.${currWidgetsDetails?.type}`);
|
||||
const [widgetValue, setWidgetValue] = useState(
|
||||
currWidgetsDetails.type !== "checkbox" &&
|
||||
(currWidgetsDetails?.options?.response ||
|
||||
currWidgetsDetails?.options?.defaultValue)
|
||||
);
|
||||
|
||||
const [widgetValue, setWidgetValue] = useState(() => {
|
||||
if (currWidgetsDetails.type === "checkbox") {
|
||||
return undefined;
|
||||
}
|
||||
return (
|
||||
currWidgetsDetails?.options?.response ||
|
||||
currWidgetsDetails?.options?.defaultValue
|
||||
);
|
||||
});
|
||||
const blocked = [
|
||||
"checkbox",
|
||||
"dropdown",
|
||||
"date",
|
||||
"radio",
|
||||
];
|
||||
|
||||
const showClearbtn =
|
||||
!blocked.includes(type);
|
||||
|
||||
const [cellsValue, setCellsValue] = useState(() => {
|
||||
const count = currWidgetsDetails?.options?.cellCount || 5;
|
||||
const val =
|
||||
@@ -192,7 +211,8 @@ function WidgetsValueModal(props) {
|
||||
} else {
|
||||
setHint(currWidgetsDetails?.type);
|
||||
}
|
||||
} else if (isSignOrInitials) {
|
||||
}
|
||||
else if (isSignOrInitials) {
|
||||
setIsTab(currWidgetsDetails?.signatureType);
|
||||
}
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
@@ -877,9 +897,10 @@ function WidgetsValueModal(props) {
|
||||
const handleOnchangeTextBox = (e) => {
|
||||
// hide any prior validation error while typing
|
||||
setIsShowValidation(false);
|
||||
setWidgetValue(e.target.value);
|
||||
let value = e.target.value;
|
||||
setWidgetValue(value);
|
||||
onChangeInput(
|
||||
e.target.value,
|
||||
value,
|
||||
currWidgetsDetails,
|
||||
xyPosition,
|
||||
props.index,
|
||||
@@ -1697,7 +1718,7 @@ function WidgetsValueModal(props) {
|
||||
|
||||
// focusNextWidget(currWidgetsDetails?.key, xyPosition)
|
||||
//function too use on click on next/finish button then update modal UI according to current widgets
|
||||
const handleClickOnNext = (isFinishDoc) => {
|
||||
const handleClickOnNext = async (isFinishDoc) => {
|
||||
if (
|
||||
["signature", "stamp", "image", "initials"].includes(
|
||||
currWidgetsDetails?.type
|
||||
@@ -1718,13 +1739,14 @@ function WidgetsValueModal(props) {
|
||||
} else if (!isSave) {
|
||||
const widgetsPosition = xyPosition?.find((data) => data.Id === uniqueId);
|
||||
let nextWidgetDetails = null;
|
||||
const editableWidgets = widgetsPosition?.placeHolder.flatMap((page) =>
|
||||
page.pos
|
||||
.filter((widget) => !widget.options?.isReadOnly)
|
||||
.map((widget) => ({
|
||||
widget,
|
||||
pageNumber: page.pageNumber
|
||||
}))
|
||||
const editableWidgets = (widgetsPosition?.placeHolder ?? []).flatMap(
|
||||
({ pos = [], pageNumber }) =>
|
||||
pos
|
||||
.filter(
|
||||
({ options }) =>
|
||||
!options?.isReadOnly
|
||||
)
|
||||
.map((widget) => ({ widget, pageNumber }))
|
||||
);
|
||||
//get current index of widget
|
||||
const currentIndex = editableWidgets.findIndex(
|
||||
@@ -1755,6 +1777,7 @@ function WidgetsValueModal(props) {
|
||||
dispatch(setIsShowModal({ [nextWidgetDetails?.key]: true }));
|
||||
props.setCurrWidgetsDetails(nextWidgetDetails);
|
||||
}
|
||||
|
||||
};
|
||||
//function is used to disable/enable save button
|
||||
const handleDisable = () => {
|
||||
@@ -1926,13 +1949,11 @@ function WidgetsValueModal(props) {
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex justify-between items-center text-center">
|
||||
{!["checkbox", "dropdown", "date", "radio"].includes(
|
||||
currWidgetsDetails?.type
|
||||
) ? (
|
||||
{showClearbtn ? (
|
||||
<button
|
||||
type="button"
|
||||
className="op-btn op-btn-ghost op-btn-sm text-base-content mr-1"
|
||||
onClick={() => handleClear()}
|
||||
onClick={handleClear}
|
||||
>
|
||||
{t("clear")}
|
||||
</button>
|
||||
|
||||
@@ -3,15 +3,20 @@ import { isMobile } from "../../constant/Utils";
|
||||
// `getWidgetType` is used to load ui of widget in side list
|
||||
const getWidgetType = (item, widgetName) => {
|
||||
return (
|
||||
<div className="op-btn w-fit md:w-[100%] op-btn-primary op-btn-outline op-btn-sm focus:outline-none outline outline-[1.5px] ml-[6px] md:ml-0 p-0 overflow-hidden">
|
||||
<div
|
||||
title={widgetName}
|
||||
className="op-btn w-fit md:w-[100%] op-btn-primary op-btn-outline op-btn-sm focus:outline-none ml-[6px] outline outline-[1px] md:ml-0 p-0 overflow-hidden"
|
||||
>
|
||||
<div className="w-full h-full flex md:justify-between items-center">
|
||||
<div className="flex justify-start items-center text-[13px] ml-1">
|
||||
{!isMobile && <i className="fa-light fa-grip-vertical ml-[3px]"></i>}
|
||||
<span className="md:inline-block text-center text-[15px] ml-[5px] font-semibold pr-1 md:pr-0">
|
||||
<div className="flex justify-start items-center ml-1 overflow-hidden">
|
||||
{!isMobile && (
|
||||
<i className="fa-light fa-grip-vertical ml-[3px] text-[13px] lg:text-[13px]"></i>
|
||||
)}
|
||||
<span className="md:inline-block text-center text-[11px] lg:text-[13px] mx-[3px] truncate font-medium capitalize">
|
||||
{widgetName}
|
||||
</span>
|
||||
</div>
|
||||
<div className="text-[20px] op-btn op-btn-primary rounded-none w-[40px] h-full flex justify-center items-center">
|
||||
<div className="text-[13px] lg:text-[14px] op-btn op-btn-primary rounded-none w-[20px] h-full flex justify-center items-center">
|
||||
<i className={item.icon}></i>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,368 @@
|
||||
import { useState, useEffect, useRef } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import Parse from "parse";
|
||||
import ReactQuill from "react-quill-new";
|
||||
import "../../styles/quill.css";
|
||||
import EditorToolbar, { module1, module2, formats } from "../pdf/EditorToolbar";
|
||||
import Tooltip from "../../primitives/Tooltip";
|
||||
import Alert from "../../primitives/Alert";
|
||||
import Loader from "../../primitives/Loader";
|
||||
|
||||
const MailTemplateEditor = ({
|
||||
info,
|
||||
tenantId,
|
||||
}) => {
|
||||
const appName = localStorage.getItem("appname") || "OpenSign™";
|
||||
const { t } = useTranslation();
|
||||
const editorRef = useRef();
|
||||
const editorRefCom = useRef();
|
||||
const [requestBody, setRequestBody] = useState("");
|
||||
const [requestSubject, setRequestSubject] = useState("");
|
||||
const [completionBody, setCompletionBody] = useState("");
|
||||
const [completionSubject, setCompletionSubject] = useState("");
|
||||
const [isDefaultMail, setIsDefaultMail] = useState({
|
||||
requestMail: false,
|
||||
completionMail: false
|
||||
});
|
||||
const [isMailLoader, setIsMailLoader] = useState({
|
||||
request: false,
|
||||
completion: false
|
||||
});
|
||||
const [isalert, setIsAlert] = useState({ type: "success", msg: "" });
|
||||
const defaultRequestSubject = `{{sender_name}} has requested you to sign {{document_title}}`;
|
||||
const defaultRequestBody = `<p>Hi {{receiver_name}},</p><br><p>We hope this email finds you well. {{sender_name}} has requested you to review and sign {{document_title}}.</p><p>Your signature is crucial to proceed with the next steps as it signifies your agreement and authorization.</p><br><p><a href='{{signing_url}}' rel='noopener noreferrer' target='_blank'>Sign here</a></p><br><br><p>If you have any questions or need further clarification regarding the document or the signing process, please contact the sender.</p><br><p>Thanks</p><p> Team ${appName}</p><br>`;
|
||||
const defaultCompletionSubject = `Document {{document_title}} has been signed by all parties`;
|
||||
const defaultCompletionBody = `<p>Hi {{sender_name}},</p><br><p>All parties have successfully signed the document {{document_title}}. Kindly download the document from the attachment.</p><br><p>Thanks</p><p> Team ${appName}</p><br>`;
|
||||
const cloudfunction =
|
||||
"updatetenant";
|
||||
|
||||
useEffect(() => {
|
||||
fetchSubscription();
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [
|
||||
info
|
||||
]);
|
||||
|
||||
const handleModifyMail = (mode) => {
|
||||
mode === "request"
|
||||
? setIsDefaultMail((p) => ({ ...p, requestMail: !p?.requestMail }))
|
||||
: setIsDefaultMail((p) => ({ ...p, completionMail: !p?.completionMail }));
|
||||
};
|
||||
const fetchSubscription = async () => {
|
||||
await tenantEmailTemplate(info);
|
||||
};
|
||||
|
||||
const tenantEmailTemplate = async (tenantRes) => {
|
||||
if (tenantRes === "user does not exist!") {
|
||||
alert(t("user-not-exist"));
|
||||
} else if (tenantRes) {
|
||||
const updateRes = tenantRes;
|
||||
const defaultRequestBody = `<p>Hi {{receiver_name}},</p><br><p>We hope this email finds you well. {{sender_name}} has requested you to review and sign {{document_title}}.</p><p>Your signature is crucial to proceed with the next steps as it signifies your agreement and authorization.</p><br><p><a href='{{signing_url}}' rel='noopener noreferrer' target='_blank'>Sign here</a></p><br><br><p>If you have any questions or need further clarification regarding the document or the signing process, please contact the sender.</p><br><p>Thanks</p><p> Team ${appName}</p><br>`;
|
||||
if (updateRes?.RequestBody) {
|
||||
setRequestBody(updateRes?.RequestBody);
|
||||
setRequestSubject(updateRes?.RequestSubject);
|
||||
setIsDefaultMail((prev) => ({ ...prev, requestMail: false }));
|
||||
} else {
|
||||
setRequestBody(defaultRequestBody);
|
||||
setRequestSubject(defaultRequestSubject);
|
||||
setIsDefaultMail((prev) => ({ ...prev, requestMail: true }));
|
||||
}
|
||||
if (updateRes?.CompletionBody) {
|
||||
setCompletionBody(updateRes?.CompletionBody);
|
||||
setCompletionSubject(updateRes?.CompletionSubject);
|
||||
setIsDefaultMail((prev) => ({ ...prev, completionMail: false }));
|
||||
} else {
|
||||
setCompletionBody(defaultCompletionBody);
|
||||
setCompletionSubject(defaultCompletionSubject);
|
||||
setIsDefaultMail((prev) => ({ ...prev, completionMail: true }));
|
||||
}
|
||||
}
|
||||
};
|
||||
//function to save completion email template
|
||||
const handleSaveCompletionEmail = async (e) => {
|
||||
e.preventDefault();
|
||||
try {
|
||||
const replacedHtmlBody = completionBody.replace(/"/g, "'");
|
||||
const htmlBody = `<html><head><meta http-equiv='Content-Type' content='text/html; charset=UTF-8' /></head><body>${replacedHtmlBody}</body></html>`;
|
||||
const updateTenant = await Parse.Cloud.run(cloudfunction, {
|
||||
tenantId: tenantId,
|
||||
details: {
|
||||
CompletionBody: htmlBody,
|
||||
CompletionSubject: completionSubject
|
||||
}
|
||||
});
|
||||
if (updateTenant) {
|
||||
const updateRes = JSON.parse(JSON.stringify(updateTenant));
|
||||
setCompletionBody(updateRes?.CompletionBody);
|
||||
setCompletionSubject(updateRes?.CompletionSubject);
|
||||
setIsAlert({ type: "success", msg: t("saved-successfully") });
|
||||
setTimeout(() => setIsAlert({ type: "", msg: "" }), 1500);
|
||||
}
|
||||
} catch (err) {
|
||||
console.error("Error while saving completion email template: ", err);
|
||||
setIsAlert({ type: "danger", msg: t("something-went-wrong-mssg") });
|
||||
setTimeout(() => setIsAlert({ type: "", msg: "" }), 1500);
|
||||
}
|
||||
};
|
||||
//function to save request email template
|
||||
const handleSaveRequestEmail = async (e) => {
|
||||
e.preventDefault();
|
||||
try {
|
||||
const replacedHtmlBody = requestBody.replace(/"/g, "'");
|
||||
const htmlBody = `<html><head><meta http-equiv='Content-Type' content='text/html; charset=UTF-8' /></head><body>${replacedHtmlBody}</body></html>`;
|
||||
const updateTenant = await Parse.Cloud.run(cloudfunction, {
|
||||
tenantId: tenantId,
|
||||
details: { RequestBody: htmlBody, RequestSubject: requestSubject }
|
||||
});
|
||||
if (updateTenant) {
|
||||
const updateRes = JSON.parse(JSON.stringify(updateTenant));
|
||||
setRequestBody(updateRes?.RequestBody);
|
||||
setRequestSubject(updateRes?.RequestSubject);
|
||||
let extUser =
|
||||
localStorage.getItem("Extand_Class") &&
|
||||
JSON.parse(localStorage.getItem("Extand_Class"))?.[0];
|
||||
if (extUser && extUser?.objectId) {
|
||||
extUser.TenantId.RequestBody = updateRes?.RequestBody;
|
||||
extUser.TenantId.RequestSubject = updateRes?.RequestSubject;
|
||||
const _extUser = JSON.parse(JSON.stringify(extUser));
|
||||
localStorage.setItem("Extand_Class", JSON.stringify([_extUser]));
|
||||
}
|
||||
setIsAlert({ type: "success", msg: t("saved-successfully") });
|
||||
setTimeout(() => setIsAlert({ type: "", msg: "" }), 1500);
|
||||
}
|
||||
} catch (err) {
|
||||
console.error("Error while saving request email template: ", err);
|
||||
setIsAlert({ type: "danger", msg: t("something-went-wrong-mssg") });
|
||||
setTimeout(() => setIsAlert({ type: "", msg: "" }), 1500);
|
||||
}
|
||||
};
|
||||
|
||||
//function to use reset form
|
||||
const handleReset = async (request, completion) => {
|
||||
let extUser =
|
||||
localStorage.getItem("Extand_Class") &&
|
||||
JSON.parse(localStorage.getItem("Extand_Class"))?.[0];
|
||||
handleModifyMail(request);
|
||||
if (request && !isDefaultMail?.requestMail) {
|
||||
setRequestBody(defaultRequestBody);
|
||||
setRequestSubject(defaultRequestSubject);
|
||||
setIsMailLoader((p) => ({ ...p, request: true }));
|
||||
try {
|
||||
await Parse.Cloud.run(cloudfunction, {
|
||||
tenantId: tenantId,
|
||||
details: { RequestBody: "", RequestSubject: "" }
|
||||
});
|
||||
|
||||
if (extUser && extUser?.objectId) {
|
||||
extUser.TenantId.RequestBody = "";
|
||||
extUser.TenantId.RequestSubject = "";
|
||||
const _extUser = JSON.parse(JSON.stringify(extUser));
|
||||
localStorage.setItem("Extand_Class", JSON.stringify([_extUser]));
|
||||
}
|
||||
} catch (err) {
|
||||
console.error("Error while resetting request mail: ", err);
|
||||
} finally {
|
||||
setIsMailLoader((p) => ({ ...p, request: false }));
|
||||
}
|
||||
} else if (completion && !isDefaultMail?.completionMail) {
|
||||
setCompletionSubject(defaultCompletionSubject);
|
||||
setCompletionBody(defaultCompletionBody);
|
||||
setIsMailLoader((p) => ({ ...p, completion: true }));
|
||||
try {
|
||||
await Parse.Cloud.run(cloudfunction, {
|
||||
tenantId: tenantId,
|
||||
details: { CompletionBody: "", CompletionSubject: "" }
|
||||
});
|
||||
if (extUser && extUser?.objectId) {
|
||||
extUser.TenantId.CompletionBody = "";
|
||||
extUser.TenantId.CompletionSubject = "";
|
||||
const _extUser = JSON.parse(JSON.stringify(extUser));
|
||||
localStorage.setItem("Extand_Class", JSON.stringify([_extUser]));
|
||||
}
|
||||
} catch (err) {
|
||||
console.error("Error while resetting completion mail: ", err);
|
||||
} finally {
|
||||
setIsMailLoader((p) => ({ ...p, completion: false }));
|
||||
}
|
||||
}
|
||||
};
|
||||
//function for handle ontext change and save again text in delta
|
||||
const handleOnchangeRequest = () => {
|
||||
if (editorRef.current) {
|
||||
const html = editorRef.current.editor.root.innerHTML;
|
||||
setRequestBody(html);
|
||||
}
|
||||
};
|
||||
const handleOnchangeCompletion = () => {
|
||||
if (editorRefCom.current) {
|
||||
const html = editorRefCom.current.editor.root.innerHTML;
|
||||
setCompletionBody(html);
|
||||
}
|
||||
};
|
||||
return (
|
||||
<>
|
||||
{isalert.msg && <Alert type={isalert.type}>{isalert.msg}</Alert>}
|
||||
<div className="flex flex-col mb-4">
|
||||
<div className="flex flex-col">
|
||||
<h1 className="text-[14px] mb-[0.7rem] font-medium">
|
||||
{t("request-email")}
|
||||
</h1>
|
||||
<div className="relative mt-2 mb-4">
|
||||
{isMailLoader.request && (
|
||||
<div className="flex z-[100] justify-center items-center absolute w-full h-full rounded-box bg-black/30">
|
||||
<Loader />
|
||||
</div>
|
||||
)}
|
||||
{
|
||||
isDefaultMail?.requestMail && (
|
||||
<div className="absolute backdrop-blur-[2px] flex w-full h-full justify-center items-center bg-black/10 rounded-box select-none z-20">
|
||||
<button
|
||||
onClick={() => handleModifyMail("request")}
|
||||
className="op-btn op-btn-primary shadow-lg"
|
||||
>
|
||||
{t("modify")}
|
||||
</button>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
<form
|
||||
onSubmit={handleSaveRequestEmail}
|
||||
className="p-3 border-[1px] border-base-content rounded-box"
|
||||
>
|
||||
<div className="text-lg font-normal">
|
||||
<label className="text-sm">
|
||||
{t("subject")}{" "}
|
||||
<Tooltip
|
||||
id={"request-sub-tooltip"}
|
||||
message={`${t("variables-use")}: {{sender_name}} {{document_title}}`}
|
||||
/>
|
||||
</label>
|
||||
<input
|
||||
required
|
||||
value={requestSubject}
|
||||
onChange={(e) => setRequestSubject(e.target.value)}
|
||||
placeholder={`{{sender_name}} ${t("send-to-sign")} {{document_title}}`}
|
||||
className="w-full op-input op-input-bordered op-input-sm focus:outline-none hover:border-base-content text-xs"
|
||||
/>
|
||||
</div>
|
||||
<div className="text-lg font-normal py-2">
|
||||
<label className="text-sm mt-3">
|
||||
{t("body")}{" "}
|
||||
<Tooltip
|
||||
id={"request-body-tooltip"}
|
||||
message={`${t("variables-use")}: {{sender_name}} {{document_title}}`}
|
||||
/>
|
||||
</label>
|
||||
<EditorToolbar containerId="toolbar1" />
|
||||
<ReactQuill
|
||||
theme="snow"
|
||||
value={requestBody}
|
||||
placeholder="add body of email"
|
||||
ref={editorRef}
|
||||
modules={module1}
|
||||
formats={formats}
|
||||
onChange={handleOnchangeRequest}
|
||||
/>
|
||||
</div>
|
||||
<div className="flex items-center mt-3 gap-2">
|
||||
<button
|
||||
disabled={!requestBody || !requestSubject}
|
||||
className="op-btn op-btn-primary"
|
||||
type="submit"
|
||||
>
|
||||
{t("save")}
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
className="op-btn op-btn-secondary"
|
||||
onClick={() => handleReset("request")}
|
||||
>
|
||||
{t("reset")}
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<h1 className="text-[14px] mb-[0.7rem] font-medium">
|
||||
{t("completion-email")}
|
||||
</h1>
|
||||
<div className="relative my-2">
|
||||
{isMailLoader.completion && (
|
||||
<div className="flex z-[100] justify-center items-center absolute w-full h-full rounded-box bg-black/30">
|
||||
<Loader />
|
||||
</div>
|
||||
)}
|
||||
{
|
||||
isDefaultMail?.completionMail && (
|
||||
<div className="absolute backdrop-blur-[2px] flex w-full h-full justify-center items-center bg-black/10 rounded-box select-none z-20">
|
||||
<button
|
||||
onClick={() => handleModifyMail("completion")}
|
||||
className="op-btn op-btn-primary shadow-lg"
|
||||
>
|
||||
{t("modify")}
|
||||
</button>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
<form
|
||||
onSubmit={handleSaveCompletionEmail}
|
||||
className="p-3 border-[1px] border-base-content rounded-box"
|
||||
>
|
||||
<div className="text-lg font-normal">
|
||||
<label className="text-sm">
|
||||
{t("subject")}{" "}
|
||||
<Tooltip
|
||||
id={"complete-sub-tooltip"}
|
||||
message={`${t("variables-use")}:{{sender_name}} {{document_title}}`}
|
||||
/>
|
||||
</label>
|
||||
<input
|
||||
required
|
||||
value={completionSubject}
|
||||
onChange={(e) => setCompletionSubject(e.target.value)}
|
||||
placeholder={`{{sender_name}} ${t("send-to-sign")} {{document_title}}`}
|
||||
className="w-full op-input op-input-bordered op-input-sm focus:outline-none hover:border-base-content text-xs"
|
||||
/>
|
||||
</div>
|
||||
<div className="text-lg font-normal py-2">
|
||||
<label className="text-sm mt-3">
|
||||
{t("body")}{" "}
|
||||
<Tooltip
|
||||
id={"complete-body-tooltip"}
|
||||
message={`${t("variables-use")}:{{sender_name}} {{document_title}} {{signing_url}}`}
|
||||
/>
|
||||
</label>
|
||||
<EditorToolbar containerId="toolbar2" />
|
||||
<ReactQuill
|
||||
theme="snow"
|
||||
value={completionBody}
|
||||
placeholder="add body of email"
|
||||
ref={editorRefCom}
|
||||
modules={module2}
|
||||
formats={formats}
|
||||
onChange={handleOnchangeCompletion}
|
||||
/>
|
||||
</div>
|
||||
<div className="flex items-center mt-3 gap-2">
|
||||
<button
|
||||
disabled={!completionBody || !completionSubject}
|
||||
className="op-btn op-btn-primary"
|
||||
type="submit"
|
||||
>
|
||||
{t("save")}
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
className="op-btn op-btn-secondary"
|
||||
onClick={() => handleReset(null, "completion")}
|
||||
>
|
||||
{t("reset")}
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
};
|
||||
export default MailTemplateEditor;
|
||||
+230
-217
@@ -9,7 +9,7 @@ import fontkit from "@pdf-lib/fontkit";
|
||||
import { themeColor } from "./const";
|
||||
import { format, toZonedTime } from "date-fns-tz";
|
||||
import i18n from "../i18n";
|
||||
import { buildDownloadFilename } from "../utils";
|
||||
import { applyNumberFormulasToPages, buildDownloadFilename } from "../utils";
|
||||
|
||||
export const fontsizeArr = [2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28];
|
||||
export const fontColorArr = ["red", "black", "blue", "yellow"];
|
||||
@@ -116,6 +116,19 @@ export const getSecureUrl = async (url) => {
|
||||
}
|
||||
};
|
||||
|
||||
// `generateId` generates a random alphanumeric ID of specified length.
|
||||
export function generateId(length) {
|
||||
const characters =
|
||||
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
||||
let result = "";
|
||||
const charactersLength = characters.length;
|
||||
|
||||
for (let i = 0; i < length; i++) {
|
||||
result += characters.charAt(Math.floor(Math.random() * charactersLength));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes a trailing path segment from a URL string, if present.
|
||||
*
|
||||
@@ -327,6 +340,7 @@ export const widgets = [
|
||||
{ type: "name", icon: "fa-light fa-user", iconSize: "21px" },
|
||||
{ type: "job title", icon: "fa-light fa-address-card", iconSize: "17px" },
|
||||
{ type: "company", icon: "fa-light fa-building", iconSize: "25px" },
|
||||
{ type: "email", icon: "fa-light fa-envelope", iconSize: "20px" },
|
||||
{ type: "date", icon: "fa-light fa-calendar-days", iconSize: "20px" },
|
||||
{ type: textWidget, icon: "fa-light fa-text-width", iconSize: "20px" },
|
||||
{ type: cellsWidget, icon: "fa-light fa-table-cells", iconSize: "20px" },
|
||||
@@ -337,8 +351,7 @@ export const widgets = [
|
||||
iconSize: "19px"
|
||||
},
|
||||
{ type: radioButtonWidget, icon: "fa-light fa-circle-dot", iconSize: "20px" },
|
||||
{ type: "image", icon: "fa-light fa-image", iconSize: "20px" },
|
||||
{ type: "email", icon: "fa-light fa-envelope", iconSize: "20px" }
|
||||
{ type: "image", icon: "fa-light fa-image", iconSize: "20px" }
|
||||
];
|
||||
|
||||
export const getDate = (dateformat) => {
|
||||
@@ -410,6 +423,35 @@ export const changeDateToMomentFormat = (format) => {
|
||||
return "L";
|
||||
}
|
||||
};
|
||||
|
||||
export const getSignerPages = (xyPosition = [], currentKey, signerId) => {
|
||||
if (!Array.isArray(xyPosition)) {
|
||||
return [];
|
||||
}
|
||||
const hasSigners = xyPosition.some((item) =>
|
||||
Array.isArray(item?.placeHolder)
|
||||
);
|
||||
if (hasSigners) {
|
||||
const candidates =
|
||||
signerId !== undefined && signerId !== null && signerId !== ""
|
||||
? xyPosition.filter(
|
||||
(item) => item.Id === signerId || item.signerObjId === signerId
|
||||
)
|
||||
: xyPosition;
|
||||
for (const signer of candidates) {
|
||||
const pages = signer?.placeHolder || [];
|
||||
const ownsWidget = pages.some((page) =>
|
||||
(page?.pos || []).some((widget) => widget?.key === currentKey)
|
||||
);
|
||||
if (ownsWidget) {
|
||||
return pages;
|
||||
}
|
||||
}
|
||||
return [];
|
||||
}
|
||||
return xyPosition;
|
||||
};
|
||||
|
||||
export const addWidgetOptions = (
|
||||
type,
|
||||
signer,
|
||||
@@ -418,20 +460,15 @@ export const addWidgetOptions = (
|
||||
widgetValue
|
||||
) => {
|
||||
let defaultOpt;
|
||||
const id = generateId(6);
|
||||
if (placeholder) {
|
||||
const countSameWidget = placeholder?.reduce((count, page) => {
|
||||
return count + page.pos.filter((item) => item.type === type).length;
|
||||
}, 0);
|
||||
const count = countSameWidget + 1;
|
||||
defaultOpt = {
|
||||
name: `${type}-${count}`,
|
||||
status: "required"
|
||||
};
|
||||
defaultOpt = { name: `${type}-${id}-${count}`, status: "required" };
|
||||
} else {
|
||||
defaultOpt = {
|
||||
name: `${type}-1`,
|
||||
status: "required"
|
||||
};
|
||||
defaultOpt = { name: `${type}-${id}-1`, status: "required" };
|
||||
}
|
||||
switch (type) {
|
||||
case "signature":
|
||||
@@ -439,13 +476,12 @@ export const addWidgetOptions = (
|
||||
case "stamp":
|
||||
return defaultOpt;
|
||||
case "checkbox":
|
||||
return { ...defaultOpt, isReadOnly: false, isHideLabel: false };
|
||||
case textInputWidget:
|
||||
return {
|
||||
...defaultOpt,
|
||||
isReadOnly: false,
|
||||
isHideLabel: false
|
||||
isReadOnly: false
|
||||
};
|
||||
case textInputWidget:
|
||||
return { ...defaultOpt, isReadOnly: false };
|
||||
case cellsWidget:
|
||||
return {
|
||||
...defaultOpt,
|
||||
@@ -495,8 +531,7 @@ export const addWidgetOptions = (
|
||||
return {
|
||||
...defaultOpt,
|
||||
values: [],
|
||||
isReadOnly: false,
|
||||
isHideLabel: false
|
||||
isReadOnly: false
|
||||
};
|
||||
case textWidget:
|
||||
return defaultOpt;
|
||||
@@ -513,20 +548,15 @@ export const addWidgetSelfsignOptions = (
|
||||
) => {
|
||||
let defaultOpt;
|
||||
//condition to handle widgets name field
|
||||
const id = generateId(6);
|
||||
if (placeholder) {
|
||||
const countSameWidget = placeholder?.reduce((count, page) => {
|
||||
return count + page.pos.filter((item) => item.type === type).length;
|
||||
}, 0);
|
||||
const count = countSameWidget + 1;
|
||||
defaultOpt = {
|
||||
name: `${type}-${count}`,
|
||||
status: "required"
|
||||
};
|
||||
defaultOpt = { name: `${type}-${id}-${count}`, status: "required" };
|
||||
} else {
|
||||
defaultOpt = {
|
||||
name: `${type}-1`,
|
||||
status: "required"
|
||||
};
|
||||
defaultOpt = { name: `${type}-${id}-1`, status: "required" };
|
||||
}
|
||||
switch (type) {
|
||||
case "signature":
|
||||
@@ -1077,9 +1107,11 @@ export const onChangeInput = (
|
||||
return obj;
|
||||
});
|
||||
|
||||
const recalculatedPages = applyNumberFormulasToPages(newUpdateSignPos);
|
||||
|
||||
const newUpdateSigner = xyPosition.map((obj) => {
|
||||
if (obj.Id === userId) {
|
||||
return { ...obj, placeHolder: newUpdateSignPos };
|
||||
return { ...obj, placeHolder: recalculatedPages };
|
||||
}
|
||||
return obj;
|
||||
});
|
||||
@@ -1125,7 +1157,7 @@ export const onChangeInput = (
|
||||
}
|
||||
return obj;
|
||||
});
|
||||
setXyPosition(updatePlaceholder);
|
||||
setXyPosition(applyNumberFormulasToPages(updatePlaceholder));
|
||||
}
|
||||
};
|
||||
//function to increase height of text area on press enter
|
||||
@@ -1220,13 +1252,13 @@ export const calculateInitialWidthHeight = (widgetData) => {
|
||||
export const widgetDataValue = (type, value) => {
|
||||
switch (type) {
|
||||
case "name":
|
||||
return value?.Name;
|
||||
return value?.Name || value?.name;
|
||||
case "company":
|
||||
return value?.Company;
|
||||
return value?.Company || value?.company;
|
||||
case "job title":
|
||||
return value?.JobTitle;
|
||||
return value?.JobTitle || value?.jobTitle;
|
||||
case "email":
|
||||
return value?.Email;
|
||||
return value?.Email || value?.email;
|
||||
default:
|
||||
return "";
|
||||
}
|
||||
@@ -1850,6 +1882,16 @@ export const embedWidgetsToDoc = async (
|
||||
console.log("error in image", e);
|
||||
}
|
||||
for (let [id, position] of widgetsPositionArr.entries()) {
|
||||
const isTextTypeWidget = [
|
||||
textWidget,
|
||||
textInputWidget,
|
||||
cellsWidget,
|
||||
"name",
|
||||
"company",
|
||||
"job title",
|
||||
"date",
|
||||
"email"
|
||||
].includes(position.type);
|
||||
if (hasError) break; // Stop the inner loop if an error occurred
|
||||
try {
|
||||
let img;
|
||||
@@ -1898,33 +1940,13 @@ export const embedWidgetsToDoc = async (
|
||||
return y;
|
||||
}
|
||||
} else {
|
||||
const WidgetsTypeTextExist = [
|
||||
textWidget,
|
||||
textInputWidget,
|
||||
cellsWidget,
|
||||
"name",
|
||||
"company",
|
||||
"job title",
|
||||
"date",
|
||||
"email"
|
||||
].includes(position.type);
|
||||
const yPosition = WidgetsTypeTextExist ? resizePos + 6 : resizePos;
|
||||
const yPosition = isTextTypeWidget ? resizePos + 6 : resizePos;
|
||||
return yPosition;
|
||||
}
|
||||
};
|
||||
const color = position?.options?.fontColor;
|
||||
const updateColorInRgb = getWidgetsFontColor(color);
|
||||
const fontSize = parseInt(position?.options?.fontSize || 12);
|
||||
const isTextTypeWidget = [
|
||||
textWidget,
|
||||
textInputWidget,
|
||||
cellsWidget,
|
||||
"name",
|
||||
"company",
|
||||
"job title",
|
||||
"date",
|
||||
"email"
|
||||
].includes(position.type);
|
||||
if (position.type === "checkbox") {
|
||||
// Determine layout mode: 'vertical' (default) or 'horizontal'
|
||||
// const isHorizontal = position.layout === "horizontal";
|
||||
@@ -2022,7 +2044,7 @@ export const embedWidgetsToDoc = async (
|
||||
textContent = position.options?.response;
|
||||
}
|
||||
} else if (position?.options?.defaultValue) {
|
||||
textContent = position?.options?.defaultValue;
|
||||
textContent = position?.options?.defaultValue?.toString();
|
||||
}
|
||||
if (position.type === cellsWidget) {
|
||||
const cellCount =
|
||||
@@ -2049,15 +2071,16 @@ export const embedWidgetsToDoc = async (
|
||||
if (ch) page.drawText(ch, textPosition);
|
||||
}
|
||||
} else {
|
||||
const fixedWidth = widgetWidth; // Set your fixed width
|
||||
const isNewOnEnterLineExist = textContent.includes("\n");
|
||||
const fixedWidth = widgetWidth; // Set your fixed
|
||||
textContent = textContent?.toString();
|
||||
const isNewOnEnterLineExist = textContent?.includes("\n");
|
||||
|
||||
// Function to break text into lines based on the fixed width
|
||||
const NewbreakTextIntoLines = (textContent, width) => {
|
||||
const lines = [];
|
||||
let currentLine = "";
|
||||
|
||||
for (const word of textContent.split(" ")) {
|
||||
for (const word of textContent?.split(" ")) {
|
||||
//get text line width
|
||||
const lineWidth = font.widthOfTextAtSize(
|
||||
`${currentLine} ${word}`,
|
||||
@@ -2242,7 +2265,6 @@ export const embedWidgetsToDoc = async (
|
||||
width: widgetWidth,
|
||||
height: widgetHeight
|
||||
};
|
||||
|
||||
const imageOptions = getWidgetPosition(page, signature, 1, getSize);
|
||||
page.drawImage(img, imageOptions);
|
||||
}
|
||||
@@ -2370,56 +2392,34 @@ export const contractDocument = async (documentId, include) => {
|
||||
|
||||
//function for add default signature or image for all requested location
|
||||
export const addDefaultSignatureImg = (xyPosition, defaultSignImg, type) => {
|
||||
let imgWH = { width: "", height: "" };
|
||||
const img = new Image();
|
||||
img.src = defaultSignImg;
|
||||
if (img.complete) {
|
||||
imgWH = { width: img.width, height: img.height };
|
||||
}
|
||||
|
||||
let xyDefaultPos = [];
|
||||
for (let i = 0; i < xyPosition.length; i++) {
|
||||
// let getIMGWH;
|
||||
const getXYdata = xyPosition[i].pos;
|
||||
const getPageNo = xyPosition[i].pageNumber;
|
||||
const getPosData = getXYdata;
|
||||
|
||||
const addSign = getPosData.map((position) => {
|
||||
// getIMGWH = calculateImgAspectRatio(imgWH, position);
|
||||
if (position.type) {
|
||||
if (position?.type === type) {
|
||||
return {
|
||||
...position,
|
||||
SignUrl: defaultSignImg,
|
||||
// Width: getIMGWH.newWidth,
|
||||
// Height: getIMGWH.newHeight,
|
||||
ImageType: "default",
|
||||
options: {
|
||||
...position.options,
|
||||
response: defaultSignImg
|
||||
}
|
||||
options: { ...position.options, response: defaultSignImg }
|
||||
};
|
||||
}
|
||||
} else if (position && !position.isStamp) {
|
||||
return {
|
||||
...position,
|
||||
SignUrl: defaultSignImg,
|
||||
// Width: getIMGWH.newWidth,
|
||||
// Height: getIMGWH.newHeight,
|
||||
ImageType: "default",
|
||||
options: {
|
||||
...position.options,
|
||||
response: defaultSignImg
|
||||
}
|
||||
options: { ...position.options, response: defaultSignImg }
|
||||
};
|
||||
}
|
||||
return position;
|
||||
});
|
||||
|
||||
const newXypos = {
|
||||
pageNumber: getPageNo,
|
||||
pos: addSign
|
||||
};
|
||||
const newXypos = { pageNumber: getPageNo, pos: addSign };
|
||||
xyDefaultPos.push(newXypos);
|
||||
}
|
||||
return xyDefaultPos;
|
||||
@@ -3006,34 +3006,34 @@ export const saveLanguageInLocal = (i18n) => {
|
||||
const detectedLanguage = i18n.language || "en";
|
||||
localStorage.setItem("i18nextLng", detectedLanguage);
|
||||
};
|
||||
//function to get default signatur eof current user from `contracts_Signature` class
|
||||
|
||||
// function to get default signature of current user from `contracts_Signature` class
|
||||
export const getDefaultSignature = async (objectId) => {
|
||||
try {
|
||||
const query = new Parse.Query("contracts_Signature");
|
||||
query.equalTo("UserId", {
|
||||
__type: "Pointer",
|
||||
className: "_User",
|
||||
objectId: objectId
|
||||
});
|
||||
if (objectId) {
|
||||
const result = await Parse.Cloud.run("getdefaultsignature", {
|
||||
userId: objectId
|
||||
});
|
||||
if (result) {
|
||||
const res = JSON.parse(JSON.stringify(result));
|
||||
const defaultSignature = res?.ImageURL
|
||||
? await getBase64FromUrl(res?.ImageURL, true)
|
||||
: "";
|
||||
const defaultInitial = res?.Initials
|
||||
? await getBase64FromUrl(res?.Initials, true)
|
||||
: "";
|
||||
|
||||
const result = await query.first();
|
||||
if (result) {
|
||||
const res = JSON.parse(JSON.stringify(result));
|
||||
const defaultSignature = res?.ImageURL
|
||||
? await getBase64FromUrl(res?.ImageURL, true)
|
||||
: "";
|
||||
const defaultInitial = res?.Initials
|
||||
? await getBase64FromUrl(res?.Initials, true)
|
||||
: "";
|
||||
|
||||
return {
|
||||
status: "success",
|
||||
res: {
|
||||
id: result?.id,
|
||||
defaultSignature: defaultSignature,
|
||||
defaultInitial: defaultInitial
|
||||
}
|
||||
};
|
||||
return {
|
||||
status: "success",
|
||||
res: {
|
||||
id: result?.id,
|
||||
defaultSignature: defaultSignature,
|
||||
defaultInitial: defaultInitial
|
||||
}
|
||||
};
|
||||
}
|
||||
} else {
|
||||
return { status: "error" };
|
||||
}
|
||||
} catch (err) {
|
||||
console.log(
|
||||
@@ -3359,10 +3359,7 @@ export const handleHeighlightWidget = (
|
||||
...data,
|
||||
pos: data.pos.map((position) => {
|
||||
if (position.key === key) {
|
||||
return {
|
||||
...position,
|
||||
zIndex: highestZIndex + 1
|
||||
};
|
||||
return { ...position, zIndex: highestZIndex + 1 };
|
||||
}
|
||||
return position;
|
||||
})
|
||||
@@ -3459,39 +3456,52 @@ export const updateDateWidgetsRes = (
|
||||
const contactUser = documentData?.Signers?.find(
|
||||
(data) => data.objectId === signerId
|
||||
);
|
||||
const extUser = JSON.stringify([contactUser]);
|
||||
const extUser =
|
||||
localStorage.getItem("Extand_Class") || JSON.stringify([contactUser]);
|
||||
let placeHolders = documentData?.Placeholders;
|
||||
if (isRemovePrefill) {
|
||||
placeHolders = placeHolders?.filter((x) => x.Role !== "prefill");
|
||||
}
|
||||
const userDetails = extUser ? JSON.parse(extUser)[0] : contactUser;
|
||||
return placeHolders?.map((item) => {
|
||||
if (item?.signerObjId === signerId) {
|
||||
return {
|
||||
...item,
|
||||
placeHolder: item?.placeHolder?.map((ph) => ({
|
||||
if (item?.signerObjId === signerId || item?.Id === signerId) {
|
||||
// Sort page number placeholders
|
||||
const placeHolder = Array.isArray(item.placeHolder)
|
||||
? [...item.placeHolder]
|
||||
: [];
|
||||
const sortedPlaceHolder = placeHolder
|
||||
.sort((a, b) => a.pageNumber - b.pageNumber)
|
||||
.map((ph) => ({
|
||||
...ph,
|
||||
pos: ph?.pos?.map((widget) => {
|
||||
if (
|
||||
["name", "email", "job title", "company"].includes(widget.type) &&
|
||||
!widget.options.defaultValue &&
|
||||
!widget.options.response
|
||||
) {
|
||||
return {
|
||||
...widget,
|
||||
options: {
|
||||
...widget.options,
|
||||
response: widgetDataValue(widget.type, userDetails)
|
||||
}
|
||||
};
|
||||
}
|
||||
return widget;
|
||||
})
|
||||
}))
|
||||
};
|
||||
} else {
|
||||
return item;
|
||||
// Sort positions within each page
|
||||
pos: [...ph.pos]
|
||||
.sort((a, b) => a.yPosition - b.yPosition)
|
||||
.map((widget) => {
|
||||
// Update widget values if needed
|
||||
if (
|
||||
["name", "email", "job title", "company"].includes(
|
||||
widget.type
|
||||
) &&
|
||||
!widget.options.defaultValue &&
|
||||
!widget.options.response &&
|
||||
userDetails
|
||||
) {
|
||||
return {
|
||||
...widget,
|
||||
options: {
|
||||
...widget.options,
|
||||
response: widgetDataValue(widget.type, userDetails)
|
||||
}
|
||||
};
|
||||
}
|
||||
return widget;
|
||||
})
|
||||
}));
|
||||
|
||||
return { ...item, placeHolder: sortedPlaceHolder };
|
||||
}
|
||||
|
||||
return item;
|
||||
});
|
||||
};
|
||||
|
||||
@@ -3891,25 +3901,17 @@ export const sendEmailToSigners = async (
|
||||
} else {
|
||||
data = { SendMail: true };
|
||||
}
|
||||
try {
|
||||
await axios.put(
|
||||
`${localStorage.getItem("baseUrl")}classes/contracts_Document/${
|
||||
pdfDetails[0]?.objectId
|
||||
}`,
|
||||
data,
|
||||
{
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
"X-Parse-Application-Id": localStorage.getItem("parseAppId"),
|
||||
"X-Parse-Session-Token": sessiontoken
|
||||
}
|
||||
}
|
||||
);
|
||||
} catch (err) {
|
||||
console.log("axois err ", err);
|
||||
}
|
||||
} catch (e) {
|
||||
console.log("error", e);
|
||||
const docUrl = `${localStorage.getItem("baseUrl")}classes/contracts_Document`;
|
||||
await axios.put(`${docUrl}/${pdfDetails[0]?.objectId}`, data, {
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
"X-Parse-Application-Id": localStorage.getItem("parseAppId"),
|
||||
"X-Parse-Session-Token": sessiontoken
|
||||
}
|
||||
});
|
||||
} catch (error) {
|
||||
const err = error?.response?.data?.error || error?.message;
|
||||
console.error("Error while updating doc: ", err);
|
||||
}
|
||||
}
|
||||
return { status: "success" };
|
||||
@@ -3982,74 +3984,68 @@ export const getSignerEmail = (data, signers) => {
|
||||
|
||||
//function is used to delete widgets
|
||||
export const handleDeleteWidget = (key, Id, pageNumber, signerPos) => {
|
||||
const updateData = [];
|
||||
// Find the signer by ID
|
||||
const signer = signerPos.find((item) => item.Id === Id);
|
||||
if (!signer || !signer.placeHolder) return signerPos;
|
||||
|
||||
const filterSignerPos = signerPos.filter((data) => data.Id === Id);
|
||||
const placeHolder = signer.placeHolder;
|
||||
|
||||
if (filterSignerPos.length > 0) {
|
||||
const getPlaceHolder = filterSignerPos[0].placeHolder;
|
||||
// Find the page inside placeHolder
|
||||
const currentPage = placeHolder.find((p) => p.pageNumber === pageNumber);
|
||||
if (!currentPage) return signerPos;
|
||||
|
||||
const getPageNumer = getPlaceHolder.filter(
|
||||
(data) => data.pageNumber === pageNumber
|
||||
// Remove widget from the selected page
|
||||
const updatedPos = currentPage.pos.filter((w) => w.key !== key);
|
||||
|
||||
// -------------------------------------------------------
|
||||
// CASE A → After deletion, page still has widgets then keep that widgets
|
||||
// -------------------------------------------------------
|
||||
if (updatedPos.length > 0) {
|
||||
const updatedPlaceHolder = placeHolder.map((p) =>
|
||||
p.pageNumber === pageNumber ? { ...p, pos: updatedPos } : p
|
||||
);
|
||||
|
||||
if (getPageNumer.length > 0) {
|
||||
const getXYdata = getPageNumer[0].pos.filter((data) => data.key !== key);
|
||||
|
||||
if (getXYdata.length > 0) {
|
||||
updateData.push(getXYdata);
|
||||
const newUpdatePos = getPlaceHolder.map((obj) => {
|
||||
if (obj.pageNumber === pageNumber) {
|
||||
return { ...obj, pos: updateData[0] };
|
||||
}
|
||||
return obj;
|
||||
});
|
||||
|
||||
const newUpdateSigner = signerPos.map((obj) => {
|
||||
if (obj.Id === Id) {
|
||||
return { ...obj, placeHolder: newUpdatePos };
|
||||
}
|
||||
return obj;
|
||||
});
|
||||
return newUpdateSigner;
|
||||
} else {
|
||||
const getRemainPage = filterSignerPos[0].placeHolder.filter(
|
||||
(data) => data.pageNumber !== pageNumber
|
||||
);
|
||||
//condition to check placeholder length is greater than 1 do not need to remove whole placeholder
|
||||
//array only resove particular widgets
|
||||
if (getRemainPage && getRemainPage.length > 0) {
|
||||
const newUpdatePos = filterSignerPos.map((obj) => {
|
||||
if (obj.Id === Id) {
|
||||
return { ...obj, placeHolder: getRemainPage };
|
||||
}
|
||||
return obj;
|
||||
});
|
||||
let signerupdate = [];
|
||||
signerupdate = signerPos.filter((data) => data.Id !== Id);
|
||||
signerupdate.push(newUpdatePos[0]);
|
||||
|
||||
return signerupdate;
|
||||
} else {
|
||||
const updatedData = signerPos
|
||||
.map((item) => {
|
||||
if (item.Id === Id && item?.Role === "prefill") {
|
||||
return null; // mark this item to remove
|
||||
}
|
||||
if (item.Id === Id) {
|
||||
const updatedItem = { ...item };
|
||||
delete updatedItem.placeHolder;
|
||||
return updatedItem;
|
||||
}
|
||||
return item;
|
||||
})
|
||||
.filter(Boolean); // remove nulls (deleted items)
|
||||
|
||||
return updatedData;
|
||||
}
|
||||
}
|
||||
}
|
||||
return signerPos.map((s) =>
|
||||
s.Id === Id ? { ...s, placeHolder: updatedPlaceHolder } : s
|
||||
);
|
||||
}
|
||||
|
||||
// -------------------------------------------------------
|
||||
// CASE B → current page becomes empty → remove current page entirely and keep another pages which have widgets
|
||||
// -------------------------------------------------------
|
||||
const remainPages = placeHolder.filter((p) => p.pageNumber !== pageNumber);
|
||||
|
||||
//`remainPages` keep another pages's data which have widgets
|
||||
if (remainPages.length > 0) {
|
||||
const index = signerPos.findIndex((s) => s.Id === Id);
|
||||
if (index === -1) return signerPos;
|
||||
|
||||
const newSignerPos = [...signerPos];
|
||||
newSignerPos[index] = {
|
||||
...newSignerPos[index],
|
||||
placeHolder: remainPages
|
||||
};
|
||||
|
||||
return newSignerPos;
|
||||
}
|
||||
|
||||
// -------------------------------------------------------
|
||||
// CASE C → No pages have widgets after delete widgets
|
||||
// Remove placeHolder field for particular signers, EXCEPT prefill role
|
||||
// -------------------------------------------------------
|
||||
const updatedData = signerPos
|
||||
.map((s) => {
|
||||
if (s.Id === Id && s.Role === "prefill") return null; // remove whole signer
|
||||
if (s.Id === Id) {
|
||||
const updated = { ...s };
|
||||
delete updated.placeHolder;
|
||||
return updated;
|
||||
}
|
||||
return s;
|
||||
})
|
||||
.filter(Boolean); // remove nulls (deleted items)
|
||||
|
||||
return updatedData;
|
||||
};
|
||||
//function to convert formatted date to new Date() format
|
||||
export const getDefaultDate = (dateStr, format) => {
|
||||
@@ -4067,3 +4063,20 @@ export const getDefaultDate = (dateStr, format) => {
|
||||
};
|
||||
//function to get default format
|
||||
export const getDefaultFormat = (dateFormat) => dateFormat || "MM/dd/yyyy";
|
||||
|
||||
//function to handle widget background color
|
||||
export const handleBackground = (data, isNeedSign, uniqueId) => {
|
||||
if (data) {
|
||||
if (isNeedSign) {
|
||||
if (data?.Id === uniqueId) {
|
||||
return data?.blockColor + "b0";
|
||||
} else {
|
||||
return "#dedddc";
|
||||
}
|
||||
} else {
|
||||
return data?.blockColor + "b0";
|
||||
}
|
||||
} else {
|
||||
return "rgba(203, 233, 237, 0.69)";
|
||||
}
|
||||
};
|
||||
|
||||
@@ -4,6 +4,10 @@ const parseAppId = process.env.REACT_APP_APPID
|
||||
? process.env.REACT_APP_APPID
|
||||
: "opensign";
|
||||
const serverUrl = serverUrl_fn();
|
||||
const commonheader = {
|
||||
"Content-Type": "application/json",
|
||||
"X-Parse-Application-Id": parseAppId
|
||||
};
|
||||
export const SaveFileSize = async (size, imageUrl, tenantId, userId) => {
|
||||
//checking server url and save file's size
|
||||
const tenantPtr = {
|
||||
@@ -29,7 +33,6 @@ export const SaveFileSize = async (size, imageUrl, tenantId, userId) => {
|
||||
);
|
||||
const response = res.data.results;
|
||||
let data;
|
||||
// console.log("response", response);
|
||||
if (response && response.length > 0) {
|
||||
data = {
|
||||
usedStorage: response[0].usedStorage
|
||||
@@ -39,20 +42,12 @@ export const SaveFileSize = async (size, imageUrl, tenantId, userId) => {
|
||||
await axios.put(
|
||||
`${serverUrl}/classes/partners_TenantCredits/${response[0].objectId}`,
|
||||
data,
|
||||
{
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
"X-Parse-Application-Id": parseAppId
|
||||
}
|
||||
}
|
||||
{ headers: commonheader }
|
||||
);
|
||||
} else {
|
||||
data = { usedStorage: size, PartnersTenant: tenantPtr };
|
||||
await axios.post(`${serverUrl}/classes/partners_TenantCredits`, data, {
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
"X-Parse-Application-Id": parseAppId
|
||||
}
|
||||
headers: commonheader
|
||||
});
|
||||
}
|
||||
} catch (err) {
|
||||
@@ -69,14 +64,9 @@ const saveDataFile = async (size, imageUrl, tenantPtr, UserId) => {
|
||||
TenantPtr: tenantPtr,
|
||||
...(UserId ? { UserId: UserId } : {})
|
||||
};
|
||||
|
||||
// console.log("data save",file, data)
|
||||
try {
|
||||
await axios.post(`${serverUrl}/classes/partners_DataFiles`, data, {
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
"X-Parse-Application-Id": parseAppId
|
||||
}
|
||||
headers: commonheader
|
||||
});
|
||||
} catch (err) {
|
||||
console.log("err in save usage ", err);
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
import { useEffect } from "react";
|
||||
import { useDrag } from "react-dnd";
|
||||
import { getEmptyImage } from "react-dnd-html5-backend";
|
||||
import { useGuidelinesContext } from "../context/GuidelinesContext";
|
||||
|
||||
export const useWidgetDrag = (item) => {
|
||||
const { showGuidelines } = useGuidelinesContext();
|
||||
const [, dragRef, preview] = useDrag({
|
||||
type: "BOX",
|
||||
item,
|
||||
collect: (monitor) => ({
|
||||
isDragging: monitor.isDragging()
|
||||
}),
|
||||
end: () => {
|
||||
showGuidelines(false);
|
||||
}
|
||||
});
|
||||
|
||||
// Hide browser default drag preview
|
||||
useEffect(() => {
|
||||
preview(getEmptyImage(), { captureDraggingState: true });
|
||||
}, [preview]);
|
||||
|
||||
return { dragRef };
|
||||
};
|
||||
@@ -533,3 +533,23 @@ export default function reportJson(id) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
export const usersActions = [
|
||||
{
|
||||
btnId: "4741",
|
||||
hoverLabel: "Delete",
|
||||
btnColor: "op-btn-secondary",
|
||||
btnIcon: "fa-light fa-trash",
|
||||
redirectUrl: "",
|
||||
action: "delete",
|
||||
restrictAdmin: true
|
||||
},
|
||||
{
|
||||
btnId: "1910",
|
||||
hoverLabel: "Reset password",
|
||||
btnIcon: "fa-light fa-key",
|
||||
redirectUrl: "",
|
||||
action: "resetpassword",
|
||||
restrictAdmin: true
|
||||
}
|
||||
];
|
||||
|
||||
@@ -8,41 +8,70 @@ function ChangePassword() {
|
||||
const [currentpassword, setCurrentPassword] = useState("");
|
||||
const [newpassword, setnewpassword] = useState("");
|
||||
const [confirmpassword, setconfirmpassword] = useState("");
|
||||
const [lengthValid, setLengthValid] = useState(false);
|
||||
const [caseDigitValid, setCaseDigitValid] = useState(false);
|
||||
const [specialCharValid, setSpecialCharValid] = useState(false);
|
||||
const [showNewPassword, setNewShowPassword] = useState(false);
|
||||
const [showConfirmPassword, setShowConfirmPassword] = useState(false);
|
||||
const toggleNewPasswordVisibility = () => {
|
||||
setNewShowPassword(!showNewPassword);
|
||||
};
|
||||
const toggleConfirmPasswordVisibility = () => {
|
||||
setShowConfirmPassword(!showConfirmPassword);
|
||||
};
|
||||
|
||||
const handlePasswordChange = (e) => {
|
||||
const newPassword = e.target.value;
|
||||
setconfirmpassword(newPassword);
|
||||
// Check conditions separately
|
||||
setLengthValid(newPassword.length >= 8);
|
||||
setCaseDigitValid(
|
||||
/[a-z]/.test(newPassword) &&
|
||||
/[A-Z]/.test(newPassword) &&
|
||||
/\d/.test(newPassword)
|
||||
);
|
||||
setSpecialCharValid(/[!@#$%^&*()\-_=+{};:,<.>]/.test(newPassword));
|
||||
};
|
||||
const handleSubmit = async (evt) => {
|
||||
evt.preventDefault();
|
||||
try {
|
||||
if (newpassword === confirmpassword) {
|
||||
Parse.User.logIn(localStorage.getItem("userEmail"), currentpassword)
|
||||
.then(async (user) => {
|
||||
if (user) {
|
||||
const User = new Parse.User();
|
||||
const query = new Parse.Query(User);
|
||||
await query.get(user.id).then((user) => {
|
||||
// Updates the data we want
|
||||
user.set("password", newpassword);
|
||||
user
|
||||
.save()
|
||||
.then(async () => {
|
||||
let _user = user.toJSON();
|
||||
if (_user) {
|
||||
await Parse.User.become(_user.sessionToken);
|
||||
localStorage.setItem("accesstoken", _user.sessionToken);
|
||||
}
|
||||
alert(t("password-update-alert-1"));
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log("err", error);
|
||||
alert(t("something-went-wrong-mssg"));
|
||||
});
|
||||
});
|
||||
} else {
|
||||
alert(t("password-update-alert-2"));
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
alert(t("password-update-alert-3"));
|
||||
console.error("Error while logging in user", error);
|
||||
});
|
||||
if (lengthValid && caseDigitValid && specialCharValid) {
|
||||
Parse.User.logIn(localStorage.getItem("userEmail"), currentpassword)
|
||||
.then(async (user) => {
|
||||
if (user) {
|
||||
const User = new Parse.User();
|
||||
const query = new Parse.Query(User);
|
||||
await query.get(user.id).then((user) => {
|
||||
// Updates the data we want
|
||||
user.set("password", newpassword);
|
||||
user
|
||||
.save()
|
||||
.then(async () => {
|
||||
let _user = user.toJSON();
|
||||
if (_user) {
|
||||
await Parse.User.become(_user.sessionToken);
|
||||
localStorage.setItem("accesstoken", _user.sessionToken);
|
||||
}
|
||||
setCurrentPassword("");
|
||||
setnewpassword("");
|
||||
setconfirmpassword("");
|
||||
alert(t("password-update-alert-1"));
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log("err", error);
|
||||
alert(t("something-went-wrong-mssg"));
|
||||
});
|
||||
});
|
||||
} else {
|
||||
alert(t("password-update-alert-2"));
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
alert(t("password-update-alert-3"));
|
||||
console.error("Error while logging in user", error);
|
||||
});
|
||||
}
|
||||
} else {
|
||||
alert(t("password-update-alert-4"));
|
||||
}
|
||||
@@ -80,34 +109,93 @@ function ChangePassword() {
|
||||
<label htmlFor="newpassword" className="text-xs block ml-1">
|
||||
{t("new-password")}
|
||||
</label>
|
||||
<input
|
||||
type="password"
|
||||
name="newpassword"
|
||||
value={newpassword}
|
||||
onChange={(e) => setnewpassword(e.target.value)}
|
||||
className="op-input op-input-bordered op-input-sm text-xs w-full"
|
||||
placeholder={t("new-password")}
|
||||
onInvalid={(e) => e.target.setCustomValidity(t("input-required"))}
|
||||
onInput={(e) => e.target.setCustomValidity("")}
|
||||
required
|
||||
/>
|
||||
<div className="relative">
|
||||
<input
|
||||
type={showNewPassword ? "text" : "password"}
|
||||
name="newpassword"
|
||||
value={newpassword}
|
||||
onChange={(e) => setnewpassword(e.target.value)}
|
||||
className="op-input op-input-bordered op-input-sm text-xs w-full"
|
||||
placeholder={t("new-password")}
|
||||
onInvalid={(e) =>
|
||||
e.target.setCustomValidity(t("input-required"))
|
||||
}
|
||||
onInput={(e) => e.target.setCustomValidity("")}
|
||||
required
|
||||
/>
|
||||
<span
|
||||
className={`absolute top-[50%] right-[10px] -translate-y-[50%] cursor-pointer text-base-content`}
|
||||
onClick={toggleNewPasswordVisibility}
|
||||
>
|
||||
{showNewPassword ? (
|
||||
<i className="fa fa-eye-slash" /> // Close eye icon
|
||||
) : (
|
||||
<i className="fa fa-eye" /> // Open eye icon
|
||||
)}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<label htmlFor="newpassword" className="text-xs block ml-1">
|
||||
<label htmlFor="confirmpassword" className="text-xs block ml-1">
|
||||
{t("confirm-password")}
|
||||
</label>
|
||||
<input
|
||||
type="password"
|
||||
name="confirmpassword"
|
||||
className="op-input op-input-bordered op-input-sm text-xs w-full"
|
||||
value={confirmpassword}
|
||||
onChange={(e) => setconfirmpassword(e.target.value)}
|
||||
placeholder={t("confirm-password")}
|
||||
onInvalid={(e) => e.target.setCustomValidity(t("input-required"))}
|
||||
onInput={(e) => e.target.setCustomValidity("")}
|
||||
required
|
||||
/>
|
||||
<div className="relative">
|
||||
<input
|
||||
type={showConfirmPassword ? "text" : "password"}
|
||||
name="confirmpassword"
|
||||
className="op-input op-input-bordered op-input-sm text-xs w-full"
|
||||
value={confirmpassword}
|
||||
onChange={handlePasswordChange}
|
||||
placeholder={t("confirm-password")}
|
||||
onInvalid={(e) =>
|
||||
e.target.setCustomValidity(t("input-required"))
|
||||
}
|
||||
onInput={(e) => e.target.setCustomValidity("")}
|
||||
required
|
||||
/>
|
||||
<span
|
||||
className={`absolute top-[50%] right-[10px] -translate-y-[50%] cursor-pointer text-base-content`}
|
||||
onClick={toggleConfirmPasswordVisibility}
|
||||
>
|
||||
{showConfirmPassword ? (
|
||||
<i className="fa fa-eye-slash" /> // Close eye icon
|
||||
) : (
|
||||
<i className="fa fa-eye" /> // Open eye icon
|
||||
)}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
{confirmpassword.length > 0 && (
|
||||
<div className="mt-1 text-[11px]">
|
||||
{newpassword.length > 0 && (
|
||||
<p
|
||||
className={`${newpassword === confirmpassword ? "text-green-600" : "text-red-600"} text-[11px] mt-1`}
|
||||
>
|
||||
{newpassword === confirmpassword ? "✓" : "✗"}{" "}
|
||||
{t("password-match-length")}
|
||||
</p>
|
||||
)}
|
||||
<p
|
||||
className={`${lengthValid ? "text-green-600" : "text-red-600"}`}
|
||||
>
|
||||
{lengthValid ? "✓" : "✗"} {t("password-length")}
|
||||
</p>
|
||||
<p
|
||||
className={`${
|
||||
caseDigitValid ? "text-green-600" : "text-red-600"
|
||||
}`}
|
||||
>
|
||||
{caseDigitValid ? "✓" : "✗"} {t("password-case")}
|
||||
</p>
|
||||
<p
|
||||
className={`${
|
||||
specialCharValid ? "text-green-600" : "text-red-600"
|
||||
}`}
|
||||
>
|
||||
{specialCharValid ? "✓" : "✗"} {t("password-special-char")}
|
||||
</p>
|
||||
</div>
|
||||
)}
|
||||
<button
|
||||
type="submit"
|
||||
className="op-btn op-btn-primary shadow-md mt-2"
|
||||
|
||||
@@ -314,8 +314,8 @@ const Forms = (props) => {
|
||||
"application/pdf"
|
||||
);
|
||||
const response = await parseFile.save({
|
||||
progress: (progressValue, loaded, total, { type }) => {
|
||||
if (type === "upload" && progressValue !== null) {
|
||||
progress: (progressValue, loaded, total) => {
|
||||
if (progressValue !== null) {
|
||||
const percentCompleted = Math.round((loaded * 100) / total);
|
||||
setpercentage(percentCompleted);
|
||||
}
|
||||
@@ -342,6 +342,7 @@ const Forms = (props) => {
|
||||
setSelectedFiles([]);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("error ", error);
|
||||
if (error?.code === 209) {
|
||||
dispatch(sessionStatus(false));
|
||||
} else {
|
||||
@@ -388,13 +389,16 @@ const Forms = (props) => {
|
||||
object.set("Description", formData?.Description);
|
||||
object.set("Note", formData?.Note);
|
||||
if (props.title === "Request Signatures") {
|
||||
if (
|
||||
extUserData?.TenantId?.RequestBody &&
|
||||
extUserData?.TenantId?.RequestSubject
|
||||
) {
|
||||
object.set("RequestBody", extUserData?.TenantId?.RequestBody);
|
||||
object.set("RequestSubject", extUserData?.TenantId?.RequestSubject);
|
||||
}
|
||||
if (
|
||||
extUserData?.TenantId?.RequestBody &&
|
||||
extUserData?.TenantId?.RequestSubject
|
||||
) {
|
||||
object.set("RequestBody", extUserData?.TenantId?.RequestBody);
|
||||
object.set(
|
||||
"RequestSubject",
|
||||
extUserData?.TenantId?.RequestSubject
|
||||
);
|
||||
}
|
||||
}
|
||||
if (props.title !== "Sign Yourself") {
|
||||
const isChecked = formData.SendinOrder === "false" ? false : true;
|
||||
@@ -582,8 +586,8 @@ const Forms = (props) => {
|
||||
const flatPdf = await flattenPdf(res);
|
||||
const parseFile = new Parse.File(name, [...flatPdf], "application/pdf");
|
||||
await parseFile.save({
|
||||
progress: (progressValue, loaded, total, { type }) => {
|
||||
if (type === "upload" && progressValue !== null) {
|
||||
progress: (progressValue, loaded, total) => {
|
||||
if (progressValue !== null) {
|
||||
const percentCompleted = Math.round((loaded * 100) / total);
|
||||
setpercentage(percentCompleted);
|
||||
}
|
||||
|
||||
@@ -463,7 +463,7 @@ function GuestLogin() {
|
||||
e.preventDefault();
|
||||
setIsOptionalDetails(!isOptionalDetails);
|
||||
}}
|
||||
className="op-link op-link-secondary max-w-fit text-xs"
|
||||
className="text-base-content/60 no-underline hover:underline focus:outline-none max-w-fit text-xs"
|
||||
>
|
||||
{isOptionalDetails
|
||||
? t("hide-optional-details")
|
||||
|
||||
@@ -47,10 +47,14 @@ function Login() {
|
||||
const [image, setImage] = useState();
|
||||
const [errMsg, setErrMsg] = useState();
|
||||
useEffect(() => {
|
||||
checkUserExt();
|
||||
handleUserExist();
|
||||
// eslint-disable-next-line
|
||||
}, []);
|
||||
|
||||
const handleUserExist = async () => {
|
||||
checkUserExt();
|
||||
};
|
||||
|
||||
|
||||
const setLocalVar = (user) => {
|
||||
localStorage.setItem("accesstoken", user.sessionToken);
|
||||
|
||||
@@ -46,10 +46,9 @@ const ManageSign = () => {
|
||||
objectId: User.id
|
||||
};
|
||||
try {
|
||||
const signCls = "contracts_Signature";
|
||||
const signQuery = new Parse.Query(signCls);
|
||||
signQuery.equalTo("UserId", userId);
|
||||
const signRes = await signQuery.first();
|
||||
const signRes = await Parse.Cloud.run("getdefaultsignature", {
|
||||
userId: User.id
|
||||
});
|
||||
if (signRes) {
|
||||
const res = signRes.toJSON();
|
||||
setId(res.objectId);
|
||||
@@ -226,44 +225,23 @@ const ManageSign = () => {
|
||||
};
|
||||
|
||||
const saveEntry = async (obj) => {
|
||||
const signCls = "contracts_Signature";
|
||||
const User = Parse?.User?.current()?.id;
|
||||
const userId = { __type: "Pointer", className: "_User", objectId: User };
|
||||
if (id) {
|
||||
try {
|
||||
const updateSign = new Parse.Object(signCls);
|
||||
updateSign.id = id;
|
||||
updateSign.set("Initials", obj.initialsUrl ? obj.initialsUrl : "");
|
||||
updateSign.set("ImageURL", obj.url ? obj.url : "");
|
||||
updateSign.set("SignatureName", obj.name);
|
||||
updateSign.set("UserId", userId);
|
||||
const res = await updateSign.save();
|
||||
setIsAlert({ type: "success", message: t("signature-saved-alert") });
|
||||
return res;
|
||||
} catch (err) {
|
||||
console.log(err);
|
||||
setIsAlert({ type: "danger", message: `${err.message}` });
|
||||
} finally {
|
||||
setIsLoader(false);
|
||||
setTimeout(() => setIsAlert({}), 2000);
|
||||
}
|
||||
} else {
|
||||
try {
|
||||
const updateSign = new Parse.Object(signCls);
|
||||
updateSign.set("Initials", obj.initialsUrl ? obj.initialsUrl : "");
|
||||
updateSign.set("ImageURL", obj.url);
|
||||
updateSign.set("SignatureName", obj.name);
|
||||
updateSign.set("UserId", userId);
|
||||
const res = await updateSign.save();
|
||||
setIsAlert({ type: "success", message: t("signature-saved-alert") });
|
||||
return res;
|
||||
} catch (err) {
|
||||
console.log(err);
|
||||
setIsAlert({ type: "success", message: `${err.message}` });
|
||||
} finally {
|
||||
setIsLoader(false);
|
||||
setTimeout(() => setIsAlert({}), 2000);
|
||||
}
|
||||
try {
|
||||
const User = Parse?.User?.current()?.id;
|
||||
const res = await Parse.Cloud.run("managesign", {
|
||||
signature: obj.url,
|
||||
userId: User,
|
||||
initials: obj.initialsUrl,
|
||||
id: id,
|
||||
title: obj.name
|
||||
});
|
||||
setIsAlert({ type: "success", message: t("signature-saved-alert") });
|
||||
return res;
|
||||
} catch (err) {
|
||||
console.log(err);
|
||||
setIsAlert({ type: "danger", message: `${err.message}` });
|
||||
} finally {
|
||||
setIsLoader(false);
|
||||
setTimeout(() => setIsAlert({}), 2000);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@ import { PDFDocument } from "pdf-lib";
|
||||
import "../styles/signature.css";
|
||||
import Parse from "parse";
|
||||
import axios from "axios";
|
||||
import { useDrop } from "react-dnd";
|
||||
import { useDispatch, useSelector } from "react-redux";
|
||||
import RenderAllPdfPage from "../components/pdf/RenderAllPdfPage";
|
||||
import Tour from "../primitives/Tour";
|
||||
@@ -156,16 +155,12 @@ function PdfRequestFiles(
|
||||
const [assignedWidgetId, setAssignedWidgetId] = useState([]);
|
||||
const [showSignPagenumber, setShowSignPagenumber] = useState([]);
|
||||
const [owner, setOwner] = useState({});
|
||||
const [tenant, setTenant] = useState({});
|
||||
const [tenantMailTemplate, setTenantMailTemplate] = useState({
|
||||
body: "",
|
||||
subject: ""
|
||||
});
|
||||
const [isOptionalDetails, setIsOptionalDetails] = useState(false);
|
||||
const [, drop] = useDrop({
|
||||
accept: "BOX",
|
||||
drop: (item, monitor) => addPositionOfSignature(item, monitor),
|
||||
collect: (monitor) => ({ isOver: !!monitor.isOver() })
|
||||
});
|
||||
const isMobile = window.innerWidth < 767;
|
||||
let isGuestSignFlow = false;
|
||||
let sendmail;
|
||||
@@ -250,6 +245,7 @@ function PdfRequestFiles(
|
||||
const filterSignTypes = signatureType?.filter(
|
||||
(x) => x.enabled === true
|
||||
);
|
||||
setTenant(tenantDetails || {});
|
||||
if (tenantDetails?.RequestBody) {
|
||||
setTenantMailTemplate({
|
||||
body: tenantDetails?.RequestBody,
|
||||
@@ -340,7 +336,6 @@ function PdfRequestFiles(
|
||||
const getCurrentSigner = getSigners?.find(
|
||||
(data) => data.UserId.objectId === jsonSender?.objectId
|
||||
);
|
||||
|
||||
currUserId = getCurrentSigner?.objectId
|
||||
? getCurrentSigner.objectId
|
||||
: contactBookId ||
|
||||
@@ -414,6 +409,35 @@ function PdfRequestFiles(
|
||||
} else {
|
||||
const obj = documentData?.[0];
|
||||
setSendInOrder(obj?.SendinOrder || false);
|
||||
if (
|
||||
obj?.Signers?.length &&
|
||||
obj?.Placeholders?.length &&
|
||||
currUserId !== "undefined"
|
||||
) {
|
||||
const params = {
|
||||
event: "viewed",
|
||||
contactId: currUserId,
|
||||
body: {
|
||||
objectId: documentData?.[0].objectId,
|
||||
}
|
||||
};
|
||||
try {
|
||||
await axios.post(
|
||||
`${localStorage.getItem("baseUrl")}functions/triggerevent`,
|
||||
params,
|
||||
{
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
"X-Parse-Application-Id":
|
||||
localStorage.getItem("parseAppId"),
|
||||
sessiontoken: localStorage.getItem("accesstoken")
|
||||
}
|
||||
}
|
||||
);
|
||||
} catch (err) {
|
||||
console.log("Err ", err);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let signers = [];
|
||||
@@ -734,7 +758,7 @@ function PdfRequestFiles(
|
||||
docId,
|
||||
contactId,
|
||||
objectId,
|
||||
widgets
|
||||
widgets,
|
||||
);
|
||||
if (resSign && resSign.status === "success") {
|
||||
dispatch(setTypedSignFont("Fasthand"));
|
||||
@@ -770,12 +794,16 @@ function PdfRequestFiles(
|
||||
sendmail !== "false" &&
|
||||
sendInOrder
|
||||
) {
|
||||
const mailBody =
|
||||
tenantMailTemplate?.body;
|
||||
const mailSubject =
|
||||
tenantMailTemplate?.subject;
|
||||
const requestBody =
|
||||
updatedDoc.updatedPdfDetails?.[0]?.RequestBody ||
|
||||
tenantMailTemplate?.body;
|
||||
mailBody;
|
||||
const requestSubject =
|
||||
updatedDoc.updatedPdfDetails?.[0]?.RequestSubject ||
|
||||
tenantMailTemplate?.subject;
|
||||
mailSubject;
|
||||
if (user) {
|
||||
const expireDate = expiry;
|
||||
const newDate = new Date(expireDate);
|
||||
@@ -1099,10 +1127,11 @@ function PdfRequestFiles(
|
||||
const userId =
|
||||
pdfDetails?.[0].Signers?.find((x) => x.objectId === signerObjectId)
|
||||
?.UserId?.objectId || jsonSender?.objectId;
|
||||
|
||||
const params = {
|
||||
docId: pdfDetails?.[0].objectId,
|
||||
reason: reason,
|
||||
userId: userId
|
||||
userId: userId,
|
||||
};
|
||||
await axios
|
||||
.post(`${localStorage.getItem("baseUrl")}functions/declinedoc`, params, {
|
||||
@@ -1488,7 +1517,10 @@ function PdfRequestFiles(
|
||||
const widgetHeight =
|
||||
defaultWidthHeight(dragTypeValue).height * containerScale;
|
||||
const extUser = localStorage.getItem("Extand_Class");
|
||||
const parseUser = extUser && JSON.parse(extUser)[0];
|
||||
let parseUser =
|
||||
(extUser && JSON.parse(extUser)[0]) ||
|
||||
JSON.parse(localStorage.getItem("signer"));
|
||||
|
||||
const widgetValue = widgetDataValue(dragTypeValue, parseUser);
|
||||
//adding and updating drop position in array when user drop signature button in div
|
||||
if (item === "onclick") {
|
||||
@@ -1530,12 +1562,16 @@ function PdfRequestFiles(
|
||||
//`containerRect.top` The distance from the top of the viewport to the top of the element.
|
||||
const x = offset.x - containerRect.left;
|
||||
const y = offset.y - containerRect.top;
|
||||
const getXPosition = signBtnPosition[0]
|
||||
? x - signBtnPosition[0].xPos
|
||||
: x;
|
||||
const getYPosition = signBtnPosition[0]
|
||||
? y - signBtnPosition[0].yPos
|
||||
: y;
|
||||
let getXPosition = signBtnPosition[0] ? x - signBtnPosition[0].xPos : x;
|
||||
let getYPosition = signBtnPosition[0] ? y - signBtnPosition[0].yPos : y;
|
||||
// to avoid negative position values (half portion of widget should not be out of pdf container)
|
||||
if (getXPosition < 0) {
|
||||
getXPosition = 0;
|
||||
}
|
||||
if (getYPosition < 0) {
|
||||
getYPosition = 0;
|
||||
}
|
||||
|
||||
dropObj = {
|
||||
xPosition: getXPosition / (containerScale * scale),
|
||||
yPosition: getYPosition / (containerScale * scale),
|
||||
@@ -1572,6 +1608,7 @@ function PdfRequestFiles(
|
||||
);
|
||||
const getPos = currentPagePosition?.pos;
|
||||
const newSignPos = getPos.concat(dropData);
|
||||
newSignPos.sort((a, b) => a.yPosition - b.yPosition);
|
||||
let xyPos = { pageNumber: pageNumber, pos: newSignPos };
|
||||
updatePlace.push(xyPos);
|
||||
const updatesignerPos = signerPos.map((x) =>
|
||||
@@ -1582,9 +1619,17 @@ function PdfRequestFiles(
|
||||
//else condition to add placeholder widgets on multiple page first time
|
||||
const updatesignerPos = signerPos.map((x) =>
|
||||
x.Id === uniqueId && x?.placeHolder
|
||||
? { ...x, placeHolder: [...x.placeHolder, placeHolder] }
|
||||
? {
|
||||
...x,
|
||||
placeHolder: [...x.placeHolder, placeHolder].sort(
|
||||
(a, b) => a.pageNumber - b.pageNumber
|
||||
)
|
||||
}
|
||||
: x.Id === uniqueId
|
||||
? { ...x, placeHolder: [placeHolder] }
|
||||
? {
|
||||
...x,
|
||||
placeHolder: [placeHolder]
|
||||
}
|
||||
: x
|
||||
);
|
||||
setSignerPos(updatesignerPos);
|
||||
@@ -2033,7 +2078,6 @@ function PdfRequestFiles(
|
||||
{containerWH && (
|
||||
<RenderPdf
|
||||
setIsPageCopy={setIsPageCopy}
|
||||
drop={drop}
|
||||
pageNumber={pageNumber}
|
||||
pdfOriginalWH={pdfOriginalWH}
|
||||
pdfNewWidth={pdfNewWidth}
|
||||
@@ -2071,6 +2115,8 @@ function PdfRequestFiles(
|
||||
setIsReqSignTourDisabled={handleCloseTour}
|
||||
currWidgetsDetails={currWidgetsDetails}
|
||||
isShowModal={isShowModal}
|
||||
signBtnPosition={signBtnPosition}
|
||||
addPositionOfSignature={addPositionOfSignature}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
|
||||
@@ -3,7 +3,6 @@ import axios from "axios";
|
||||
import Parse from "parse";
|
||||
import "../styles/signature.css";
|
||||
import { PDFDocument } from "pdf-lib";
|
||||
import { useDrop } from "react-dnd";
|
||||
import RenderAllPdfPage from "../components/pdf/RenderAllPdfPage";
|
||||
import WidgetComponent from "../components/pdf/WidgetComponent";
|
||||
import Tour from "../primitives/Tour";
|
||||
@@ -164,11 +163,6 @@ function PlaceHolderSign() {
|
||||
const [docTitle, setDocTitle] = useState("");
|
||||
const [isEditDoc, setIsEditDoc] = useState(false);
|
||||
const isMobile = window.innerWidth < 767;
|
||||
const [, drop] = useDrop({
|
||||
accept: "BOX",
|
||||
drop: (item, monitor) => addPositionOfSignature(item, monitor),
|
||||
collect: (monitor) => ({ isOver: !!monitor.isOver() })
|
||||
});
|
||||
const currentUser = localStorage.getItem(
|
||||
`Parse/${localStorage.getItem("parseAppId")}/currentUser`
|
||||
);
|
||||
@@ -571,12 +565,33 @@ function PlaceHolderSign() {
|
||||
//`containerRect.top` The distance from the top of the viewport to the top of the element.
|
||||
const x = offset.x - containerRect.left;
|
||||
const y = offset.y - containerRect.top;
|
||||
const getXPosition = signBtnPosition[0]
|
||||
let getXPosition = signBtnPosition[0]
|
||||
? x - signBtnPosition[0].xPos
|
||||
: x;
|
||||
const getYPosition = signBtnPosition[0]
|
||||
let getYPosition = signBtnPosition[0]
|
||||
? y - signBtnPosition[0].yPos
|
||||
: y;
|
||||
|
||||
// to avoid negative position values (half portion of widget should not be out of pdf container)
|
||||
const calculateWidth =
|
||||
getXPosition + widgetWidth - containerRect.width;
|
||||
const calculateHeight =
|
||||
getYPosition + widgetHeight - containerRect.height;
|
||||
|
||||
if (getXPosition < 0) {
|
||||
getXPosition = 0;
|
||||
}
|
||||
if (getYPosition < 0) {
|
||||
getYPosition = 0;
|
||||
}
|
||||
|
||||
if (calculateWidth > 0) {
|
||||
getXPosition = getXPosition - calculateWidth;
|
||||
}
|
||||
|
||||
if (calculateHeight > 0) {
|
||||
getYPosition = getYPosition - calculateHeight;
|
||||
}
|
||||
dropObj = {
|
||||
xPosition: getXPosition / (containerScale * scale),
|
||||
yPosition: getYPosition / (containerScale * scale),
|
||||
@@ -722,9 +737,7 @@ function PlaceHolderSign() {
|
||||
(data) => data.pageNumber === pageNumber
|
||||
);
|
||||
if (getPageNumer.length > 0) {
|
||||
const getXYdata = getPageNumer[0].pos;
|
||||
const getPosData = getXYdata;
|
||||
const addSignPos = getPosData.map((url) => {
|
||||
const addSignPos = getPageNumer?.[0]?.pos?.map((url) => {
|
||||
if (url.key === keyValue) {
|
||||
return {
|
||||
...url,
|
||||
@@ -1455,9 +1468,9 @@ function PlaceHolderSign() {
|
||||
(data) => data.pageNumber === pageNumber
|
||||
);
|
||||
if (getPageNumer.length > 0) {
|
||||
const getXYdata = getPageNumer[0].pos;
|
||||
const getPosData = getXYdata;
|
||||
const addSignPos = getPosData.map((position) => {
|
||||
const textSize = fontSize || currWidgetsDetails?.options?.fontSize;
|
||||
const textColor = fontColor || currWidgetsDetails?.options?.fontColor;
|
||||
const addSignPos = getPageNumer?.[0]?.pos?.map((position) => {
|
||||
if (position.key === currWidgetsDetails?.key) {
|
||||
if (currWidgetsDetails?.type === radioButtonWidget) {
|
||||
if (addOption) {
|
||||
@@ -1486,12 +1499,8 @@ function PlaceHolderSign() {
|
||||
isReadOnly: isReadOnly || false,
|
||||
isHideLabel: isHideLabel || false,
|
||||
defaultValue: defaultValue,
|
||||
fontSize:
|
||||
fontSize || currWidgetsDetails?.options?.fontSize || 12,
|
||||
fontColor:
|
||||
fontColor ||
|
||||
currWidgetsDetails?.options?.fontColor ||
|
||||
"black"
|
||||
fontSize: textSize || 12,
|
||||
fontColor: textColor || "black"
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -1525,12 +1534,8 @@ function PlaceHolderSign() {
|
||||
layout: layout,
|
||||
isReadOnly: isReadOnly || false,
|
||||
isHideLabel: isHideLabel || false,
|
||||
fontSize:
|
||||
fontSize || currWidgetsDetails?.options?.fontSize || 12,
|
||||
fontColor:
|
||||
fontColor ||
|
||||
currWidgetsDetails?.options?.fontColor ||
|
||||
"black"
|
||||
fontSize: textSize || 12,
|
||||
fontColor: textColor || "black"
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -1543,12 +1548,8 @@ function PlaceHolderSign() {
|
||||
status: status,
|
||||
values: dropdownOptions,
|
||||
defaultValue: defaultValue,
|
||||
fontSize:
|
||||
fontSize || currWidgetsDetails?.options?.fontSize || 12,
|
||||
fontColor:
|
||||
fontColor ||
|
||||
currWidgetsDetails?.options?.fontColor ||
|
||||
"black",
|
||||
fontSize: textSize || 12,
|
||||
fontColor: textColor || "black",
|
||||
...(isReadOnly ? { isReadOnly: isReadOnly || false } : {})
|
||||
}
|
||||
};
|
||||
@@ -1563,9 +1564,11 @@ function PlaceHolderSign() {
|
||||
}
|
||||
return obj;
|
||||
});
|
||||
const recalculatedPlaceholders =
|
||||
utils.applyNumberFormulasToPages(newUpdateSignPos);
|
||||
const newUpdateSigner = signerPos.map((obj) => {
|
||||
if (obj.Id === uniqueId) {
|
||||
return { ...obj, placeHolder: newUpdateSignPos };
|
||||
return { ...obj, placeHolder: recalculatedPlaceholders };
|
||||
}
|
||||
return obj;
|
||||
});
|
||||
@@ -1597,9 +1600,9 @@ function PlaceHolderSign() {
|
||||
);
|
||||
|
||||
if (getPageNumer.length > 0) {
|
||||
const getXYdata = getPageNumer[0].pos;
|
||||
const getPosData = getXYdata;
|
||||
const addSignPos = getPosData.map((position) => {
|
||||
const textSize = fontSize || currWidgetsDetails?.options?.fontSize;
|
||||
const textColor = fontColor || currWidgetsDetails?.options?.fontColor;
|
||||
const addSignPos = getPageNumer?.[0]?.pos?.map((position) => {
|
||||
if (position.key === currWidgetsDetails?.key) {
|
||||
if (position.type === textInputWidget) {
|
||||
return {
|
||||
@@ -1612,13 +1615,9 @@ function PlaceHolderSign() {
|
||||
defaultValue: defaultdata?.defaultValue || "",
|
||||
validation:
|
||||
{},
|
||||
fontSize:
|
||||
fontSize || currWidgetsDetails?.options?.fontSize || 12,
|
||||
fontColor:
|
||||
fontColor ||
|
||||
currWidgetsDetails?.options?.fontColor ||
|
||||
"black",
|
||||
isReadOnly: defaultdata?.isReadOnly || false
|
||||
fontSize: textSize || 12,
|
||||
fontColor: textColor || "black",
|
||||
isReadOnly: defaultdata?.isReadOnly || false,
|
||||
}
|
||||
};
|
||||
} else if (position.type === cellsWidget) {
|
||||
@@ -1636,16 +1635,13 @@ function PlaceHolderSign() {
|
||||
),
|
||||
validation:
|
||||
{},
|
||||
fontSize:
|
||||
fontSize || currWidgetsDetails?.options?.fontSize || 12,
|
||||
fontColor:
|
||||
fontColor ||
|
||||
currWidgetsDetails?.options?.fontColor ||
|
||||
"black",
|
||||
isReadOnly: defaultdata?.isReadOnly || false
|
||||
fontSize: textSize || 12,
|
||||
fontColor: textColor || "black",
|
||||
isReadOnly: defaultdata?.isReadOnly || false,
|
||||
}
|
||||
};
|
||||
} else if (["signature"].includes(position.type)) {
|
||||
}
|
||||
else if (["signature"].includes(position.type)) {
|
||||
return {
|
||||
...position,
|
||||
options: {
|
||||
@@ -1663,12 +1659,8 @@ function PlaceHolderSign() {
|
||||
status: defaultdata.status,
|
||||
defaultValue: defaultdata.defaultValue,
|
||||
hint: defaultdata?.hint || "",
|
||||
fontSize:
|
||||
fontSize || currWidgetsDetails?.options?.fontSize || 12,
|
||||
fontColor:
|
||||
fontColor ||
|
||||
currWidgetsDetails?.options?.fontColor ||
|
||||
"black"
|
||||
fontSize: textSize || 12,
|
||||
fontColor: textColor || "black",
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -1751,11 +1743,14 @@ function PlaceHolderSign() {
|
||||
}
|
||||
};
|
||||
const handleLinkUser = (id) => {
|
||||
setRoleName("");
|
||||
setIsAddUser({ [id]: true });
|
||||
};
|
||||
//`handleAddUser` function to use add new user
|
||||
const handleAddUser = (data, signerObjId) => {
|
||||
const id = signerObjId ? signerObjId : uniqueId;
|
||||
setRoleName("");
|
||||
setCurrWidgetsDetails({});
|
||||
if (isAddSigner) {
|
||||
handleAddNewRecipients(data);
|
||||
} else {
|
||||
@@ -1954,6 +1949,7 @@ function PlaceHolderSign() {
|
||||
return { ...x, ...data };
|
||||
});
|
||||
setPdfDetails(updateDocument);
|
||||
setDocTitle(updateDocument?.[0]?.Name);
|
||||
try {
|
||||
const Bcc = updateDocument?.[0]?.Bcc?.length
|
||||
? {
|
||||
@@ -2355,7 +2351,6 @@ function PlaceHolderSign() {
|
||||
numPages={numPages}
|
||||
pageDetails={pageDetails}
|
||||
placeholder={true}
|
||||
drop={drop}
|
||||
handleDeleteWidget={handleDeleteWidget}
|
||||
handleTabDrag={handleTabDrag}
|
||||
handleStop={handleStop}
|
||||
@@ -2391,6 +2386,8 @@ function PlaceHolderSign() {
|
||||
currWidgetsDetails={currWidgetsDetails}
|
||||
setRoleName={setRoleName}
|
||||
isShowModal={isShowModal}
|
||||
signBtnPosition={signBtnPosition}
|
||||
addPositionOfSignature={addPositionOfSignature}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
@@ -2535,6 +2532,8 @@ function PlaceHolderSign() {
|
||||
fontColor={fontColor}
|
||||
setFontColor={setFontColor}
|
||||
roleName={roleName}
|
||||
widgetsSource={signerPos}
|
||||
activeSignerId={uniqueId}
|
||||
/>
|
||||
<RotateAlert
|
||||
showRotateAlert={showRotateAlert.status}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import React, { useEffect, useState, useRef } from "react";
|
||||
import React, { useEffect, useState } from "react";
|
||||
import Alert from "../primitives/Alert";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import Loader from "../primitives/Loader";
|
||||
@@ -6,37 +6,24 @@ import Tooltip from "../primitives/Tooltip";
|
||||
import {
|
||||
getTenantDetails,
|
||||
handleSignatureType,
|
||||
openInNewTab,
|
||||
signatureTypes,
|
||||
usertimezone
|
||||
} from "../constant/Utils";
|
||||
import Parse from "parse";
|
||||
import { Tooltip as ReactTooltip } from "react-tooltip";
|
||||
import ReactQuill from "react-quill-new";
|
||||
import "../styles/quill.css";
|
||||
import EditorToolbar, {
|
||||
module1,
|
||||
module2,
|
||||
formats
|
||||
} from "../components/pdf/EditorToolbar";
|
||||
import TimezoneSelector from "../components/preferences/TimezoneSelector";
|
||||
import DateFormatSelector from "../components/preferences/DateFormatSelector";
|
||||
import FilenameFormatSelector from "../components/preferences/FilenameFormatSelector";
|
||||
import axios from "axios";
|
||||
import MailTemplateEditor from "../components/preferences/MailTemplateEditor";
|
||||
|
||||
const Preferences = () => {
|
||||
const appName =
|
||||
"OpenSign™";
|
||||
const { t } = useTranslation();
|
||||
const editorRef = useRef();
|
||||
const editorRefCom = useRef();
|
||||
const Extand_Class = localStorage.getItem("Extand_Class");
|
||||
const extClass = Extand_Class && JSON.parse(Extand_Class);
|
||||
const [requestSubject, setRequestSubject] = useState("");
|
||||
const [completionBody, SetCompletionBody] = useState("");
|
||||
const [completionsubject, setCompletionSubject] = useState("");
|
||||
const [requestBody, setRequestBody] = useState("");
|
||||
const [defaultCompHtml, setDefaultCompHtml] = useState({});
|
||||
const [tenantId, setTenantId] = useState("");
|
||||
const [defaultReqHtml, setDefaultReqHtml] = useState({});
|
||||
const [isalert, setIsAlert] = useState({ type: "success", msg: "" });
|
||||
const [isTopLoader, setIsTopLoader] = useState(false);
|
||||
const [isLoader, setIsLoader] = useState(false);
|
||||
@@ -56,11 +43,9 @@ const Preferences = () => {
|
||||
const [dateFormat, setDateFormat] = useState("MM/DD/YYYY");
|
||||
const [is12HourTime, setIs12HourTime] = useState(false);
|
||||
const [isLTVEnabled, setIsLTVEnabled] = useState(false);
|
||||
const [isDefaultMail, setIsDefaultMail] = useState({
|
||||
requestMail: false,
|
||||
completionMail: false
|
||||
});
|
||||
const [fileNameFormat, setFileNameFormat] = useState("DOCNAME");
|
||||
const [userInfo, setUserInfo] = useState({});
|
||||
const [tenantInfo, setTenantInfo] = useState({});
|
||||
|
||||
useEffect(() => {
|
||||
fetchSignType();
|
||||
@@ -69,10 +54,10 @@ const Preferences = () => {
|
||||
|
||||
const fetchSignType = async () => {
|
||||
setIsTopLoader(true);
|
||||
const EmailTab =
|
||||
extClass?.[0]?.UserRole === "contracts_Admin"
|
||||
? [{ name: "email", title: t("email"), icon: "fa-light fa-envelope" }]
|
||||
: [];
|
||||
const EmailTab = [
|
||||
{ name: "email", title: t("email"), icon: "fa-light fa-envelope" }
|
||||
];
|
||||
|
||||
const arr = [
|
||||
generaltab,
|
||||
...EmailTab,
|
||||
@@ -85,17 +70,29 @@ const Preferences = () => {
|
||||
)
|
||||
);
|
||||
const tenantDetails = await getTenantDetails(user?.objectId);
|
||||
await tenantEmailTemplate(tenantDetails);
|
||||
setTenantInfo(tenantDetails);
|
||||
const signatureType = tenantDetails?.SignatureType || [];
|
||||
const tenantSignTypes = signatureType?.filter((x) => x.enabled === true);
|
||||
const getUser = await Parse.Cloud.run("getUserDetails");
|
||||
const extUser = await axios.post(
|
||||
`${localStorage.getItem("baseUrl")}functions/getUserDetails`,
|
||||
{},
|
||||
{
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
"X-Parse-Application-Id": localStorage.getItem("parseAppId"),
|
||||
"X-Parse-Session-Token": localStorage.getItem("accesstoken")
|
||||
}
|
||||
}
|
||||
);
|
||||
const getUser = extUser.data?.result;
|
||||
if (getUser) {
|
||||
const _getUser = JSON.parse(JSON.stringify(getUser));
|
||||
const notifyOnSignatures =
|
||||
setUserInfo(_getUser);
|
||||
setIsNotifyOnSignatures(
|
||||
_getUser?.NotifyOnSignatures !== undefined
|
||||
? _getUser?.NotifyOnSignatures
|
||||
: true;
|
||||
setIsNotifyOnSignatures(notifyOnSignatures);
|
||||
: true
|
||||
);
|
||||
setTimezone(_getUser?.Timezone || usertimezone);
|
||||
if (tenantSignTypes?.length > 0) {
|
||||
const signatureType = _getUser?.SignatureType || signatureTypes;
|
||||
@@ -108,31 +105,29 @@ const Preferences = () => {
|
||||
const SignatureType = _getUser?.SignatureType || signatureTypes;
|
||||
setSignatureType(SignatureType);
|
||||
}
|
||||
const sendinorder =
|
||||
_getUser?.SendinOrder !== undefined ? _getUser?.SendinOrder : true;
|
||||
setSendinOrder(sendinorder);
|
||||
const istourenabled =
|
||||
_getUser?.IsTourEnabled !== undefined
|
||||
? _getUser?.IsTourEnabled
|
||||
: true;
|
||||
setIsTourEnabled(istourenabled);
|
||||
const DateFormat =
|
||||
setSendinOrder(
|
||||
_getUser?.SendinOrder !== undefined ? _getUser?.SendinOrder : true
|
||||
);
|
||||
setIsTourEnabled(
|
||||
_getUser?.IsTourEnabled !== undefined ? _getUser?.IsTourEnabled : true
|
||||
);
|
||||
setDateFormat(
|
||||
_getUser?.DateFormat !== undefined
|
||||
? _getUser?.DateFormat
|
||||
: "MM/DD/YYYY";
|
||||
setDateFormat(DateFormat);
|
||||
const is12Hr =
|
||||
_getUser?.Is12HourTime !== undefined ? _getUser?.Is12HourTime : false;
|
||||
setIs12HourTime(is12Hr);
|
||||
const isLTVEnabled =
|
||||
_getUser?.IsLTVEnabled !== undefined ? _getUser?.IsLTVEnabled : false;
|
||||
setIsLTVEnabled(isLTVEnabled);
|
||||
: "MM/DD/YYYY"
|
||||
);
|
||||
setIs12HourTime(
|
||||
_getUser?.Is12HourTime !== undefined ? _getUser?.Is12HourTime : false
|
||||
);
|
||||
setIsLTVEnabled(
|
||||
_getUser?.IsLTVEnabled !== undefined ? _getUser?.IsLTVEnabled : false
|
||||
);
|
||||
const downloadFilenameFormat =
|
||||
_getUser?.DownloadFilenameFormat || "DOCNAME";
|
||||
setFileNameFormat(downloadFilenameFormat);
|
||||
}
|
||||
} catch (err) {
|
||||
console.log("err while getting user details", err);
|
||||
console.error("Error while getting user details: ", err);
|
||||
setErrMsg(t("something-went-wrong-mssg"));
|
||||
} finally {
|
||||
setIsTopLoader(false);
|
||||
@@ -215,7 +210,7 @@ const Preferences = () => {
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
console.log("Error updating signature type", err);
|
||||
console.error("Error updating signature type: ", err);
|
||||
setIsAlert({ type: "danger", msg: err.message });
|
||||
}
|
||||
|
||||
@@ -228,178 +223,12 @@ const Preferences = () => {
|
||||
const handleNotifySignChange = (value) => {
|
||||
setIsNotifyOnSignatures(value);
|
||||
};
|
||||
const tenantEmailTemplate = async (tenantRes) => {
|
||||
if (tenantRes === "user does not exist!") {
|
||||
alert(t("user-not-exist"));
|
||||
} else if (tenantRes) {
|
||||
setIsLoader(true);
|
||||
const updateRes = tenantRes;
|
||||
setTenantId(updateRes?.objectId);
|
||||
const defaultRequestBody = `<p>Hi {{receiver_name}},</p><br><p>We hope this email finds you well. {{sender_name}} has requested you to review and sign {{document_title}}.</p><p>Your signature is crucial to proceed with the next steps as it signifies your agreement and authorization.</p><br><p><a href='{{signing_url}}' rel='noopener noreferrer' target='_blank'>Sign here</a></p><br><br><p>If you have any questions or need further clarification regarding the document or the signing process, please contact the sender.</p><br><p>Thanks</p><p> Team ${appName}</p><br>`;
|
||||
if (updateRes?.RequestBody) {
|
||||
setRequestBody(updateRes?.RequestBody);
|
||||
setRequestSubject(updateRes?.RequestSubject);
|
||||
} else {
|
||||
setRequestBody(defaultRequestBody);
|
||||
setRequestSubject(
|
||||
`{{sender_name}} has requested you to sign {{document_title}}`
|
||||
);
|
||||
setIsDefaultMail((prev) => ({ ...prev, requestMail: true }));
|
||||
}
|
||||
setDefaultReqHtml({
|
||||
body: defaultRequestBody,
|
||||
subject: `{{sender_name}} has requested you to sign {{document_title}}`
|
||||
});
|
||||
const defaultCompletionBody = `<p>Hi {{sender_name}},</p><br><p>All parties have successfully signed the document {{document_title}}. Kindly download the document from the attachment.</p><br><p>Thanks</p><p> Team ${appName}</p><br>`;
|
||||
if (updateRes?.CompletionBody) {
|
||||
SetCompletionBody(updateRes?.CompletionBody);
|
||||
setCompletionSubject(updateRes?.CompletionSubject);
|
||||
} else {
|
||||
SetCompletionBody(defaultCompletionBody);
|
||||
setCompletionSubject(
|
||||
`Document {{document_title}} has been signed by all parties`
|
||||
);
|
||||
setIsDefaultMail((prev) => ({ ...prev, completionMail: true }));
|
||||
}
|
||||
setDefaultCompHtml({
|
||||
body: defaultCompletionBody,
|
||||
subject: `Document {{document_title}} has been signed by all parties`
|
||||
});
|
||||
setIsLoader(false);
|
||||
}
|
||||
};
|
||||
//function to save completion email template
|
||||
const handleSaveCompletionEmail = async (e) => {
|
||||
e.preventDefault();
|
||||
try {
|
||||
setIsLoader(true);
|
||||
const replacedHtmlBody = completionBody.replace(/"/g, "'");
|
||||
const htmlBody = `<html><head><meta http-equiv='Content-Type' content='text/html; charset=UTF-8' /></head><body>${replacedHtmlBody}</body></html>`;
|
||||
const updateTenant = await Parse.Cloud.run("updatetenant", {
|
||||
tenantId: tenantId,
|
||||
details: {
|
||||
CompletionBody: htmlBody,
|
||||
CompletionSubject: completionsubject
|
||||
}
|
||||
});
|
||||
if (updateTenant) {
|
||||
const updateRes = JSON.parse(JSON.stringify(updateTenant));
|
||||
SetCompletionBody(updateRes?.CompletionBody);
|
||||
setCompletionSubject(updateRes?.CompletionSubject);
|
||||
setIsAlert({ type: "success", msg: t("saved-successfully") });
|
||||
setTimeout(() => setIsAlert({ type: "", msg: "" }), 1500);
|
||||
}
|
||||
} catch (err) {
|
||||
console.log("Err", err);
|
||||
setIsAlert({ type: "danger", msg: t("something-went-wrong-mssg") });
|
||||
setTimeout(() => setIsAlert({ type: "", msg: "" }), 1500);
|
||||
} finally {
|
||||
setIsLoader(false);
|
||||
}
|
||||
};
|
||||
//function to save request email template
|
||||
const handleSaveRequestEmail = async (e) => {
|
||||
e.preventDefault();
|
||||
try {
|
||||
setIsLoader(true);
|
||||
const replacedHtmlBody = requestBody.replace(/"/g, "'");
|
||||
const htmlBody = `<html><head><meta http-equiv='Content-Type' content='text/html; charset=UTF-8' /></head><body>${replacedHtmlBody}</body></html>`;
|
||||
const updateTenant = await Parse.Cloud.run("updatetenant", {
|
||||
tenantId: tenantId,
|
||||
details: {
|
||||
RequestBody: htmlBody,
|
||||
RequestSubject: requestSubject
|
||||
}
|
||||
});
|
||||
if (updateTenant) {
|
||||
const updateRes = JSON.parse(JSON.stringify(updateTenant));
|
||||
setRequestBody(updateRes?.RequestBody);
|
||||
setRequestSubject(updateRes?.RequestSubject);
|
||||
let extUser =
|
||||
localStorage.getItem("Extand_Class") &&
|
||||
JSON.parse(localStorage.getItem("Extand_Class"))?.[0];
|
||||
if (extUser && extUser?.objectId) {
|
||||
extUser.TenantId.RequestBody = updateRes?.RequestBody;
|
||||
extUser.TenantId.RequestSubject = updateRes?.RequestSubject;
|
||||
const _extUser = JSON.parse(JSON.stringify(extUser));
|
||||
localStorage.setItem("Extand_Class", JSON.stringify([_extUser]));
|
||||
}
|
||||
setIsAlert({ type: "success", msg: t("saved-successfully") });
|
||||
setTimeout(() => setIsAlert({ type: "", msg: "" }), 1500);
|
||||
}
|
||||
} catch (err) {
|
||||
console.log("Err", err);
|
||||
setIsAlert({ type: "danger", msg: t("something-went-wrong-mssg") });
|
||||
setTimeout(() => setIsAlert({ type: "", msg: "" }), 1500);
|
||||
} finally {
|
||||
setIsLoader(false);
|
||||
}
|
||||
};
|
||||
|
||||
//function to use reset form
|
||||
const handleReset = async (request, completion) => {
|
||||
let extUser =
|
||||
localStorage.getItem("Extand_Class") &&
|
||||
JSON.parse(localStorage.getItem("Extand_Class"))?.[0];
|
||||
handleModifyMail(request);
|
||||
if (request && !isDefaultMail?.requestMail) {
|
||||
setRequestBody(defaultReqHtml?.body);
|
||||
setRequestSubject(defaultReqHtml?.subject);
|
||||
try {
|
||||
await Parse.Cloud.run("updatetenant", {
|
||||
tenantId: tenantId,
|
||||
details: { RequestBody: "", RequestSubject: "" }
|
||||
});
|
||||
if (extUser && extUser?.objectId) {
|
||||
extUser.TenantId.RequestBody = "";
|
||||
extUser.TenantId.RequestSubject = "";
|
||||
const _extUser = JSON.parse(JSON.stringify(extUser));
|
||||
localStorage.setItem("Extand_Class", JSON.stringify([_extUser]));
|
||||
}
|
||||
} catch (err) {
|
||||
console.log("Err in reseting request mail", err);
|
||||
}
|
||||
} else if (completion && !isDefaultMail?.completionMail) {
|
||||
setCompletionSubject(defaultCompHtml?.subject);
|
||||
SetCompletionBody(defaultCompHtml?.body);
|
||||
try {
|
||||
await Parse.Cloud.run("updatetenant", {
|
||||
tenantId: tenantId,
|
||||
details: { CompletionBody: "", CompletionSubject: "" }
|
||||
});
|
||||
if (extUser && extUser?.objectId) {
|
||||
extUser.TenantId.CompletionBody = "";
|
||||
extUser.TenantId.CompletionSubject = "";
|
||||
const _extUser = JSON.parse(JSON.stringify(extUser));
|
||||
localStorage.setItem("Extand_Class", JSON.stringify([_extUser]));
|
||||
}
|
||||
} catch (err) {
|
||||
console.log("Err in reseting completion mail", err);
|
||||
}
|
||||
}
|
||||
};
|
||||
//function for handle ontext change and save again text in delta
|
||||
const handleOnchangeRequest = () => {
|
||||
if (editorRef.current) {
|
||||
const html = editorRef.current.editor.root.innerHTML;
|
||||
setRequestBody(html);
|
||||
}
|
||||
};
|
||||
const handleOnchangeCompletion = () => {
|
||||
if (editorRefCom.current) {
|
||||
const html = editorRefCom.current.editor.root.innerHTML;
|
||||
SetCompletionBody(html);
|
||||
}
|
||||
};
|
||||
|
||||
const handleTourInput = () => setIsTourEnabled(!isTourEnabled);
|
||||
const handleSendinOrderInput = () => setSendinOrder(!sendinOrder);
|
||||
const tabName = (ind) => tab.find((t, i) => i === ind)?.name;
|
||||
const handleModifyMail = (mode) => {
|
||||
mode === "request"
|
||||
? setIsDefaultMail((p) => ({ ...p, requestMail: !p?.requestMail }))
|
||||
: setIsDefaultMail((p) => ({ ...p, completionMail: !p?.completionMail }));
|
||||
};
|
||||
|
||||
return (
|
||||
<React.Fragment>
|
||||
{isalert.msg && <Alert type={isalert.type}>{isalert.msg}</Alert>}
|
||||
@@ -793,160 +622,12 @@ const Preferences = () => {
|
||||
)}
|
||||
{tabName(activeTab) === "email" && (
|
||||
<div className="flex flex-col mb-4">
|
||||
<div className="flex flex-col">
|
||||
<h1 className="text-[14px] mb-[0.7rem] font-medium">
|
||||
{t("request-email")}
|
||||
</h1>
|
||||
<div className="relative mt-2 mb-4">
|
||||
{
|
||||
isDefaultMail?.requestMail && (
|
||||
<div className="absolute backdrop-blur-[2px] flex w-full h-full justify-center items-center bg-black/10 rounded-box select-none z-20">
|
||||
<button
|
||||
onClick={() => handleModifyMail("request")}
|
||||
className="op-btn op-btn-primary shadow-lg"
|
||||
>
|
||||
{t("modify")}
|
||||
</button>
|
||||
</div>
|
||||
)
|
||||
<MailTemplateEditor
|
||||
info={
|
||||
tenantInfo
|
||||
}
|
||||
<form
|
||||
onSubmit={handleSaveRequestEmail}
|
||||
className="p-3 border-[1px] border-base-content rounded-box"
|
||||
>
|
||||
<div className="text-lg font-normal">
|
||||
<label className="text-sm">
|
||||
{t("subject")}{" "}
|
||||
<Tooltip
|
||||
id={"request-sub-tooltip"}
|
||||
message={`${t("variables-use")}: {{sender_name}} {{document_title}}`}
|
||||
/>
|
||||
</label>
|
||||
<input
|
||||
required
|
||||
value={requestSubject}
|
||||
onChange={(e) =>
|
||||
setRequestSubject(e.target.value)
|
||||
}
|
||||
placeholder={`{{sender_name}} ${t("send-to-sign")} {{document_title}}`}
|
||||
className="w-full op-input op-input-bordered op-input-sm focus:outline-none hover:border-base-content text-xs"
|
||||
/>
|
||||
</div>
|
||||
<div className="text-lg font-normal py-2">
|
||||
<label className="text-sm mt-3">
|
||||
{t("body")}{" "}
|
||||
<Tooltip
|
||||
id={"request-body-tooltip"}
|
||||
message={`${t("variables-use")}: {{sender_name}} {{document_title}}`}
|
||||
/>
|
||||
</label>
|
||||
<EditorToolbar containerId="toolbar1" />
|
||||
<ReactQuill
|
||||
theme="snow"
|
||||
value={requestBody}
|
||||
placeholder="add body of email"
|
||||
// onChangeSelection={handleTextSelection} // Listen for text selection
|
||||
ref={editorRef}
|
||||
modules={module1}
|
||||
formats={formats}
|
||||
onChange={handleOnchangeRequest}
|
||||
/>
|
||||
</div>
|
||||
<div className="flex items-center mt-3 gap-2">
|
||||
<button
|
||||
disabled={!requestBody || !requestSubject}
|
||||
className="op-btn op-btn-primary"
|
||||
type="submit"
|
||||
>
|
||||
{t("save")}
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
className="op-btn op-btn-secondary"
|
||||
onClick={() => handleReset("request")}
|
||||
>
|
||||
{t("reset")}
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<h1 className="text-[14px] mb-[0.7rem] font-medium">
|
||||
{t("completion-email")}
|
||||
</h1>
|
||||
<div className="relative my-2">
|
||||
{
|
||||
isDefaultMail?.completionMail && (
|
||||
<div className="absolute backdrop-blur-[2px] flex w-full h-full justify-center items-center bg-black/10 rounded-box select-none z-20">
|
||||
<button
|
||||
onClick={() => handleModifyMail("completion")}
|
||||
className="op-btn op-btn-primary shadow-lg"
|
||||
>
|
||||
{t("modify")}
|
||||
</button>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
<form
|
||||
onSubmit={handleSaveCompletionEmail}
|
||||
className="p-3 border-[1px] border-base-content rounded-box"
|
||||
>
|
||||
<div className="text-lg font-normal">
|
||||
<label className="text-sm">
|
||||
{t("subject")}{" "}
|
||||
<Tooltip
|
||||
id={"complete-sub-tooltip"}
|
||||
message={`${t("variables-use")}:{{sender_name}} {{document_title}}`}
|
||||
/>
|
||||
</label>
|
||||
<input
|
||||
required
|
||||
value={completionsubject}
|
||||
onChange={(e) =>
|
||||
setCompletionSubject(e.target.value)
|
||||
}
|
||||
placeholder={`{{sender_name}} ${t("send-to-sign")} {{document_title}}`}
|
||||
className="w-full op-input op-input-bordered op-input-sm focus:outline-none hover:border-base-content text-xs"
|
||||
/>
|
||||
</div>
|
||||
<div className="text-lg font-normal py-2">
|
||||
<label className="text-sm mt-3">
|
||||
{t("body")}{" "}
|
||||
<Tooltip
|
||||
id={"complete-body-tooltip"}
|
||||
message={`${t("variables-use")}:{{sender_name}} {{document_title}} {{signing_url}}`}
|
||||
/>
|
||||
</label>
|
||||
<EditorToolbar containerId="toolbar2" />
|
||||
<ReactQuill
|
||||
theme="snow"
|
||||
value={completionBody}
|
||||
placeholder="add body of email "
|
||||
// onChangeSelection={handleTextSelection} // Listen for text selection
|
||||
ref={editorRefCom}
|
||||
modules={module2}
|
||||
formats={formats}
|
||||
onChange={handleOnchangeCompletion}
|
||||
/>
|
||||
</div>
|
||||
<div className="flex items-center mt-3 gap-2">
|
||||
<button
|
||||
disabled={!completionBody || !completionsubject}
|
||||
className="op-btn op-btn-primary"
|
||||
type="submit"
|
||||
>
|
||||
{t("save")}
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
className="op-btn op-btn-secondary"
|
||||
onClick={() => handleReset(null, "completion")}
|
||||
>
|
||||
{t("reset")}
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
tenantId={tenantInfo?.objectId}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
{tabName(activeTab) === "security" && (
|
||||
|
||||
@@ -5,7 +5,6 @@ import Parse from "parse";
|
||||
import Confetti from "react-confetti";
|
||||
import axios from "axios";
|
||||
import RenderAllPdfPage from "../components/pdf/RenderAllPdfPage";
|
||||
import { useDrop } from "react-dnd";
|
||||
import EmailComponent from "../components/pdf/EmailComponent";
|
||||
import WidgetComponent from "../components/pdf/WidgetComponent";
|
||||
import {
|
||||
@@ -69,6 +68,9 @@ import {
|
||||
import WidgetsValueModal from "../components/pdf/WidgetsValueModal";
|
||||
import WidgetNameModal from "../components/pdf/WidgetNameModal";
|
||||
import CellsSettingModal from "../components/pdf/CellsSettingModal";
|
||||
import {
|
||||
applyNumberFormulasToPages,
|
||||
} from "../utils";
|
||||
//For signYourself inProgress section signer can add sign and complete doc sign.
|
||||
function SignYourSelf() {
|
||||
const { t } = useTranslation();
|
||||
@@ -140,13 +142,9 @@ function SignYourSelf() {
|
||||
const [isDownloadModal, setIsDownloadModal] = useState(false);
|
||||
const [isResize, setIsResize] = useState(false);
|
||||
const [isUploadPdf, setIsUploadPdf] = useState(false);
|
||||
|
||||
const [unSignedWidgetId, setUnSignedWidgetId] = useState("");
|
||||
const [widgetsTour, setWidgetsTour] = useState(false);
|
||||
const [owner, setOwner] = useState({});
|
||||
const [, drop] = useDrop({
|
||||
accept: "BOX",
|
||||
drop: (item, monitor) => addPositionOfSignature(item, monitor),
|
||||
collect: (monitor) => ({ isOver: !!monitor.isOver() })
|
||||
});
|
||||
const index = xyPosition?.findIndex((object) => {
|
||||
return object.pageNumber === pageNumber;
|
||||
});
|
||||
@@ -394,15 +392,34 @@ function SignYourSelf() {
|
||||
.getBoundingClientRect();
|
||||
//`containerRect.left`, The distance from the left of the viewport to the left side of the element.
|
||||
//`containerRect.top` The distance from the top of the viewport to the top of the element.
|
||||
|
||||
const x = offset.x - containerRect.left;
|
||||
const y = offset.y - containerRect.top;
|
||||
const getXPosition = signBtnPosition[0] ? x - signBtnPosition[0].xPos : x;
|
||||
const getYPosition = signBtnPosition[0] ? y - signBtnPosition[0].yPos : y;
|
||||
let getXPosition = signBtnPosition[0] ? x - signBtnPosition[0].xPos : x;
|
||||
let getYPosition = signBtnPosition[0] ? y - signBtnPosition[0].yPos : y;
|
||||
const getWidth = widgetTypeExist
|
||||
? calculateInitialWidthHeight(widgetValue).getWidth
|
||||
: defaultWidthHeight(dragTypeValue).width;
|
||||
const getHeight = defaultWidthHeight(dragTypeValue).height;
|
||||
|
||||
// to avoid negative position values (half portion of widget should not be out of pdf container)
|
||||
const calculateWidth = getXPosition + getWidth - containerRect.width;
|
||||
const calculateHeight = getYPosition + getWidth - containerRect.height;
|
||||
|
||||
// to avoid negative position values (half portion of widget should not be out of pdf container)
|
||||
if (getXPosition < 0) {
|
||||
getXPosition = 0;
|
||||
}
|
||||
if (getYPosition < 0) {
|
||||
getYPosition = 0;
|
||||
}
|
||||
|
||||
if (calculateWidth > 0) {
|
||||
getXPosition = getXPosition - calculateWidth;
|
||||
}
|
||||
|
||||
if (calculateHeight > 0) {
|
||||
getYPosition = getYPosition - calculateHeight;
|
||||
}
|
||||
dropObj = {
|
||||
xPosition: getXPosition / (containerScale * scale),
|
||||
yPosition: getYPosition / (containerScale * scale),
|
||||
@@ -451,9 +468,7 @@ function SignYourSelf() {
|
||||
setFontColor("black");
|
||||
}
|
||||
dispatch(setIsShowModal({ [key]: true }));
|
||||
// if (dragTypeValue !== "checkbox") {
|
||||
setCurrWidgetsDetails(dropObj);
|
||||
// }
|
||||
};
|
||||
|
||||
//`handleResend` function is used to resend otp for email verification
|
||||
@@ -586,9 +601,23 @@ function SignYourSelf() {
|
||||
}
|
||||
if (!isEnableOTP || isEmailVerified) {
|
||||
let showAlert = false,
|
||||
isSignatureExist = false;
|
||||
widgetKey,
|
||||
tourPageNumber;
|
||||
try {
|
||||
const isSignatureExist = xyPosition?.some((p) =>
|
||||
p?.pos?.some((x) => x?.type === "signature")
|
||||
);
|
||||
if (!isSignatureExist) {
|
||||
setIsAlert({
|
||||
header: t("fields-required"),
|
||||
isShow: true,
|
||||
alertMessage: t("signature-widget-alert-1")
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
for (let i = 0; i < xyPosition?.length; i++) {
|
||||
tourPageNumber = xyPosition[i]?.pageNumber;
|
||||
const requiredWidgets = xyPosition[i].pos.filter(
|
||||
(position) => position.type !== "checkbox"
|
||||
);
|
||||
@@ -597,34 +626,24 @@ function SignYourSelf() {
|
||||
for (let i = 0; i < requiredWidgets?.length; i++) {
|
||||
checkSigned = requiredWidgets[i]?.options?.response;
|
||||
if (!checkSigned) {
|
||||
const checkSignUrl = requiredWidgets[i]?.pos?.SignUrl;
|
||||
const checkSignUrl = requiredWidgets[i]?.SignUrl;
|
||||
let checkDefaultSigned =
|
||||
requiredWidgets[i]?.options?.defaultValue;
|
||||
if (!checkSignUrl && !checkDefaultSigned && !showAlert) {
|
||||
showAlert = true;
|
||||
widgetKey = requiredWidgets[i]?.key;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//condition to check exist signature widget or not
|
||||
if (!isSignatureExist) {
|
||||
isSignatureExist = xyPosition[i].pos.some(
|
||||
(data) => data?.type === "signature"
|
||||
);
|
||||
if (showAlert) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (xyPosition.length === 0 || !isSignatureExist) {
|
||||
setIsAlert({
|
||||
header: t("fields-required"),
|
||||
isShow: true,
|
||||
alertMessage: t("signature-widget-alert-1")
|
||||
});
|
||||
return;
|
||||
} else if (showAlert) {
|
||||
setIsAlert({
|
||||
isShow: true,
|
||||
alertMessage: t("signature-widget-alert-2")
|
||||
});
|
||||
if (showAlert) {
|
||||
setUnSignedWidgetId(widgetKey);
|
||||
setPageNumber(tourPageNumber);
|
||||
setWidgetsTour(true);
|
||||
return;
|
||||
} else {
|
||||
setIsUiLoading(true);
|
||||
@@ -771,9 +790,7 @@ function SignYourSelf() {
|
||||
(data) => data.pageNumber === pageNumber
|
||||
);
|
||||
if (filterDropPos?.length > 0) {
|
||||
const getXYdata = xyPosition[index].pos;
|
||||
const getPosData = getXYdata;
|
||||
const addSign = getPosData.map((url) => {
|
||||
const addSign = xyPosition[index]?.pos?.map((url) => {
|
||||
if (url.key === dragKey) {
|
||||
return {
|
||||
...url,
|
||||
@@ -958,11 +975,9 @@ function SignYourSelf() {
|
||||
(data) => data.pageNumber === pageNumber
|
||||
);
|
||||
if (getPageNumer.length > 0) {
|
||||
const getXYdata = getPageNumer[0].pos;
|
||||
const getPosData = getXYdata;
|
||||
const widgetLayout =
|
||||
currWidgetsDetails?.type === "checkbox" ? { layout: layout } : {};
|
||||
const addSignPos = getPosData.map((position) => {
|
||||
const addSignPos = getPageNumer?.[0]?.pos?.map((position) => {
|
||||
if (position.key === currWidgetsDetails?.key) {
|
||||
if (addOption) {
|
||||
return {
|
||||
@@ -1024,9 +1039,7 @@ function SignYourSelf() {
|
||||
(data) => data.pageNumber === pageNumber
|
||||
);
|
||||
if (getPageNumer.length > 0) {
|
||||
const getXYdata = getPageNumer[0].pos;
|
||||
const getPosData = getXYdata;
|
||||
const addSignPos = getPosData.map((position) => {
|
||||
const addSignPos = getPageNumer?.[0]?.pos?.map((position) => {
|
||||
if (position.key === currWidgetsDetails?.key) {
|
||||
return {
|
||||
...position,
|
||||
@@ -1083,6 +1096,8 @@ function SignYourSelf() {
|
||||
);
|
||||
if (getPageNumer.length > 0) {
|
||||
const updatePos = getPageNumer[0].pos.map((position) => {
|
||||
const textSize = newFontSize || position?.options?.fontSize;
|
||||
const textColor = newFontColor || position?.options?.fontColor;
|
||||
if (position.key === currWidgetsDetails?.key) {
|
||||
if (position.type === cellsWidget) {
|
||||
const count = parseInt(
|
||||
@@ -1096,20 +1111,19 @@ function SignYourSelf() {
|
||||
name: defaultdata?.name || position.options?.name || "Cells",
|
||||
cellCount: count,
|
||||
defaultValue: (defaultdata?.defaultValue || "").slice(0, count),
|
||||
fontSize: newFontSize || position.options?.fontSize || 12,
|
||||
fontColor:
|
||||
newFontColor || position.options?.fontColor || "black"
|
||||
fontSize: textSize || 12,
|
||||
fontColor: textColor || "black"
|
||||
}
|
||||
};
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
return {
|
||||
...position,
|
||||
options: {
|
||||
...position.options,
|
||||
name: defaultdata?.name || position.options?.name,
|
||||
fontSize: newFontSize || position.options?.fontSize || 12,
|
||||
fontColor:
|
||||
newFontColor || position.options?.fontColor || "black"
|
||||
fontSize: textSize || 12,
|
||||
fontColor: textColor || "black"
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -1119,7 +1133,7 @@ function SignYourSelf() {
|
||||
const updateXYposition = xyPosition.map((obj, ind) =>
|
||||
ind === index ? { ...obj, pos: updatePos } : obj
|
||||
);
|
||||
setXyPosition(updateXYposition);
|
||||
setXyPosition(applyNumberFormulasToPages(updateXYposition));
|
||||
}
|
||||
setFontSize();
|
||||
setFontColor();
|
||||
@@ -1196,6 +1210,14 @@ function SignYourSelf() {
|
||||
setPdfBase64Url(urlDetails.base64);
|
||||
setShowRotateAlert({ status: false, degree: 0 });
|
||||
};
|
||||
const WidgetTourConfig = [
|
||||
{
|
||||
selector: '[data-tut="IsSigned"]',
|
||||
content: t("signature-validate-alert-2"),
|
||||
position: "top",
|
||||
style: { fontSize: "13px" }
|
||||
}
|
||||
];
|
||||
return (
|
||||
<>
|
||||
{isLoading.isLoad ? (
|
||||
@@ -1241,6 +1263,14 @@ function SignYourSelf() {
|
||||
isOpen={signTour}
|
||||
/>
|
||||
)}
|
||||
<Tour
|
||||
showNumber={false}
|
||||
showNavigation={false}
|
||||
showNavigationNumber={false}
|
||||
onRequestClose={() => setWidgetsTour(false)}
|
||||
steps={WidgetTourConfig}
|
||||
isOpen={widgetsTour}
|
||||
/>
|
||||
{/* this component used to render all pdf pages in left side */}
|
||||
<RenderAllPdfPage
|
||||
allPages={allPages}
|
||||
@@ -1370,7 +1400,6 @@ function SignYourSelf() {
|
||||
pageNumber={pageNumber}
|
||||
pdfOriginalWH={pdfOriginalWH}
|
||||
pdfNewWidth={pdfNewWidth}
|
||||
drop={drop}
|
||||
successEmail={successEmail}
|
||||
nodeRef={nodeRef}
|
||||
handleTabDrag={handleTabDrag}
|
||||
@@ -1408,6 +1437,9 @@ function SignYourSelf() {
|
||||
divRef={divRef}
|
||||
currWidgetsDetails={currWidgetsDetails}
|
||||
isShowModal={isShowModal}
|
||||
unSignedWidgetId={unSignedWidgetId}
|
||||
signBtnPosition={signBtnPosition}
|
||||
addPositionOfSignature={addPositionOfSignature}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
@@ -1459,6 +1491,8 @@ function SignYourSelf() {
|
||||
setFontSize={setFontSize}
|
||||
fontColor={fontColor}
|
||||
setFontColor={setFontColor}
|
||||
widgetsSource={xyPosition}
|
||||
isSelfSign={true}
|
||||
/>
|
||||
<CellsSettingModal
|
||||
isOpen={isCellsSetting}
|
||||
|
||||
@@ -3,7 +3,6 @@ import RenderAllPdfPage from "../components/pdf/RenderAllPdfPage";
|
||||
import { useParams, useNavigate } from "react-router";
|
||||
import axios from "axios";
|
||||
import "../styles/signature.css";
|
||||
import { useDrop } from "react-dnd";
|
||||
import WidgetComponent from "../components/pdf/WidgetComponent";
|
||||
import Tour from "../primitives/Tour";
|
||||
import SignerListPlace from "../components/pdf/SignerListPlace";
|
||||
@@ -124,11 +123,6 @@ const TemplatePlaceholder = () => {
|
||||
const [pdfBase64Url, setPdfBase64Url] = useState("");
|
||||
const [isUploadPdf, setIsUploadPdf] = useState(false);
|
||||
const isMobile = window.innerWidth < 767;
|
||||
const [, drop] = useDrop({
|
||||
accept: "BOX",
|
||||
drop: (item, monitor) => addPositionOfSignature(item, monitor),
|
||||
collect: (monitor) => ({ isOver: !!monitor.isOver() })
|
||||
});
|
||||
const [uniqueId, setUniqueId] = useState("");
|
||||
const [isModalRole, setIsModalRole] = useState(false);
|
||||
const [roleName, setRoleName] = useState("");
|
||||
@@ -166,6 +160,7 @@ const TemplatePlaceholder = () => {
|
||||
const [documentDetails, setDocumentDetails] = useState();
|
||||
const [copied, setCopied] = useState(false);
|
||||
const [isUseTemplate, setIsUseTemplate] = useState(false);
|
||||
const [prevRole, setPrevRole] = useState("");
|
||||
const currentUser = localStorage.getItem(
|
||||
`Parse/${localStorage.getItem("parseAppId")}/currentUser`
|
||||
);
|
||||
@@ -215,28 +210,21 @@ const TemplatePlaceholder = () => {
|
||||
const filterSignTypes = signatureType?.filter(
|
||||
(x) => x.enabled === true
|
||||
);
|
||||
if (tenantDetails?.RequestBody) {
|
||||
//customize mail state is handle to when user want to customize already set tenant email format then use that format
|
||||
setCustomizeMail({
|
||||
subject: tenantDetails?.RequestSubject,
|
||||
body: tenantDetails?.RequestBody
|
||||
});
|
||||
setDefaultMail({
|
||||
subject: tenantDetails?.RequestSubject,
|
||||
body: tenantDetails?.RequestBody
|
||||
});
|
||||
} else {
|
||||
const defaultRequestBody = defaultMailBody;
|
||||
const defaultSubject = defaultMailSubject;
|
||||
setCustomizeMail({
|
||||
subject: defaultSubject,
|
||||
body: defaultRequestBody
|
||||
});
|
||||
setDefaultMail({
|
||||
subject: defaultSubject,
|
||||
body: defaultRequestBody
|
||||
});
|
||||
}
|
||||
const extUser =
|
||||
localStorage.getItem("Extand_Class") &&
|
||||
JSON.parse(localStorage.getItem("Extand_Class"))?.[0];
|
||||
const subject = tenantDetails?.RequestSubject ?? "";
|
||||
const body = tenantDetails?.RequestBody ?? "";
|
||||
//customize mail state is handle to when user want to customize already set tenant email format then use that format
|
||||
const userSubject =
|
||||
subject;
|
||||
const userBody =
|
||||
body;
|
||||
setCustomizeMail({
|
||||
subject: userSubject ?? defaultMailSubject,
|
||||
body: userBody ?? defaultMailBody
|
||||
});
|
||||
setDefaultMail({ subject: userSubject, body: userBody });
|
||||
return filterSignTypes;
|
||||
}
|
||||
} catch (e) {
|
||||
@@ -498,12 +486,33 @@ const TemplatePlaceholder = () => {
|
||||
.getBoundingClientRect();
|
||||
const x = offset.x - containerRect.left;
|
||||
const y = offset.y - containerRect.top;
|
||||
const getXPosition = signBtnPosition[0]
|
||||
let getXPosition = signBtnPosition[0]
|
||||
? x - signBtnPosition[0].xPos
|
||||
: x;
|
||||
const getYPosition = signBtnPosition[0]
|
||||
let getYPosition = signBtnPosition[0]
|
||||
? y - signBtnPosition[0].yPos
|
||||
: y;
|
||||
// to avoid negative position values (half portion of widget should not be out of pdf container)
|
||||
const calculateWidth =
|
||||
getXPosition + widgetWidth - containerRect.width;
|
||||
const calculateHeight =
|
||||
getYPosition + widgetHeight - containerRect.height;
|
||||
|
||||
if (getXPosition < 0) {
|
||||
getXPosition = 0;
|
||||
}
|
||||
if (getYPosition < 0) {
|
||||
getYPosition = 0;
|
||||
}
|
||||
|
||||
if (calculateWidth > 0) {
|
||||
getXPosition = getXPosition - calculateWidth;
|
||||
}
|
||||
|
||||
if (calculateHeight > 0) {
|
||||
getYPosition = getYPosition - calculateHeight;
|
||||
}
|
||||
|
||||
dropObj = {
|
||||
xPosition: getXPosition / (containerScale * scale),
|
||||
yPosition: getYPosition / (containerScale * scale),
|
||||
@@ -662,9 +671,7 @@ const TemplatePlaceholder = () => {
|
||||
(data) => data.pageNumber === pageNumber
|
||||
);
|
||||
if (getPageNumer.length > 0) {
|
||||
const getXYdata = getPageNumer[0].pos;
|
||||
const getPosData = getXYdata;
|
||||
const addSignPos = getPosData.map((url) => {
|
||||
const addSignPos = getPageNumer?.[0]?.pos?.map((url) => {
|
||||
if (url.key === keyValue) {
|
||||
return {
|
||||
...url,
|
||||
@@ -756,7 +763,11 @@ const TemplatePlaceholder = () => {
|
||||
}
|
||||
};
|
||||
useEffect(() => {
|
||||
if (pdfDetails?.[0]?.CreatedBy?.objectId !== user?.objectId) return;
|
||||
if (
|
||||
pdfDetails?.[0]?.CreatedBy?.objectId !== user?.objectId ||
|
||||
isPrefillModal
|
||||
)
|
||||
return;
|
||||
const timer = setTimeout(() => {
|
||||
autosavedetails();
|
||||
}, 2000);
|
||||
@@ -1107,6 +1118,7 @@ const TemplatePlaceholder = () => {
|
||||
// `handleAddSigner` is used to open Add Role Modal
|
||||
const handleAddSigner = () => {
|
||||
setIsModalRole(true);
|
||||
setPrevRole(roleName || "");
|
||||
setRoleName("");
|
||||
};
|
||||
|
||||
@@ -1134,6 +1146,7 @@ const TemplatePlaceholder = () => {
|
||||
setSignerPos((prev) => [...prev, signerPosObj]);
|
||||
setIsModalRole(false);
|
||||
setRoleName("");
|
||||
setCurrWidgetsDetails({});
|
||||
setUniqueId(Id);
|
||||
setBlockColor(color[index]);
|
||||
setIsSelectId(index);
|
||||
@@ -1295,6 +1308,7 @@ const TemplatePlaceholder = () => {
|
||||
};
|
||||
|
||||
const handleCloseRoleModal = () => {
|
||||
setRoleName(prevRole || "");
|
||||
setIsModalRole(false);
|
||||
};
|
||||
const handleSaveWidgetsOptions = (
|
||||
@@ -1319,10 +1333,9 @@ const TemplatePlaceholder = () => {
|
||||
);
|
||||
|
||||
if (getPageNumer.length > 0) {
|
||||
const getXYdata = getPageNumer[0].pos;
|
||||
|
||||
const getPosData = getXYdata;
|
||||
const addSignPos = getPosData.map((position) => {
|
||||
const textSize = fontSize || currWidgetsDetails?.options?.fontSize;
|
||||
const textColor = fontColor || currWidgetsDetails?.options?.fontColor;
|
||||
const addSignPos = getPageNumer?.[0]?.pos?.map((position) => {
|
||||
if (position.key === currWidgetsDetails?.key) {
|
||||
if (currWidgetsDetails?.type === radioButtonWidget) {
|
||||
if (addOption) {
|
||||
@@ -1351,12 +1364,8 @@ const TemplatePlaceholder = () => {
|
||||
defaultValue: defaultValue,
|
||||
isReadOnly: isReadOnly || false,
|
||||
isHideLabel: isHideLabel || false,
|
||||
fontSize:
|
||||
fontSize || currWidgetsDetails?.options?.fontSize || 12,
|
||||
fontColor:
|
||||
fontColor ||
|
||||
currWidgetsDetails?.options?.fontColor ||
|
||||
"black"
|
||||
fontSize: textSize || 12,
|
||||
fontColor: textColor || "black"
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -1390,12 +1399,8 @@ const TemplatePlaceholder = () => {
|
||||
isReadOnly: isReadOnly || false,
|
||||
defaultValue: defaultValue,
|
||||
isHideLabel: isHideLabel || false,
|
||||
fontSize:
|
||||
fontSize || currWidgetsDetails?.options?.fontSize || 12,
|
||||
fontColor:
|
||||
fontColor ||
|
||||
currWidgetsDetails?.options?.fontColor ||
|
||||
"black"
|
||||
fontSize: textSize || 12,
|
||||
fontColor: textColor || "black"
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -1408,12 +1413,8 @@ const TemplatePlaceholder = () => {
|
||||
status: status,
|
||||
values: dropdownOptions,
|
||||
defaultValue: defaultValue,
|
||||
fontSize:
|
||||
fontSize || currWidgetsDetails?.options?.fontSize || 12,
|
||||
fontColor:
|
||||
fontColor ||
|
||||
currWidgetsDetails?.options?.fontColor ||
|
||||
"black",
|
||||
fontSize: textSize || 12,
|
||||
fontColor: textColor || "black",
|
||||
...(isReadOnly ? { isReadOnly: isReadOnly || false } : {})
|
||||
}
|
||||
};
|
||||
@@ -1428,9 +1429,11 @@ const TemplatePlaceholder = () => {
|
||||
}
|
||||
return obj;
|
||||
});
|
||||
const recalculatedPlaceholders =
|
||||
utils.applyNumberFormulasToPages(newUpdateSignPos);
|
||||
const newUpdateSigner = signerPos.map((obj) => {
|
||||
if (obj.Id === uniqueId) {
|
||||
return { ...obj, placeHolder: newUpdateSignPos };
|
||||
return { ...obj, placeHolder: recalculatedPlaceholders };
|
||||
}
|
||||
return obj;
|
||||
});
|
||||
@@ -1463,9 +1466,9 @@ const TemplatePlaceholder = () => {
|
||||
);
|
||||
|
||||
if (getPageNumer.length > 0) {
|
||||
const getXYdata = getPageNumer[0].pos;
|
||||
const getPosData = getXYdata;
|
||||
const addSignPos = getPosData.map((position) => {
|
||||
const textSize = fontSize || currWidgetsDetails?.options?.fontSize;
|
||||
const textColor = fontColor || currWidgetsDetails?.options?.fontColor;
|
||||
const addSignPos = getPageNumer?.[0]?.pos?.map((position) => {
|
||||
if (position.key === currWidgetsDetails?.key) {
|
||||
if (position.type === textInputWidget) {
|
||||
return {
|
||||
@@ -1479,12 +1482,8 @@ const TemplatePlaceholder = () => {
|
||||
isReadOnly: defaultdata?.isReadOnly || false,
|
||||
validation:
|
||||
{},
|
||||
fontSize:
|
||||
fontSize || currWidgetsDetails?.options?.fontSize || 12,
|
||||
fontColor:
|
||||
fontColor ||
|
||||
currWidgetsDetails?.options?.fontColor ||
|
||||
"black"
|
||||
fontSize: textSize || 12,
|
||||
fontColor: textColor || "black"
|
||||
}
|
||||
};
|
||||
} else if (position.type === cellsWidget) {
|
||||
@@ -1503,15 +1502,12 @@ const TemplatePlaceholder = () => {
|
||||
validation:
|
||||
{},
|
||||
isReadOnly: defaultdata?.isReadOnly || false,
|
||||
fontSize:
|
||||
fontSize || currWidgetsDetails?.options?.fontSize || 12,
|
||||
fontColor:
|
||||
fontColor ||
|
||||
currWidgetsDetails?.options?.fontColor ||
|
||||
"black"
|
||||
fontSize: textSize || 12,
|
||||
fontColor: textColor || "black"
|
||||
}
|
||||
};
|
||||
} else if (["signature"].includes(position.type)) {
|
||||
}
|
||||
else if (["signature"].includes(position.type)) {
|
||||
return {
|
||||
...position,
|
||||
options: {
|
||||
@@ -1529,12 +1525,8 @@ const TemplatePlaceholder = () => {
|
||||
status: defaultdata.status,
|
||||
defaultValue: defaultdata.defaultValue,
|
||||
hint: defaultdata?.hint || "",
|
||||
fontSize:
|
||||
fontSize || currWidgetsDetails?.options?.fontSize || 12,
|
||||
fontColor:
|
||||
fontColor ||
|
||||
currWidgetsDetails?.options?.fontColor ||
|
||||
"black"
|
||||
fontSize: textSize || 12,
|
||||
fontColor: textColor || "black",
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -1950,7 +1942,6 @@ const TemplatePlaceholder = () => {
|
||||
numPages={numPages}
|
||||
pageDetails={pageDetails}
|
||||
placeholder={true}
|
||||
drop={drop}
|
||||
handleDeleteWidget={handleDeleteWidgetObj}
|
||||
handleTabDrag={handleTabDrag}
|
||||
handleStop={handleStop}
|
||||
@@ -1987,6 +1978,8 @@ const TemplatePlaceholder = () => {
|
||||
currWidgetsDetails={currWidgetsDetails}
|
||||
setRoleName={setRoleName}
|
||||
isShowModal={isShowModal}
|
||||
signBtnPosition={signBtnPosition}
|
||||
addPositionOfSignature={addPositionOfSignature}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
@@ -2063,9 +2056,6 @@ const TemplatePlaceholder = () => {
|
||||
initial={true}
|
||||
isTemplateFlow={true}
|
||||
roleName={roleName}
|
||||
Add
|
||||
commentMore
|
||||
actions
|
||||
isPrefillDropdown={true}
|
||||
/>
|
||||
</div>
|
||||
@@ -2125,6 +2115,8 @@ const TemplatePlaceholder = () => {
|
||||
fontColor={fontColor}
|
||||
setFontColor={setFontColor}
|
||||
roleName={roleName}
|
||||
widgetsSource={signerPos}
|
||||
activeSignerId={uniqueId}
|
||||
/>
|
||||
{isPrefillModal && (
|
||||
<PrefillWidgetModal
|
||||
@@ -2140,7 +2132,6 @@ const TemplatePlaceholder = () => {
|
||||
navigatePageToDoc={navigatePageToDoc}
|
||||
setIsNewContact={setIsNewContact}
|
||||
isNewContact={isNewContact}
|
||||
documentFlow={"template"}
|
||||
docId={pdfDetails[0]?.objectId}
|
||||
isSubmit={isUseTemplate}
|
||||
/>
|
||||
|
||||
@@ -13,26 +13,8 @@ import {
|
||||
import DeleteUserModal from "../primitives/DeleteUserModal";
|
||||
import axios from "axios";
|
||||
import PasswordResetModal from "../primitives/PasswordResetModal";
|
||||
import { usersActions } from "../json/ReportJson";
|
||||
|
||||
const actions = [
|
||||
{
|
||||
btnId: "4741",
|
||||
hoverLabel: "Delete",
|
||||
btnColor: "op-btn-secondary",
|
||||
btnIcon: "fa-light fa-trash",
|
||||
redirectUrl: "",
|
||||
action: "delete",
|
||||
restrictAdmin: true
|
||||
},
|
||||
{
|
||||
btnId: "1910",
|
||||
hoverLabel: "Reset password",
|
||||
btnIcon: "fa-light fa-key",
|
||||
redirectUrl: "",
|
||||
action: "resetpassword",
|
||||
restrictAdmin: true
|
||||
},
|
||||
];
|
||||
const heading = ["Sr.No", "Name", "Email", "Phone", "Role", "Team", "Active"];
|
||||
const UserList = () => {
|
||||
const { t } = useTranslation();
|
||||
@@ -342,7 +324,7 @@ const UserList = () => {
|
||||
{t(`report-heading.${item}`)}
|
||||
</th>
|
||||
))}
|
||||
{actions?.length > 0 && (
|
||||
{usersActions?.length > 0 && (
|
||||
<th className="p-2 text-transparent pointer-events-none">
|
||||
{t("action")}
|
||||
</th>
|
||||
@@ -375,10 +357,14 @@ const UserList = () => {
|
||||
</td>
|
||||
{handleActiveToggleVisibility(item) ? (
|
||||
<td className="px-4 py-2 font-semibold">
|
||||
<label className="cursor-pointer relative block items-center mb-0">
|
||||
<label
|
||||
htmlFor={`isdisabled-${item.objectId}`}
|
||||
className="cursor-pointer relative block items-center mb-0"
|
||||
>
|
||||
<input
|
||||
id={`isdisabled-${item.objectId}`}
|
||||
type="checkbox"
|
||||
className="op-toggle transition-all op-toggle-secondary"
|
||||
className="op-toggle checked:[--tglbg:#3368ff] transition-all checked:text-white"
|
||||
checked={item?.IsDisabled !== true}
|
||||
onChange={() => handleToggleBtn(item)}
|
||||
/>
|
||||
@@ -425,8 +411,8 @@ const UserList = () => {
|
||||
{isAdmin && (
|
||||
<td className="px-3 py-2">
|
||||
<div className="text-base-content min-w-max flex flex-row gap-x-2 gap-y-1 justify-start items-center">
|
||||
{actions?.length > 0 &&
|
||||
actions.map((act, index) => (
|
||||
{usersActions?.length > 0 &&
|
||||
usersActions?.map((act, index) => (
|
||||
<React.Fragment key={index}>
|
||||
{handleBtnVisibility(act, item) && (
|
||||
<div
|
||||
@@ -454,37 +440,29 @@ const UserList = () => {
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
<DeleteUserModal
|
||||
title={t("delete-account")}
|
||||
deleting={deleting}
|
||||
userEmail={item?.Email}
|
||||
isOpen={
|
||||
isActModal[
|
||||
"delete_" + item.objectId
|
||||
]
|
||||
}
|
||||
onConfirm={() =>
|
||||
handleDeleteAccount(item)
|
||||
}
|
||||
deleteRes={deleteUserRes}
|
||||
handleClose={handleCloseModal}
|
||||
/>
|
||||
<PasswordResetModal
|
||||
isOpen={
|
||||
isActModal[
|
||||
"resetpassword_" + item.objectId
|
||||
]
|
||||
}
|
||||
userId={item?.UserId?.objectId}
|
||||
onClose={handleCloseModal}
|
||||
onSubmit={submitPassword}
|
||||
showAlert={showAlert}
|
||||
/>
|
||||
</React.Fragment>
|
||||
))}
|
||||
</div>
|
||||
</td>
|
||||
)}
|
||||
<DeleteUserModal
|
||||
title={t("delete-account")}
|
||||
deleting={deleting}
|
||||
userEmail={item?.Email}
|
||||
isOpen={isActModal["delete_" + item.objectId]}
|
||||
onConfirm={() => handleDeleteAccount(item)}
|
||||
deleteRes={deleteUserRes}
|
||||
handleClose={handleCloseModal}
|
||||
/>
|
||||
<PasswordResetModal
|
||||
isOpen={
|
||||
isActModal["resetpassword_" + item.objectId]
|
||||
}
|
||||
userId={item?.UserId?.objectId}
|
||||
onClose={handleCloseModal}
|
||||
onSubmit={submitPassword}
|
||||
showAlert={showAlert}
|
||||
/>
|
||||
</tr>
|
||||
))}
|
||||
</tbody>
|
||||
|
||||
@@ -172,8 +172,8 @@ function UserProfile() {
|
||||
|
||||
try {
|
||||
const response = await parseFile.save({
|
||||
progress: (progressValue, loaded, total, { type }) => {
|
||||
if (type === "upload" && progressValue !== null) {
|
||||
progress: (progressValue, loaded, total) => {
|
||||
if (progressValue !== null) {
|
||||
const percentCompleted = Math.round((loaded * 100) / total);
|
||||
// console.log("percentCompleted ", percentCompleted);
|
||||
setpercentage(percentCompleted);
|
||||
|
||||
@@ -139,7 +139,7 @@ const AddContact = (props) => {
|
||||
)}
|
||||
<div className="w-full mx-auto p-[8px]">
|
||||
{!props?.isDisableTitle && (
|
||||
<div className="text-[14px] font-[700]">{t("add-contact")}</div>
|
||||
<div className="text-[14px] font-[700] text-base-content mb-1">{t("add-contact")}</div>
|
||||
)}
|
||||
{isUserExist && props?.isAddYourSelfCheckbox && (
|
||||
<div className="mb-[0.75rem] flex items-center mt-1">
|
||||
@@ -248,7 +248,7 @@ const AddContact = (props) => {
|
||||
e.preventDefault();
|
||||
setIsOptionalDetails(!isOptionalDetails);
|
||||
}}
|
||||
className="op-link op-link-secondary no-underline hover:underline"
|
||||
className="text-base-content/60 no-underline hover:underline focus:outline-none"
|
||||
>
|
||||
{isOptionalDetails
|
||||
? t("hide-optional-details")
|
||||
|
||||
@@ -55,7 +55,7 @@ function CustomModal(props) {
|
||||
className="op-btn op-btn-primary px-6 ml-[20px] mb-3 mt-1"
|
||||
onClick={() => handleExtendBtn()}
|
||||
>
|
||||
Extend
|
||||
{t("extend")}
|
||||
</button>
|
||||
)}
|
||||
{props.isDownloadBtn && (
|
||||
|
||||
@@ -32,7 +32,8 @@ export const RenderReportCell = ({
|
||||
startIndex,
|
||||
handleDownload,
|
||||
handleRemovePrefill,
|
||||
reportName
|
||||
reportName,
|
||||
handleItemClick
|
||||
}) => {
|
||||
const { t } = useTranslation();
|
||||
const appName =
|
||||
@@ -59,7 +60,11 @@ export const RenderReportCell = ({
|
||||
);
|
||||
case "Reason":
|
||||
return (
|
||||
<td key={col} className="p-2 text-center">
|
||||
<td
|
||||
key={col}
|
||||
className="p-2 text-center cursor-pointer"
|
||||
onClick={() => handleItemClick(col, rowData?.DeclineReason)}
|
||||
>
|
||||
{rowData?.DeclineReason?.length > 25
|
||||
? rowData?.DeclineReason?.slice(0, 25) + "..."
|
||||
: rowData?.DeclineReason || "-"}
|
||||
@@ -68,7 +73,12 @@ export const RenderReportCell = ({
|
||||
case "Note":
|
||||
return (
|
||||
<td key={col} className="p-2 text-center">
|
||||
<p className="truncate w-[100px]">{rowData?.Note || "-"}</p>
|
||||
<p
|
||||
className="truncate w-[100px] cursor-pointer"
|
||||
onClick={() => handleItemClick(col, rowData?.Note)}
|
||||
>
|
||||
{rowData?.Note || "-"}
|
||||
</p>
|
||||
</td>
|
||||
);
|
||||
case "Folder":
|
||||
|
||||
@@ -158,7 +158,7 @@ const SignerCell = ({ reportName, item, handleRemovePrefill }) => {
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{item.Placeholders.map(
|
||||
{item?.Placeholders?.map(
|
||||
(x, i) =>
|
||||
x.Role !== "prefill" && (
|
||||
<tr key={i} className="text-sm font-medium">
|
||||
|
||||
@@ -14,7 +14,7 @@ const Tooltip = ({
|
||||
onClick={() =>
|
||||
handleOnlickHelp ? handleOnlickHelp() : openInNewTab(url)
|
||||
}
|
||||
className={"text-center cursor-pointer"}
|
||||
className="text-center cursor-pointer focus:outline-none"
|
||||
>
|
||||
<sup>
|
||||
<i
|
||||
|
||||
@@ -97,6 +97,7 @@ const DocumentsReport = (props) => {
|
||||
const [defaultMail, setDefaultMail] = useState({ body: "", subject: "" });
|
||||
const [currUserId, setCurrUserId] = useState(false);
|
||||
const [documentDetails, setDocumentDetails] = useState();
|
||||
const [objInfoModal, setObjInfoModal] = useState({ title: "", info: "" });
|
||||
const startIndex = (currentPage - 1) * props.docPerPage;
|
||||
const { isMoreDocs, setIsNextRecord } = props;
|
||||
|
||||
@@ -202,29 +203,21 @@ const DocumentsReport = (props) => {
|
||||
const filterSignTypes = signatureType?.filter(
|
||||
(x) => x.enabled === true
|
||||
);
|
||||
//condition to check tenant have some already set any email template
|
||||
if (tenantDetails?.RequestBody) {
|
||||
//customize mail state is handle to when user want to customize already set tenant email format then use that format
|
||||
setCustomizeMail({
|
||||
subject: tenantDetails?.RequestSubject,
|
||||
body: tenantDetails?.RequestBody
|
||||
});
|
||||
setDefaultMail({
|
||||
subject: tenantDetails?.RequestSubject,
|
||||
body: tenantDetails?.RequestBody
|
||||
});
|
||||
} else {
|
||||
const defaultRequestBody = defaultMailBody;
|
||||
const defaultSubject = defaultMailSubject;
|
||||
setCustomizeMail({
|
||||
subject: defaultSubject,
|
||||
body: defaultRequestBody
|
||||
});
|
||||
setDefaultMail({
|
||||
subject: defaultSubject,
|
||||
body: defaultRequestBody
|
||||
});
|
||||
}
|
||||
const extUser =
|
||||
localStorage.getItem("Extand_Class") &&
|
||||
JSON.parse(localStorage.getItem("Extand_Class"))?.[0];
|
||||
const subject = tenantDetails?.RequestSubject ?? "";
|
||||
const body = tenantDetails?.RequestBody ?? "";
|
||||
//customize mail state is handle to when user want to customize already set tenant email format then use that format
|
||||
const userSubject =
|
||||
subject;
|
||||
const userBody =
|
||||
body;
|
||||
setCustomizeMail({
|
||||
subject: userSubject ?? defaultMailSubject,
|
||||
body: userBody ?? defaultMailBody
|
||||
});
|
||||
setDefaultMail({ subject: userSubject, body: userBody });
|
||||
return filterSignTypes;
|
||||
}
|
||||
} catch (e) {
|
||||
@@ -1049,6 +1042,10 @@ const DocumentsReport = (props) => {
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
const handleItemClick = (title, info) => {
|
||||
setObjInfoModal({ title, info });
|
||||
};
|
||||
return (
|
||||
<div className="relative">
|
||||
{Object.keys(actLoader)?.length > 0 && (
|
||||
@@ -1173,6 +1170,7 @@ const DocumentsReport = (props) => {
|
||||
handleDownload={handleDownload}
|
||||
handleRemovePrefill={handleRemovePrefill}
|
||||
reportName={props.ReportName}
|
||||
handleItemClick={handleItemClick}
|
||||
/>
|
||||
))}
|
||||
{/* actions */}
|
||||
@@ -1852,6 +1850,13 @@ const DocumentsReport = (props) => {
|
||||
)}
|
||||
</div>
|
||||
</ModalUi>
|
||||
<ModalUi
|
||||
title={t(`report-heading.${objInfoModal.title}`)}
|
||||
isOpen={objInfoModal.title}
|
||||
handleClose={() => setObjInfoModal({ title: "", info: "" })}
|
||||
>
|
||||
<div className="p-[20px]">{objInfoModal.info || "-"}</div>
|
||||
</ModalUi>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -86,6 +86,7 @@ const TemplatesReport = (props) => {
|
||||
const [isNewContact, setIsNewContact] = useState({ status: false, id: "" });
|
||||
const [isPrefillModal, setIsPrefillModal] = useState({});
|
||||
const [isSubmit, setIsSubmit] = useState(false);
|
||||
const [objInfoModal, setObjInfoModal] = useState({ title: "", info: "" });
|
||||
const startIndex = (currentPage - 1) * props.docPerPage;
|
||||
const { isMoreDocs, setIsNextRecord } = props;
|
||||
const [isMailModal, setIsMailModal] = useState(false);
|
||||
@@ -237,8 +238,8 @@ const TemplatesReport = (props) => {
|
||||
navigate(`/${act.redirectUrl}/${item.objectId}`);
|
||||
} else {
|
||||
// handle Use template
|
||||
const placeholder = item?.Placeholders;
|
||||
const isRoleExist = placeholder.filter((x) => x.Role !== "prefill");
|
||||
const placeholder = item?.Placeholders || [];
|
||||
const isRoleExist = placeholder?.filter((x) => x.Role !== "prefill");
|
||||
//condition to check atleast one role is present for use template
|
||||
if (isRoleExist && isRoleExist?.length > 0) {
|
||||
const checkIsSignatureExist = isRoleExist?.every((placeholderObj) =>
|
||||
@@ -345,9 +346,13 @@ const TemplatesReport = (props) => {
|
||||
setIsShareWith({ [item.objectId]: true });
|
||||
}
|
||||
else if (act.action === "duplicate") {
|
||||
const isPrefill = item?.Placeholders?.some((p) => p?.Role === "prefill");
|
||||
setError(isPrefill ? t("duplicate-template-error") : "");
|
||||
setIsModal({ [`duplicate_${item.objectId}`]: true });
|
||||
const hasDuplicate = utils.hasDuplicateWidgetNames(item?.Placeholders);
|
||||
if (hasDuplicate) {
|
||||
setError(t("duplicate-template-widget-error"));
|
||||
setIsModal({ [`duplicate_${item.objectId}`]: true });
|
||||
} else {
|
||||
setIsModal({ [`duplicate_${item.objectId}`]: true });
|
||||
}
|
||||
} else if (act.action === "rename") {
|
||||
setIsModal({ [`rename_${item.objectId}`]: true });
|
||||
} else if (act.action === "edit") {
|
||||
@@ -726,7 +731,7 @@ const TemplatesReport = (props) => {
|
||||
// `handleBulkSend` is used to open modal as well as fetch template
|
||||
// and show Ui on the basis template response handleBulkSendTemplate
|
||||
const handleBulkSend = async (template) => {
|
||||
const isPrefillExist = template?.Placeholders.some(
|
||||
const isPrefillExist = template?.Placeholders?.some(
|
||||
(x) => x.Role === "prefill"
|
||||
);
|
||||
if (isPrefillExist) {
|
||||
@@ -755,6 +760,7 @@ const TemplatesReport = (props) => {
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// `handleShareWith` is used to save teams in sharedWith field
|
||||
const handleShareWith = async (e, template) => {
|
||||
e.preventDefault();
|
||||
@@ -919,29 +925,21 @@ const TemplatesReport = (props) => {
|
||||
if (tenantDetails && tenantDetails === "user does not exist!") {
|
||||
alert(t("user-not-exist"));
|
||||
} else if (tenantDetails) {
|
||||
//condition to check tenant have some already set any email template
|
||||
if (tenantDetails?.RequestBody) {
|
||||
//customize mail state is handle to when user want to customize already set tenant email format then use that format
|
||||
setCustomizeMail({
|
||||
subject: tenantDetails?.RequestSubject,
|
||||
body: tenantDetails?.RequestBody
|
||||
});
|
||||
setDefaultMail({
|
||||
subject: tenantDetails?.RequestSubject,
|
||||
body: tenantDetails?.RequestBody
|
||||
});
|
||||
} else {
|
||||
const defaultRequestBody = defaultMailBody;
|
||||
const defaultSubject = defaultMailSubject;
|
||||
setCustomizeMail({
|
||||
subject: defaultSubject,
|
||||
body: defaultRequestBody
|
||||
});
|
||||
setDefaultMail({
|
||||
subject: defaultSubject,
|
||||
body: defaultRequestBody
|
||||
});
|
||||
}
|
||||
const extUser =
|
||||
localStorage.getItem("Extand_Class") &&
|
||||
JSON.parse(localStorage.getItem("Extand_Class"))?.[0];
|
||||
const subject = tenantDetails?.RequestSubject ?? "";
|
||||
const body = tenantDetails?.RequestBody ?? "";
|
||||
//customize mail state is handle to when user want to customize already set tenant email format then use that format
|
||||
const userSubject =
|
||||
subject;
|
||||
const userBody =
|
||||
body;
|
||||
setCustomizeMail({
|
||||
subject: userSubject ?? defaultMailSubject,
|
||||
body: userBody ?? defaultMailBody
|
||||
});
|
||||
setDefaultMail({ subject: userSubject, body: userBody });
|
||||
}
|
||||
} catch (e) {
|
||||
alert(t("user-not-exist"));
|
||||
@@ -1011,6 +1009,10 @@ const TemplatesReport = (props) => {
|
||||
navigate(`/recipientSignPdf/${docId}`);
|
||||
}
|
||||
};
|
||||
|
||||
const handleItemClick = (title, info) => {
|
||||
setObjInfoModal({ title, info });
|
||||
};
|
||||
return (
|
||||
<div className="relative">
|
||||
{Object.keys(actLoader)?.length > 0 && (
|
||||
@@ -1147,6 +1149,7 @@ const TemplatesReport = (props) => {
|
||||
handleDownload={handleDownload}
|
||||
handleRemovePrefill={handleRemovePrefill}
|
||||
reportName={props.ReportName}
|
||||
handleItemClick={handleItemClick}
|
||||
/>
|
||||
))}
|
||||
<td className="px-2 py-2">
|
||||
@@ -1682,6 +1685,13 @@ const TemplatesReport = (props) => {
|
||||
)}
|
||||
</div>
|
||||
</ModalUi>
|
||||
<ModalUi
|
||||
title={t(`report-heading.${objInfoModal.title}`)}
|
||||
isOpen={objInfoModal.title}
|
||||
handleClose={() => setObjInfoModal({ title: "", info: "" })}
|
||||
>
|
||||
<div className="p-[20px]">{objInfoModal.info || "-"}</div>
|
||||
</ModalUi>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { generateTitleFromFilename, getBase64FromUrl } from "../constant/Utils";
|
||||
import { generateTitleFromFilename } from "../constant/Utils";
|
||||
import { base64StringtoFile, uploadFile } from "./fileUtils";
|
||||
import { sanitizeFileName } from "./sanitizeFileName";
|
||||
import Parse from "parse";
|
||||
@@ -17,21 +17,20 @@ export const saveToMySign = async (widget) => {
|
||||
const file = base64StringtoFile(base64, fileName);
|
||||
const fileUrl = await uploadFile(file, User?.id);
|
||||
// below code is used to save or update default signature, initials, stamp
|
||||
const signCls = new Parse.Object("contracts_Signature");
|
||||
if (widget?.defaultSignId) {
|
||||
signCls.id = widget.defaultSignId;
|
||||
}
|
||||
const params = {
|
||||
id: widget?.defaultSignId, // pass id to update existing signature/initials
|
||||
userId: User.id
|
||||
};
|
||||
if (widget?.type === "initials") {
|
||||
signCls.set("Initials", fileUrl);
|
||||
params.initials = fileUrl; // save initials image url
|
||||
} else if (widget?.type === "signature") {
|
||||
signCls.set("ImageURL", fileUrl);
|
||||
params.signature = fileUrl; // save signature image url
|
||||
}
|
||||
signCls.set("UserId", Parse.User.createWithoutData(User.id));
|
||||
const signRes = await signCls.save();
|
||||
const signRes = await Parse.Cloud.run("savesignature", params);
|
||||
return { base64File: base64, id: signRes?.id };
|
||||
} catch (err) {
|
||||
console.log("Err while saving signature", err);
|
||||
return url;
|
||||
return err;
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -41,3 +40,76 @@ export const hasSignatureWidget = (s) =>
|
||||
(s.placeHolder ?? []).some((ph) =>
|
||||
(ph?.pos ?? []).some((p) => p?.type === "signature")
|
||||
);
|
||||
|
||||
export const widgetNamesArr = (placeholders, signerId) => {
|
||||
const widgetNames =
|
||||
placeholders?.length > 0
|
||||
? placeholders
|
||||
?.filter((x) => x.Id !== signerId) // exclude current signer
|
||||
?.flatMap((item) => item.placeHolder || []) // go inside placeHolder[]
|
||||
?.flatMap((ph) => ph.pos || []) // go inside pos[]
|
||||
?.map((pos) => pos.options?.name) // pick the name
|
||||
.filter(Boolean)
|
||||
: [];
|
||||
|
||||
return widgetNames;
|
||||
};
|
||||
|
||||
// `hasDuplicateWidgetNames` checks for duplicate widget names across different placeholder objects
|
||||
export const hasDuplicateWidgetNames = (placeholders = []) => {
|
||||
const seen = new Set(); // names we've already seen in previous objs
|
||||
|
||||
for (const obj of placeholders || []) {
|
||||
const widgetNames =
|
||||
obj?.placeHolder
|
||||
?.flatMap((ph) => ph.pos || [])
|
||||
?.map((pos) => pos.options?.name)
|
||||
.filter(Boolean) || [];
|
||||
|
||||
const uniqueNames = [...new Set(widgetNames)]; // ignore duplicates inside same obj
|
||||
|
||||
const isDuplicate = uniqueNames.some((name) => seen.has(name));
|
||||
if (isDuplicate) return true; // early exit on first cross-obj duplicate
|
||||
|
||||
uniqueNames.forEach((name) => seen.add(name));
|
||||
}
|
||||
|
||||
return false;
|
||||
};
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {Array<object>} pages
|
||||
* Array of page objects. Each page is expected to have:
|
||||
* - pos: Array<Widget> where Widget has shape:
|
||||
* {
|
||||
* key: string,
|
||||
* type: string,
|
||||
* options?: {
|
||||
* response?: number|string,
|
||||
* defaultValue?: number|string,
|
||||
* formula?: string
|
||||
* }
|
||||
* }
|
||||
*
|
||||
* @returns {Array<object>}
|
||||
*/
|
||||
export const applyNumberFormulasToPages = (pages = []) => {
|
||||
// Guard: if not an array or empty, just return as-is
|
||||
if (!Array.isArray(pages) || pages.length === 0) {
|
||||
return pages;
|
||||
}
|
||||
|
||||
// Clone pages and each widget.options so we do not mutate caller's data.
|
||||
// (Shallow clone is sufficient for our current usage since we only touch `options`.)
|
||||
const clonedPages = pages.map((page) => ({
|
||||
...page,
|
||||
pos: (page?.pos || []).map((widget) => ({
|
||||
...widget,
|
||||
options: { ...widget.options }
|
||||
}))
|
||||
}));
|
||||
|
||||
// Return the cloned, updated pages
|
||||
return clonedPages;
|
||||
};
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
# Use an official Node runtime as the base image
|
||||
FROM node:22.14.0
|
||||
|
||||
|
||||
# Install LibreOffice for DOCX to PDF conversions
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y libreoffice \
|
||||
|
||||
@@ -11,6 +11,7 @@ export const deleteUserOtp = async (req, res) => {
|
||||
|
||||
const extUserQuery = new Parse.Query('contracts_Users');
|
||||
extUserQuery.equalTo('UserId', { __type: 'Pointer', className: '_User', objectId: userId });
|
||||
extUserQuery.include('TenantId');
|
||||
const extUser = await extUserQuery.first({ useMasterKey: true });
|
||||
if (!extUser) return res.status(404).json({ error: 'User not found' });
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@ export function generateOtp(len = OTP_LENGTH) {
|
||||
}
|
||||
|
||||
export async function sendDeleteOtpEmail(extUser, otp) {
|
||||
const _extUser = extUser && JSON.parse(JSON.stringify(extUser));
|
||||
const params = {
|
||||
extUserId: extUser.id,
|
||||
from: appName,
|
||||
|
||||
@@ -1,171 +1,182 @@
|
||||
import fs from 'node:fs';
|
||||
import axios from 'axios';
|
||||
import multer from 'multer';
|
||||
import libre from 'libreoffice-convert';
|
||||
import util from 'node:util';
|
||||
import { cloudServerUrl, getSecureUrl, serverAppId } from '../../Utils.js';
|
||||
|
||||
libre.convertAsync = util.promisify(libre.convert);
|
||||
/** @returns {Promise<Buffer>} */
|
||||
async function convertLibre(input, ext, opts) {
|
||||
return await new Promise((resolve, reject) => {
|
||||
try {
|
||||
libre.convert(input, ext, opts, (err, out) => (err ? reject(err) : resolve(out)));
|
||||
} catch (e) {
|
||||
reject(e);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
const storage = multer.diskStorage({
|
||||
destination(req, file, cb) {
|
||||
cb(null, 'exports');
|
||||
},
|
||||
filename(req, file, cb) {
|
||||
cb(null, file.originalname);
|
||||
// -------------------- Concurrency limiter --------------------
|
||||
// CRITICAL FIX: Reduced to 1 for CPU-intensive LibreOffice conversions
|
||||
const MAX_CONCURRENCY = Number(process.env.DOCX2PDF_CONCURRENCY || 1);
|
||||
let active = 0;
|
||||
const queue = [];
|
||||
|
||||
function runWithLimit(task) {
|
||||
return new Promise((resolve, reject) => {
|
||||
const run = () => {
|
||||
active++;
|
||||
Promise.resolve()
|
||||
.then(task)
|
||||
.then(resolve, reject)
|
||||
.finally(() => {
|
||||
active--;
|
||||
if (queue.length) queue.shift()();
|
||||
});
|
||||
};
|
||||
if (active < MAX_CONCURRENCY) run();
|
||||
else queue.push(run);
|
||||
});
|
||||
}
|
||||
|
||||
// -------------------- Timeout helper --------------------
|
||||
/**
|
||||
* @template T
|
||||
* @param {Promise<T>} promise
|
||||
* @param {number} ms
|
||||
* @param {string} [label='operation']
|
||||
* @returns {Promise<T>}
|
||||
*/
|
||||
export async function withTimeout(promise, ms, label = 'operation') {
|
||||
let timer;
|
||||
try {
|
||||
const timeout = new Promise((_, reject) => {
|
||||
timer = setTimeout(() => reject(new Error(`${label} timed out after ${ms}ms`)), ms);
|
||||
});
|
||||
return await Promise.race([promise, timeout]);
|
||||
} finally {
|
||||
if (timer) clearTimeout(timer);
|
||||
}
|
||||
}
|
||||
|
||||
// -------------------- Multer: use memory storage --------------------
|
||||
const storage = multer.memoryStorage();
|
||||
export const upload = multer({
|
||||
storage,
|
||||
limits: { fileSize: 50 * 1024 * 1024 }, // 50MB hard limit at multer level
|
||||
fileFilter: (req, file, cb) => {
|
||||
const okExt = /\.docx$/i.test(file.originalname || '');
|
||||
const okMime =
|
||||
file.mimetype === 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' ||
|
||||
file.mimetype === 'application/octet-stream';
|
||||
if (okExt && okMime) return cb(null, true);
|
||||
cb(new Error('Only .docx files are supported'));
|
||||
},
|
||||
});
|
||||
|
||||
export const upload = multer({ storage });
|
||||
|
||||
function generatePdfName(length) {
|
||||
const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
|
||||
let result = '';
|
||||
for (let i = 0; i < length; i++) {
|
||||
result += chars.charAt(Math.floor(Math.random() * chars.length));
|
||||
}
|
||||
for (let i = 0; i < length; i++) result += chars.charAt(Math.floor(Math.random() * chars.length));
|
||||
return result;
|
||||
}
|
||||
|
||||
export default async function docxtopdf(req, res) {
|
||||
const serverUrl = cloudServerUrl;
|
||||
const appId = serverAppId;
|
||||
const parseAppKey = { 'X-Parse-Application-Id': serverAppId };
|
||||
const masterKey = process.env.MASTER_KEY;
|
||||
const inputPath = req.file.path;
|
||||
const name = generatePdfName(16);
|
||||
const fileName = `${name}.pdf`;
|
||||
const outputPath = './exports/output.pdf';
|
||||
|
||||
const masterHeader = { ...parseAppKey, 'X-Parse-Master-Key': masterKey };
|
||||
const sessionHeader = { ...parseAppKey, 'X-Parse-Session-Token': req.headers['sessiontoken'] };
|
||||
|
||||
if (!req.file || !req.file.buffer) {
|
||||
return res.status(400).json({ error: 'No file uploaded.' });
|
||||
}
|
||||
|
||||
try {
|
||||
const userRes = await axios.get(serverUrl + '/users/me', {
|
||||
headers: {
|
||||
'X-Parse-Application-Id': appId,
|
||||
'X-Parse-Session-Token': req.headers['sessiontoken'],
|
||||
},
|
||||
});
|
||||
const userId = JSON.stringify({
|
||||
UserId: {
|
||||
__type: 'Pointer',
|
||||
className: '_User',
|
||||
objectId: userRes.data.objectId,
|
||||
},
|
||||
// ---- Auth: current user ----
|
||||
const userRes = await axios.get(`${serverUrl}/users/me`, { headers: sessionHeader });
|
||||
|
||||
// ---- contracts_Users ----
|
||||
const whereUser = JSON.stringify({
|
||||
UserId: { __type: 'Pointer', className: '_User', objectId: userRes.data.objectId },
|
||||
});
|
||||
const resUser = await axios.get(
|
||||
serverUrl + `/classes/contracts_Users?where=${userId}&limit=1&include=TenantId`,
|
||||
{
|
||||
headers: {
|
||||
'X-Parse-Application-Id': appId,
|
||||
'X-Parse-Master-Key': masterKey,
|
||||
},
|
||||
}
|
||||
`${serverUrl}/classes/contracts_Users?where=${whereUser}&limit=1&include=TenantId`,
|
||||
{ headers: masterHeader }
|
||||
);
|
||||
|
||||
if (resUser?.data?.results?.length > 0) {
|
||||
const tenantId = resUser.data.results[0].TenantId?.objectId;
|
||||
const ext = '.pdf';
|
||||
const outPath = `./exports/output${ext}`;
|
||||
const docxBuf = fs.readFileSync(inputPath);
|
||||
const pdfBuffer = await libre.convertAsync(docxBuf, ext, undefined);
|
||||
fs.writeFileSync(outPath, pdfBuffer);
|
||||
const file = fs.readFileSync(outPath);
|
||||
const size = fs.statSync(outPath).size;
|
||||
const PartnersTenant = JSON.stringify({
|
||||
PartnersTenant: {
|
||||
__type: 'Pointer',
|
||||
className: 'partners_Tenant',
|
||||
objectId: tenantId,
|
||||
},
|
||||
});
|
||||
const resTenantCredit = await axios.get(
|
||||
serverUrl + `/classes/partners_TenantCredits?where=${PartnersTenant}&limit=1`,
|
||||
{
|
||||
headers: {
|
||||
'X-Parse-Application-Id': appId,
|
||||
'X-Parse-Master-Key': masterKey,
|
||||
},
|
||||
}
|
||||
);
|
||||
if (resTenantCredit.data?.results?.length > 0) {
|
||||
const tenantCreditsId = resTenantCredit.data.results[0].objectId;
|
||||
const activeFileAdapter = resUser.data.results[0].TenantId?.ActiveFileAdapter;
|
||||
let fileUrl;
|
||||
if (activeFileAdapter) {
|
||||
const params = {
|
||||
fileBase64: file.toString('base64'),
|
||||
fileName,
|
||||
id: activeFileAdapter,
|
||||
};
|
||||
const url = serverUrl + '/functions/savetofileadapter';
|
||||
const headers = {
|
||||
'Content-Type': 'application/json',
|
||||
'X-Parse-Application-Id': appId,
|
||||
'X-Parse-Session-Token': req.headers['sessiontoken'],
|
||||
};
|
||||
try {
|
||||
const savetos3 = await axios.post(url, params, { headers });
|
||||
fileUrl = savetos3?.data?.result?.url;
|
||||
} catch (err) {
|
||||
console.log('err in save to customfile', err);
|
||||
}
|
||||
} else {
|
||||
const parsefile = await axios.post(serverUrl + `/files/${fileName}`, file, {
|
||||
headers: {
|
||||
'X-Parse-Application-Id': appId,
|
||||
'X-Parse-Master-Key': masterKey,
|
||||
'Content-Type': 'application/pdf',
|
||||
},
|
||||
});
|
||||
const fileRes = getSecureUrl(parsefile.data.url);
|
||||
fileUrl = fileRes.url;
|
||||
}
|
||||
const usedStorage = resTenantCredit.data.results[0].usedStorage
|
||||
? resTenantCredit.data.results[0].usedStorage + size
|
||||
: size;
|
||||
await axios.put(
|
||||
serverUrl + `/classes/partners_TenantCredits/${tenantCreditsId}`,
|
||||
{ usedStorage },
|
||||
{
|
||||
headers: {
|
||||
'X-Parse-Application-Id': appId,
|
||||
'X-Parse-Master-Key': masterKey,
|
||||
},
|
||||
}
|
||||
);
|
||||
await axios.post(
|
||||
serverUrl + '/classes/partners_DataFiles',
|
||||
{
|
||||
FileSize: size,
|
||||
FileUrl: fileUrl,
|
||||
TenantPtr: {
|
||||
__type: 'Pointer',
|
||||
className: 'partners_Tenant',
|
||||
objectId: tenantId,
|
||||
},
|
||||
UserId: {
|
||||
__type: 'Pointer',
|
||||
className: '_User',
|
||||
objectId: userRes.data.objectId,
|
||||
},
|
||||
},
|
||||
{
|
||||
headers: {
|
||||
'X-Parse-Application-Id': appId,
|
||||
'X-Parse-Master-Key': masterKey,
|
||||
},
|
||||
}
|
||||
);
|
||||
[inputPath, outPath].forEach(p => fs.existsSync(p) && fs.unlinkSync(p));
|
||||
return res.status(200).json({ message: 'success.', url: fileUrl });
|
||||
}
|
||||
if (!resUser?.data?.results?.length) {
|
||||
return res.status(403).json({ error: 'User not linked to tenant.' });
|
||||
}
|
||||
} catch (err) {
|
||||
[inputPath, outputPath].forEach(p => fs.existsSync(p) && fs.unlinkSync(p));
|
||||
const msg =
|
||||
err?.response?.data?.error || err?.response?.data || err?.message || 'Something went wrong.';
|
||||
console.log(`Error converting file: ${msg}`);
|
||||
|
||||
const tenantId = resUser.data.results[0]?.TenantId?.objectId;
|
||||
if (!tenantId) {
|
||||
return res.status(403).json({ error: 'Tenant not found for user.' });
|
||||
}
|
||||
|
||||
// ---- DOCX -> PDF conversion with concurrency control and timeout ----
|
||||
const fileName = `${generatePdfName(16)}.pdf`;
|
||||
|
||||
// FIX: Increased timeout to 90s for large files, added nice priority
|
||||
const pdfBuffer = await runWithLimit(async () => {
|
||||
// Log for monitoring
|
||||
console.log(`[DOCX2PDF] Starting conversion, active: ${active}, queued: ${queue.length}`);
|
||||
|
||||
const startTime = Date.now();
|
||||
try {
|
||||
const result = await withTimeout(
|
||||
convertLibre(req.file.buffer, '.pdf', undefined),
|
||||
90_000, // Increased from 60s to 90s
|
||||
'DOCX->PDF'
|
||||
);
|
||||
console.log(`[DOCX2PDF] Completed in ${Date.now() - startTime}ms`);
|
||||
return result;
|
||||
} catch (error) {
|
||||
console.error(`[DOCX2PDF] Failed after ${Date.now() - startTime}ms:`, error.message);
|
||||
throw error;
|
||||
}
|
||||
});
|
||||
|
||||
// ---- Upload PDF ----
|
||||
const activeFileAdapter = resUser.data.results[0]?.TenantId?.ActiveFileAdapter;
|
||||
let fileUrl;
|
||||
if (activeFileAdapter) {
|
||||
const params = {
|
||||
fileBase64: Buffer.from(pdfBuffer).toString('base64'),
|
||||
fileName,
|
||||
id: activeFileAdapter,
|
||||
};
|
||||
const url = serverUrl + '/functions/savetofileadapter';
|
||||
const headers = { 'Content-Type': 'application/json', ...sessionHeader };
|
||||
const savetos3 = await axios.post(url, params, { headers });
|
||||
fileUrl = savetos3?.data?.result?.url;
|
||||
if (!fileUrl) throw new Error('No URL returned from file adapter');
|
||||
} else {
|
||||
const parsefile = await axios.post(`${serverUrl}/files/${fileName}`, pdfBuffer, {
|
||||
headers: { ...masterHeader, 'Content-Type': 'application/pdf' },
|
||||
});
|
||||
const fileRes = getSecureUrl(parsefile.data.url);
|
||||
fileUrl = fileRes.url;
|
||||
}
|
||||
|
||||
return res.status(200).json({ message: 'success.', url: fileUrl });
|
||||
} catch (err) {
|
||||
// More specific error messages
|
||||
let msg =
|
||||
err?.response?.data?.error || err?.response?.data || err?.message || 'Something went wrong.';
|
||||
// Friendly message to the client
|
||||
const message =
|
||||
'We are currently experiencing some issues with processing DOCX files. Please upload the PDF version or contact us on support@opensignlabs.com';
|
||||
|
||||
if (msg.includes('timed out')) {
|
||||
msg =
|
||||
'Document conversion is taking too long. Please try a smaller file or contact support@opensignlabs.com';
|
||||
} else if (msg.includes('too large') || msg.includes('size')) {
|
||||
msg =
|
||||
'File is too large to process. Please reduce the file size or contact support@opensignlabs.com';
|
||||
} else {
|
||||
msg = message;
|
||||
}
|
||||
console.error(`[DOCX2PDF] Error: ${msg}`);
|
||||
return res.status(400).json({ error: message });
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,6 +57,11 @@ import addUser from './parsefunction/addUser.js';
|
||||
import filterDocs from './parsefunction/filterDocs.js';
|
||||
import sendDeleteUserMail from './parsefunction/sendDeleteUserMail.js';
|
||||
import resetPassword from './parsefunction/resetPassword.js';
|
||||
import saveSignature from './parsefunction/saveSignature.js';
|
||||
import manageSign from './parsefunction/manageSign.js';
|
||||
import getSignature from './parsefunction/getSignature.js';
|
||||
import updateEmailTemplates from './parsefunction/updateEmailTemplates.js';
|
||||
import triggerEvent from './parsefunction/triggerEvent.js';
|
||||
|
||||
// This afterSave function triggers after an object is added or updated in the specified class, allowing for post-processing logic.
|
||||
Parse.Cloud.afterSave('contracts_Document', DocumentAftersave);
|
||||
@@ -124,3 +129,8 @@ Parse.Cloud.define('adduser', addUser);
|
||||
Parse.Cloud.define('filterdocs', filterDocs);
|
||||
Parse.Cloud.define('senddeleterequest', sendDeleteUserMail);
|
||||
Parse.Cloud.define('resetpassword', resetPassword);
|
||||
Parse.Cloud.define('savesignature', saveSignature);
|
||||
Parse.Cloud.define('managesign', manageSign);
|
||||
Parse.Cloud.define('getdefaultsignature', getSignature);
|
||||
Parse.Cloud.define('updateemailtemplates', updateEmailTemplates);
|
||||
Parse.Cloud.define('triggerevent', triggerEvent);
|
||||
|
||||
@@ -49,8 +49,8 @@ async function sendMail(document, publicUrl) {
|
||||
let signPdf = `${hostUrl}/login/${encodeBase64}`;
|
||||
const orgName = document.ExtUserPtr.Company ? document.ExtUserPtr.Company : '';
|
||||
const senderObj = document?.ExtUserPtr;
|
||||
const mailBody = document?.ExtUserPtr?.TenantId?.RequestBody || '';
|
||||
const mailSubject = document?.ExtUserPtr?.TenantId?.RequestSubject || '';
|
||||
let mailBody = senderObj?.TenantId?.RequestBody || '';
|
||||
let mailSubject = senderObj?.TenantId?.RequestSubject || '';
|
||||
let replaceVar;
|
||||
if (mailBody && mailSubject) {
|
||||
const replacedRequestBody = mailBody.replace(/"/g, "'");
|
||||
@@ -126,8 +126,8 @@ async function batchQuery(userId, Documents, Ip, parseConfig, type, publicUrl) {
|
||||
}
|
||||
});
|
||||
}
|
||||
const mailBody = x?.ExtUserPtr?.TenantId?.RequestBody || '';
|
||||
const mailSubject = x?.ExtUserPtr?.TenantId?.RequestSubject || '';
|
||||
let mailBody = x?.ExtUserPtr?.TenantId?.RequestBody || '';
|
||||
let mailSubject = x?.ExtUserPtr?.TenantId?.RequestSubject || '';
|
||||
return {
|
||||
method: 'POST',
|
||||
path: '/app/classes/contracts_Document',
|
||||
@@ -192,7 +192,6 @@ async function batchQuery(userId, Documents, Ip, parseConfig, type, publicUrl) {
|
||||
},
|
||||
};
|
||||
});
|
||||
// console.log('requests ', requests);
|
||||
if (requests?.length > 0) {
|
||||
const newrequests = [requests?.[0]];
|
||||
const response = await axios.post('batch', { requests: newrequests }, parseConfig);
|
||||
|
||||
@@ -1,26 +1,78 @@
|
||||
import axios from 'axios';
|
||||
import { appName, cloudServerUrl, serverAppId } from '../../Utils.js';
|
||||
const serverUrl = cloudServerUrl;
|
||||
const APPID = serverAppId;
|
||||
const masterKEY = process.env.MASTER_KEY;
|
||||
const headers = {
|
||||
'Content-Type': 'application/json',
|
||||
'X-Parse-Application-Id': APPID,
|
||||
'X-Parse-Master-Key': masterKEY,
|
||||
};
|
||||
|
||||
async function sendDeclineMail(doc, publicUrl, userId, reason) {
|
||||
try {
|
||||
const TenantAppName = appName;
|
||||
const logo =
|
||||
"<img src='https://qikinnovation.ams3.digitaloceanspaces.com/logo.png' height='50' style='padding:20px'/>";
|
||||
const opurl = ` <a href=www.opensignlabs.com target=_blank>here</a>`;
|
||||
const removePrefill =
|
||||
doc?.Placeholders?.length > 0 && doc?.Placeholders?.filter(x => x?.Role !== 'prefill');
|
||||
const signUser =
|
||||
removePrefill?.length > 0 &&
|
||||
removePrefill?.find(x => x?.signerPtr?.UserId?.objectId === userId);
|
||||
|
||||
const sender = doc.ExtUserPtr;
|
||||
const pdfName = doc.Name;
|
||||
const creatorName = doc.ExtUserPtr.Name;
|
||||
const creatorEmail = doc.ExtUserPtr.Email;
|
||||
const signerName = signUser?.signerPtr?.Name || '';
|
||||
const signerEmail = signUser?.signerPtr?.Email || signUser?.email || '';
|
||||
const viewDocUrl = `${publicUrl}/recipientSignPdf/${doc.objectId}`;
|
||||
const subject = `Document "${pdfName}" has been declined by ${signerName}`;
|
||||
const body =
|
||||
"<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>${logo}</div><div style='padding:2px;font-family:system-ui;background-color:#47a3ad'><p style='font-size:20px;font-weight:400;color:white;padding-left:20px'>Document declined by ${signerName}</p>` +
|
||||
`</div><div style='padding:20px;font-family:system-ui;font-size:14px'><p>Dear ${creatorName},</p>` +
|
||||
`<p>${pdfName} has been declined by ${signerName} "${signerEmail}" on ${new Date().toLocaleDateString()}.</p>` +
|
||||
`<p>Decline Reason: ${reason || 'Not specified'}</p>` +
|
||||
`<p><a href=${viewDocUrl} target=_blank>View Document</a></p></div></div><div><p>This is an automated email from ${TenantAppName}. For any queries regarding this email, ` +
|
||||
`please contact the sender ${creatorEmail} directly. If you think this email is inappropriate or spam, you may file a complaint with ${TenantAppName}${opurl}.</p></div></div></body></html>`;
|
||||
|
||||
const params = {
|
||||
extUserId: sender.objectId,
|
||||
from: TenantAppName,
|
||||
recipient: creatorEmail,
|
||||
subject: subject,
|
||||
pdfName: pdfName,
|
||||
html: body,
|
||||
};
|
||||
await axios.post(serverUrl + '/functions/sendmailv3', params, { headers });
|
||||
} catch (err) {
|
||||
console.log('err in sendnotifymail', err);
|
||||
}
|
||||
}
|
||||
export default async function declinedocument(request) {
|
||||
const docId = request.params.docId;
|
||||
const reason = request.params?.reason || '';
|
||||
const declineBy = {
|
||||
__type: 'Pointer',
|
||||
className: '_User',
|
||||
objectId: request.params?.userId,
|
||||
};
|
||||
|
||||
const userId = request.params.userId;
|
||||
const declineBy = { __type: 'Pointer', className: '_User', objectId: userId };
|
||||
const publicUrl = request.headers.public_url;
|
||||
if (!docId) {
|
||||
throw new Parse.Error(Parse.Error.SCRIPT_FAILED, 'missing parameter docId.');
|
||||
}
|
||||
try {
|
||||
const docCls = new Parse.Query('contracts_Document');
|
||||
docCls.include('ExtUserPtr.TenantId');
|
||||
docCls.include('ExtUserPtr.TenantId,Placeholders.signerPtr,Signers');
|
||||
const updateDoc = await docCls.get(docId, { useMasterKey: true });
|
||||
if (updateDoc) {
|
||||
const _doc = JSON.parse(JSON.stringify(updateDoc));
|
||||
const isEnableOTP = updateDoc?.get('IsEnableOTP') || false;
|
||||
if (!isEnableOTP) {
|
||||
updateDoc.set('IsDeclined', true);
|
||||
updateDoc.set('DeclineReason', reason);
|
||||
updateDoc.set('DeclineBy', declineBy);
|
||||
await updateDoc.save(null, { useMasterKey: true });
|
||||
sendDeclineMail(_doc, publicUrl, userId, reason);
|
||||
return 'document declined';
|
||||
} else {
|
||||
if (!request?.user) {
|
||||
@@ -30,6 +82,7 @@ export default async function declinedocument(request) {
|
||||
updateDoc.set('DeclineReason', reason);
|
||||
updateDoc.set('DeclineBy', declineBy);
|
||||
await updateDoc.save(null, { useMasterKey: true });
|
||||
sendDeclineMail(_doc, publicUrl, userId, reason);
|
||||
return 'document declined';
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
export default async function getSignature(request) {
|
||||
const { userId } = request.params;
|
||||
if (!userId) {
|
||||
throw new Parse.Error(Parse.Error.INVALID_QUERY, 'Missing userId parameter.');
|
||||
}
|
||||
if (userId !== request.user?.id) {
|
||||
throw new Parse.Error(Parse.Error.INVALID_QUERY, 'Cannot save signature for the current user.');
|
||||
}
|
||||
try {
|
||||
const query = new Parse.Query('contracts_Signature');
|
||||
query.equalTo('UserId', { __type: 'Pointer', className: '_User', objectId: userId });
|
||||
const result = await query.first({ useMasterKey: true });
|
||||
return result;
|
||||
} catch (err) {
|
||||
console.error('Error fetching signature:', err);
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
export default async function manageSign(request) {
|
||||
const { signature, userId, initials, id, title } = request.params;
|
||||
|
||||
if (!userId) {
|
||||
throw new Parse.Error(Parse.Error.INVALID_QUERY, 'Missing userId parameter.');
|
||||
}
|
||||
if (userId !== request.user?.id) {
|
||||
throw new Parse.Error(Parse.Error.INVALID_QUERY, 'Cannot save signature for the current user.');
|
||||
}
|
||||
const userPtr = { __type: 'Pointer', className: '_User', objectId: userId };
|
||||
try {
|
||||
const signatureCls = new Parse.Object('contracts_Signature');
|
||||
if (id) {
|
||||
signatureCls.id = id;
|
||||
}
|
||||
signatureCls.set('Initials', initials ? initials : '');
|
||||
signatureCls.set('ImageURL', signature ? signature : '');
|
||||
signatureCls.set('SignatureName', title ? title : '');
|
||||
if (userPtr) {
|
||||
signatureCls.set('UserId', userPtr);
|
||||
}
|
||||
const signRes = await signatureCls.save(null, { useMasterKey: true });
|
||||
return signRes;
|
||||
} catch (err) {
|
||||
console.error('Error saving signature:', err);
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
@@ -41,6 +41,7 @@ export default async function GenerateCertificate(docDetails) {
|
||||
const maxX = width - margin - textWidth; // Ensures text stays inside the border with 30px margin
|
||||
const OriginIp = docDetails?.OriginIp || '';
|
||||
const company = docDetails?.ExtUserPtr?.Company || '';
|
||||
const documentHash = docDetails?.DocumentHash || '';
|
||||
const createdAt = docDetails?.DocSentAt?.iso || docDetails.createdAt;
|
||||
const createdAtperTimezone = formatDateTime(createdAt, DateFormat, timezone, Is12Hr);
|
||||
const IsEnableOTP = docDetails?.IsEnableOTP || false;
|
||||
@@ -150,9 +151,36 @@ export default async function GenerateCertificate(docDetails) {
|
||||
color: textValueColor,
|
||||
});
|
||||
|
||||
if (documentHash) {
|
||||
page.drawText('Document hash (sha256) :', {
|
||||
x: 30,
|
||||
y: 670,
|
||||
size: text,
|
||||
font: timesRomanFont,
|
||||
color: textKeyColor,
|
||||
});
|
||||
|
||||
page.drawText(documentHash, {
|
||||
x: 170,
|
||||
y: 670,
|
||||
size: text,
|
||||
font: timesRomanFont,
|
||||
color: textValueColor,
|
||||
});
|
||||
}
|
||||
|
||||
const organizationY = documentHash ? 650 : 670;
|
||||
const createdOnY = organizationY - 20;
|
||||
const completedOnY = createdOnY - 20;
|
||||
const signersY = completedOnY - 20;
|
||||
const originatorHeaderY = signersY - 20;
|
||||
const nameY = originatorHeaderY - 17;
|
||||
const emailY = nameY - 20;
|
||||
const ipY = emailY - 20;
|
||||
|
||||
page.drawText('Organization :', {
|
||||
x: 30,
|
||||
y: 670,
|
||||
y: organizationY,
|
||||
size: text,
|
||||
font: timesRomanFont,
|
||||
color: textKeyColor,
|
||||
@@ -160,14 +188,14 @@ export default async function GenerateCertificate(docDetails) {
|
||||
|
||||
page.drawText(company, {
|
||||
x: 110,
|
||||
y: 670,
|
||||
y: organizationY,
|
||||
size: text,
|
||||
font: timesRomanFont,
|
||||
color: textValueColor,
|
||||
});
|
||||
page.drawText('Created on :', {
|
||||
x: 30,
|
||||
y: 650,
|
||||
y: createdOnY,
|
||||
size: text,
|
||||
font: timesRomanFont,
|
||||
color: textKeyColor,
|
||||
@@ -175,14 +203,14 @@ export default async function GenerateCertificate(docDetails) {
|
||||
|
||||
page.drawText(`${createdAtperTimezone}`, {
|
||||
x: 97,
|
||||
y: 650,
|
||||
y: createdOnY,
|
||||
size: text,
|
||||
font: timesRomanFont,
|
||||
color: textValueColor,
|
||||
});
|
||||
page.drawText('Completed on :', {
|
||||
x: 30,
|
||||
y: 630,
|
||||
y: completedOnY,
|
||||
size: text,
|
||||
font: timesRomanFont,
|
||||
color: textKeyColor,
|
||||
@@ -190,14 +218,14 @@ export default async function GenerateCertificate(docDetails) {
|
||||
|
||||
page.drawText(`${completedUTCtime}`, {
|
||||
x: 115,
|
||||
y: 630,
|
||||
y: completedOnY,
|
||||
size: text,
|
||||
font: timesRomanFont,
|
||||
color: textValueColor,
|
||||
});
|
||||
page.drawText('Signers :', {
|
||||
x: 30,
|
||||
y: 610,
|
||||
y: signersY,
|
||||
size: text,
|
||||
font: timesRomanFont,
|
||||
color: textKeyColor,
|
||||
@@ -205,75 +233,75 @@ export default async function GenerateCertificate(docDetails) {
|
||||
|
||||
page.drawText(`${signersCount}`, {
|
||||
x: 80,
|
||||
y: 610,
|
||||
y: signersY,
|
||||
size: text,
|
||||
font: timesRomanFont,
|
||||
color: textValueColor,
|
||||
});
|
||||
page.drawText('Document originator', {
|
||||
x: 30,
|
||||
y: 590,
|
||||
y: originatorHeaderY,
|
||||
size: 17,
|
||||
font: timesRomanFont,
|
||||
color: titleColor,
|
||||
});
|
||||
page.drawText('Name :', {
|
||||
x: 60,
|
||||
y: 573,
|
||||
y: nameY,
|
||||
size: text,
|
||||
font: timesRomanFont,
|
||||
color: textKeyColor,
|
||||
});
|
||||
page.drawText(ownerName, {
|
||||
x: 105,
|
||||
y: 573,
|
||||
y: nameY,
|
||||
size: text,
|
||||
font: timesRomanFont,
|
||||
color: textValueColor,
|
||||
});
|
||||
page.drawText('Email :', {
|
||||
x: 60,
|
||||
y: 553,
|
||||
y: emailY,
|
||||
size: text,
|
||||
font: timesRomanFont,
|
||||
color: textKeyColor,
|
||||
});
|
||||
page.drawText(ownerEmail, {
|
||||
x: 105,
|
||||
y: 553,
|
||||
y: emailY,
|
||||
size: text,
|
||||
font: timesRomanFont,
|
||||
color: textValueColor,
|
||||
});
|
||||
page.drawText('IP address :', {
|
||||
x: 60,
|
||||
y: 533,
|
||||
y: ipY,
|
||||
size: text,
|
||||
font: timesRomanFont,
|
||||
color: textKeyColor,
|
||||
});
|
||||
page.drawText(`${OriginIp}`, {
|
||||
x: 125,
|
||||
y: 533,
|
||||
y: ipY,
|
||||
size: text,
|
||||
font: timesRomanFont,
|
||||
color: textValueColor,
|
||||
});
|
||||
|
||||
page.drawLine({
|
||||
start: { x: 30, y: 527 },
|
||||
end: { x: width - 30, y: 527 },
|
||||
start: { x: 30, y: ipY - 6 },
|
||||
end: { x: width - 30, y: ipY - 6 },
|
||||
color: rgb(0.12, 0.12, 0.12),
|
||||
thickness: 0.5,
|
||||
});
|
||||
let yPosition1 = 512;
|
||||
let yPosition2 = 498;
|
||||
let yPosition3 = 478;
|
||||
let yPosition4 = 458;
|
||||
let yPosition5 = 438;
|
||||
let yPosition6 = 418;
|
||||
let yPosition7 = 398;
|
||||
let yPosition8 = 363;
|
||||
let yPosition1 = ipY - 21;
|
||||
let yPosition2 = yPosition1 - 14;
|
||||
let yPosition3 = yPosition2 - 20;
|
||||
let yPosition4 = yPosition3 - 20;
|
||||
let yPosition5 = yPosition4 - 20;
|
||||
let yPosition6 = yPosition5 - 20;
|
||||
let yPosition7 = yPosition6 - 20;
|
||||
let yPosition8 = yPosition7 - 35;
|
||||
|
||||
auditTrail.slice(0, 3).forEach(async (x, i) => {
|
||||
const embedPng = x.Signature ? await pdfDoc.embedPng(x.Signature) : '';
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import fs from 'node:fs';
|
||||
import { createHash } from 'node:crypto';
|
||||
import axios from 'axios';
|
||||
import { PDFDocument } from 'pdf-lib';
|
||||
import {
|
||||
@@ -28,6 +29,10 @@ const headers = {
|
||||
'X-Parse-Master-Key': masterKEY,
|
||||
};
|
||||
|
||||
function generateDocumentHash(buffer) {
|
||||
return createHash('sha256').update(buffer).digest('hex');
|
||||
}
|
||||
|
||||
async function unlinkFile(path) {
|
||||
if (fs.existsSync(path)) {
|
||||
try {
|
||||
@@ -44,11 +49,6 @@ async function uploadFile(pdfName, filepath) {
|
||||
const filedata = fs.readFileSync(filepath);
|
||||
let fileUrl;
|
||||
|
||||
// const file = new Parse.File(pdfName, [...filedata], 'application/pdf');
|
||||
// await file.save({ useMasterKey: true });
|
||||
// const fileRes = getSecureUrl(file.url());
|
||||
// fileUrl = fileRes.url;
|
||||
|
||||
const fileRes = await parseUploadFile(pdfName, filedata, 'application/pdf');
|
||||
fileUrl = getSecureUrl(fileRes?.url)?.url;
|
||||
|
||||
@@ -61,7 +61,7 @@ async function uploadFile(pdfName, filepath) {
|
||||
}
|
||||
|
||||
// `updateDoc` is used to update signedUrl, AuditTrail, Iscompleted in document
|
||||
async function updateDoc(docId, url, userId, ipAddress, data, className, sign) {
|
||||
async function updateDoc(docId, url, userId, ipAddress, data, className, sign, documentHash) {
|
||||
try {
|
||||
const UserPtr = { __type: 'Pointer', className: className, objectId: userId };
|
||||
const obj = {
|
||||
@@ -100,8 +100,16 @@ async function updateDoc(docId, url, userId, ipAddress, data, className, sign) {
|
||||
isCompleted = true;
|
||||
}
|
||||
const body = { SignedUrl: url, AuditTrail: updateAuditTrail, IsCompleted: isCompleted };
|
||||
if (documentHash && isCompleted) {
|
||||
body.DocumentHash = documentHash;
|
||||
}
|
||||
const signedRes = await axios.put(`${docUrl}/${docId}`, body, { headers });
|
||||
return { isCompleted: isCompleted, message: 'success', AuditTrail: updateAuditTrail };
|
||||
return {
|
||||
isCompleted: isCompleted,
|
||||
message: 'success',
|
||||
AuditTrail: updateAuditTrail,
|
||||
DocumentHash: documentHash && isCompleted ? documentHash : undefined,
|
||||
};
|
||||
} catch (err) {
|
||||
console.log('update doc err ', err);
|
||||
return 'err';
|
||||
@@ -183,8 +191,8 @@ async function sendCompletedMail(obj) {
|
||||
if (obj?.isCustomMail) {
|
||||
const tenant = sender?.TenantId;
|
||||
if (tenant) {
|
||||
subject = tenant?.CompletionSubject || '';
|
||||
body = tenant?.CompletionBody || '';
|
||||
subject = tenant?.CompletionSubject ? tenant?.CompletionSubject : subject;
|
||||
body = tenant?.CompletionBody ? tenant?.CompletionBody : body;
|
||||
} else {
|
||||
const userId = sender?.CreatedBy?.objectId || sender?.UserId?.objectId;
|
||||
if (userId) {
|
||||
@@ -198,8 +206,8 @@ async function sendCompletedMail(obj) {
|
||||
const tenantRes = await tenantQuery.first({ useMasterKey: true });
|
||||
if (tenantRes) {
|
||||
const _tenantRes = JSON.parse(JSON.stringify(tenantRes));
|
||||
subject = _tenantRes?.CompletionSubject || '';
|
||||
body = _tenantRes?.CompletionBody || '';
|
||||
subject = _tenantRes?.CompletionSubject ? tenant?.CompletionSubject : subject;
|
||||
body = _tenantRes?.CompletionBody ? tenant?.CompletionBody : body;
|
||||
}
|
||||
} catch (err) {
|
||||
console.log('error in fetch tenant in signpdf', err.message);
|
||||
@@ -427,6 +435,7 @@ async function PDF(req) {
|
||||
let filePath = `./exports/${name}`;
|
||||
let signedFilePath = `./exports/signed_${name}`;
|
||||
let pdfSize = PdfBuffer.length;
|
||||
let documentHash;
|
||||
if (isCompleted) {
|
||||
const signersName = _resDoc.Signers?.map(x => x.Name + ' <' + x.Email + '>');
|
||||
const reason =
|
||||
@@ -444,6 +453,7 @@ async function PDF(req) {
|
||||
//`saveUrl` is used to save signed pdf in exports folder
|
||||
fs.writeFileSync(signedFilePath, signedDocs);
|
||||
pdfSize = signedDocs.length;
|
||||
documentHash = generateDocumentHash(signedDocs);
|
||||
console.log(`✅ PDF digitally signed created: ${signedFilePath} \n`);
|
||||
} else {
|
||||
//`saveUrl` is used to save signed pdf in exports folder
|
||||
@@ -464,12 +474,17 @@ async function PDF(req) {
|
||||
userIP, // client ipAddress,
|
||||
_resDoc, // auditTrail, signers, etc data
|
||||
className, // className based on flow
|
||||
sign // sign base64
|
||||
sign, // sign base64
|
||||
isCompleted ? documentHash : undefined
|
||||
);
|
||||
sendNotifyMail(_resDoc, signUser, mailProvider, publicUrl);
|
||||
saveFileUsage(pdfSize, data.imageUrl, _resDoc?.CreatedBy?.objectId);
|
||||
if (updatedDoc && updatedDoc.isCompleted) {
|
||||
const hashForDoc = documentHash || updatedDoc?.DocumentHash;
|
||||
const doc = { ..._resDoc, AuditTrail: updatedDoc.AuditTrail, SignedUrl: data.imageUrl };
|
||||
if (hashForDoc) {
|
||||
doc.DocumentHash = hashForDoc;
|
||||
}
|
||||
sendMailsaveCertifcate(doc, pfx, isCustomMail, mailProvider, `signed_${name}`);
|
||||
} else {
|
||||
unlinkFile(pfxname);
|
||||
|
||||
@@ -59,7 +59,9 @@ export default async function saveAsTemplate(request) {
|
||||
options: {
|
||||
...p.options,
|
||||
status: 'required',
|
||||
response: '',
|
||||
...(p?.options?.defaultValue ? { defaultValue: '' } : {}),
|
||||
...(p?.options?.isReadOnly ? { isReadOnly: false } : {}),
|
||||
},
|
||||
})),
|
||||
}));
|
||||
@@ -88,7 +90,14 @@ export default async function saveAsTemplate(request) {
|
||||
pos: (page.pos || []).map(widget => {
|
||||
// if there is a defaultValue in options, zero it out
|
||||
if (widget.options && widget.options.defaultValue !== undefined) {
|
||||
return { ...widget, options: { ...widget.options, defaultValue: '' } }; // reset only the value
|
||||
return {
|
||||
...widget,
|
||||
options: {
|
||||
...widget.options,
|
||||
defaultValue: '',
|
||||
...(widget?.options?.isReadOnly ? { isReadOnly: false } : {}),
|
||||
},
|
||||
}; // reset only the value
|
||||
}
|
||||
// otherwise, return the widget unchanged
|
||||
return widget;
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
export default async function saveSignature(request) {
|
||||
const { signature, userId, initials, id, title } = request.params;
|
||||
|
||||
if (!userId) {
|
||||
throw new Parse.Error(Parse.Error.INVALID_QUERY, 'Missing userId parameter.');
|
||||
}
|
||||
if (userId !== request.user?.id) {
|
||||
throw new Parse.Error(Parse.Error.INVALID_QUERY, 'Cannot save signature for the current user.');
|
||||
}
|
||||
const userPtr = { __type: 'Pointer', className: '_User', objectId: userId };
|
||||
try {
|
||||
const signatureCls = new Parse.Object('contracts_Signature');
|
||||
if (id) {
|
||||
signatureCls.id = id;
|
||||
}
|
||||
if (initials) {
|
||||
signatureCls.set('Initials', initials);
|
||||
}
|
||||
if (signature) {
|
||||
signatureCls.set('ImageURL', signature);
|
||||
}
|
||||
if (title) {
|
||||
signatureCls.set('SignatureName', title);
|
||||
}
|
||||
if (userPtr) {
|
||||
signatureCls.set('UserId', userPtr);
|
||||
}
|
||||
const signRes = await signatureCls.save(null, { useMasterKey: true });
|
||||
return signRes;
|
||||
} catch (err) {
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
@@ -159,7 +159,8 @@ export default async function sendMailGmailProvider(_extRes, template) {
|
||||
template;
|
||||
|
||||
if (_extRes) {
|
||||
const refresh_token = _extRes.google_refresh_token;
|
||||
let refresh_token = '';
|
||||
refresh_token = _extRes?.TenantId?.google_refresh_token;
|
||||
// generate access token
|
||||
const access_token = await refreshAccessToken(refresh_token);
|
||||
|
||||
|
||||
@@ -12,15 +12,23 @@ async function sendMailProvider(req, plan, monthchange) {
|
||||
let mailgunClient;
|
||||
let mailgunDomain;
|
||||
if (smtpenable) {
|
||||
transporterSMTP = createTransport({
|
||||
let transporterConfig = {
|
||||
host: process.env.SMTP_HOST,
|
||||
port: process.env.SMTP_PORT || 465,
|
||||
secure: smtpsecure,
|
||||
auth: {
|
||||
};
|
||||
|
||||
// ✅ Add auth only if BOTH username & password exist
|
||||
const smtpUser = process.env.SMTP_USERNAME;
|
||||
const smtpPass = process.env.SMTP_PASS;
|
||||
|
||||
if (smtpUser && smtpPass) {
|
||||
transporterConfig.auth = {
|
||||
user: process.env.SMTP_USERNAME ? process.env.SMTP_USERNAME : process.env.SMTP_USER_EMAIL,
|
||||
pass: process.env.SMTP_PASS,
|
||||
},
|
||||
});
|
||||
pass: smtpPass,
|
||||
};
|
||||
}
|
||||
transporterSMTP = createTransport(transporterConfig);
|
||||
} else {
|
||||
if (mailgunApiKey) {
|
||||
const mailgun = new Mailgun(formData);
|
||||
@@ -185,7 +193,7 @@ async function sendMailProvider(req, plan, monthchange) {
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
console.log('err in sendmailv3', err);
|
||||
console.log(`Error in sendmailv3: ${err}`);
|
||||
if (fs.existsSync(testPdf)) {
|
||||
try {
|
||||
fs.unlinkSync(testPdf);
|
||||
@@ -236,7 +244,7 @@ async function sendMailProvider(req, plan, monthchange) {
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
console.log('err in sendmailv3', err);
|
||||
console.log(`Error in sendmailv3: ${err}`);
|
||||
if (err) {
|
||||
return { status: 'error' };
|
||||
}
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
import axios from 'axios';
|
||||
import { cloudServerUrl, serverAppId } from '../../Utils.js';
|
||||
|
||||
export default async function triggerEvent(request) {
|
||||
const event = request.params.event;
|
||||
const body = request.params.body;
|
||||
const docId = body.objectId;
|
||||
const contactId = request.params.contactId;
|
||||
const serverUrl = cloudServerUrl; //process.env.SERVER_URL;
|
||||
const appId = serverAppId;
|
||||
try {
|
||||
const docQuery = new Parse.Query('contracts_Document');
|
||||
docQuery.select(['Name', 'IsEnableOTP', 'SignedUrl', 'AuditTrail']);
|
||||
const docRes = await docQuery.get(docId, { useMasterKey: true });
|
||||
const _docRes = docRes && docRes?.toJSON();
|
||||
const isEnableOTP = docRes?.get('IsEnableOTP') || false;
|
||||
|
||||
let userId;
|
||||
if (isEnableOTP) {
|
||||
const userRes = await axios.get(serverUrl + '/users/me', {
|
||||
headers: {
|
||||
'X-Parse-Application-Id': appId,
|
||||
'X-Parse-Session-Token': request.headers['sessiontoken'],
|
||||
},
|
||||
});
|
||||
userId = userRes.data && userRes.data.objectId;
|
||||
if (!userId) {
|
||||
return { message: 'User not found!' };
|
||||
}
|
||||
}
|
||||
|
||||
if (event === 'viewed' && contactId) {
|
||||
const auditTrail = Array.isArray(_docRes.AuditTrail) ? _docRes.AuditTrail : [];
|
||||
const isUserExist = auditTrail.some(x => x?.UserPtr?.objectId === contactId && x?.ViewedOn);
|
||||
if (!isUserExist) {
|
||||
const contactPtr = {
|
||||
__type: 'Pointer',
|
||||
className: 'contracts_Contactbook',
|
||||
objectId: contactId,
|
||||
};
|
||||
|
||||
const date = new Date().toISOString();
|
||||
const newEntry = {
|
||||
UserPtr: contactPtr,
|
||||
SignedUrl: _docRes?.SignedUrl || '',
|
||||
Activity: 'Viewed',
|
||||
ipAddress: request.headers['x-real-ip'],
|
||||
ViewedOn: date,
|
||||
};
|
||||
|
||||
// update Audit trail entry
|
||||
const updateDoc = new Parse.Object('contracts_Document');
|
||||
updateDoc.id = docRes.id;
|
||||
updateDoc.set('AuditTrail', [...auditTrail, newEntry]);
|
||||
await updateDoc.save(null, { useMasterKey: true });
|
||||
}
|
||||
}
|
||||
|
||||
return { message: 'event called!' };
|
||||
} catch (err) {
|
||||
console.log(`Err in triggerEvent: ${err}`);
|
||||
return { message: 'Something went wrong!' };
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
export default async function updateEmailTemplates(request) {
|
||||
const { tenantId, details } = request.params;
|
||||
|
||||
if (!tenantId || !details) {
|
||||
throw new Parse.Error(400, 'Missing tenantId or details.');
|
||||
}
|
||||
|
||||
if (!request.user) {
|
||||
throw new Parse.Error(Parse.Error.INVALID_SESSION_TOKEN, 'unauthorized');
|
||||
}
|
||||
|
||||
try {
|
||||
const extUser = new Parse.Query('contracts_Users');
|
||||
extUser.equalTo('UserId', { __type: 'Pointer', className: '_User', objectId: request.user.id });
|
||||
extUser.include('TenantId');
|
||||
const extUserRes = await extUser.first({ useMasterKey: true });
|
||||
const mailKeys = ['CompletionBody', 'CompletionSubject', 'RequestBody', 'RequestSubject'];
|
||||
Object.keys(details).forEach(key => {
|
||||
if (mailKeys.includes(key)) {
|
||||
if (details?.[key]) {
|
||||
extUserRes.set(key, details?.[key]);
|
||||
} else {
|
||||
extUserRes.unset(key);
|
||||
}
|
||||
}
|
||||
});
|
||||
const updateExtRes = await extUserRes.save(null, { useMasterKey: true });
|
||||
if (updateExtRes) {
|
||||
const res = JSON.parse(JSON.stringify(updateExtRes));
|
||||
return res;
|
||||
}
|
||||
} catch (error) {
|
||||
console.log('error while updating email templates:', error);
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -15,7 +15,11 @@ export default async function updateTenant(request) {
|
||||
// Update tenant details
|
||||
Object.keys(details).forEach(key => {
|
||||
if (validKeys.includes(key)) {
|
||||
tenant.set(key, details?.[key]);
|
||||
if (details?.[key] !== undefined) {
|
||||
tenant.set(key, details?.[key]);
|
||||
} else {
|
||||
tenant.unset(key);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ import { exec } from 'child_process';
|
||||
import { createTransport } from 'nodemailer';
|
||||
import { appName, cloudServerUrl, serverAppId, smtpenable, smtpsecure, useLocal } from './Utils.js';
|
||||
import { SSOAuth } from './auth/authadapter.js';
|
||||
import createContactIndex from './migrationdb/createContactIndex.js';
|
||||
import runDbMigrations from './migrationdb/index.js';
|
||||
import { validateSignedLocalUrl } from './cloud/parsefunction/getSignedUrl.js';
|
||||
import maintenance_mode_message from 'aws-sdk/lib/maintenance_mode_message.js';
|
||||
let fsAdapter;
|
||||
@@ -61,20 +61,28 @@ let mailgunDomain;
|
||||
let isMailAdapter = false;
|
||||
if (smtpenable) {
|
||||
try {
|
||||
transporterMail = createTransport({
|
||||
let transporterConfig = {
|
||||
host: process.env.SMTP_HOST,
|
||||
port: process.env.SMTP_PORT || 465,
|
||||
secure: smtpsecure,
|
||||
auth: {
|
||||
};
|
||||
|
||||
// ✅ Add auth only if BOTH username & password exist
|
||||
const smtpUser = process.env.SMTP_USERNAME;
|
||||
const smtpPass = process.env.SMTP_PASS;
|
||||
|
||||
if (smtpUser && smtpPass) {
|
||||
transporterConfig.auth = {
|
||||
user: process.env.SMTP_USERNAME ? process.env.SMTP_USERNAME : process.env.SMTP_USER_EMAIL,
|
||||
pass: process.env.SMTP_PASS,
|
||||
},
|
||||
});
|
||||
pass: smtpPass,
|
||||
};
|
||||
}
|
||||
transporterMail = createTransport(transporterConfig);
|
||||
await transporterMail.verify();
|
||||
isMailAdapter = true;
|
||||
} catch (err) {
|
||||
isMailAdapter = false;
|
||||
console.log('Please provide valid SMTP credentials');
|
||||
console.log(`Please provide valid SMTP credentials: ${err}`);
|
||||
}
|
||||
} else if (process.env.MAILGUN_API_KEY) {
|
||||
try {
|
||||
@@ -110,6 +118,8 @@ export const config = {
|
||||
appName: appName,
|
||||
allowClientClassCreation: false,
|
||||
allowExpiredAuthDataToken: false,
|
||||
enableInsecureAuthAdapters: false,
|
||||
databaseOptions: { allowPublicExplain: false },
|
||||
encodeParseObjectInCloudFunction: true,
|
||||
...(isMailAdapter === true
|
||||
? {
|
||||
@@ -231,7 +241,7 @@ if (!process.env.TESTING) {
|
||||
console.log('opensign-server running on port ' + port + '.');
|
||||
const isWindows = process.platform === 'win32';
|
||||
// console.log('isWindows', isWindows);
|
||||
createContactIndex();
|
||||
runDbMigrations();
|
||||
const migrate = isWindows
|
||||
? `set APPLICATION_ID=${serverAppId}&& set SERVER_URL=${cloudServerUrl}&& set MASTER_KEY=${process.env.MASTER_KEY}&& npx parse-dbtool migrate`
|
||||
: `APPLICATION_ID=${serverAppId} SERVER_URL=${cloudServerUrl} MASTER_KEY=${process.env.MASTER_KEY} npx parse-dbtool migrate`;
|
||||
|
||||
@@ -18,8 +18,7 @@ export default async function createContactIndex() {
|
||||
const migrationExists = await migrationCollection.findOne({ name: migrationName });
|
||||
|
||||
if (migrationExists) {
|
||||
console.log(' INFO No migrations were executed, database schema was already up to date.');
|
||||
console.log(' SUCCESS Successfully ran indexed migrations directly on db.');
|
||||
console.log(' INFO The unqiue index for contracts_Contactbook is already present.');
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -61,10 +60,9 @@ export default async function createContactIndex() {
|
||||
|
||||
// Insert the document
|
||||
await migrationdb.insertOne(schemaDocument);
|
||||
console.log(' Unique index created successfully.');
|
||||
console.log(' SUCCESS Successfully ran indexed migrations directly on db.');
|
||||
console.log(' SUCCESS The unqiue index for contracts_Contactbook is already created.');
|
||||
} catch (error) {
|
||||
console.log(' ERROR running indexed migration:', error);
|
||||
console.log(' ERROR Running unqiue index for contracts_Contactbook migration:', error);
|
||||
} finally {
|
||||
await client.close();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
import dotenv from 'dotenv';
|
||||
import { MongoClient } from 'mongodb';
|
||||
import { generateId } from '../Utils.js';
|
||||
dotenv.config({ quiet: true });
|
||||
|
||||
export default async function createDocumentIndex() {
|
||||
// Provide the complete MongoDB connection URL with the database name
|
||||
const uri = process.env.MONGODB_URI || 'mongodb://localhost:27017/dev'; // Replace with your MongoDB URI
|
||||
const client = new MongoClient(uri);
|
||||
try {
|
||||
await client.connect();
|
||||
const database = client.db();
|
||||
|
||||
const migrationCollection = database.collection('Migrationdb');
|
||||
const docMigration = 'documentIndex_1';
|
||||
|
||||
// Check if the migration has already been executed
|
||||
const docMigrationExists = await migrationCollection.findOne({ name: docMigration });
|
||||
|
||||
if (docMigrationExists) {
|
||||
console.log(' INFO The completed report index for contracts_document is already present.');
|
||||
return;
|
||||
}
|
||||
|
||||
const docCollection = database.collection('contracts_Document');
|
||||
|
||||
await docCollection.createIndex(
|
||||
{ _p_CreatedBy: 1, _updated_at: -1 },
|
||||
{
|
||||
name: 'idx_docs_by_creator_recent_completed',
|
||||
partialFilterExpression: { IsCompleted: true },
|
||||
}
|
||||
);
|
||||
|
||||
await docCollection.createIndex(
|
||||
{ Signers: 1, _updated_at: -1 },
|
||||
{
|
||||
name: 'idx_docs_by_signer_recent_completed',
|
||||
partialFilterExpression: { IsCompleted: true },
|
||||
}
|
||||
);
|
||||
|
||||
// Save the migration record in the migrationdb collection
|
||||
await migrationCollection.insertOne({
|
||||
_id: generateId(10),
|
||||
name: docMigration,
|
||||
_created_at: new Date(),
|
||||
_updated_at: new Date(),
|
||||
executedAt: new Date(),
|
||||
details: 'Created unique index on CreatedBy, IsImported, Email',
|
||||
});
|
||||
|
||||
console.log(' SUCCESS The completed report index for contracts_document is created.');
|
||||
} catch (error) {
|
||||
console.log(' ERROR Running completed report index for contracts_document migration:', error);
|
||||
} finally {
|
||||
await client.close();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
import createContactIndex from './createContactIndex.js';
|
||||
import createDocumentIndex from './createDocumentIndex.js';
|
||||
|
||||
export default async function runDbMigrations() {
|
||||
await createContactIndex();
|
||||
await createDocumentIndex();
|
||||
}
|
||||
Generated
-20212
File diff suppressed because it is too large
Load Diff
@@ -1,10 +1,10 @@
|
||||
{
|
||||
"name": "open_sign_server",
|
||||
"version": "2.26.0",
|
||||
"description": "An example Parse API server using the parse-server module",
|
||||
"version": "2.32.0",
|
||||
"description": "opensign server using the parse-server module",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/ParsePlatform/parse-server-example"
|
||||
"url": "https://github.com/OpenSignLabs/OpenSign"
|
||||
},
|
||||
"license": "MIT",
|
||||
"main": "index.js",
|
||||
@@ -18,58 +18,60 @@
|
||||
"watch": "nodemon index.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"@aws-sdk/client-s3": "^3.896.0",
|
||||
"@aws-sdk/s3-request-presigner": "^3.896.0",
|
||||
"@aws-sdk/client-s3": "^3.943.0",
|
||||
"@aws-sdk/s3-request-presigner": "^3.943.0",
|
||||
"@parse/fs-files-adapter": "^3.0.0",
|
||||
"@parse/push-adapter": "^8.0.2",
|
||||
"@parse/s3-files-adapter": "^4.2.0",
|
||||
"@pdf-lib/fontkit": "^1.1.1",
|
||||
"@signpdf/placeholder-pdf-lib": "^3.2.6",
|
||||
"@signpdf/signer-p12": "^3.2.4",
|
||||
"@signpdf/signpdf": "^3.2.5",
|
||||
"aws-sdk": "^2.1692.0",
|
||||
"axios": "^1.12.2",
|
||||
"axios": "^1.13.2",
|
||||
"coherentpdf": "^2.5.5",
|
||||
"cors": "^2.8.5",
|
||||
"date-fns-tz": "^3.2.0",
|
||||
"dotenv": "^17.2.2",
|
||||
"express": "^5.1.0",
|
||||
"form-data": "^4.0.4",
|
||||
"dotenv": "^17.2.3",
|
||||
"express": "^5.2.1",
|
||||
"form-data": "^4.0.5",
|
||||
"generate-api-key": "^1.0.2",
|
||||
"googleapis": "^159.0.0",
|
||||
"googleapis": "^167.0.0",
|
||||
"libreoffice-convert": "^1.7.0",
|
||||
"mailgun.js": "^12.1.0",
|
||||
"mongodb": "^6.20.0",
|
||||
"mailgun.js": "^12.2.0",
|
||||
"mongodb": "^5.9.2",
|
||||
"multer": "^2.0.2",
|
||||
"multer-s3": "^3.0.1",
|
||||
"node-forge": "^1.3.1",
|
||||
"nodemailer": "^7.0.6",
|
||||
"p-limit": "^7.1.1",
|
||||
"parse": "^6.1.1",
|
||||
"node-forge": "^1.3.3",
|
||||
"nodemailer": "^7.0.11",
|
||||
"p-limit": "^7.2.0",
|
||||
"parse": "^7.1.2",
|
||||
"parse-dbtool": "^1.2.0",
|
||||
"parse-server": "^8.2.4",
|
||||
"parse-server-api-mail-adapter": "^4.1.0",
|
||||
"parse-server": "^8.5.0",
|
||||
"parse-server-api-mail-adapter": "^5.0.2",
|
||||
"pdf-lib": "^1.17.1",
|
||||
"posthog-node": "^5.9.1",
|
||||
"posthog-node": "^5.14.0",
|
||||
"qrcode": "^1.5.4",
|
||||
"rate-limiter-flexible": "^7.4.0",
|
||||
"sharp": "^0.34.4",
|
||||
"rate-limiter-flexible": "^8.3.0",
|
||||
"sharp": "^0.34.5",
|
||||
"speakeasy": "^2.0.0",
|
||||
"ws": "^8.18.3"
|
||||
},
|
||||
"type": "module",
|
||||
"devDependencies": {
|
||||
"@babel/eslint-parser": "^7.28.4",
|
||||
"eslint": "^9.36.0",
|
||||
"jasmine": "^5.11.0",
|
||||
"mongodb-runner": "^5.10.0",
|
||||
"nodemon": "^3.1.10",
|
||||
"@babel/eslint-parser": "^7.28.5",
|
||||
"eslint": "^9.39.1",
|
||||
"jasmine": "^5.12.0",
|
||||
"mongodb-runner": "^5.11.1",
|
||||
"nodemon": "^3.1.11",
|
||||
"nyc": "^17.1.0",
|
||||
"prettier": "^3.6.2"
|
||||
"prettier": "^3.7.4"
|
||||
},
|
||||
"overrides": {
|
||||
"ws": "$ws",
|
||||
"parse": "$parse",
|
||||
"form-data": "$form-data"
|
||||
"form-data": "$form-data",
|
||||
"@parse/push-adapter": "$@parse/push-adapter"
|
||||
},
|
||||
"engines": {
|
||||
"node": "18 || 20 || 22"
|
||||
|
||||
Generated
+140
-354
@@ -9,16 +9,17 @@
|
||||
"version": "1.0.6",
|
||||
"license": "AGPL-3.0",
|
||||
"devDependencies": {
|
||||
"husky": "^8.0.0",
|
||||
"lint-staged": "^15.1.0",
|
||||
"prettier": "3.1.0"
|
||||
"husky": "^9.1.7",
|
||||
"lint-staged": "^16.2.7",
|
||||
"prettier": "^3.6.2"
|
||||
}
|
||||
},
|
||||
"node_modules/ansi-escapes": {
|
||||
"version": "7.0.0",
|
||||
"resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-7.0.0.tgz",
|
||||
"integrity": "sha512-GdYO7a61mR0fOlAsvC9/rIHf7L96sBc6dEWzeOu+KAea5bZyQRPIpojrVoI4AXGJS/ycu/fBTdLrUkA4ODrvjw==",
|
||||
"version": "7.2.0",
|
||||
"resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-7.2.0.tgz",
|
||||
"integrity": "sha512-g6LhBsl+GBPRWGWsBtutpzBYuIIdBkLEvad5C/va/74Db018+5TZiyA26cZJAr3Rft5lprVqOIPxf5Vid6tqAw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"environment": "^1.0.0"
|
||||
},
|
||||
@@ -30,10 +31,11 @@
|
||||
}
|
||||
},
|
||||
"node_modules/ansi-regex": {
|
||||
"version": "6.0.1",
|
||||
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz",
|
||||
"integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==",
|
||||
"version": "6.2.2",
|
||||
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz",
|
||||
"integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
},
|
||||
@@ -42,10 +44,11 @@
|
||||
}
|
||||
},
|
||||
"node_modules/ansi-styles": {
|
||||
"version": "6.2.1",
|
||||
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz",
|
||||
"integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==",
|
||||
"version": "6.2.3",
|
||||
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.3.tgz",
|
||||
"integrity": "sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
},
|
||||
@@ -65,23 +68,12 @@
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/chalk": {
|
||||
"version": "5.3.0",
|
||||
"resolved": "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz",
|
||||
"integrity": "sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": "^12.17.0 || ^14.13 || >=16.0.0"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/chalk/chalk?sponsor=1"
|
||||
}
|
||||
},
|
||||
"node_modules/cli-cursor": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-5.0.0.tgz",
|
||||
"integrity": "sha512-aCj4O5wKyszjMmDT4tZj93kxyydN/K5zPWSCe6/0AV/AA1pqe5ZBIw0a2ZfPQV7lL5/yb5HsUreJ6UFAF1tEQw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"restore-cursor": "^5.0.0"
|
||||
},
|
||||
@@ -93,16 +85,17 @@
|
||||
}
|
||||
},
|
||||
"node_modules/cli-truncate": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/cli-truncate/-/cli-truncate-4.0.0.tgz",
|
||||
"integrity": "sha512-nPdaFdQ0h/GEigbPClz11D0v/ZJEwxmeVZGeMo3Z5StPtUTkA9o1lD6QwoirYiSDzbcwn2XcjwmCp68W1IS4TA==",
|
||||
"version": "5.1.1",
|
||||
"resolved": "https://registry.npmjs.org/cli-truncate/-/cli-truncate-5.1.1.tgz",
|
||||
"integrity": "sha512-SroPvNHxUnk+vIW/dOSfNqdy1sPEFkrTk6TUtqLCnBlo3N7TNYYkzzN7uSD6+jVjrdO4+p8nH7JzH6cIvUem6A==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"slice-ansi": "^5.0.0",
|
||||
"string-width": "^7.0.0"
|
||||
"slice-ansi": "^7.1.0",
|
||||
"string-width": "^8.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
"node": ">=20"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
@@ -112,59 +105,32 @@
|
||||
"version": "2.0.20",
|
||||
"resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.20.tgz",
|
||||
"integrity": "sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==",
|
||||
"dev": true
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/commander": {
|
||||
"version": "12.1.0",
|
||||
"resolved": "https://registry.npmjs.org/commander/-/commander-12.1.0.tgz",
|
||||
"integrity": "sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA==",
|
||||
"version": "14.0.2",
|
||||
"resolved": "https://registry.npmjs.org/commander/-/commander-14.0.2.tgz",
|
||||
"integrity": "sha512-TywoWNNRbhoD0BXs1P3ZEScW8W5iKrnbithIl0YH+uCmBd0QpPOA8yc82DS3BIE5Ma6FnBVUsJ7wVUDz4dvOWQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/cross-spawn": {
|
||||
"version": "7.0.3",
|
||||
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz",
|
||||
"integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"path-key": "^3.1.0",
|
||||
"shebang-command": "^2.0.0",
|
||||
"which": "^2.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 8"
|
||||
}
|
||||
},
|
||||
"node_modules/debug": {
|
||||
"version": "4.3.6",
|
||||
"resolved": "https://registry.npmjs.org/debug/-/debug-4.3.6.tgz",
|
||||
"integrity": "sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"ms": "2.1.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"supports-color": {
|
||||
"optional": true
|
||||
}
|
||||
"node": ">=20"
|
||||
}
|
||||
},
|
||||
"node_modules/emoji-regex": {
|
||||
"version": "10.4.0",
|
||||
"resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.4.0.tgz",
|
||||
"integrity": "sha512-EC+0oUMY1Rqm4O6LLrgjtYDvcVYTy7chDnM4Q7030tP4Kwj3u/pR6gP9ygnp2CJMK5Gq+9Q2oqmrFJAz01DXjw==",
|
||||
"dev": true
|
||||
"version": "10.6.0",
|
||||
"resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.6.0.tgz",
|
||||
"integrity": "sha512-toUI84YS5YmxW219erniWD0CIVOo46xGKColeNQRgOzDorgBi1v4D71/OFzgD9GO2UGKIv1C3Sp8DAn0+j5w7A==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/environment": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/environment/-/environment-1.1.0.tgz",
|
||||
"integrity": "sha512-xUtoPkMggbz0MPyPiIWr1Kp4aeWJjDZ6SMvURhimjdZgsRuDplF5/s9hcgGhyXMhs+6vpnuoiZ2kFiu3FMnS8Q==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
},
|
||||
@@ -176,30 +142,8 @@
|
||||
"version": "5.0.1",
|
||||
"resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.1.tgz",
|
||||
"integrity": "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/execa": {
|
||||
"version": "8.0.1",
|
||||
"resolved": "https://registry.npmjs.org/execa/-/execa-8.0.1.tgz",
|
||||
"integrity": "sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"cross-spawn": "^7.0.3",
|
||||
"get-stream": "^8.0.1",
|
||||
"human-signals": "^5.0.0",
|
||||
"is-stream": "^3.0.0",
|
||||
"merge-stream": "^2.0.0",
|
||||
"npm-run-path": "^5.1.0",
|
||||
"onetime": "^6.0.0",
|
||||
"signal-exit": "^4.1.0",
|
||||
"strip-final-newline": "^3.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=16.17"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sindresorhus/execa?sponsor=1"
|
||||
}
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/fill-range": {
|
||||
"version": "7.1.1",
|
||||
@@ -214,10 +158,11 @@
|
||||
}
|
||||
},
|
||||
"node_modules/get-east-asian-width": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/get-east-asian-width/-/get-east-asian-width-1.2.0.tgz",
|
||||
"integrity": "sha512-2nk+7SIVb14QrgXFHcm84tD4bKQz0RxPuMT8Ag5KPOq7J5fEmAg0UbXdTOSHqNuHSU28k55qnceesxXRZGzKWA==",
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/get-east-asian-width/-/get-east-asian-width-1.4.0.tgz",
|
||||
"integrity": "sha512-QZjmEOC+IT1uk6Rx0sX22V6uHWVwbdbxf1faPqJ1QhLdGgsRGCZoyaQBm/piRdJy/D2um6hM1UP7ZEeQ4EkP+Q==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
},
|
||||
@@ -225,49 +170,33 @@
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/get-stream": {
|
||||
"version": "8.0.1",
|
||||
"resolved": "https://registry.npmjs.org/get-stream/-/get-stream-8.0.1.tgz",
|
||||
"integrity": "sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=16"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/human-signals": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/human-signals/-/human-signals-5.0.0.tgz",
|
||||
"integrity": "sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=16.17.0"
|
||||
}
|
||||
},
|
||||
"node_modules/husky": {
|
||||
"version": "8.0.3",
|
||||
"resolved": "https://registry.npmjs.org/husky/-/husky-8.0.3.tgz",
|
||||
"integrity": "sha512-+dQSyqPh4x1hlO1swXBiNb2HzTDN1I2IGLQx1GrBuiqFJfoMrnZWwVmatvSiO+Iz8fBUnf+lekwNo4c2LlXItg==",
|
||||
"version": "9.1.7",
|
||||
"resolved": "https://registry.npmjs.org/husky/-/husky-9.1.7.tgz",
|
||||
"integrity": "sha512-5gs5ytaNjBrh5Ow3zrvdUUY+0VxIuWVL4i9irt6friV+BqdCfmV11CQTWMiBYWHbXhco+J1kHfTOUkePhCDvMA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"bin": {
|
||||
"husky": "lib/bin.js"
|
||||
"husky": "bin.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14"
|
||||
"node": ">=18"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/typicode"
|
||||
}
|
||||
},
|
||||
"node_modules/is-fullwidth-code-point": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-4.0.0.tgz",
|
||||
"integrity": "sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ==",
|
||||
"version": "5.1.0",
|
||||
"resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-5.1.0.tgz",
|
||||
"integrity": "sha512-5XHYaSyiqADb4RnZ1Bdad6cPp8Toise4TzEjcOYDHZkTCbKgiUl7WTUCpNWHuxmDt91wnsZBc9xinNzopv3JMQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"get-east-asian-width": "^1.3.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
"node": ">=18"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
@@ -282,70 +211,39 @@
|
||||
"node": ">=0.12.0"
|
||||
}
|
||||
},
|
||||
"node_modules/is-stream": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz",
|
||||
"integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": "^12.20.0 || ^14.13.1 || >=16.0.0"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/isexe": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
|
||||
"integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/lilconfig": {
|
||||
"version": "3.1.2",
|
||||
"resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-3.1.2.tgz",
|
||||
"integrity": "sha512-eop+wDAvpItUys0FWkHIKeC9ybYrTGbU41U5K7+bttZZeohvnY7M9dZ5kB21GNWiFT2q1OoPTvncPCgSOVO5ow==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=14"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/antonk52"
|
||||
}
|
||||
},
|
||||
"node_modules/lint-staged": {
|
||||
"version": "15.2.9",
|
||||
"resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-15.2.9.tgz",
|
||||
"integrity": "sha512-BZAt8Lk3sEnxw7tfxM7jeZlPRuT4M68O0/CwZhhaw6eeWu0Lz5eERE3m386InivXB64fp/mDID452h48tvKlRQ==",
|
||||
"version": "16.2.7",
|
||||
"resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-16.2.7.tgz",
|
||||
"integrity": "sha512-lDIj4RnYmK7/kXMya+qJsmkRFkGolciXjrsZ6PC25GdTfWOAWetR0ZbsNXRAj1EHHImRSalc+whZFg56F5DVow==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"chalk": "~5.3.0",
|
||||
"commander": "~12.1.0",
|
||||
"debug": "~4.3.6",
|
||||
"execa": "~8.0.1",
|
||||
"lilconfig": "~3.1.2",
|
||||
"listr2": "~8.2.4",
|
||||
"micromatch": "~4.0.7",
|
||||
"pidtree": "~0.6.0",
|
||||
"string-argv": "~0.3.2",
|
||||
"yaml": "~2.5.0"
|
||||
"commander": "^14.0.2",
|
||||
"listr2": "^9.0.5",
|
||||
"micromatch": "^4.0.8",
|
||||
"nano-spawn": "^2.0.0",
|
||||
"pidtree": "^0.6.0",
|
||||
"string-argv": "^0.3.2",
|
||||
"yaml": "^2.8.1"
|
||||
},
|
||||
"bin": {
|
||||
"lint-staged": "bin/lint-staged.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18.12.0"
|
||||
"node": ">=20.17"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://opencollective.com/lint-staged"
|
||||
}
|
||||
},
|
||||
"node_modules/listr2": {
|
||||
"version": "8.2.4",
|
||||
"resolved": "https://registry.npmjs.org/listr2/-/listr2-8.2.4.tgz",
|
||||
"integrity": "sha512-opevsywziHd3zHCVQGAj8zu+Z3yHNkkoYhWIGnq54RrCVwLz0MozotJEDnKsIBLvkfLGN6BLOyAeRrYI0pKA4g==",
|
||||
"version": "9.0.5",
|
||||
"resolved": "https://registry.npmjs.org/listr2/-/listr2-9.0.5.tgz",
|
||||
"integrity": "sha512-ME4Fb83LgEgwNw96RKNvKV4VTLuXfoKudAmm2lP8Kk87KaMK0/Xrx/aAkMWmT8mDb+3MlFDspfbCs7adjRxA2g==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"cli-truncate": "^4.0.0",
|
||||
"cli-truncate": "^5.0.0",
|
||||
"colorette": "^2.0.20",
|
||||
"eventemitter3": "^5.0.1",
|
||||
"log-update": "^6.1.0",
|
||||
@@ -353,7 +251,7 @@
|
||||
"wrap-ansi": "^9.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18.0.0"
|
||||
"node": ">=20.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/log-update": {
|
||||
@@ -361,6 +259,7 @@
|
||||
"resolved": "https://registry.npmjs.org/log-update/-/log-update-6.1.0.tgz",
|
||||
"integrity": "sha512-9ie8ItPR6tjY5uYJh8K/Zrv/RMZ5VOlOWvtZdEHYSTFKZfIBPQa9tOAEeAWhd+AnIneLJ22w5fjOYtoutpWq5w==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"ansi-escapes": "^7.0.0",
|
||||
"cli-cursor": "^5.0.0",
|
||||
@@ -375,43 +274,6 @@
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/log-update/node_modules/is-fullwidth-code-point": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-5.0.0.tgz",
|
||||
"integrity": "sha512-OVa3u9kkBbw7b8Xw5F9P+D/T9X+Z4+JruYVNapTjPYZYUznQ5YfWeFkOj606XYYW8yugTfC8Pj0hYqvi4ryAhA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"get-east-asian-width": "^1.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/log-update/node_modules/slice-ansi": {
|
||||
"version": "7.1.0",
|
||||
"resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-7.1.0.tgz",
|
||||
"integrity": "sha512-bSiSngZ/jWeX93BqeIAbImyTbEihizcwNjFoRUIY/T1wWQsfsm2Vw1agPKylXvQTU7iASGdHhyqRlqQzfz+Htg==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"ansi-styles": "^6.2.1",
|
||||
"is-fullwidth-code-point": "^5.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/chalk/slice-ansi?sponsor=1"
|
||||
}
|
||||
},
|
||||
"node_modules/merge-stream": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz",
|
||||
"integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/micromatch": {
|
||||
"version": "4.0.8",
|
||||
"resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz",
|
||||
@@ -425,23 +287,12 @@
|
||||
"node": ">=8.6"
|
||||
}
|
||||
},
|
||||
"node_modules/mimic-fn": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz",
|
||||
"integrity": "sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/mimic-function": {
|
||||
"version": "5.0.1",
|
||||
"resolved": "https://registry.npmjs.org/mimic-function/-/mimic-function-5.0.1.tgz",
|
||||
"integrity": "sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
},
|
||||
@@ -449,63 +300,35 @@
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/ms": {
|
||||
"version": "2.1.2",
|
||||
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
|
||||
"integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/npm-run-path": {
|
||||
"version": "5.1.0",
|
||||
"resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.1.0.tgz",
|
||||
"integrity": "sha512-sJOdmRGrY2sjNTRMbSvluQqg+8X7ZK61yvzBEIDhz4f8z1TZFYABsqjjCBd/0PUNE9M6QDgHJXQkGUEm7Q+l9Q==",
|
||||
"node_modules/nano-spawn": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/nano-spawn/-/nano-spawn-2.0.0.tgz",
|
||||
"integrity": "sha512-tacvGzUY5o2D8CBh2rrwxyNojUsZNU2zjNTzKQrkgGJQTbGAfArVWXSKMBokBeeg6C7OLRGUEyoFlYbfeWQIqw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"path-key": "^4.0.0"
|
||||
},
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": "^12.20.0 || ^14.13.1 || >=16.0.0"
|
||||
"node": ">=20.17"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/npm-run-path/node_modules/path-key": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/path-key/-/path-key-4.0.0.tgz",
|
||||
"integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
"url": "https://github.com/sindresorhus/nano-spawn?sponsor=1"
|
||||
}
|
||||
},
|
||||
"node_modules/onetime": {
|
||||
"version": "6.0.0",
|
||||
"resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz",
|
||||
"integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==",
|
||||
"version": "7.0.0",
|
||||
"resolved": "https://registry.npmjs.org/onetime/-/onetime-7.0.0.tgz",
|
||||
"integrity": "sha512-VXJjc87FScF88uafS3JllDgvAm+c/Slfz06lorj2uAY34rlUu0Nt+v8wreiImcrgAjjIHp1rXpTDlLOGw29WwQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"mimic-fn": "^4.0.0"
|
||||
"mimic-function": "^5.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
"node": ">=18"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/path-key": {
|
||||
"version": "3.1.1",
|
||||
"resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz",
|
||||
"integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/picomatch": {
|
||||
"version": "2.3.1",
|
||||
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz",
|
||||
@@ -531,10 +354,11 @@
|
||||
}
|
||||
},
|
||||
"node_modules/prettier": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/prettier/-/prettier-3.1.0.tgz",
|
||||
"integrity": "sha512-TQLvXjq5IAibjh8EpBIkNKxO749UEWABoiIZehEPiY4GNpVdhaFKqSTu+QrlU6D2dPAfubRmtJTi4K4YkQ5eXw==",
|
||||
"version": "3.6.2",
|
||||
"resolved": "https://registry.npmjs.org/prettier/-/prettier-3.6.2.tgz",
|
||||
"integrity": "sha512-I7AIg5boAr5R0FFtJ6rCfD+LFsWHp81dolrFD8S79U9tb8Az2nGrJncnMSnys+bpQJfRUzqs9hnA81OAA3hCuQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"bin": {
|
||||
"prettier": "bin/prettier.cjs"
|
||||
},
|
||||
@@ -550,6 +374,7 @@
|
||||
"resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-5.1.0.tgz",
|
||||
"integrity": "sha512-oMA2dcrw6u0YfxJQXm342bFKX/E4sG9rbTzO9ptUcR/e8A33cHuvStiYOwH7fszkZlZ1z/ta9AAoPk2F4qIOHA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"onetime": "^7.0.0",
|
||||
"signal-exit": "^4.1.0"
|
||||
@@ -561,53 +386,19 @@
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/restore-cursor/node_modules/onetime": {
|
||||
"version": "7.0.0",
|
||||
"resolved": "https://registry.npmjs.org/onetime/-/onetime-7.0.0.tgz",
|
||||
"integrity": "sha512-VXJjc87FScF88uafS3JllDgvAm+c/Slfz06lorj2uAY34rlUu0Nt+v8wreiImcrgAjjIHp1rXpTDlLOGw29WwQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"mimic-function": "^5.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/rfdc": {
|
||||
"version": "1.4.1",
|
||||
"resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.4.1.tgz",
|
||||
"integrity": "sha512-q1b3N5QkRUWUl7iyylaaj3kOpIT0N2i9MqIEQXP73GVsN9cw3fdx8X63cEmWhJGi2PPCF23Ijp7ktmd39rawIA==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/shebang-command": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz",
|
||||
"integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"shebang-regex": "^3.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/shebang-regex": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz",
|
||||
"integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/signal-exit": {
|
||||
"version": "4.1.0",
|
||||
"resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz",
|
||||
"integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==",
|
||||
"dev": true,
|
||||
"license": "ISC",
|
||||
"engines": {
|
||||
"node": ">=14"
|
||||
},
|
||||
@@ -616,16 +407,17 @@
|
||||
}
|
||||
},
|
||||
"node_modules/slice-ansi": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-5.0.0.tgz",
|
||||
"integrity": "sha512-FC+lgizVPfie0kkhqUScwRu1O/lF6NOgJmlCgK+/LYxDCTk8sGelYaHDhFcDN+Sn3Cv+3VSa4Byeo+IMCzpMgQ==",
|
||||
"version": "7.1.2",
|
||||
"resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-7.1.2.tgz",
|
||||
"integrity": "sha512-iOBWFgUX7caIZiuutICxVgX1SdxwAVFFKwt1EvMYYec/NWO5meOJ6K5uQxhrYBdQJne4KxiqZc+KptFOWFSI9w==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"ansi-styles": "^6.0.0",
|
||||
"is-fullwidth-code-point": "^4.0.0"
|
||||
"ansi-styles": "^6.2.1",
|
||||
"is-fullwidth-code-point": "^5.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
"node": ">=18"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/chalk/slice-ansi?sponsor=1"
|
||||
@@ -641,27 +433,28 @@
|
||||
}
|
||||
},
|
||||
"node_modules/string-width": {
|
||||
"version": "7.2.0",
|
||||
"resolved": "https://registry.npmjs.org/string-width/-/string-width-7.2.0.tgz",
|
||||
"integrity": "sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==",
|
||||
"version": "8.1.0",
|
||||
"resolved": "https://registry.npmjs.org/string-width/-/string-width-8.1.0.tgz",
|
||||
"integrity": "sha512-Kxl3KJGb/gxkaUMOjRsQ8IrXiGW75O4E3RPjFIINOVH8AMl2SQ/yWdTzWwF3FevIX9LcMAjJW+GRwAlAbTSXdg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"emoji-regex": "^10.3.0",
|
||||
"get-east-asian-width": "^1.0.0",
|
||||
"get-east-asian-width": "^1.3.0",
|
||||
"strip-ansi": "^7.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
"node": ">=20"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/strip-ansi": {
|
||||
"version": "7.1.0",
|
||||
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz",
|
||||
"integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==",
|
||||
"version": "7.1.2",
|
||||
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.2.tgz",
|
||||
"integrity": "sha512-gmBGslpoQJtgnMAvOVqGZpEz9dyoKTCzy2nfz/n8aIFhN/jCE/rCmcxabB6jOOHV+0WNnylOxaxBQPSvcWklhA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"ansi-regex": "^6.0.1"
|
||||
},
|
||||
@@ -672,18 +465,6 @@
|
||||
"url": "https://github.com/chalk/strip-ansi?sponsor=1"
|
||||
}
|
||||
},
|
||||
"node_modules/strip-final-newline": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz",
|
||||
"integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/to-regex-range": {
|
||||
"version": "5.0.1",
|
||||
"resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
|
||||
@@ -696,26 +477,12 @@
|
||||
"node": ">=8.0"
|
||||
}
|
||||
},
|
||||
"node_modules/which": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
|
||||
"integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"isexe": "^2.0.0"
|
||||
},
|
||||
"bin": {
|
||||
"node-which": "bin/node-which"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 8"
|
||||
}
|
||||
},
|
||||
"node_modules/wrap-ansi": {
|
||||
"version": "9.0.0",
|
||||
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-9.0.0.tgz",
|
||||
"integrity": "sha512-G8ura3S+3Z2G+mkgNRq8dqaFZAuxfsxpBB8OCTGRTCtp+l/v9nbFNmCUP1BZMts3G1142MsZfn6eeUKrr4PD1Q==",
|
||||
"version": "9.0.2",
|
||||
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-9.0.2.tgz",
|
||||
"integrity": "sha512-42AtmgqjV+X1VpdOfyTGOYRi0/zsoLqtXQckTmqTeybT+BDIbM/Guxo7x3pE2vtpr1ok6xRqM9OpBe+Jyoqyww==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"ansi-styles": "^6.2.1",
|
||||
"string-width": "^7.0.0",
|
||||
@@ -728,16 +495,35 @@
|
||||
"url": "https://github.com/chalk/wrap-ansi?sponsor=1"
|
||||
}
|
||||
},
|
||||
"node_modules/yaml": {
|
||||
"version": "2.5.0",
|
||||
"resolved": "https://registry.npmjs.org/yaml/-/yaml-2.5.0.tgz",
|
||||
"integrity": "sha512-2wWLbGbYDiSqqIKoPjar3MPgB94ErzCtrNE1FdqGuaO0pi2JGjmE8aW8TDZwzU7vuxcGRdL/4gPQwQ7hD5AMSw==",
|
||||
"node_modules/wrap-ansi/node_modules/string-width": {
|
||||
"version": "7.2.0",
|
||||
"resolved": "https://registry.npmjs.org/string-width/-/string-width-7.2.0.tgz",
|
||||
"integrity": "sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"emoji-regex": "^10.3.0",
|
||||
"get-east-asian-width": "^1.0.0",
|
||||
"strip-ansi": "^7.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/yaml": {
|
||||
"version": "2.8.1",
|
||||
"resolved": "https://registry.npmjs.org/yaml/-/yaml-2.8.1.tgz",
|
||||
"integrity": "sha512-lcYcMxX2PO9XMGvAJkJ3OsNMw+/7FKes7/hgerGUYWIoWu5j/+YQqcZr5JnPZWzOsEBgMbSbiSTn/dv/69Mkpw==",
|
||||
"dev": true,
|
||||
"license": "ISC",
|
||||
"bin": {
|
||||
"yaml": "bin.mjs"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 14"
|
||||
"node": ">= 14.6"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+3
-3
@@ -23,8 +23,8 @@
|
||||
"author": "OpenSignLabs",
|
||||
"license": "AGPL-3.0",
|
||||
"devDependencies": {
|
||||
"husky": "^8.0.0",
|
||||
"lint-staged": "^15.1.0",
|
||||
"prettier": "3.1.0"
|
||||
"husky": "^9.1.7",
|
||||
"lint-staged": "^16.2.7",
|
||||
"prettier": "^3.6.2"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user