From b0c73bc63e038c4ddd4fdc48e33e10f79b6e0df6 Mon Sep 17 00:00:00 2001 From: prafull-opensignlabs <93375423+prafull-opensignlabs@users.noreply.github.com> Date: Thu, 22 Feb 2024 18:27:35 +0530 Subject: [PATCH 1/4] Update Docker.yml --- .github/workflows/Docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Docker.yml b/.github/workflows/Docker.yml index f61d435ce..bfee0f645 100644 --- a/.github/workflows/Docker.yml +++ b/.github/workflows/Docker.yml @@ -2,7 +2,7 @@ name: ci on: push: branches: - - 'main' + - 'staging' jobs: docker: From 761925fcedcae31db7d153c4ac7b1e978589eb93 Mon Sep 17 00:00:00 2001 From: prafull-opensignlabs Date: Sun, 5 May 2024 18:25:50 +0530 Subject: [PATCH 2/4] fix: login issue --- apps/OpenSign/src/components/LoginGoogle.js | 6 +++--- apps/OpenSign/src/pages/Login.js | 24 +++++++++++++++------ 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/apps/OpenSign/src/components/LoginGoogle.js b/apps/OpenSign/src/components/LoginGoogle.js index 96e97c1b0..469352b52 100644 --- a/apps/OpenSign/src/components/LoginGoogle.js +++ b/apps/OpenSign/src/components/LoginGoogle.js @@ -115,8 +115,8 @@ const GoogleSignInBtn = ({ // console.log("payload ", payload); if (payload && payload.sessiontoken) { // setThirdpartyLoader(true); - const billingDate = - extRes.get("Next_billing_date") && extRes.get("Next_billing_date"); + // const billingDate = + // extRes.get("Next_billing_date") && extRes.get("Next_billing_date"); // console.log("billingDate expired", billingDate > new Date()); const LocalUserDetails = { name: details.Name, @@ -125,7 +125,7 @@ const GoogleSignInBtn = ({ company: extRes.get("Company") }; localStorage.setItem("userDetails", JSON.stringify(LocalUserDetails)); - thirdpartyLoginfn(payload.sessiontoken, billingDate); + thirdpartyLoginfn(payload.sessiontoken); } return { msg: "exist" }; } else { diff --git a/apps/OpenSign/src/pages/Login.js b/apps/OpenSign/src/pages/Login.js index 2b050dab1..a2e4b401c 100644 --- a/apps/OpenSign/src/pages/Login.js +++ b/apps/OpenSign/src/pages/Login.js @@ -422,7 +422,7 @@ function Login() { alert("Somenthing went wrong, please try again later!"); } }; - const thirdpartyLoginfn = async (sessionToken, billingDate) => { + const thirdpartyLoginfn = async (sessionToken) => { const baseUrl = localStorage.getItem("baseUrl"); const parseAppId = localStorage.getItem("parseAppId"); const res = await axios.get(baseUrl + "users/me", { @@ -521,7 +521,7 @@ function Login() { await Parse.Cloud.run("getUserDetails", { email: currentUser.get("email") }).then( - (result) => { + async (result) => { let tenentInfo = []; const results = [result]; if (results) { @@ -571,7 +571,7 @@ function Login() { setState({ ...state, loading: false }); navigate("/"); } else { - extendedInfo.forEach((x) => { + extendedInfo.forEach(async (x) => { if (x.TenantId) { let obj = { tenentId: x.TenantId.objectId, @@ -608,8 +608,13 @@ function Login() { setThirdpartyLoader(false); setState({ ...state, loading: false }); if (isEnableSubscription) { - if (billingDate) { - if (billingDate > new Date()) { + const res = await fetchSubscription(); + const freeplan = res.plan; + const billingDate = res.billingDate; + if (freeplan === "freeplan") { + navigate(redirectUrl); + } else if (billingDate) { + if (new Date(billingDate) > new Date()) { localStorage.removeItem("userDetails"); navigate(redirectUrl); } else { @@ -644,8 +649,13 @@ function Login() { setState({ ...state, loading: false }); setThirdpartyLoader(false); if (isEnableSubscription) { - if (billingDate) { - if (billingDate > new Date()) { + const res = await fetchSubscription(); + const freeplan = res.plan; + const billingDate = res.billingDate; + if (freeplan === "freeplan") { + navigate(redirectUrl); + } else if (billingDate) { + if (new Date(billingDate) > new Date()) { localStorage.removeItem("userDetails"); // Redirect to the appropriate URL after successful login navigate(redirectUrl); From 2ae7e8ced28cb6921922e4f8c96924db6f894deb Mon Sep 17 00:00:00 2001 From: RaktimaNXG Date: Tue, 7 May 2024 11:53:17 +0530 Subject: [PATCH 3/4] fix: document loading error No PDF file specified --- apps/OpenSign/src/pages/PdfRequestFiles.js | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/apps/OpenSign/src/pages/PdfRequestFiles.js b/apps/OpenSign/src/pages/PdfRequestFiles.js index e3ec3012f..6a1aebceb 100644 --- a/apps/OpenSign/src/pages/PdfRequestFiles.js +++ b/apps/OpenSign/src/pages/PdfRequestFiles.js @@ -471,7 +471,8 @@ function PdfRequestFiles() { const maxCount = requiredCheckbox[i].options?.validation?.maxRequiredCount; const parseMax = maxCount && parseInt(maxCount); - const response = requiredCheckbox[i].options?.response?.length; + const response = + requiredCheckbox[i].options?.response?.length; const defaultValue = requiredCheckbox[i].options?.defaultValue?.length; if (parseMin === 0 && parseMax === 0) { @@ -670,7 +671,8 @@ function PdfRequestFiles() { )}&${localStorage.getItem("_appName")}`; const hostUrl = window.location.origin; let signPdf = `${hostUrl}/login/${pdfDetails?.[0].objectId}/${user.Email}/${objectId}/${serverParams}`; - const openSignUrl = "https://www.opensignlabs.com/contact-us"; + const openSignUrl = + "https://www.opensignlabs.com/contact-us"; const orgName = pdfDetails[0]?.ExtUserPtr.Company ? pdfDetails[0].ExtUserPtr.Company : ""; @@ -681,7 +683,10 @@ function PdfRequestFiles() { requestSubject && (!isEnableSubscription || isSubscribed) ) { - const replacedRequestBody = requestBody.replace(/"/g, "'"); + const replacedRequestBody = requestBody.replace( + /"/g, + "'" + ); const htmlReqBody = "" + replacedRequestBody + @@ -1148,9 +1153,9 @@ function PdfRequestFiles() { isDecline.currnt === "Sure" ? "Are you sure want to decline this document ?" : isDecline.currnt === "YouDeclined" - ? "You have declined this document!" - : isDecline.currnt === "another" && - "You can not sign this document as it has been declined/revoked." + ? "You have declined this document!" + : isDecline.currnt === "another" && + "You can not sign this document as it has been declined/revoked." } footerMessage={isDecline.currnt === "Sure"} declineDoc={declineDoc} @@ -1229,7 +1234,10 @@ function PdfRequestFiles() { {/* this component used to render all pdf pages in left side */} Date: Tue, 7 May 2024 20:00:26 +0530 Subject: [PATCH 4/4] Revert "fix: document loading error No PDF file specified" --- apps/OpenSign/src/pages/PdfRequestFiles.js | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/apps/OpenSign/src/pages/PdfRequestFiles.js b/apps/OpenSign/src/pages/PdfRequestFiles.js index 6a1aebceb..e3ec3012f 100644 --- a/apps/OpenSign/src/pages/PdfRequestFiles.js +++ b/apps/OpenSign/src/pages/PdfRequestFiles.js @@ -471,8 +471,7 @@ function PdfRequestFiles() { const maxCount = requiredCheckbox[i].options?.validation?.maxRequiredCount; const parseMax = maxCount && parseInt(maxCount); - const response = - requiredCheckbox[i].options?.response?.length; + const response = requiredCheckbox[i].options?.response?.length; const defaultValue = requiredCheckbox[i].options?.defaultValue?.length; if (parseMin === 0 && parseMax === 0) { @@ -671,8 +670,7 @@ function PdfRequestFiles() { )}&${localStorage.getItem("_appName")}`; const hostUrl = window.location.origin; let signPdf = `${hostUrl}/login/${pdfDetails?.[0].objectId}/${user.Email}/${objectId}/${serverParams}`; - const openSignUrl = - "https://www.opensignlabs.com/contact-us"; + const openSignUrl = "https://www.opensignlabs.com/contact-us"; const orgName = pdfDetails[0]?.ExtUserPtr.Company ? pdfDetails[0].ExtUserPtr.Company : ""; @@ -683,10 +681,7 @@ function PdfRequestFiles() { requestSubject && (!isEnableSubscription || isSubscribed) ) { - const replacedRequestBody = requestBody.replace( - /"/g, - "'" - ); + const replacedRequestBody = requestBody.replace(/"/g, "'"); const htmlReqBody = "" + replacedRequestBody + @@ -1153,9 +1148,9 @@ function PdfRequestFiles() { isDecline.currnt === "Sure" ? "Are you sure want to decline this document ?" : isDecline.currnt === "YouDeclined" - ? "You have declined this document!" - : isDecline.currnt === "another" && - "You can not sign this document as it has been declined/revoked." + ? "You have declined this document!" + : isDecline.currnt === "another" && + "You can not sign this document as it has been declined/revoked." } footerMessage={isDecline.currnt === "Sure"} declineDoc={declineDoc} @@ -1234,10 +1229,7 @@ function PdfRequestFiles() { {/* this component used to render all pdf pages in left side */}