feat: highlight problematic fields (#1330)

This commit is contained in:
Catalin Pit
2024-10-08 13:55:20 +03:00
committed by GitHub
parent cd3d9b701b
commit d40ed94b74
14 changed files with 158 additions and 68 deletions

View File

@ -2,7 +2,7 @@ import { useCallback, useEffect, useState } from 'react';
import { getBoundingClientRect } from '@documenso/lib/client-only/get-bounding-client-rect'; import { getBoundingClientRect } from '@documenso/lib/client-only/get-bounding-client-rect';
import { PDF_VIEWER_PAGE_SELECTOR } from '@documenso/lib/constants/pdf-viewer'; import { PDF_VIEWER_PAGE_SELECTOR } from '@documenso/lib/constants/pdf-viewer';
import { Field } from '@documenso/prisma/client'; import type { Field } from '@documenso/prisma/client';
export const useFieldPageCoords = (field: Field) => { export const useFieldPageCoords = (field: Field) => {
const [coords, setCoords] = useState({ const [coords, setCoords] = useState({

View File

@ -115,7 +115,7 @@ msgstr "Admin"
msgid "Advanced Options" msgid "Advanced Options"
msgstr "Erweiterte Optionen" msgstr "Erweiterte Optionen"
#: packages/ui/primitives/document-flow/add-fields.tsx:527 #: packages/ui/primitives/document-flow/add-fields.tsx:565
#: packages/ui/primitives/template-flow/add-template-fields.tsx:402 #: packages/ui/primitives/template-flow/add-template-fields.tsx:402
msgid "Advanced settings" msgid "Advanced settings"
msgstr "Erweiterte Einstellungen" msgstr "Erweiterte Einstellungen"
@ -178,7 +178,7 @@ msgstr "CC'd"
msgid "Character Limit" msgid "Character Limit"
msgstr "Zeichenbeschränkung" msgstr "Zeichenbeschränkung"
#: packages/ui/primitives/document-flow/add-fields.tsx:950 #: packages/ui/primitives/document-flow/add-fields.tsx:993
#: packages/ui/primitives/template-flow/add-template-fields.tsx:788 #: packages/ui/primitives/template-flow/add-template-fields.tsx:788
msgid "Checkbox" msgid "Checkbox"
msgstr "Checkbox" msgstr "Checkbox"
@ -207,7 +207,7 @@ msgstr "Schließen"
msgid "Configure Direct Recipient" msgid "Configure Direct Recipient"
msgstr "Direkten Empfänger konfigurieren" msgstr "Direkten Empfänger konfigurieren"
#: packages/ui/primitives/document-flow/add-fields.tsx:528 #: packages/ui/primitives/document-flow/add-fields.tsx:566
#: packages/ui/primitives/template-flow/add-template-fields.tsx:403 #: packages/ui/primitives/template-flow/add-template-fields.tsx:403
msgid "Configure the {0} field" msgid "Configure the {0} field"
msgstr "Konfigurieren Sie das Feld {0}" msgstr "Konfigurieren Sie das Feld {0}"
@ -224,7 +224,7 @@ msgstr "In die Zwischenablage kopiert"
msgid "Custom Text" msgid "Custom Text"
msgstr "Benutzerdefinierter Text" msgstr "Benutzerdefinierter Text"
#: packages/ui/primitives/document-flow/add-fields.tsx:846 #: packages/ui/primitives/document-flow/add-fields.tsx:889
#: packages/ui/primitives/template-flow/add-template-fields.tsx:684 #: packages/ui/primitives/template-flow/add-template-fields.tsx:684
msgid "Date" msgid "Date"
msgstr "Datum" msgstr "Datum"
@ -256,7 +256,7 @@ msgstr "Herunterladen"
msgid "Drag & drop your PDF here." msgid "Drag & drop your PDF here."
msgstr "Ziehen Sie Ihr PDF hierher." msgstr "Ziehen Sie Ihr PDF hierher."
#: packages/ui/primitives/document-flow/add-fields.tsx:976 #: packages/ui/primitives/document-flow/add-fields.tsx:1019
#: packages/ui/primitives/template-flow/add-template-fields.tsx:814 #: packages/ui/primitives/template-flow/add-template-fields.tsx:814
msgid "Dropdown" msgid "Dropdown"
msgstr "Dropdown" msgstr "Dropdown"
@ -265,7 +265,7 @@ msgstr "Dropdown"
msgid "Dropdown options" msgid "Dropdown options"
msgstr "Dropdown-Optionen" msgstr "Dropdown-Optionen"
#: packages/ui/primitives/document-flow/add-fields.tsx:794 #: packages/ui/primitives/document-flow/add-fields.tsx:837
#: packages/ui/primitives/document-flow/add-signature.tsx:272 #: packages/ui/primitives/document-flow/add-signature.tsx:272
#: packages/ui/primitives/document-flow/add-signers.tsx:500 #: packages/ui/primitives/document-flow/add-signers.tsx:500
#: packages/ui/primitives/template-flow/add-template-fields.tsx:632 #: packages/ui/primitives/template-flow/add-template-fields.tsx:632
@ -278,6 +278,10 @@ msgstr "E-Mail"
msgid "Email Options" msgid "Email Options"
msgstr "E-Mail-Optionen" msgstr "E-Mail-Optionen"
#: packages/ui/primitives/document-flow/add-fields.tsx:1082
msgid "Empty field"
msgstr ""
#: packages/lib/constants/template.ts:8 #: packages/lib/constants/template.ts:8
msgid "Enable Direct Link Signing" msgid "Enable Direct Link Signing"
msgstr "Direktlink-Signierung aktivieren" msgstr "Direktlink-Signierung aktivieren"
@ -384,7 +388,7 @@ msgstr "Nachricht <0>(Optional)</0>"
msgid "Min" msgid "Min"
msgstr "Min" msgstr "Min"
#: packages/ui/primitives/document-flow/add-fields.tsx:820 #: packages/ui/primitives/document-flow/add-fields.tsx:863
#: packages/ui/primitives/document-flow/add-signature.tsx:298 #: packages/ui/primitives/document-flow/add-signature.tsx:298
#: packages/ui/primitives/document-flow/add-signers.tsx:535 #: packages/ui/primitives/document-flow/add-signers.tsx:535
#: packages/ui/primitives/document-flow/add-signers.tsx:541 #: packages/ui/primitives/document-flow/add-signers.tsx:541
@ -406,12 +410,12 @@ msgstr "Muss unterzeichnen"
msgid "Needs to view" msgid "Needs to view"
msgstr "Muss sehen" msgstr "Muss sehen"
#: packages/ui/primitives/document-flow/add-fields.tsx:631 #: packages/ui/primitives/document-flow/add-fields.tsx:674
#: packages/ui/primitives/template-flow/add-template-fields.tsx:497 #: packages/ui/primitives/template-flow/add-template-fields.tsx:497
msgid "No recipient matching this description was found." msgid "No recipient matching this description was found."
msgstr "Kein passender Empfänger mit dieser Beschreibung gefunden." msgstr "Kein passender Empfänger mit dieser Beschreibung gefunden."
#: packages/ui/primitives/document-flow/add-fields.tsx:647 #: packages/ui/primitives/document-flow/add-fields.tsx:690
#: packages/ui/primitives/template-flow/add-template-fields.tsx:513 #: packages/ui/primitives/template-flow/add-template-fields.tsx:513
msgid "No recipients with this role" msgid "No recipients with this role"
msgstr "Keine Empfänger mit dieser Rolle" msgstr "Keine Empfänger mit dieser Rolle"
@ -436,7 +440,7 @@ msgstr "Kein Unterschriftsfeld gefunden"
msgid "No value found." msgid "No value found."
msgstr "Kein Wert gefunden." msgstr "Kein Wert gefunden."
#: packages/ui/primitives/document-flow/add-fields.tsx:898 #: packages/ui/primitives/document-flow/add-fields.tsx:941
#: packages/ui/primitives/template-flow/add-template-fields.tsx:736 #: packages/ui/primitives/template-flow/add-template-fields.tsx:736
msgid "Number" msgid "Number"
msgstr "Nummer" msgstr "Nummer"
@ -471,7 +475,7 @@ msgstr "Wählen Sie eine Zahl"
msgid "Placeholder" msgid "Placeholder"
msgstr "Platzhalter" msgstr "Platzhalter"
#: packages/ui/primitives/document-flow/add-fields.tsx:924 #: packages/ui/primitives/document-flow/add-fields.tsx:967
#: packages/ui/primitives/template-flow/add-template-fields.tsx:762 #: packages/ui/primitives/template-flow/add-template-fields.tsx:762
msgid "Radio" msgid "Radio"
msgstr "Radio" msgstr "Radio"
@ -507,7 +511,7 @@ msgstr "Rot"
msgid "Redirect URL" msgid "Redirect URL"
msgstr "Weiterleitungs-URL" msgstr "Weiterleitungs-URL"
#: packages/ui/primitives/document-flow/add-fields.tsx:1027 #: packages/ui/primitives/document-flow/add-fields.tsx:1069
msgid "Remove" msgid "Remove"
msgstr "Entfernen" msgstr "Entfernen"
@ -578,7 +582,7 @@ msgstr "Erweiterte Einstellungen anzeigen"
msgid "Sign" msgid "Sign"
msgstr "Unterschreiben" msgstr "Unterschreiben"
#: packages/ui/primitives/document-flow/add-fields.tsx:742 #: packages/ui/primitives/document-flow/add-fields.tsx:785
#: packages/ui/primitives/document-flow/add-signature.tsx:323 #: packages/ui/primitives/document-flow/add-signature.tsx:323
#: packages/ui/primitives/document-flow/field-icon.tsx:52 #: packages/ui/primitives/document-flow/field-icon.tsx:52
#: packages/ui/primitives/template-flow/add-template-fields.tsx:580 #: packages/ui/primitives/template-flow/add-template-fields.tsx:580
@ -626,7 +630,7 @@ msgstr "Einreichen"
msgid "Template title" msgid "Template title"
msgstr "Vorlagentitel" msgstr "Vorlagentitel"
#: packages/ui/primitives/document-flow/add-fields.tsx:872 #: packages/ui/primitives/document-flow/add-fields.tsx:915
#: packages/ui/primitives/template-flow/add-template-fields.tsx:710 #: packages/ui/primitives/template-flow/add-template-fields.tsx:710
msgid "Text" msgid "Text"
msgstr "Text" msgstr "Text"
@ -687,7 +691,7 @@ msgstr "Der Name des Unterzeichners"
msgid "This can be overriden by setting the authentication requirements directly on each recipient in the next step." msgid "This can be overriden by setting the authentication requirements directly on each recipient in the next step."
msgstr "Dies kann überschrieben werden, indem die Authentifizierungsanforderungen im nächsten Schritt direkt für jeden Empfänger festgelegt werden." msgstr "Dies kann überschrieben werden, indem die Authentifizierungsanforderungen im nächsten Schritt direkt für jeden Empfänger festgelegt werden."
#: packages/ui/primitives/document-flow/add-fields.tsx:703 #: packages/ui/primitives/document-flow/add-fields.tsx:746
msgid "This document has already been sent to this recipient. You can no longer edit this recipient." msgid "This document has already been sent to this recipient. You can no longer edit this recipient."
msgstr "Dieses Dokument wurde bereits an diesen Empfänger gesendet. Sie können diesen Empfänger nicht mehr bearbeiten." msgstr "Dieses Dokument wurde bereits an diesen Empfänger gesendet. Sie können diesen Empfänger nicht mehr bearbeiten."
@ -699,7 +703,7 @@ msgstr "Dieses Dokument ist durch ein Passwort geschützt. Bitte geben Sie das P
msgid "This field cannot be modified or deleted. When you share this template's direct link or add it to your public profile, anyone who accesses it can input their name and email, and fill in the fields assigned to them." msgid "This field cannot be modified or deleted. When you share this template's direct link or add it to your public profile, anyone who accesses it can input their name and email, and fill in the fields assigned to them."
msgstr "Dieses Feld kann nicht geändert oder gelöscht werden. Wenn Sie den direkten Link dieser Vorlage teilen oder zu Ihrem öffentlichen Profil hinzufügen, kann jeder, der darauf zugreift, seinen Namen und seine E-Mail-Adresse eingeben und die ihm zugewiesenen Felder ausfüllen." msgstr "Dieses Feld kann nicht geändert oder gelöscht werden. Wenn Sie den direkten Link dieser Vorlage teilen oder zu Ihrem öffentlichen Profil hinzufügen, kann jeder, der darauf zugreift, seinen Namen und seine E-Mail-Adresse eingeben und die ihm zugewiesenen Felder ausfüllen."
#: packages/ui/primitives/document-flow/add-fields.tsx:1007 #: packages/ui/primitives/document-flow/add-fields.tsx:1050
msgid "This recipient can no longer be modified as they have signed a field, or completed the document." msgid "This recipient can no longer be modified as they have signed a field, or completed the document."
msgstr "" msgstr ""
@ -724,7 +728,7 @@ msgstr "Zeitzone"
msgid "Title" msgid "Title"
msgstr "Titel" msgstr "Titel"
#: packages/ui/primitives/document-flow/add-fields.tsx:990 #: packages/ui/primitives/document-flow/add-fields.tsx:1033
#: packages/ui/primitives/template-flow/add-template-fields.tsx:828 #: packages/ui/primitives/template-flow/add-template-fields.tsx:828
msgid "To proceed further, please set at least one value for the {0} field." msgid "To proceed further, please set at least one value for the {0} field."
msgstr "Um fortzufahren, legen Sie bitte mindestens einen Wert für das Feld {0} fest." msgstr "Um fortzufahren, legen Sie bitte mindestens einen Wert für das Feld {0} fest."

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -110,7 +110,7 @@ msgstr "Admin"
msgid "Advanced Options" msgid "Advanced Options"
msgstr "Advanced Options" msgstr "Advanced Options"
#: packages/ui/primitives/document-flow/add-fields.tsx:527 #: packages/ui/primitives/document-flow/add-fields.tsx:565
#: packages/ui/primitives/template-flow/add-template-fields.tsx:402 #: packages/ui/primitives/template-flow/add-template-fields.tsx:402
msgid "Advanced settings" msgid "Advanced settings"
msgstr "Advanced settings" msgstr "Advanced settings"
@ -173,7 +173,7 @@ msgstr "CC'd"
msgid "Character Limit" msgid "Character Limit"
msgstr "Character Limit" msgstr "Character Limit"
#: packages/ui/primitives/document-flow/add-fields.tsx:950 #: packages/ui/primitives/document-flow/add-fields.tsx:993
#: packages/ui/primitives/template-flow/add-template-fields.tsx:788 #: packages/ui/primitives/template-flow/add-template-fields.tsx:788
msgid "Checkbox" msgid "Checkbox"
msgstr "Checkbox" msgstr "Checkbox"
@ -202,7 +202,7 @@ msgstr "Close"
msgid "Configure Direct Recipient" msgid "Configure Direct Recipient"
msgstr "Configure Direct Recipient" msgstr "Configure Direct Recipient"
#: packages/ui/primitives/document-flow/add-fields.tsx:528 #: packages/ui/primitives/document-flow/add-fields.tsx:566
#: packages/ui/primitives/template-flow/add-template-fields.tsx:403 #: packages/ui/primitives/template-flow/add-template-fields.tsx:403
msgid "Configure the {0} field" msgid "Configure the {0} field"
msgstr "Configure the {0} field" msgstr "Configure the {0} field"
@ -219,7 +219,7 @@ msgstr "Copied to clipboard"
msgid "Custom Text" msgid "Custom Text"
msgstr "Custom Text" msgstr "Custom Text"
#: packages/ui/primitives/document-flow/add-fields.tsx:846 #: packages/ui/primitives/document-flow/add-fields.tsx:889
#: packages/ui/primitives/template-flow/add-template-fields.tsx:684 #: packages/ui/primitives/template-flow/add-template-fields.tsx:684
msgid "Date" msgid "Date"
msgstr "Date" msgstr "Date"
@ -251,7 +251,7 @@ msgstr "Download"
msgid "Drag & drop your PDF here." msgid "Drag & drop your PDF here."
msgstr "Drag & drop your PDF here." msgstr "Drag & drop your PDF here."
#: packages/ui/primitives/document-flow/add-fields.tsx:976 #: packages/ui/primitives/document-flow/add-fields.tsx:1019
#: packages/ui/primitives/template-flow/add-template-fields.tsx:814 #: packages/ui/primitives/template-flow/add-template-fields.tsx:814
msgid "Dropdown" msgid "Dropdown"
msgstr "Dropdown" msgstr "Dropdown"
@ -260,7 +260,7 @@ msgstr "Dropdown"
msgid "Dropdown options" msgid "Dropdown options"
msgstr "Dropdown options" msgstr "Dropdown options"
#: packages/ui/primitives/document-flow/add-fields.tsx:794 #: packages/ui/primitives/document-flow/add-fields.tsx:837
#: packages/ui/primitives/document-flow/add-signature.tsx:272 #: packages/ui/primitives/document-flow/add-signature.tsx:272
#: packages/ui/primitives/document-flow/add-signers.tsx:500 #: packages/ui/primitives/document-flow/add-signers.tsx:500
#: packages/ui/primitives/template-flow/add-template-fields.tsx:632 #: packages/ui/primitives/template-flow/add-template-fields.tsx:632
@ -273,6 +273,10 @@ msgstr "Email"
msgid "Email Options" msgid "Email Options"
msgstr "Email Options" msgstr "Email Options"
#: packages/ui/primitives/document-flow/add-fields.tsx:1082
msgid "Empty field"
msgstr "Empty field"
#: packages/lib/constants/template.ts:8 #: packages/lib/constants/template.ts:8
msgid "Enable Direct Link Signing" msgid "Enable Direct Link Signing"
msgstr "Enable Direct Link Signing" msgstr "Enable Direct Link Signing"
@ -379,7 +383,7 @@ msgstr "Message <0>(Optional)</0>"
msgid "Min" msgid "Min"
msgstr "Min" msgstr "Min"
#: packages/ui/primitives/document-flow/add-fields.tsx:820 #: packages/ui/primitives/document-flow/add-fields.tsx:863
#: packages/ui/primitives/document-flow/add-signature.tsx:298 #: packages/ui/primitives/document-flow/add-signature.tsx:298
#: packages/ui/primitives/document-flow/add-signers.tsx:535 #: packages/ui/primitives/document-flow/add-signers.tsx:535
#: packages/ui/primitives/document-flow/add-signers.tsx:541 #: packages/ui/primitives/document-flow/add-signers.tsx:541
@ -401,12 +405,12 @@ msgstr "Needs to sign"
msgid "Needs to view" msgid "Needs to view"
msgstr "Needs to view" msgstr "Needs to view"
#: packages/ui/primitives/document-flow/add-fields.tsx:631 #: packages/ui/primitives/document-flow/add-fields.tsx:674
#: packages/ui/primitives/template-flow/add-template-fields.tsx:497 #: packages/ui/primitives/template-flow/add-template-fields.tsx:497
msgid "No recipient matching this description was found." msgid "No recipient matching this description was found."
msgstr "No recipient matching this description was found." msgstr "No recipient matching this description was found."
#: packages/ui/primitives/document-flow/add-fields.tsx:647 #: packages/ui/primitives/document-flow/add-fields.tsx:690
#: packages/ui/primitives/template-flow/add-template-fields.tsx:513 #: packages/ui/primitives/template-flow/add-template-fields.tsx:513
msgid "No recipients with this role" msgid "No recipients with this role"
msgstr "No recipients with this role" msgstr "No recipients with this role"
@ -431,7 +435,7 @@ msgstr "No signature field found"
msgid "No value found." msgid "No value found."
msgstr "No value found." msgstr "No value found."
#: packages/ui/primitives/document-flow/add-fields.tsx:898 #: packages/ui/primitives/document-flow/add-fields.tsx:941
#: packages/ui/primitives/template-flow/add-template-fields.tsx:736 #: packages/ui/primitives/template-flow/add-template-fields.tsx:736
msgid "Number" msgid "Number"
msgstr "Number" msgstr "Number"
@ -466,7 +470,7 @@ msgstr "Pick a number"
msgid "Placeholder" msgid "Placeholder"
msgstr "Placeholder" msgstr "Placeholder"
#: packages/ui/primitives/document-flow/add-fields.tsx:924 #: packages/ui/primitives/document-flow/add-fields.tsx:967
#: packages/ui/primitives/template-flow/add-template-fields.tsx:762 #: packages/ui/primitives/template-flow/add-template-fields.tsx:762
msgid "Radio" msgid "Radio"
msgstr "Radio" msgstr "Radio"
@ -502,7 +506,7 @@ msgstr "Red"
msgid "Redirect URL" msgid "Redirect URL"
msgstr "Redirect URL" msgstr "Redirect URL"
#: packages/ui/primitives/document-flow/add-fields.tsx:1027 #: packages/ui/primitives/document-flow/add-fields.tsx:1069
msgid "Remove" msgid "Remove"
msgstr "Remove" msgstr "Remove"
@ -573,7 +577,7 @@ msgstr "Show advanced settings"
msgid "Sign" msgid "Sign"
msgstr "Sign" msgstr "Sign"
#: packages/ui/primitives/document-flow/add-fields.tsx:742 #: packages/ui/primitives/document-flow/add-fields.tsx:785
#: packages/ui/primitives/document-flow/add-signature.tsx:323 #: packages/ui/primitives/document-flow/add-signature.tsx:323
#: packages/ui/primitives/document-flow/field-icon.tsx:52 #: packages/ui/primitives/document-flow/field-icon.tsx:52
#: packages/ui/primitives/template-flow/add-template-fields.tsx:580 #: packages/ui/primitives/template-flow/add-template-fields.tsx:580
@ -621,7 +625,7 @@ msgstr "Submit"
msgid "Template title" msgid "Template title"
msgstr "Template title" msgstr "Template title"
#: packages/ui/primitives/document-flow/add-fields.tsx:872 #: packages/ui/primitives/document-flow/add-fields.tsx:915
#: packages/ui/primitives/template-flow/add-template-fields.tsx:710 #: packages/ui/primitives/template-flow/add-template-fields.tsx:710
msgid "Text" msgid "Text"
msgstr "Text" msgstr "Text"
@ -682,7 +686,7 @@ msgstr "The signer's name"
msgid "This can be overriden by setting the authentication requirements directly on each recipient in the next step." msgid "This can be overriden by setting the authentication requirements directly on each recipient in the next step."
msgstr "This can be overriden by setting the authentication requirements directly on each recipient in the next step." msgstr "This can be overriden by setting the authentication requirements directly on each recipient in the next step."
#: packages/ui/primitives/document-flow/add-fields.tsx:703 #: packages/ui/primitives/document-flow/add-fields.tsx:746
msgid "This document has already been sent to this recipient. You can no longer edit this recipient." msgid "This document has already been sent to this recipient. You can no longer edit this recipient."
msgstr "This document has already been sent to this recipient. You can no longer edit this recipient." msgstr "This document has already been sent to this recipient. You can no longer edit this recipient."
@ -694,7 +698,7 @@ msgstr "This document is password protected. Please enter the password to view t
msgid "This field cannot be modified or deleted. When you share this template's direct link or add it to your public profile, anyone who accesses it can input their name and email, and fill in the fields assigned to them." msgid "This field cannot be modified or deleted. When you share this template's direct link or add it to your public profile, anyone who accesses it can input their name and email, and fill in the fields assigned to them."
msgstr "This field cannot be modified or deleted. When you share this template's direct link or add it to your public profile, anyone who accesses it can input their name and email, and fill in the fields assigned to them." msgstr "This field cannot be modified or deleted. When you share this template's direct link or add it to your public profile, anyone who accesses it can input their name and email, and fill in the fields assigned to them."
#: packages/ui/primitives/document-flow/add-fields.tsx:1007 #: packages/ui/primitives/document-flow/add-fields.tsx:1050
msgid "This recipient can no longer be modified as they have signed a field, or completed the document." msgid "This recipient can no longer be modified as they have signed a field, or completed the document."
msgstr "This recipient can no longer be modified as they have signed a field, or completed the document." msgstr "This recipient can no longer be modified as they have signed a field, or completed the document."
@ -719,7 +723,7 @@ msgstr "Time Zone"
msgid "Title" msgid "Title"
msgstr "Title" msgstr "Title"
#: packages/ui/primitives/document-flow/add-fields.tsx:990 #: packages/ui/primitives/document-flow/add-fields.tsx:1033
#: packages/ui/primitives/template-flow/add-template-fields.tsx:828 #: packages/ui/primitives/template-flow/add-template-fields.tsx:828
msgid "To proceed further, please set at least one value for the {0} field." msgid "To proceed further, please set at least one value for the {0} field."
msgstr "To proceed further, please set at least one value for the {0} field." msgstr "To proceed further, please set at least one value for the {0} field."

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -115,7 +115,7 @@ msgstr "Administrateur"
msgid "Advanced Options" msgid "Advanced Options"
msgstr "Options avancées" msgstr "Options avancées"
#: packages/ui/primitives/document-flow/add-fields.tsx:527 #: packages/ui/primitives/document-flow/add-fields.tsx:565
#: packages/ui/primitives/template-flow/add-template-fields.tsx:402 #: packages/ui/primitives/template-flow/add-template-fields.tsx:402
msgid "Advanced settings" msgid "Advanced settings"
msgstr "Paramètres avancés" msgstr "Paramètres avancés"
@ -174,7 +174,7 @@ msgstr "CC'd"
msgid "Character Limit" msgid "Character Limit"
msgstr "Limite de caractères" msgstr "Limite de caractères"
#: packages/ui/primitives/document-flow/add-fields.tsx:950 #: packages/ui/primitives/document-flow/add-fields.tsx:993
#: packages/ui/primitives/template-flow/add-template-fields.tsx:788 #: packages/ui/primitives/template-flow/add-template-fields.tsx:788
msgid "Checkbox" msgid "Checkbox"
msgstr "Case à cocher" msgstr "Case à cocher"
@ -203,7 +203,7 @@ msgstr "Fermer"
msgid "Configure Direct Recipient" msgid "Configure Direct Recipient"
msgstr "Configurer le destinataire direct" msgstr "Configurer le destinataire direct"
#: packages/ui/primitives/document-flow/add-fields.tsx:528 #: packages/ui/primitives/document-flow/add-fields.tsx:566
#: packages/ui/primitives/template-flow/add-template-fields.tsx:403 #: packages/ui/primitives/template-flow/add-template-fields.tsx:403
msgid "Configure the {0} field" msgid "Configure the {0} field"
msgstr "Configurer le champ {0}" msgstr "Configurer le champ {0}"
@ -220,7 +220,7 @@ msgstr "Copié dans le presse-papiers"
msgid "Custom Text" msgid "Custom Text"
msgstr "Texte personnalisé" msgstr "Texte personnalisé"
#: packages/ui/primitives/document-flow/add-fields.tsx:846 #: packages/ui/primitives/document-flow/add-fields.tsx:889
#: packages/ui/primitives/template-flow/add-template-fields.tsx:684 #: packages/ui/primitives/template-flow/add-template-fields.tsx:684
msgid "Date" msgid "Date"
msgstr "Date" msgstr "Date"
@ -252,7 +252,7 @@ msgstr "Télécharger"
msgid "Drag & drop your PDF here." msgid "Drag & drop your PDF here."
msgstr "Faites glisser et déposez votre PDF ici." msgstr "Faites glisser et déposez votre PDF ici."
#: packages/ui/primitives/document-flow/add-fields.tsx:976 #: packages/ui/primitives/document-flow/add-fields.tsx:1019
#: packages/ui/primitives/template-flow/add-template-fields.tsx:814 #: packages/ui/primitives/template-flow/add-template-fields.tsx:814
msgid "Dropdown" msgid "Dropdown"
msgstr "Liste déroulante" msgstr "Liste déroulante"
@ -261,7 +261,7 @@ msgstr "Liste déroulante"
msgid "Dropdown options" msgid "Dropdown options"
msgstr "Options de liste déroulante" msgstr "Options de liste déroulante"
#: packages/ui/primitives/document-flow/add-fields.tsx:794 #: packages/ui/primitives/document-flow/add-fields.tsx:837
#: packages/ui/primitives/document-flow/add-signature.tsx:272 #: packages/ui/primitives/document-flow/add-signature.tsx:272
#: packages/ui/primitives/document-flow/add-signers.tsx:500 #: packages/ui/primitives/document-flow/add-signers.tsx:500
#: packages/ui/primitives/template-flow/add-template-fields.tsx:632 #: packages/ui/primitives/template-flow/add-template-fields.tsx:632
@ -274,6 +274,10 @@ msgstr "Email"
msgid "Email Options" msgid "Email Options"
msgstr "Options d'email" msgstr "Options d'email"
#: packages/ui/primitives/document-flow/add-fields.tsx:1082
msgid "Empty field"
msgstr ""
#: packages/lib/constants/template.ts:8 #: packages/lib/constants/template.ts:8
msgid "Enable Direct Link Signing" msgid "Enable Direct Link Signing"
msgstr "Activer la signature de lien direct" msgstr "Activer la signature de lien direct"
@ -380,7 +384,7 @@ msgstr "Message <0>(Optionnel)</0>"
msgid "Min" msgid "Min"
msgstr "Min" msgstr "Min"
#: packages/ui/primitives/document-flow/add-fields.tsx:820 #: packages/ui/primitives/document-flow/add-fields.tsx:863
#: packages/ui/primitives/document-flow/add-signature.tsx:298 #: packages/ui/primitives/document-flow/add-signature.tsx:298
#: packages/ui/primitives/document-flow/add-signers.tsx:535 #: packages/ui/primitives/document-flow/add-signers.tsx:535
#: packages/ui/primitives/document-flow/add-signers.tsx:541 #: packages/ui/primitives/document-flow/add-signers.tsx:541
@ -402,12 +406,12 @@ msgstr "Nécessite une signature"
msgid "Needs to view" msgid "Needs to view"
msgstr "Nécessite une visualisation" msgstr "Nécessite une visualisation"
#: packages/ui/primitives/document-flow/add-fields.tsx:631 #: packages/ui/primitives/document-flow/add-fields.tsx:674
#: packages/ui/primitives/template-flow/add-template-fields.tsx:497 #: packages/ui/primitives/template-flow/add-template-fields.tsx:497
msgid "No recipient matching this description was found." msgid "No recipient matching this description was found."
msgstr "Aucun destinataire correspondant à cette description n'a été trouvé." msgstr "Aucun destinataire correspondant à cette description n'a été trouvé."
#: packages/ui/primitives/document-flow/add-fields.tsx:647 #: packages/ui/primitives/document-flow/add-fields.tsx:690
#: packages/ui/primitives/template-flow/add-template-fields.tsx:513 #: packages/ui/primitives/template-flow/add-template-fields.tsx:513
msgid "No recipients with this role" msgid "No recipients with this role"
msgstr "Aucun destinataire avec ce rôle" msgstr "Aucun destinataire avec ce rôle"
@ -432,7 +436,7 @@ msgstr "Aucun champ de signature trouvé"
msgid "No value found." msgid "No value found."
msgstr "Aucune valeur trouvée." msgstr "Aucune valeur trouvée."
#: packages/ui/primitives/document-flow/add-fields.tsx:898 #: packages/ui/primitives/document-flow/add-fields.tsx:941
#: packages/ui/primitives/template-flow/add-template-fields.tsx:736 #: packages/ui/primitives/template-flow/add-template-fields.tsx:736
msgid "Number" msgid "Number"
msgstr "Numéro" msgstr "Numéro"
@ -467,7 +471,7 @@ msgstr "Choisissez un numéro"
msgid "Placeholder" msgid "Placeholder"
msgstr "Espace réservé" msgstr "Espace réservé"
#: packages/ui/primitives/document-flow/add-fields.tsx:924 #: packages/ui/primitives/document-flow/add-fields.tsx:967
#: packages/ui/primitives/template-flow/add-template-fields.tsx:762 #: packages/ui/primitives/template-flow/add-template-fields.tsx:762
msgid "Radio" msgid "Radio"
msgstr "Radio" msgstr "Radio"
@ -503,7 +507,7 @@ msgstr "Rouge"
msgid "Redirect URL" msgid "Redirect URL"
msgstr "URL de redirection" msgstr "URL de redirection"
#: packages/ui/primitives/document-flow/add-fields.tsx:1027 #: packages/ui/primitives/document-flow/add-fields.tsx:1069
msgid "Remove" msgid "Remove"
msgstr "Retirer" msgstr "Retirer"
@ -574,7 +578,7 @@ msgstr "Afficher les paramètres avancés"
msgid "Sign" msgid "Sign"
msgstr "Signer" msgstr "Signer"
#: packages/ui/primitives/document-flow/add-fields.tsx:742 #: packages/ui/primitives/document-flow/add-fields.tsx:785
#: packages/ui/primitives/document-flow/add-signature.tsx:323 #: packages/ui/primitives/document-flow/add-signature.tsx:323
#: packages/ui/primitives/document-flow/field-icon.tsx:52 #: packages/ui/primitives/document-flow/field-icon.tsx:52
#: packages/ui/primitives/template-flow/add-template-fields.tsx:580 #: packages/ui/primitives/template-flow/add-template-fields.tsx:580
@ -622,7 +626,7 @@ msgstr "Soumettre"
msgid "Template title" msgid "Template title"
msgstr "Titre du modèle" msgstr "Titre du modèle"
#: packages/ui/primitives/document-flow/add-fields.tsx:872 #: packages/ui/primitives/document-flow/add-fields.tsx:915
#: packages/ui/primitives/template-flow/add-template-fields.tsx:710 #: packages/ui/primitives/template-flow/add-template-fields.tsx:710
msgid "Text" msgid "Text"
msgstr "Texte" msgstr "Texte"
@ -683,7 +687,7 @@ msgstr "Le nom du signataire"
msgid "This can be overriden by setting the authentication requirements directly on each recipient in the next step." msgid "This can be overriden by setting the authentication requirements directly on each recipient in the next step."
msgstr "Cela peut être remplacé par le paramétrage direct des exigences d'authentification pour chaque destinataire à l'étape suivante." msgstr "Cela peut être remplacé par le paramétrage direct des exigences d'authentification pour chaque destinataire à l'étape suivante."
#: packages/ui/primitives/document-flow/add-fields.tsx:703 #: packages/ui/primitives/document-flow/add-fields.tsx:746
msgid "This document has already been sent to this recipient. You can no longer edit this recipient." msgid "This document has already been sent to this recipient. You can no longer edit this recipient."
msgstr "Ce document a déjà été envoyé à ce destinataire. Vous ne pouvez plus modifier ce destinataire." msgstr "Ce document a déjà été envoyé à ce destinataire. Vous ne pouvez plus modifier ce destinataire."
@ -695,7 +699,7 @@ msgstr "Ce document est protégé par mot de passe. Veuillez entrer le mot de pa
msgid "This field cannot be modified or deleted. When you share this template's direct link or add it to your public profile, anyone who accesses it can input their name and email, and fill in the fields assigned to them." msgid "This field cannot be modified or deleted. When you share this template's direct link or add it to your public profile, anyone who accesses it can input their name and email, and fill in the fields assigned to them."
msgstr "Ce champ ne peut pas être modifié ou supprimé. Lorsque vous partagez le lien direct de ce modèle ou l'ajoutez à votre profil public, toute personne qui y accède peut saisir son nom et son email, et remplir les champs qui lui sont attribués." msgstr "Ce champ ne peut pas être modifié ou supprimé. Lorsque vous partagez le lien direct de ce modèle ou l'ajoutez à votre profil public, toute personne qui y accède peut saisir son nom et son email, et remplir les champs qui lui sont attribués."
#: packages/ui/primitives/document-flow/add-fields.tsx:1007 #: packages/ui/primitives/document-flow/add-fields.tsx:1050
msgid "This recipient can no longer be modified as they have signed a field, or completed the document." msgid "This recipient can no longer be modified as they have signed a field, or completed the document."
msgstr "" msgstr ""
@ -720,7 +724,7 @@ msgstr "Fuseau horaire"
msgid "Title" msgid "Title"
msgstr "Titre" msgstr "Titre"
#: packages/ui/primitives/document-flow/add-fields.tsx:990 #: packages/ui/primitives/document-flow/add-fields.tsx:1033
#: packages/ui/primitives/template-flow/add-template-fields.tsx:828 #: packages/ui/primitives/template-flow/add-template-fields.tsx:828
msgid "To proceed further, please set at least one value for the {0} field." msgid "To proceed further, please set at least one value for the {0} field."
msgstr "Pour continuer, veuillez définir au moins une valeur pour le champ {0}." msgstr "Pour continuer, veuillez définir au moins une valeur pour le champ {0}."

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -39,3 +39,27 @@ export const validateFieldsInserted = (fields: Field[]): boolean => {
return uninsertedFields.length === 0; return uninsertedFields.length === 0;
}; };
export const validateFieldsUninserted = (): boolean => {
const fieldCardElements = document.getElementsByClassName('react-draggable');
const errorElements: HTMLElement[] = [];
Array.from(fieldCardElements).forEach((element) => {
const innerDiv = element.querySelector('div');
const hasError = innerDiv?.getAttribute('data-error') === 'true';
if (hasError) {
errorElements.push(element as HTMLElement);
} else {
element.removeAttribute('data-error');
}
});
if (errorElements.length > 0) {
errorElements[0].scrollIntoView({ behavior: 'smooth', block: 'center' });
return false;
}
return errorElements.length === 0;
};

View File

@ -49,7 +49,7 @@ export function FieldToolTip({ children, color, className = '', field }: FieldTo
}} }}
> >
<TooltipProvider> <TooltipProvider>
<Tooltip delayDuration={0} open={!field.inserted}> <Tooltip delayDuration={0} open={!field.inserted || !field.fieldMeta}>
<TooltipTrigger className="absolute inset-0 w-full"></TooltipTrigger> <TooltipTrigger className="absolute inset-0 w-full"></TooltipTrigger>
<TooltipContent className={tooltipVariants({ color, className })} sideOffset={2}> <TooltipContent className={tooltipVariants({ color, className })} sideOffset={2}>

View File

@ -5,6 +5,7 @@ import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
import { Caveat } from 'next/font/google'; import { Caveat } from 'next/font/google';
import { Trans, msg } from '@lingui/macro'; import { Trans, msg } from '@lingui/macro';
import { Prisma } from '@prisma/client';
import { import {
CalendarDays, CalendarDays,
Check, Check,
@ -32,6 +33,7 @@ import {
ZFieldMetaSchema, ZFieldMetaSchema,
} from '@documenso/lib/types/field-meta'; } from '@documenso/lib/types/field-meta';
import { nanoid } from '@documenso/lib/universal/id'; import { nanoid } from '@documenso/lib/universal/id';
import { validateFieldsUninserted } from '@documenso/lib/utils/fields';
import { import {
canRecipientBeModified, canRecipientBeModified,
canRecipientFieldsBeModified, canRecipientFieldsBeModified,
@ -39,6 +41,7 @@ import {
import type { Field, Recipient } from '@documenso/prisma/client'; import type { Field, Recipient } from '@documenso/prisma/client';
import { FieldType, RecipientRole, SendStatus } from '@documenso/prisma/client'; import { FieldType, RecipientRole, SendStatus } from '@documenso/prisma/client';
import { FieldToolTip } from '../../components/field/field-tooltip';
import { getSignerColorStyles, useSignerColors } from '../../lib/signer-colors'; import { getSignerColorStyles, useSignerColors } from '../../lib/signer-colors';
import { cn } from '../../lib/utils'; import { cn } from '../../lib/utils';
import { Alert, AlertDescription } from '../alert'; import { Alert, AlertDescription } from '../alert';
@ -96,12 +99,6 @@ export type AddFieldsFormProps = {
teamId?: number; teamId?: number;
}; };
/*
I hate this, but due to TailwindCSS JIT, I couldnn't find a better way to do this for now.
TODO: Try to find a better way to do this.
*/
export const AddFieldsFormPartial = ({ export const AddFieldsFormPartial = ({
documentFlow, documentFlow,
hideRecipients = false, hideRecipients = false,
@ -195,6 +192,7 @@ export const AddFieldsFormPartial = ({
const selectedSignerStyles = useSignerColors( const selectedSignerStyles = useSignerColors(
selectedSignerIndex === -1 ? 0 : selectedSignerIndex, selectedSignerIndex === -1 ? 0 : selectedSignerIndex,
); );
const [validateUninsertedFields, setValidateUninsertedFields] = useState(false);
const filterFieldsWithEmptyValues = (fields: typeof localFields, fieldType: string) => const filterFieldsWithEmptyValues = (fields: typeof localFields, fieldType: string) =>
fields fields
@ -228,6 +226,38 @@ export const AddFieldsFormPartial = ({
const hasErrors = const hasErrors =
emptyCheckboxFields.length > 0 || emptyRadioFields.length > 0 || emptySelectFields.length > 0; emptyCheckboxFields.length > 0 || emptyRadioFields.length > 0 || emptySelectFields.length > 0;
const fieldsWithError = useMemo(() => {
const fields = localFields.filter((field) => {
const hasError =
((field.type === FieldType.CHECKBOX ||
field.type === FieldType.RADIO ||
field.type === FieldType.DROPDOWN) &&
field.fieldMeta === undefined) ||
(field.fieldMeta && 'values' in field.fieldMeta && field?.fieldMeta?.values?.length === 0);
return hasError;
});
const mappedFields = fields.map((field) => ({
id: field.nativeId ?? 0,
secondaryId: field.formId,
documentId: null,
templateId: null,
recipientId: 0,
type: field.type,
page: field.pageNumber,
positionX: new Prisma.Decimal(field.pageX),
positionY: new Prisma.Decimal(field.pageY),
width: new Prisma.Decimal(field.pageWidth),
height: new Prisma.Decimal(field.pageHeight),
customText: '',
inserted: true,
fieldMeta: field.fieldMeta ?? null,
}));
return mappedFields;
}, [localFields]);
const isFieldsDisabled = useMemo(() => { const isFieldsDisabled = useMemo(() => {
if (!selectedSigner) { if (!selectedSigner) {
return true; return true;
@ -515,6 +545,14 @@ export const AddFieldsFormPartial = ({
if (!everySignerHasSignature) { if (!everySignerHasSignature) {
setIsMissingSignatureDialogVisible(true); setIsMissingSignatureDialogVisible(true);
return;
}
setValidateUninsertedFields(true);
const isFieldsValid = validateFieldsUninserted();
if (!isFieldsValid) {
return;
} else { } else {
void onFormSubmit(); void onFormSubmit();
} }
@ -566,6 +604,10 @@ export const AddFieldsFormPartial = ({
{isDocumentPdfLoaded && {isDocumentPdfLoaded &&
localFields.map((field, index) => { localFields.map((field, index) => {
const recipientIndex = recipients.findIndex((r) => r.email === field.signerEmail); const recipientIndex = recipients.findIndex((r) => r.email === field.signerEmail);
const hasFieldError =
emptyCheckboxFields.find((f) => f.formId === field.formId) ||
emptyRadioFields.find((f) => f.formId === field.formId) ||
emptySelectFields.find((f) => f.formId === field.formId);
return ( return (
<FieldItem <FieldItem
@ -590,6 +632,7 @@ export const AddFieldsFormPartial = ({
handleAdvancedSettings(); handleAdvancedSettings();
}} }}
hideRecipients={hideRecipients} hideRecipients={hideRecipients}
hasErrors={!!hasFieldError}
/> />
); );
})} })}
@ -1018,7 +1061,6 @@ export const AddFieldsFormPartial = ({
<DocumentFlowFormContainerActions <DocumentFlowFormContainerActions
loading={isSubmitting} loading={isSubmitting}
disabled={isSubmitting} disabled={isSubmitting}
disableNextStep={hasErrors}
onGoBackClick={() => { onGoBackClick={() => {
previousStep(); previousStep();
remove(); remove();
@ -1035,6 +1077,11 @@ export const AddFieldsFormPartial = ({
/> />
</> </>
)} )}
{validateUninsertedFields && fieldsWithError[0] && (
<FieldToolTip key={fieldsWithError[0].id} field={fieldsWithError[0]} color="warning">
<Trans>Empty field</Trans>
</FieldToolTip>
)}
</> </>
); );
}; };

View File

@ -44,6 +44,7 @@ export type FieldItemProps = {
onBlur?: () => void; onBlur?: () => void;
recipientIndex?: number; recipientIndex?: number;
hideRecipients?: boolean; hideRecipients?: boolean;
hasErrors?: boolean;
}; };
export const FieldItem = ({ export const FieldItem = ({
@ -61,6 +62,7 @@ export const FieldItem = ({
onAdvancedSettings, onAdvancedSettings,
recipientIndex = 0, recipientIndex = 0,
hideRecipients = false, hideRecipients = false,
hasErrors,
}: FieldItemProps) => { }: FieldItemProps) => {
const [active, setActive] = useState(false); const [active, setActive] = useState(false);
const [coords, setCoords] = useState({ const [coords, setCoords] = useState({
@ -201,10 +203,15 @@ export const FieldItem = ({
<div <div
className={cn( className={cn(
'relative flex h-full w-full items-center justify-center bg-white', 'relative flex h-full w-full items-center justify-center bg-white',
!hasErrors && signerStyles.default.base,
!hasErrors && signerStyles.default.fieldItem,
{
'rounded-lg border border-red-400 bg-red-400/20 shadow-[0_0_0_5px_theme(colors.red.500/10%),0_0_0_2px_theme(colors.red.500/40%),0_0_0_0.5px_theme(colors.red.500)]':
hasErrors,
},
!fixedSize && '[container-type:size]', !fixedSize && '[container-type:size]',
signerStyles.default.base,
signerStyles.default.fieldItem,
)} )}
data-error={hasErrors ? 'true' : undefined}
onClick={() => { onClick={() => {
setSettingsActive((prev) => !prev); setSettingsActive((prev) => !prev);
onFocus?.(); onFocus?.();