Skip to content

Commit e9d0af7

Browse files
v2.13.0
refactor: remove unnecessary code
1 parent 031673f commit e9d0af7

File tree

17 files changed

+1510
-716
lines changed

17 files changed

+1510
-716
lines changed

apps/OpenSign/package-lock.json

Lines changed: 1364 additions & 578 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/OpenSign/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"@react-pdf/renderer": "^4.1.6",
1111
"@reduxjs/toolkit": "^2.5.1",
1212
"axios": "^1.7.9",
13+
"css-minimizer-webpack-plugin": "^7.0.0",
1314
"file-saver": "^2.0.5",
1415
"i18next": "^23.16.8",
1516
"i18next-browser-languagedetector": "^8.0.2",
@@ -101,7 +102,6 @@
101102
"@babel/runtime-corejs2": "^7.26.7",
102103
"autoprefixer": "^10.4.20",
103104
"babel-loader": "^9.2.1",
104-
"clean-webpack-plugin": "^4.0.0",
105105
"commitizen": "^4.3.1",
106106
"concurrently": "^9.1.2",
107107
"css-loader": "^7.1.2",

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -666,11 +666,11 @@
666666
"insufficient-credits": "Nicht genügend Signatur-Credits",
667667
"insufficient-credits-mssg": "Der Besitzer dieses Dokuments verfügt derzeit nicht über die notwendigen OpenSign-Credits, damit Sie unterzeichnen können. Bitte wenden Sie sich an den Besitzer, wenn Sie weitere Informationen benötigen.",
668668
"angular-npm-mssg-1": "Um OpenSign in Ihr Angular-Projekt zu integrieren, führen Sie einfach den folgenden Befehl aus:",
669-
"quota-mail-info-head": "Monatliches Limit für Signaturanfragen per E-Mail",
670-
"quota-mail-info": "Sie können bis zu 15 Signaturanfragen per E-Mail pro Monat senden. Jetzt upgraden, um unbegrenzt Signaturanfragen direkt zu senden.",
669+
"quota-mail-info-head": "Monatliches E-Mail-Limit",
670+
"quota-mail-info": "Um die Servicequalität aufrechtzuerhalten und Spam zu verhindern, erlaubt OpenSign bis zu 15 E-Mails pro Monat im kostenlosen Plan. Upgraden Sie jetzt für unbegrenzten E-Mail-Versand.",
671671
"quota-mail-reset": "Ihre Credits für Signaturanfragen per E-Mail werden zurückgesetzt am",
672672
"quota-mail": "Sie haben Ihr monatliches Limit von 15 Signaturanfragen per E-Mail erreicht. Jetzt upgraden, um weiter E-Mails direkt zu senden.",
673-
"quota-mail-tip": "Tipp: Sie können weiterhin <1>unbegrenzt Dokumente</1> signieren, indem Sie die Signaturanfragelinks manuell teilen.",
673+
"quota-mail-tip": "Tipp: Sie können weiterhin <1>unbegrenzt Dokumente</1> signieren, indem Sie den Signaturanfragelink manuell teilen.",
674674
"quota-mail-head": "Kontingent erreicht",
675675
"unauthorized-modal": "Sie haben keine Berechtigung, diese Aktion auszuführen. Bitte kontaktieren Sie {{adminEmail}}.",
676676
"sent-this-month": "Diesen Monat gesendet",

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -667,11 +667,11 @@
667667
"insufficient-credits": "Insufficient signing credits",
668668
"insufficient-credits-mssg": "The owner of this document currently lacks the necessary OpenSign credits for you to sign. Please reach out to the owner if you require further details.",
669669
"angular-npm-mssg-1": "To integrate OpenSign into your Angular project, simply run the following command:",
670-
"quota-mail-info-head": "Monthly request signatures email limit",
671-
"quota-mail-info": "You can send upto 15 signature request emails every month. Upgrade now to send unlimited signing requests directly.",
670+
"quota-mail-info-head": "Monthly Email Limit",
671+
"quota-mail-info": "To maintain service quality and prevent spam, OpenSign allows up to 15 emails per month on the free plan. Upgrade now for unlimited email sending.",
672672
"quota-mail-reset": "Your signature request email credits will be reset on",
673673
"quota-mail": "You've reached your limit of 15 signature request emails for this month. Upgrade now to continue sending emails directly.",
674-
"quota-mail-tip": "Tip: You can still sign <1>unlimited documents</1> by manually sharing the signing request links.",
674+
"quota-mail-tip": "Tip: You can still sign <1>unlimited documents</1> by manually sharing the signing request link.",
675675
"quota-mail-head": "Quota reached",
676676
"unauthorized-modal": "You don't have permission to perform this action, please contact {{adminEmail}}.",
677677
"sent-this-month": "Sent this month",

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -667,11 +667,11 @@
667667
"insufficient-credits": "Créditos de firma insuficientes",
668668
"insufficient-credits-mssg": "El propietario de este documento actualmente carece de los créditos OpenSign necesarios para que puedas firmarlo. Por favor, contacta al propietario si necesitas más detalles.",
669669
"angular-npm-mssg-1": "Para integrar OpenSign a tu proyecto Angular, simplemente ejecuta los siguientes comandos:",
670-
"quota-mail-info-head": "Límite mensual de solicitudes de firma por correo",
671-
"quota-mail-info": "Puedes enviar hasta 15 solicitudes de firma por correo cada mes. Mejora ahora para enviar solicitudes de firma sin límite.",
670+
"quota-mail-info-head": "Límite mensual de correos electrónicos",
671+
"quota-mail-info": "Para mantener la calidad del servicio y prevenir el spam, OpenSign permite hasta 15 correos electrónicos por mes en el plan gratuito. Mejora tu plan ahora para envíos ilimitados de correos electrónicos.",
672672
"quota-mail-reset": "Los créditos de tu correo electrónico de solicitud de firma se restablecerán el",
673673
"quota-mail": "Has alcanzado tu límite de 15 solicitudes de firma por correo para este mes. Mejora ahora para continuar enviando correos.",
674-
"quota-mail-tip": "Consejo: Todavía puedes solciitar la firma de <1>documentos ilimitados</1> compartiendo manualmente los enlaces de solicitud de firma.",
674+
"quota-mail-tip": "Consejo: Aún puedes firmar <1>documentos ilimitados</1> compartiendo manualmente el enlace de solicitud de firma.",
675675
"quota-mail-head": "Cuota alcanzada",
676676
"unauthorized-modal": "No tienes permisos para realizar esta acción, por favor, contacta a {{adminEmail}}.",
677677
"sent-this-month": "Enviados este mes",

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -666,11 +666,11 @@
666666
"insufficient-credits": "Crédits de signature insuffisants",
667667
"insufficient-credits-mssg": "Le propriétaire de ce document ne dispose actuellement pas des crédits OpenSign nécessaires pour que vous puissiez le signer. Veuillez contacter le propriétaire si vous avez besoin de plus de détails.",
668668
"angular-npm-mssg-1": "Pour intégrer OpenSign dans votre projet Angular, exécutez simplement la commande suivante :",
669-
"quota-mail-info-head": "Limite mensuelle d'e-mails de signatures de demandes",
670-
"quota-mail-info": "Vous pouvez envoyer jusqu'à 15 e-mails de demande de signature chaque mois. Mettez à niveau maintenant pour envoyer directement des demandes de signature illimitées.",
669+
"quota-mail-info-head": "Limite mensuelle d'e-mails",
670+
"quota-mail-info": "Pour maintenir la qualité du service et prévenir le spam, OpenSign permet jusqu'à 15 e-mails par mois avec le plan gratuit. Passez à l'offre supérieure pour un envoi illimité d'e-mails.",
671671
"quota-mail-reset": "Les crédits de votre email de demande de signature seront réinitialisés le",
672672
"quota-mail": "Vous avez atteint votre limite de 15 e-mails de demande de signature pour ce mois. Mettez à niveau maintenant pour continuer à envoyer des e-mails directement.",
673-
"quota-mail-tip-tip": "Astuce : Vous pouvez toujours signer un nombre <1>illimité de documents</1> en partageant manuellement les liens de demande de signature.",
673+
"quota-mail-tip-tip": "Astuce: Vous pouvez toujours signer un nombre <1>illimité de documents</1> en partageant manuellement le lien de demande de signature.",
674674
"quota-mail-head": "Quota atteint",
675675
"unauthorized-modal": "Vous n'êtes pas autorisé à effectuer cette action, veuillez contacter {{adminEmail}}.",
676676
"sent-this-month": "envoyé ce mois-ci",

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -666,11 +666,11 @@
666666
"insufficient-credits": "Crediti di firma insufficienti",
667667
"insufficient-credits-mssg": "Il proprietario di questo documento non dispone attualmente dei crediti OpenSign necessari affinché tu possa firmare. Contatta il proprietario per ulteriori dettagli.",
668668
"angular-npm-mssg-1": "Per integrare OpenSign nel tuo progetto Angular, esegui semplicemente il seguente comando:",
669-
"quota-mail-info-head": "Limite mensile email per richieste di firma",
670-
"quota-mail-info": "Puoi inviare fino a 15 email di richiesta di firma ogni mese. Passa al piano superiore per inviare richieste di firma illimitate direttamente.",
669+
"quota-mail-info-head": "Limite mensile di email",
670+
"quota-mail-info": "Per mantenere la qualità del servizio e prevenire lo spam, OpenSign consente fino a 15 email al mese con il piano gratuito. Esegui l'upgrade ora per l'invio illimitato di email.",
671671
"quota-mail-reset": "I tuoi crediti email per richieste di firma saranno ripristinati il",
672672
"quota-mail": "Hai raggiunto il limite di 15 email di richiesta di firma per questo mese. Passa al piano superiore per continuare a inviare email direttamente.",
673-
"quota-mail-tip": "Suggerimento: Puoi comunque firmare <1>documenti illimitati</1> condividendo manualmente i link per le richieste di firma.",
673+
"quota-mail-tip": "Suggerimento: Puoi ancora firmare un numero <1>illimitato de documenti</1> condividendo manualmente il link della richiesta di firma.",
674674
"quota-mail-head": "Quota Raggiunta",
675675
"unauthorized-modal": "Non hai l'autorizzazione per eseguire questa azione, contatta {{adminEmail}}.",
676676
"sent-this-month": "Inviati questo mese",

apps/OpenSign/src/components/BulkSendUi.js

Lines changed: 64 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const BulkSendUi = (props) => {
1313
const [scrollOnNextUpdate, setScrollOnNextUpdate] = useState(false);
1414
const [isSubmit, setIsSubmit] = useState(false);
1515
const [isSignatureExist, setIsSignatureExist] = useState();
16-
const [isBulkAvailable, setIsBulkAvailable] = useState(false);
16+
const [isDisableBulkSend, setIsDisableBulkSend] = useState(false);
1717
const [isLoader, setIsLoader] = useState(false);
1818
useEffect(() => {
1919
signatureExist();
@@ -22,7 +22,7 @@ const BulkSendUi = (props) => {
2222

2323
//function to check atleast one signature field exist
2424
const signatureExist = async () => {
25-
setIsBulkAvailable(true);
25+
setIsDisableBulkSend(false);
2626
const getPlaceholder = props?.Placeholders;
2727
const checkIsSignatureExistt = getPlaceholder?.every((placeholderObj) =>
2828
placeholderObj?.placeHolder?.some((holder) =>
@@ -95,70 +95,70 @@ const BulkSendUi = (props) => {
9595
const handleSubmit = async (e) => {
9696
e.preventDefault();
9797
e.stopPropagation();
98-
setIsSubmit(true);
99-
if (validateEmails(forms)) {
100-
// Create a copy of Placeholders array from props.item
101-
let Placeholders = [...props.Placeholders];
102-
// Initialize an empty array to store updated documents
103-
let Documents = [];
104-
// Loop through each form
105-
forms.forEach((form) => {
106-
//checking if user enter email which already exist as a signer then add user in a signers array
107-
let existSigner = [];
108-
form.fields.map((data) => {
109-
if (data.signer) {
110-
existSigner.push(data.signer);
111-
}
112-
});
113-
// Map through the copied Placeholders array to update email values
114-
const updatedPlaceholders = Placeholders.map((placeholder) => {
115-
// Find the field in the current form that matches the placeholder Id
116-
const field = form.fields.find(
117-
(element) => parseInt(element.fieldId) === placeholder.Id
118-
);
119-
// If a matching field is found, update the email value in the placeholder
120-
const signer = field?.signer?.objectId ? field.signer : "";
121-
if (field) {
122-
if (signer) {
123-
return {
124-
...placeholder,
125-
signerObjId: field?.signer?.objectId || "",
126-
signerPtr: signer
127-
};
128-
} else {
129-
return {
130-
...placeholder,
131-
email: field.email,
132-
signerObjId: field?.signer?.objectId || "",
133-
signerPtr: signer
134-
};
98+
setIsSubmit(true);
99+
if (validateEmails(forms)) {
100+
// Create a copy of Placeholders array from props.item
101+
let Placeholders = [...props.Placeholders];
102+
// Initialize an empty array to store updated documents
103+
let Documents = [];
104+
// Loop through each form
105+
forms.forEach((form) => {
106+
//checking if user enter email which already exist as a signer then add user in a signers array
107+
let existSigner = [];
108+
form.fields.map((data) => {
109+
if (data.signer) {
110+
existSigner.push(data.signer);
135111
}
136-
}
137-
// If no matching field is found, keep the placeholder as is
138-
return placeholder;
139-
});
140-
141-
// Push a new document object with updated Placeholders into the Documents array
142-
if (existSigner?.length > 0) {
143-
Documents.push({
144-
...props.item,
145-
Placeholders: updatedPlaceholders,
146-
Signers: props.item.Signers
147-
? [...props.item.Signers, ...existSigner]
148-
: [...existSigner]
149112
});
150-
} else {
151-
Documents.push({
152-
...props.item,
153-
Placeholders: updatedPlaceholders,
154-
SignatureType: props.signatureType
113+
// Map through the copied Placeholders array to update email values
114+
const updatedPlaceholders = Placeholders.map((placeholder) => {
115+
// Find the field in the current form that matches the placeholder Id
116+
const field = form.fields.find(
117+
(element) => parseInt(element.fieldId) === placeholder.Id
118+
);
119+
// If a matching field is found, update the email value in the placeholder
120+
const signer = field?.signer?.objectId ? field.signer : "";
121+
if (field) {
122+
if (signer) {
123+
return {
124+
...placeholder,
125+
signerObjId: field?.signer?.objectId || "",
126+
signerPtr: signer
127+
};
128+
} else {
129+
return {
130+
...placeholder,
131+
email: field.email,
132+
signerObjId: field?.signer?.objectId || "",
133+
signerPtr: signer
134+
};
135+
}
136+
}
137+
// If no matching field is found, keep the placeholder as is
138+
return placeholder;
155139
});
156-
}
157-
});
158-
await batchQuery(Documents);
159-
} else {
160-
setIsSubmit(false);
161-
}
140+
141+
// Push a new document object with updated Placeholders into the Documents array
142+
if (existSigner?.length > 0) {
143+
Documents.push({
144+
...props.item,
145+
Placeholders: updatedPlaceholders,
146+
Signers: props.item.Signers
147+
? [...props.item.Signers, ...existSigner]
148+
: [...existSigner]
149+
});
150+
} else {
151+
Documents.push({
152+
...props.item,
153+
Placeholders: updatedPlaceholders,
154+
SignatureType: props.signatureType
155+
});
156+
}
157+
});
158+
await batchQuery(Documents);
159+
} else {
160+
setIsSubmit(false);
161+
}
162162
};
163163

164164
const batchQuery = async (Documents) => {
@@ -199,7 +199,7 @@ const BulkSendUi = (props) => {
199199
<Loader />
200200
</div>
201201
)}
202-
{isBulkAvailable ? (
202+
{!isDisableBulkSend ? (
203203
<>
204204
{props.Placeholders?.length > 0 ? (
205205
isSignatureExist ? (

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

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ const EditTemplate = ({
3030
: false,
3131
Bcc: template?.Bcc,
3232
RedirectUrl: template?.RedirectUrl || "",
33-
AllowModifications: template?.AllowModifications || false
33+
AllowModifications: template?.AllowModifications || false,
34+
TimeToCompleteDays: template?.TimeToCompleteDays || 15
3435
});
3536

3637
// `isValidURL` is used to check valid webhook url
@@ -228,14 +229,13 @@ const EditTemplate = ({
228229
</div>
229230
</div>
230231
<div className="text-xs mt-3">
231-
<label
232-
>
232+
<label>
233233
{t("notify-on-signatures")}
234234
<a data-tooltip-id="nos-tooltip" className="ml-1">
235235
<sup>
236236
<i className="fa-light fa-question rounded-full border-[#33bbff] text-[#33bbff] text-[13px] border-[1px] py-[1.5px] px-[4px]"></i>
237237
</sup>
238-
</a>
238+
</a>{" "}
239239
<Tooltip id="nos-tooltip" className="z-[999]">
240240
<div className="max-w-[200px] md:max-w-[450px] text-[11px]">
241241
<p className="font-bold">{t("notify-on-signatures")}</p>
@@ -247,7 +247,7 @@ const EditTemplate = ({
247247
<div className="flex flex-col md:flex-row md:gap-4">
248248
<div
249249
className={
250-
"flex items-center gap-2 ml-2 mb-1"
250+
`flex items-center gap-2 ml-2 mb-1`
251251
}
252252
>
253253
<input
@@ -260,7 +260,7 @@ const EditTemplate = ({
260260
</div>
261261
<div
262262
className={
263-
"flex items-center gap-2 ml-2 mb-1"
263+
`flex items-center gap-2 ml-2 mb-1`
264264
}
265265
>
266266
<input
@@ -294,6 +294,22 @@ const EditTemplate = ({
294294
onInput={(e) => e.target.setCustomValidity("")}
295295
/>
296296
</div>
297+
<div className="text-xs mt-2">
298+
<label className="block">
299+
{t("time-to-complete")}
300+
<span className="text-red-500 text-[13px]">*</span>
301+
</label>
302+
<input
303+
type="number"
304+
name="TimeToCompleteDays"
305+
className="op-input op-input-bordered op-input-sm focus:outline-none hover:border-base-content w-full text-xs"
306+
value={formData.TimeToCompleteDays}
307+
onChange={(e) => handleStrInput(e)}
308+
onInvalid={(e) => e.target.setCustomValidity(t("input-required"))}
309+
onInput={(e) => e.target.setCustomValidity("")}
310+
required
311+
/>
312+
</div>
297313
<div className="mt-[1rem] flex justify-start">
298314
<button type="submit" className="op-btn op-btn-primary">
299315
{t("submit")}

apps/OpenSign/src/constant/Utils.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,7 @@ export const signPdfFun = async (
491491
documentId,
492492
signerObjectId,
493493
objectId,
494-
widgets
494+
widgets,
495495
) => {
496496
let isCustomCompletionMail = false;
497497
try {
@@ -632,6 +632,7 @@ export const createDocument = async (
632632
IsEnableOTP: Doc?.IsEnableOTP || false,
633633
IsTourEnabled: Doc?.IsTourEnabled || false,
634634
AllowModifications: Doc?.AllowModifications || false,
635+
TimeToCompleteDays: parseInt(Doc?.TimeToCompleteDays) || 15,
635636
...SignatureType,
636637
...NotifyOnSignatures,
637638
...Bcc,

0 commit comments

Comments
 (0)