From 4caf9f598a6e33f96b6dac25b9759252bb4087cc Mon Sep 17 00:00:00 2001 From: prafull-opensignlabs Date: Wed, 18 Sep 2024 14:32:45 +0530 Subject: [PATCH] refactor: change variable from isDisableOTP to isEnableOTP --- .../public/locales/en/translation.json | 4 +- .../public/locales/fr/translation.json | 4 +- .../src/components/pdf/EditTemplate.js | 69 ++++++++++++++++++- apps/OpenSign/src/constant/Utils.js | 6 +- apps/OpenSign/src/pages/Form.js | 57 +++++++-------- apps/OpenSign/src/pages/GuestLogin.js | 4 +- apps/OpenSign/src/pages/PdfRequestFiles.js | 14 ++-- .../src/primitives/GetReportDisplay.js | 2 +- .../src/script/locales/en/translation.json | 4 +- .../src/script/locales/fr/translation.json | 4 +- .../v1/routes/CreateDocumentWithTemplate.js | 5 +- .../v1/routes/createDocumentwithCoordinate.js | 4 +- .../customRoute/v1/routes/createTemplate.js | 2 + .../v1/routes/createTemplatewithCoordinate.js | 4 +- .../customRoute/v1/routes/draftDocument.js | 3 + .../customRoute/v1/routes/getDocument.js | 1 + .../customRoute/v1/routes/getDocumentList.js | 1 + .../customRoute/v1/routes/getTemplate.js | 1 + .../customRoute/v1/routes/getTemplateList.js | 1 + .../customRoute/v1/routes/updateDocument.js | 4 ++ .../customRoute/v1/routes/updateTemplate.js | 3 + .../cloud/parsefunction/callWebhook.js | 6 +- .../cloud/parsefunction/createBatchDocs.js | 2 +- .../cloud/parsefunction/getDocument.js | 4 +- .../cloud/parsefunction/getSignedUrl.js | 2 +- .../parsefunction/pdf/GenerateCertificate.js | 4 +- .../cloud/parsefunction/pdf/PDF.js | 6 +- ...=> 20240913121404-add_isenableotp_doc.cjs} | 8 +-- 28 files changed, 156 insertions(+), 73 deletions(-) rename apps/OpenSignServer/databases/migrations/{20240913121404-add_isdisableotp_doc.cjs => 20240913121404-add_isenableotp_doc.cjs} (77%) diff --git a/apps/OpenSign/public/locales/en/translation.json b/apps/OpenSign/public/locales/en/translation.json index cfd1f51a5..c3d3d88f7 100644 --- a/apps/OpenSign/public/locales/en/translation.json +++ b/apps/OpenSign/public/locales/en/translation.json @@ -639,8 +639,8 @@ "sent-this-month":"Sent this month", "available-seats":"Available seats", "buy-users":"Buy more users", - "isdisable-otp": "Enable OTP verification", - "isdisable-otp-help": { + "isenable-otp": "Enable OTP verification", + "isenable-otp-help": { "p1": "Would you like to enable the verification process using a one-time password (OTP)?", "p2": "Selecting this option will enable OTP verification. Users will receive a verification code via email, which they must enter to sign the document.", "p3": "Selecting this option will disable OTP verification, allowing users to sign the document directly without additional steps.", diff --git a/apps/OpenSign/public/locales/fr/translation.json b/apps/OpenSign/public/locales/fr/translation.json index 9c13f9e2b..3d5114f43 100644 --- a/apps/OpenSign/public/locales/fr/translation.json +++ b/apps/OpenSign/public/locales/fr/translation.json @@ -638,8 +638,8 @@ "sent-this-month":"envoyé ce mois-ci", "available-seats":"Disponible sièges", "buy-users":"Acheter plus d'utilisateurs", - "isdisable-otp": "Activer la vérification OTP", - "isdisable-otp-help": { + "isenable-otp": "Activer la vérification OTP", + "isenable-otp-help": { "p1": "Souhaitez-vous activer le processus de vérification à l'aide d'un mot de passe à usage unique (OTP)?", "p2": "La sélection de cette option activera la vérification OTP. Les utilisateurs recevront un code de vérification par e-mail, qu'ils devront saisir pour signer le document.", "p3": "La sélection de cette option désactivera la vérification OTP, permettant aux utilisateurs de signer le document directement sans étapes supplémentaires.", diff --git a/apps/OpenSign/src/components/pdf/EditTemplate.js b/apps/OpenSign/src/components/pdf/EditTemplate.js index adf480218..2a8fd6574 100644 --- a/apps/OpenSign/src/components/pdf/EditTemplate.js +++ b/apps/OpenSign/src/components/pdf/EditTemplate.js @@ -3,6 +3,8 @@ import { checkIsSubscribed, getFileName } from "../../constant/Utils"; import Upgrade from "../../primitives/Upgrade"; import { isEnableSubscription } from "../../constant/const"; import { useTranslation } from "react-i18next"; +import { Tooltip } from "react-tooltip"; + // import SelectFolder from "../../premitives/SelectFolder"; const EditTemplate = ({ template, onSuccess }) => { @@ -14,7 +16,8 @@ const EditTemplate = ({ template, onSuccess }) => { Description: template?.Description || "", SendinOrder: template?.SendinOrder ? `${template?.SendinOrder}` : "false", AutomaticReminders: template?.AutomaticReminders || false, - RemindOnceInEvery: template?.RemindOnceInEvery || 5 + RemindOnceInEvery: template?.RemindOnceInEvery || 5, + IsEnableOTP: template?.IsEnableOTP ? `${template?.IsEnableOTP}` : "false" }); const [isSubscribe, setIsSubscribe] = useState(false); useEffect(() => { @@ -184,6 +187,70 @@ const EditTemplate = ({ template, onSuccess }) => { /> )} + {isEnableSubscription && ( +
+ +
+ +
{t("yes")}
+
+
+ +
{t("no")}
+
+
+ )}