Skip to content

Commit db1fb1c

Browse files
fix: issue of signature types
1 parent e03f07a commit db1fb1c

File tree

12 files changed

+152
-42
lines changed

12 files changed

+152
-42
lines changed

apps/OpenSign/public/locales/en/translation.json

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,8 @@
446446
"cutomize-email": "Cutomize Email",
447447
"upgrade-to-customize-email": "Upgrade to customize Email",
448448
"sign-url": "Sign url",
449-
"Mails Sent": "Mails Sent",
449+
"mails-sent": "Mails sent",
450+
"mail-not-delivered": "Mail not delivered",
450451
"document-alert": "Document Alert",
451452
"owner-subscription-expired": "Owner's subscription has expired.",
452453
"subscription-expired": "Subscription Expired",
@@ -687,5 +688,12 @@
687688
"text-field-tour":"Fields of type 'Text' must be filled in advance before the document is sent. If you need the signers to provide input, use the 'Text Input' field instead.",
688689
"attach-signer-tour":"You need to attach a Signer to every role. You can do that by clicking this icon. Once you select a Signer it will be attached to all the fields associated with that role which appear in the same colour.",
689690
"allowed-signature-types": "Allowed signature types",
690-
"at-least-one-signature-type": "At least one signature type should be enabled."
691+
"at-least-one-signature-type": "At least one signature type should be enabled.",
692+
"allowed-signature-types-help": {
693+
"p1": "This signature preference controls which signing options are available to your signers. Only the signature types you select will appear in the signature widget when a document is signed. For example, if you choose only the 'Draw' option in preferences, your signer will see only the 'Draw' option in the signature widget, while the other three options will not be available.",
694+
"l1": "Create a handwritten signature directly on the screen using your finger or a stylus.",
695+
"l2": "Enter your name and choose from various font styles to create a signature.",
696+
"l3": "Upload an existing digital version of your signature.",
697+
"l4": "Use a pre-set signature style saved under 'My Signature' in your settings."
698+
}
691699
}

apps/OpenSign/public/locales/es/translation.json

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,8 @@
446446
"cutomize-email": "Personalizar correo",
447447
"upgrade-to-customize-email": "Mejora para personalizar el correo",
448448
"sign-url": "URL de firma",
449-
"Mails Sent": "Correos enviados",
449+
"mails-sent": "Correos enviados",
450+
"mail-not-delivered": "correo no entregado",
450451
"document-alert": "Alerta de documento",
451452
"owner-subscription-expired": "La suscripción del propietario ha expirado.",
452453
"subscription-expired": "Suscripción expirada",
@@ -687,5 +688,12 @@
687688
"text-field-tour":"Los campos de tipo 'Texto' deben completarse con anticipación antes de enviar el documento. Si necesita que los firmantes proporcionen información, utilice el campo 'Entrada de texto'",
688689
"attach-signer-tour" :"Debe adjuntar un firmante a cada función. Puede hacerlo haciendo clic en este icono. Una vez que seleccione un Firmante, se adjuntará a todos los campos asociados con ese rol que aparecen en el mismo color.",
689690
"allowed-signature-types": "Tipos de firma permitidos",
690-
"at-least-one-signature-type": "Se debe habilitar al menos un tipo de firma."
691+
"at-least-one-signature-type": "Se debe habilitar al menos un tipo de firma.",
692+
"allowed-signature-types-help": {
693+
"p1": "Esta preferencia de firma controla qué opciones de firma están disponibles para sus firmantes. Solo los tipos de firma que seleccione aparecerán en el widget de firma cuando se firme un documento. Por ejemplo, si elige sólo la opción 'Draw' en las preferencias, su firmante verá sólo la opción 'Draw' en el widget de firma, mientras que las otras tres opciones no estarán disponibles.",
694+
"l1": "Cree una firma manuscrita directamente en la pantalla usando su dedo o un lápiz.",
695+
"l2": "Ingrese su nombre y elija entre varios estilos de fuente para crear una firma.",
696+
"l3": "Cargue una versión digital existente de su firma.",
697+
"l4": "Utilice un estilo de firma preestablecido guardado en 'Mi firma' en su configuración."
698+
}
691699
}

apps/OpenSign/public/locales/fr/translation.json

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,8 @@
445445
"cutomize-email": "Personnaliser l'e-mail",
446446
"upgrade-to-customize-email": "Mise à niveau pour personnaliser l'e-mail",
447447
"sign-url": "Signer l'URL",
448-
"Mails Sent": "Mails envoyés avec succès !",
448+
"mails-sent": "Mails envoyés avec succès !",
449+
"mail-not-delivered": "Courrier non distribué",
449450
"document-alert": "Alerte document",
450451
"owner-subscription-expired": "L'abonnement du propriétaire a expiré.",
451452
"subscription-expired": "Abonnement expiré",
@@ -686,5 +687,12 @@
686687
"text-field-tour" :"Les champs de type 'Texte' doivent être remplis à l'avance avant l'envoi du document. Si vous avez besoin que les signataires fournissent des informations, utilisez plutôt le champ 'Saisie de texte'.",
687688
"attach-signer-tour" :"Vous devez associer un signataire à chaque rôle. Vous pouvez le faire en cliquant sur cette icône. Une fois que vous avez sélectionné un signataire, il sera attaché à tous les champs associés à ce rôle qui apparaissent dans la même couleur.",
688689
"allowed-signature-types": "Types de signature autorisés",
689-
"at-least-one-signature-type": "Au moins un type de signature doit être activé."
690+
"at-least-one-signature-type": "Au moins un type de signature doit être activé.",
691+
"allowed-signature-types-help": {
692+
"p1": "Cette préférence de signature contrôle les options de signature disponibles pour vos signataires. Seuls les types de signature que vous sélectionnez apparaîtront dans le widget de signature lorsqu'un document est signé. Par exemple, si vous choisissez uniquement l'option 'Draw' dans les préférences, votre signataire ne verra que l'option 'Draw' dans le widget de signature, tandis que les trois autres options ne seront pas disponibles.",
693+
"l1": "Créez une signature manuscrite directement sur l'écran à l'aide de votre doigt ou d'un stylet.",
694+
"l2": "Entrez votre nom et choisissez parmi différents styles de police pour créer une signature.",
695+
"l3": "Téléchargez une version numérique existante de votre signature.",
696+
"l4": "Utilisez un style de signature prédéfini enregistré sous 'Ma signature' ​​dans vos paramètres."
697+
}
690698
}

apps/OpenSign/src/components/pdf/DefaultSignature.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,7 @@ function DefaultSignature(props) {
2222
<div className="mx-2 pr-2 pt-2 pb-1 text-[15px] text-base-content font-semibold border-b-[1px] border-base-300">
2323
{t("signature")}
2424
</div>
25-
<div
26-
className={`${
27-
props?.isDefault ? "" : "bg-black/70"
28-
} flex flex-col items-center mt-[10px] font-semibold relative`}
29-
>
25+
<div className="flex flex-col items-center mt-[10px] font-semibold relative">
3026
<p className="text-base-content">{t("Your-Signature")}</p>
3127
<div className="op-card shadow-md h-[111px] w-[90%] p-2">
3228
<img
@@ -44,8 +40,10 @@ function DefaultSignature(props) {
4440
{t("auto-sign-all")}
4541
</button>
4642
{!props.isDefault && (
47-
<div className="absolute text-white w-full h-full flex items-center justify-center -rotate-45 text-[11px] cursor-default">
48-
Document creator has disabled this option
43+
<div className="absolute bg-black/70 text-white w-full h-full flex items-center justify-center text-[11px] cursor-default">
44+
<span className="-rotate-45">
45+
Document creator has disabled this option
46+
</span>
4947
</div>
5048
)}
5149
</div>

apps/OpenSign/src/components/pdf/WidgetNameModal.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ const WidgetNameModal = (props) => {
304304
checked={type.enabled}
305305
/>
306306
<div
307-
className="text-[13px] font-medium hover:underline underline-offset-2 cursor-default"
307+
className="text-[13px] font-medium hover:underline underline-offset-2 cursor-default capitalize"
308308
title={`Enabling this allow signers to ${type.name} signature`}
309309
>
310310
{type.name}

apps/OpenSign/src/pages/DraftTemplate.js

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -195,14 +195,9 @@ const DraftTemplate = () => {
195195
}
196196
//function to fetch tenant Details
197197
const fetchTenantDetails = async () => {
198-
const user = JSON.parse(
199-
localStorage.getItem(
200-
`Parse/${localStorage.getItem("parseAppId")}/currentUser`
201-
)
202-
);
203-
if (user) {
198+
if (jwttoken) {
204199
try {
205-
const tenantDetails = await getTenantDetails(user?.objectId);
200+
const tenantDetails = await getTenantDetails("", jwttoken);
206201
if (tenantDetails && tenantDetails === "user does not exist!") {
207202
alert(t("user-not-exist"));
208203
} else if (tenantDetails) {
@@ -262,7 +257,9 @@ const DraftTemplate = () => {
262257
if (isEnableSubscription) {
263258
checkIsSubscribed(documentData[0]?.ExtUserPtr?.Email);
264259
}
265-
setPdfDetails(documentData);
260+
const updatedPdfDetails = [...documentData];
261+
updatedPdfDetails[0].SignatureType = updatedSignatureType;
262+
setPdfDetails(updatedPdfDetails);
266263
setIsSigners(true);
267264
if (documentData[0].Signers && documentData[0].Signers.length > 0) {
268265
setIsSelectId(0);
@@ -338,6 +335,11 @@ const DraftTemplate = () => {
338335
docSignTypes
339336
);
340337
setSignatureType(updatedSignatureType);
338+
if (documentData?.length && documentData?.[0]?.objectId) {
339+
const updatedPdfDetails = [...documentData];
340+
updatedPdfDetails[0].SignatureType = updatedSignatureType;
341+
setPdfDetails(updatedPdfDetails);
342+
}
341343
setSignerUserId(res[0].objectId);
342344
const tourstatus = res[0].TourStatus && res[0].TourStatus;
343345
if (tourstatus && tourstatus.length > 0) {

apps/OpenSign/src/pages/PlaceHolderSign.js

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,9 @@ function PlaceHolderSign() {
320320
});
321321
}
322322
}
323-
setPdfDetails(documentData);
323+
const updatedPdfDetails = [...documentData];
324+
updatedPdfDetails[0].SignatureType = updatedSignatureType;
325+
setPdfDetails(updatedPdfDetails);
324326
//condition when placeholder have empty array with role details and signers array have signers data
325327
//and both array length are same
326328
//this case happen using placeholder form in auto save funtionality to save draft type document without adding any placehlder
@@ -451,6 +453,11 @@ function PlaceHolderSign() {
451453
docSignTypes
452454
);
453455
setSignatureType(updatedSignatureType);
456+
if (documentData?.length && documentData?.[0]?.objectId) {
457+
const updatedPdfDetails = [...documentData];
458+
updatedPdfDetails[0].SignatureType = updatedSignatureType;
459+
setPdfDetails(updatedPdfDetails);
460+
}
454461
setActiveMailAdapter(res[0]?.active_mail_adapter);
455462
setSignerUserId(res[0].objectId);
456463
const tourstatus = res[0].TourStatus && res[0].TourStatus;
@@ -931,7 +938,7 @@ function PlaceHolderSign() {
931938
}, 2000);
932939
return () => clearTimeout(timer);
933940
// eslint-disable-next-line react-hooks/exhaustive-deps
934-
}, [signerPos, signersdata]);
941+
}, [signerPos, signersdata, signatureType]);
935942

936943
// `autosavedetails` is used to save doc details after every 2 sec when changes are happern in placeholder like drag-drop widgets, remove signers
937944
const autosavedetails = async () => {
@@ -950,6 +957,7 @@ function PlaceHolderSign() {
950957
docCls.id = documentId;
951958
docCls.set("Placeholders", signerPos);
952959
docCls.set("Signers", signers);
960+
docCls.set("SignatureType", signatureType);
953961
await docCls.save();
954962
} catch (e) {
955963
console.log("error", e);
@@ -1906,9 +1914,11 @@ function PlaceHolderSign() {
19061914
<ModalUi
19071915
isOpen={isSend}
19081916
title={
1909-
mailStatus === "quotareached"
1910-
? t("quota-mail-head")
1911-
: t("Mails Sent")
1917+
mailStatus === "success"
1918+
? t("mails-sent")
1919+
: mailStatus === "quotareached"
1920+
? t("quota-mail-head")
1921+
: t("mail-not-delivered")
19121922
}
19131923
handleClose={() => {
19141924
setIsSend(false);
@@ -1935,7 +1945,12 @@ function PlaceHolderSign() {
19351945
<div className="my-3">{handleShareList()}</div>
19361946
</div>
19371947
) : (
1938-
<p>{t("placeholder-alert-6")}</p>
1948+
<div className="mb-[10px]">
1949+
<p>{t("placeholder-alert-6")}</p>
1950+
{isCurrUser && (
1951+
<p className="mt-1">{t("placeholder-alert-5")}</p>
1952+
)}
1953+
</div>
19391954
)}
19401955
{!mailStatus && (
19411956
<div className="w-full h-[1px] bg-[#9f9f9f] my-[15px]"></div>

apps/OpenSign/src/pages/Preferences.js

Lines changed: 45 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
signatureTypes
1111
} from "../constant/Utils";
1212
import Parse from "parse";
13-
13+
import { Tooltip as ReactTooltip } from "react-tooltip";
1414
const Preferences = () => {
1515
const { t } = useTranslation();
1616
const [isalert, setIsAlert] = useState({ type: "success", msg: "" });
@@ -84,7 +84,7 @@ const Preferences = () => {
8484
} else {
8585
setIsAlert({
8686
type: "danger",
87-
msg: "please enable at least one signature type"
87+
msg: "Please enable at least one signature type"
8888
});
8989
setTimeout(() => setIsAlert({ type: "success", msg: "" }), 1500);
9090
setIsLoader(false);
@@ -112,7 +112,6 @@ const Preferences = () => {
112112
<Loader />
113113
</div>
114114
)}
115-
116115
<h1 className="ml-4 mt-3 mb-2 font-semibold">
117116
OpenSign™ {t("Preferences")}{" "}
118117
<span>
@@ -128,7 +127,48 @@ const Preferences = () => {
128127
htmlFor="signaturetype"
129128
className="text-[14px] mb-[0.7rem] font-medium"
130129
>
131-
Allowed signature types
130+
{t("allowed-signature-types")}
131+
<a data-tooltip-id="signtypes-tooltip" className="ml-1">
132+
<sup>
133+
<i className="fa-light fa-question rounded-full border-[#33bbff] text-[#33bbff] text-[13px] border-[1px] py-[1.5px] px-[4px]"></i>
134+
</sup>
135+
</a>
136+
<ReactTooltip id="signtypes-tooltip" className="z-[999]">
137+
<div className="max-w-[200px] md:max-w-[450px] text-[11px]">
138+
<p className="font-bold">
139+
{t("allowed-signature-types")}
140+
</p>
141+
<p>{t("allowed-signature-types-help.p1")}</p>
142+
<p className="p-[5px] ml-2">
143+
<ol className="list-disc">
144+
<li>
145+
<span className="font-bold">Draw: </span>
146+
<span>
147+
{t("allowed-signature-types-help.l1")}
148+
</span>
149+
</li>
150+
<li>
151+
<span className="font-bold">Typed: </span>
152+
<span>
153+
{t("allowed-signature-types-help.l2")}
154+
</span>
155+
</li>
156+
<li>
157+
<span className="font-bold">Upload: </span>
158+
<span>
159+
{t("allowed-signature-types-help.l3")}
160+
</span>
161+
</li>
162+
<li>
163+
<span className="font-bold">Default: </span>
164+
<span>
165+
{t("allowed-signature-types-help.l4")}
166+
</span>
167+
</li>
168+
</ol>
169+
</p>
170+
</div>
171+
</ReactTooltip>
132172
</label>
133173
<div className=" ml-[7px] flex flex-col md:flex-row gap-[10px] mb-[0.7rem]">
134174
{signatureType.map((type, i) => (
@@ -144,10 +184,9 @@ const Preferences = () => {
144184
checked={type.enabled}
145185
/>
146186
<div
147-
className="text-[13px] font-medium hover:underline underline-offset-2 cursor-default"
187+
className="text-[13px] font-medium hover:underline underline-offset-2 cursor-default capitalize"
148188
title={`Enabling this allow signers to ${type.name} signature`}
149189
>
150-
{/* {t(`widget-status.${data}`)} */}
151190
{type.name}
152191
</div>
153192
</div>

apps/OpenSign/src/pages/TemplatePlaceholder.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,9 @@ const TemplatePlaceholder = () => {
245245
if (isEnableSubscription) {
246246
checkIsSubscribed(documentData[0]?.ExtUserPtr?.Email);
247247
}
248-
setPdfDetails(documentData);
248+
const updatedPdfDetails = [...documentData];
249+
updatedPdfDetails[0].SignatureType = updatedSignatureType;
250+
setPdfDetails(updatedPdfDetails);
249251
setIsSigners(true);
250252
if (documentData[0].Signers && documentData[0].Signers.length > 0) {
251253
setIsSelectId(0);
@@ -320,6 +322,11 @@ const TemplatePlaceholder = () => {
320322
docSignTypes
321323
);
322324
setSignatureType(updatedSignatureType);
325+
if (documentData?.length && documentData?.[0]?.objectId) {
326+
const updatedPdfDetails = [...documentData];
327+
updatedPdfDetails[0].SignatureType = updatedSignatureType;
328+
setPdfDetails(updatedPdfDetails);
329+
}
323330
setSignerUserId(res[0].objectId);
324331
setCurrentEmail(res[0].Email);
325332
const tourstatus = res[0].TourStatus && res[0].TourStatus;
@@ -693,7 +700,7 @@ const TemplatePlaceholder = () => {
693700
}, 2000);
694701
return () => clearTimeout(timer);
695702
// eslint-disable-next-line react-hooks/exhaustive-deps
696-
}, [signerPos]);
703+
}, [signerPos, signatureType]);
697704

698705
// `autosavedetails` is used to save template details after every 2 sec when changes are happern in placeholder like drag-drop widgets, remove signers
699706
const autosavedetails = async () => {
@@ -715,6 +722,7 @@ const TemplatePlaceholder = () => {
715722
templateCls.id = templateId;
716723
templateCls.set("Placeholders", signerPos);
717724
templateCls.set("Signers", signers);
725+
templateCls.set("SignatureType", signatureType);
718726
await templateCls.save();
719727
} catch (err) {
720728
console.log("error in autosave template", err);

apps/OpenSign/src/script/locales/en/translation.json

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,8 @@
446446
"cutomize-email": "Cutomize Email",
447447
"upgrade-to-customize-email": "Upgrade to customize Email",
448448
"sign-url": "Sign url",
449-
"Mails Sent": "Mails Sent",
449+
"mails-sent": "Mails Sent",
450+
"mail-not-delivered": "Mail not delivered",
450451
"document-alert": "Document Alert",
451452
"owner-subscription-expired": "Owner's subscription has expired.",
452453
"subscription-expired": "Subscription Expired",
@@ -687,5 +688,12 @@
687688
"text-field-tour": "Fields of type 'Text' must be filled in advance before the document is sent. If you need the signers to provide input, use the 'Text Input' field instead.",
688689
"attach-signer-tour": "You need to attach a Signer to every role. You can do that by clicking this icon. Once you select a Signer it will be attached to all the fields associated with that role which appear in the same colour.",
689690
"allowed-signature-types": "Allowed signature types",
690-
"at-least-one-signature-type": "At least one signature type should be enabled."
691+
"at-least-one-signature-type": "At least one signature type should be enabled.",
692+
"allowed-signature-types-help": {
693+
"p1": "This signature preference controls which signing options are available to your signers. Only the signature types you select will appear in the signature widget when a document is signed. For example, if you choose only the 'Draw' option in preferences, your signer will see only the 'Draw' option in the signature widget, while the other three options will not be available.",
694+
"l1": "Create a handwritten signature directly on the screen using your finger or a stylus.",
695+
"l2": "Enter your name and choose from various font styles to create a signature.",
696+
"l3": "Upload an existing digital version of your signature.",
697+
"l4": "Use a pre-set signature style saved under 'My Signature' in your settings."
698+
}
691699
}

0 commit comments

Comments
 (0)