diff --git a/apps/OpenSign/src/components/AddTeam.js b/apps/OpenSign/src/components/AddTeam.js
index 3c784738c..d01264623 100644
--- a/apps/OpenSign/src/components/AddTeam.js
+++ b/apps/OpenSign/src/components/AddTeam.js
@@ -107,6 +107,7 @@ const AddTeam = (props) => {
objectId: localUser.OrganizationId.objectId
});
}
+ newTeam.set("IsActive", true);
const newTeamRes = await newTeam.save();
if (updatedAncestors.length > 0) {
const ParentId = teamList.find((x) => x.objectId === formdata.team);
diff --git a/apps/OpenSign/src/components/AddUser.js b/apps/OpenSign/src/components/AddUser.js
index 82bac3ced..7808c6040 100644
--- a/apps/OpenSign/src/components/AddUser.js
+++ b/apps/OpenSign/src/components/AddUser.js
@@ -44,7 +44,7 @@ const AddUser = (props) => {
className: "contracts_Organizations",
objectId: extUser.OrganizationId.objectId
});
- team.equalTo("IsActive", true);
+ team.notEqualTo("IsActive", false);
const teamRes = await team.find();
if (teamRes.length > 0) {
const _teamRes = JSON.parse(JSON.stringify(teamRes));
diff --git a/apps/OpenSign/src/pages/GenerateToken.js b/apps/OpenSign/src/pages/GenerateToken.js
index 775fd5b0d..bf2a9ff82 100644
--- a/apps/OpenSign/src/pages/GenerateToken.js
+++ b/apps/OpenSign/src/pages/GenerateToken.js
@@ -45,7 +45,7 @@ function GenerateToken() {
};
const res = await axios.post(url, {}, { headers: headers });
if (res) {
- SetApiToken(res.data.result.result);
+ SetApiToken(res.data?.result?.result);
}
setIsLoader(false);
} catch (err) {
diff --git a/apps/OpenSign/src/pages/Pgsignup.js b/apps/OpenSign/src/pages/Pgsignup.js
index 9180bf015..7e5c97637 100644
--- a/apps/OpenSign/src/pages/Pgsignup.js
+++ b/apps/OpenSign/src/pages/Pgsignup.js
@@ -70,6 +70,19 @@ const PgSignUp = () => {
});
if (res) {
localStorage.removeItem("userDetails");
+ try {
+ const extUser = await Parse.Cloud.run("getUserDetails", {
+ email: userDetails.email
+ });
+ const userRole = extUser?.get("UserRole");
+ const _currentRole = userRole;
+ const _role = _currentRole.replace("contracts_", "");
+ localStorage.setItem("_user_role", _role);
+ const extInfo_stringify = JSON.stringify([extUser]);
+ localStorage.setItem("Extand_Class", extInfo_stringify);
+ } catch (err) {
+ console.log("Err in fetching extuser", err);
+ }
navigate(
"/" + userSettings[0].pageType + "/" + userSettings[0].pageId
);
diff --git a/apps/OpenSign/src/pages/PlanSubscriptions.js b/apps/OpenSign/src/pages/PlanSubscriptions.js
index a45f525e1..fd39f5efb 100644
--- a/apps/OpenSign/src/pages/PlanSubscriptions.js
+++ b/apps/OpenSign/src/pages/PlanSubscriptions.js
@@ -1,5 +1,5 @@
import React, { useState, useEffect } from "react";
-import { NavLink, useNavigate } from "react-router-dom";
+import { useNavigate } from "react-router-dom";
import checkmark from "../assets/images/checkmark.png";
import plansArr from "../json/plansArr";
import Title from "../components/Title";
@@ -61,25 +61,33 @@ const PlanSubscriptions = () => {
// eslint-disable-next-line
}, []);
- const handleFreePlan = async () => {
- setIsLoader(true);
- try {
- const params = { userId: Parse.User.current().id };
- const res = await Parse.Cloud.run("freesubscription", params);
- if (res.status === "success" && res.result === "already subscribed!") {
- setIsLoader(false);
- alert("You have already subscribed to plan!");
- } else if (res.status === "success") {
- setIsLoader(false);
- navigate("/");
- } else if (res.status === "error") {
- setIsLoader(false);
- alert(res.result);
+ const handleFreePlan = async (item) => {
+ if (item.url) {
+ const url = yearlyVisible ? item.yearlyUrl + details : item.url + details;
+ if (user) {
+ localStorage.setItem("userDetails", JSON.stringify(user));
+ }
+ openInNewTab(url, item?.target);
+ } else {
+ setIsLoader(true);
+ try {
+ const params = { userId: Parse.User.current().id };
+ const res = await Parse.Cloud.run("freesubscription", params);
+ if (res.status === "success" && res.result === "already subscribed!") {
+ setIsLoader(false);
+ alert("You have already subscribed to plan!");
+ } else if (res.status === "success") {
+ setIsLoader(false);
+ navigate("/");
+ } else if (res.status === "error") {
+ setIsLoader(false);
+ alert(res.result);
+ }
+ } catch (err) {
+ setIsLoader(false);
+ console.log("err in free subscribe", err.message);
+ alert("Somenthing went wrong, please try again later!");
}
- } catch (err) {
- setIsLoader(false);
- console.log("err in free subscribe", err.message);
- alert("Somenthing went wrong, please try again later!");
}
};
return (
@@ -173,28 +181,12 @@ const PlanSubscriptions = () => {
- {item.url ? (
-