diff --git a/apps/OpenSign/src/components/AddDepartment.js b/apps/OpenSign/src/components/AddDepartment.js index 9b151ff3c..b9de1d4b3 100644 --- a/apps/OpenSign/src/components/AddDepartment.js +++ b/apps/OpenSign/src/components/AddDepartment.js @@ -56,11 +56,15 @@ const AddDepartment = (props) => { objectId: x.objectId })); } else { - updatedAncestors.push({ - __type: "Pointer", - className: "contracts_Departments", - objectId: formdata.department - }); + const AllUser = departmentList.find((x) => x.objectId === "All User"); + updatedAncestors = [ + AllUser, + { + __type: "Pointer", + className: "contracts_Departments", + objectId: formdata.department + } + ]; } } try { diff --git a/apps/OpenSign/src/constant/Utils.js b/apps/OpenSign/src/constant/Utils.js index 3976d8b1c..beefad8e6 100644 --- a/apps/OpenSign/src/constant/Utils.js +++ b/apps/OpenSign/src/constant/Utils.js @@ -63,7 +63,7 @@ export async function fetchSubscription( return { plan: "", billingDate: "" }; } } -//function to get subcripition details from Extand user class +//function to get subcripition details from subscription class export async function checkIsSubscribed() { try { const res = await fetchSubscription(); @@ -84,6 +84,28 @@ export async function checkIsSubscribed() { } } +//function to get subcripition details from subscription class +export async function checkIsSubscribedTeam() { + try { + const res = await fetchSubscription(); + if (res.plan === "freeplan") { + return false; + } else if (res.billingDate) { + const plan = res.plan === "team-weekly" || res.plan === "team-yearly"; + if (plan && new Date(res.billingDate) > new Date()) { + return true; + } else { + return false; + } + } else { + return false; + } + } catch (err) { + console.log("Err in fetch subscription", err); + return false; + } +} + export const color = [ "#93a3db", "#e6c3db", diff --git a/apps/OpenSign/src/json/plansArr.js b/apps/OpenSign/src/json/plansArr.js index 3cc7b1696..7a347caa0 100644 --- a/apps/OpenSign/src/json/plansArr.js +++ b/apps/OpenSign/src/json/plansArr.js @@ -56,6 +56,36 @@ const plans = [ "Auto reminders" ] }, + { + planName: "OPENSIGN™ TEAM", + currency: "$", + monthlyPrice: "100.99", + yearlyPrice: "329.99", + subtitle: "Exclusive Access to advanced features.", + btnText: "Subscribe", + url: + window.location.origin === "http://localhost:3001" + ? "https://billing.zoho.in/subscribe/ed8097273a82b6bf39892c11a3bb3c381eb2705736014cfbdbde1ccf1c7a189d/team-weekly" + : "https://billing.opensignlabs.com/subscribe/ef798486e6a0a11ea65f2bae8f2af901d1a09dfa8085585cdd4ec4d7f32137f3/professional-monthly", + yearlyUrl: + window.location.origin === "http://localhost:3001" + ? "https://billing.zoho.in/subscribe/ed8097273a82b6bf39892c11a3bb3c381eb2705736014cfbdbde1ccf1c7a189d/team-weekly" + : "https://billing.opensignlabs.com/subscribe/ef798486e6a0a11ea65f2bae8f2af901d8ad1135190dff951330360e47585a71/professional-yearly", + target: "_self", + benefits: [ + "Everything in OpenSign™ free, professional", + "Field validations", + "Regular expression validations", + "Organize docs in OpenSign™ Drive", + "Webhooks", + "Zapier integration", + "API Access", + "100 API signatures included", + "DocumentId removal from signed docs", + "Custom email templates", + "Auto reminders" + ] + }, { planName: "OPENSIGN™ ENTERPRISE", currency: "", diff --git a/apps/OpenSign/src/pages/DepartmentList.js b/apps/OpenSign/src/pages/DepartmentList.js index 6bd204546..7b9fe3d9a 100644 --- a/apps/OpenSign/src/pages/DepartmentList.js +++ b/apps/OpenSign/src/pages/DepartmentList.js @@ -7,6 +7,9 @@ import Tooltip from "../primitives/Tooltip"; import ModalUi from "../primitives/ModalUi"; import pad from "../assets/images/pad.svg"; import AddDepartment from "../components/AddDepartment"; +import { isEnableSubscription } from "../constant/const"; +import { checkIsSubscribedTeam } from "../constant/Utils"; +import SubscribeCard from "../primitives/SubscribeCard"; const heading = ["Sr.No", "Name", "Parent Department", "Is-Active"]; // const actions = [ @@ -32,6 +35,7 @@ const DepartmentList = () => { const [isActiveModal, setIsActiveModal] = useState(false); const [isAlert, setIsAlert] = useState({ type: "success", msg: "" }); const [isActLoader, setIsActLoader] = useState({}); + const [isSubscribe, setIsSubscribe] = useState(false); const startIndex = (currentPage - 1) * recordperPage; // user per page const getPaginationRange = () => { @@ -92,6 +96,10 @@ const DepartmentList = () => { async function fetchDepartmentList() { try { setIsLoader(true); + if (isEnableSubscription) { + const getIsSubscribe = await checkIsSubscribedTeam(); + setIsSubscribe(getIsSubscribe); + } const extUser = JSON.parse(localStorage.getItem("Extand_Class"))?.[0]; const department = new Parse.Query("contracts_Departments"); department.equalTo("OrganizationId", { @@ -173,7 +181,7 @@ const DepartmentList = () => { return (
| {item} | -||||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| {startIndex + index + 1} | - )} -{item?.Name} | -- {item?.ParentId?.Name || "-"} - | -
-
- {isActiveModal[item.objectId] && (
-
-
-
- Are you sure you want to disable this
- department?
-
- -
-
-
-
-
+
-
- {departmentList.length > recordperPage && (
-
- )}
- {pageNumbers.map((x, i) => (
-
- ))}
- {departmentList.length > recordperPage && (
-
- )}
-
- {departmentList?.length <= 0 && (
-
-
-
- No Data Available
+ |
| {item} | -||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| {startIndex + index + 1} | - )} -{item?.Name} | -{item?.Email || "-"} | -{item?.Phone || "-"} | -- {item?.UserRole?.split("_").pop() || "-"} - | -- {formatRow(item.DepartmentIds)} - | -
-
- {isActiveModal[item.objectId] && (
-
-
-
- Are you sure you want to deactivate this user?
-
- -
-
-
-
-
+
-
- {userList.length > recordperPage && (
-
- )}
- {pageNumbers.map((x, i) => (
-
- ))}
- {userList.length > recordperPage && (
-
- )}
-
- {userList?.length <= 0 && (
-
-
-
- No Data Available
+ |
$29.99/month: Sign 100 docs using API. Only $0.15/doc after that.