From 00e6ea5b3b77635bdbdafe72ed6797098f0bf0c8 Mon Sep 17 00:00:00 2001 From: RaktimaNXG Date: Fri, 9 Aug 2024 15:31:57 +0530 Subject: [PATCH] fix: resolve warning --- apps/OpenSign/src/constant/const.js | 5 ++-- apps/OpenSign/src/i18n.js | 8 +++--- apps/OpenSign/src/pages/PlaceHolderSign.js | 25 ++++++++----------- apps/OpenSign/src/pages/TeamList.js | 1 + apps/OpenSign/src/pages/UserList.js | 1 + apps/OpenSign/src/pages/UserProfile.js | 1 + apps/OpenSign/src/primitives/ValidateRoute.js | 1 + 7 files changed, 21 insertions(+), 21 deletions(-) diff --git a/apps/OpenSign/src/constant/const.js b/apps/OpenSign/src/constant/const.js index 850980ece..f5a7babe8 100644 --- a/apps/OpenSign/src/constant/const.js +++ b/apps/OpenSign/src/constant/const.js @@ -11,8 +11,7 @@ export const isEnableSubscription = : false; export const isStaging = window.location.origin === "https://staging-app.opensignlabs.com"; -export const isPublic = - window.location.origin === "https://opensign.me" || - window.location.origin === "https://staging.opensign.me"; +export const isPublicProduction = + window.location.origin === "https://opensign.me"; export const isPublicStaging = window.location.origin === "https://staging.opensign.me"; diff --git a/apps/OpenSign/src/i18n.js b/apps/OpenSign/src/i18n.js index 0cd8692f8..3d9e3adfd 100644 --- a/apps/OpenSign/src/i18n.js +++ b/apps/OpenSign/src/i18n.js @@ -2,12 +2,14 @@ import i18n from "i18next"; import { initReactI18next } from "react-i18next"; import Backend from "i18next-http-backend"; import LanguageDetector from "i18next-browser-languagedetector"; -import { isPublic } from "./constant/const"; +import { isPublicProduction, isPublicStaging } from "./constant/const"; //handle path to support language on public profile -const backendPath = isPublic +const backendPath = isPublicStaging ? "https://staging-app.opensignlabs.com/locales/{{lng}}/{{ns}}.json" - : "/locales/{{lng}}/{{ns}}.json"; + : isPublicProduction + ? "https://app.opensignlabs.com/locales/{{lng}}/{{ns}}.json" + : "/locales/{{lng}}/{{ns}}.json"; i18n .use(Backend) diff --git a/apps/OpenSign/src/pages/PlaceHolderSign.js b/apps/OpenSign/src/pages/PlaceHolderSign.js index 04831ea19..f1fbf810b 100644 --- a/apps/OpenSign/src/pages/PlaceHolderSign.js +++ b/apps/OpenSign/src/pages/PlaceHolderSign.js @@ -190,28 +190,20 @@ function PlaceHolderSign() { if (user) { try { + const defaultRequestBody = `

Hi {{receiver_name}},


We hope this email finds you well. {{sender_name}} has requested you to review and sign {{document_title}}.

Your signature is crucial to proceed with the next steps as it signifies your agreement and authorization.


{{signing_url}}


If you have any questions or need further clarification regarding the document or the signing process, please contact the sender.


Thanks

Team OpenSign™


`; + const defaultSubject = `{{sender_name}} has requested you to sign {{document_title}}`; + setDefaultBody(defaultRequestBody); + setDefaultSubject(defaultSubject); const tenantDetails = await getTenantDetails(user?.objectId); if (tenantDetails && tenantDetails === "user does not exist!") { alert(t("user-not-exist")); } else if (tenantDetails) { - const defaultRequestBody = `

Hi {{receiver_name}},


We hope this email finds you well. {{sender_name}} has requested you to review and sign {{document_title}}.

Your signature is crucial to proceed with the next steps as it signifies your agreement and authorization.


{{signing_url}}


If you have any questions or need further clarification regarding the document or the signing process, please contact the sender.


Thanks

Team OpenSign™


`; if (tenantDetails?.RequestBody) { setRequestBody(tenantDetails?.RequestBody); setRequestSubject(tenantDetails?.RequestSubject); - - setDefaultBody(defaultRequestBody); - setDefaultSubject( - `{{sender_name}} has requested you to sign {{document_title}}` - ); } else { setRequestBody(defaultRequestBody); - setRequestSubject( - `{{sender_name}} has requested you to sign {{document_title}}` - ); - setDefaultBody(defaultRequestBody); - setDefaultSubject( - `{{sender_name}}has requested you to sign {{document_title}}` - ); + setRequestSubject(defaultSubject); } } } catch (e) { @@ -222,6 +214,7 @@ function PlaceHolderSign() { } }; + console.log("default body", defaultBody); useEffect(() => { const updateSize = () => { if (divRef.current) { @@ -1772,8 +1765,10 @@ function PlaceHolderSign() { <> diff --git a/apps/OpenSign/src/pages/TeamList.js b/apps/OpenSign/src/pages/TeamList.js index 65e7359e6..d4b4eb063 100644 --- a/apps/OpenSign/src/pages/TeamList.js +++ b/apps/OpenSign/src/pages/TeamList.js @@ -97,6 +97,7 @@ const TeamList = () => { const pageNumbers = getPaginationRange(); useEffect(() => { fetchTeamList(); + // eslint-disable-next-line react-hooks/exhaustive-deps }, []); async function fetchTeamList() { try { diff --git a/apps/OpenSign/src/pages/UserList.js b/apps/OpenSign/src/pages/UserList.js index 3d07febe1..9d38d154c 100644 --- a/apps/OpenSign/src/pages/UserList.js +++ b/apps/OpenSign/src/pages/UserList.js @@ -85,6 +85,7 @@ const UserList = () => { const pageNumbers = getPaginationRange(); useEffect(() => { fetchUserList(); + // eslint-disable-next-line react-hooks/exhaustive-deps }, []); async function fetchUserList() { try { diff --git a/apps/OpenSign/src/pages/UserProfile.js b/apps/OpenSign/src/pages/UserProfile.js index 1c383d840..0ef940688 100644 --- a/apps/OpenSign/src/pages/UserProfile.js +++ b/apps/OpenSign/src/pages/UserProfile.js @@ -57,6 +57,7 @@ function UserProfile() { useEffect(() => { getUserDetail(); + // eslint-disable-next-line react-hooks/exhaustive-deps }, []); const getUserDetail = async () => { diff --git a/apps/OpenSign/src/primitives/ValidateRoute.js b/apps/OpenSign/src/primitives/ValidateRoute.js index 23caa01ca..e0af692b6 100644 --- a/apps/OpenSign/src/primitives/ValidateRoute.js +++ b/apps/OpenSign/src/primitives/ValidateRoute.js @@ -23,6 +23,7 @@ const ValidateRoute = () => { } } })(); + // eslint-disable-next-line react-hooks/exhaustive-deps }, []); const handlelogout = async () => { let appdata = localStorage.getItem("userSettings");