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 (
{isLoader && ( -
+
)} @@ -182,86 +190,93 @@ const DepartmentList = () => {
)} -
- {isAlert.msg && ( - -
{isAlert.msg}
-
- )} -
-
- department list{" "} - - - + {isSubscribe && isEnableSubscription && !isLoader && ( +
+ {isAlert.msg && ( + +
{isAlert.msg}
+
+ )} +
+
+ department list{" "} + + + +
+
handleFormModal()}> + +
-
handleFormModal()}> - -
-
-
- - - - {heading?.map((item, index) => ( - - - - ))} - - - - {departmentList?.length > 0 && ( - <> - {currentList.map((item, index) => ( - - {heading.includes("Sr.No") && ( - - )} - - - + ))} + + )} + +
{item}
{startIndex + index + 1}{item?.Name} - {item?.ParentId?.Name || "-"} - - - {isActiveModal[item.objectId] && ( - -
-
- Are you sure you want to disable this - department? -
-
-
- - -
-
-
+
+ + + + {heading?.map((item, index) => ( + + + + ))} + + + + {departmentList?.length > 0 && ( + <> + {currentList.map((item, index) => ( + + {heading.includes("Sr.No") && ( + )} - - {/* + + {item?.Name !== "All User" && ( + + )} + {/* */} - - ))} - - )} - -
{item}
+ {startIndex + index + 1} + + + {item?.Name} + + {item?.ParentId?.Name || "-"} + + + {isActiveModal[item.objectId] && ( + +
+
+ Are you sure you want to disable this + department? +
+
+
+ + +
+
+
+ )} +
{actions?.length > 0 && actions.map((act, index) => ( ))}
-
-
- {departmentList.length > recordperPage && ( - - )} - {pageNumbers.map((x, i) => ( - - ))} - {departmentList.length > recordperPage && ( - - )} -
- {departmentList?.length <= 0 && ( -
-
- img -
-
No Data Available
+
- )} - - - -
+
+ {departmentList.length > recordperPage && ( + + )} + {pageNumbers.map((x, i) => ( + + ))} + {departmentList.length > recordperPage && ( + + )} +
+ {departmentList?.length <= 0 && ( +
+
+ img +
+
No Data Available
+
+ )} + + + +
+ )} + {!isSubscribe && isEnableSubscription && !isLoader && ( +
+ +
+ )}
); }; diff --git a/apps/OpenSign/src/pages/Login.js b/apps/OpenSign/src/pages/Login.js index 583d065ac..8a41d5c86 100644 --- a/apps/OpenSign/src/pages/Login.js +++ b/apps/OpenSign/src/pages/Login.js @@ -123,102 +123,161 @@ function Login() { if (roles) { userRoles = roles; let _currentRole = ""; - if (userRoles.length > 0) { - _currentRole = userRoles.find( - (x) => x === extUser.get("UserRole") - ); - } - userSettings.forEach(async (element) => { - const redirectUrl = - location?.state?.from || - `/${element.pageType}/${element.pageId}`; - if (element.role === _currentRole) { - let _role = _currentRole.replace( - "contracts_", - "" - ); - localStorage.setItem("_user_role", _role); - // Get TenentID from Extendend Class - localStorage.setItem( - "extended_class", - element.extended_class - ); - let tenentInfo = []; - const results = [extUser]; - if (results) { - let extendedInfo_stringify = - JSON.stringify(results); + const valuesToExclude = [ + "contracts_Guest", + "contracts_appeditor" + ]; + const filterRoles = userRoles.filter( + (x) => !valuesToExclude.includes(x) + ); + if (filterRoles.length > 0) { + _currentRole = filterRoles?.[0]; + userSettings.forEach(async (element) => { + const redirectUrl = + location?.state?.from || + `/${element.pageType}/${element.pageId}`; + if (element.role === _currentRole) { + let _role = _currentRole.replace( + "contracts_", + "" + ); + localStorage.setItem("_user_role", _role); + // Get TenentID from Extendend Class localStorage.setItem( - "Extand_Class", - extendedInfo_stringify + "extended_class", + element.extended_class ); - let extendedInfo = JSON.parse( - extendedInfo_stringify - ); - if (extendedInfo.length > 1) { - extendedInfo.forEach((x) => { - if (x.TenantId) { - let obj = { - tenentId: x.TenantId.objectId, - tenentName: - x.TenantId.TenantName || "" - }; - tenentInfo.push(obj); - } - }); - if (tenentInfo.length) { - dispatch( - showTenant( + let tenentInfo = []; + const results = [extUser]; + if (results) { + let extendedInfo_stringify = + JSON.stringify(results); + + localStorage.setItem( + "Extand_Class", + extendedInfo_stringify + ); + let extendedInfo = JSON.parse( + extendedInfo_stringify + ); + if (extendedInfo.length > 1) { + extendedInfo.forEach((x) => { + if (x.TenantId) { + let obj = { + tenentId: x.TenantId.objectId, + tenentName: + x.TenantId.TenantName || "" + }; + tenentInfo.push(obj); + } + }); + if (tenentInfo.length) { + dispatch( + showTenant( + tenentInfo[0].tenentName || "" + ) + ); + localStorage.setItem( + "TenantName", tenentInfo[0].tenentName || "" - ) + ); + } + + localStorage.setItem("showpopup", true); + localStorage.setItem( + "PageLanding", + element.pageId ); localStorage.setItem( - "TenantName", - tenentInfo[0].tenentName || "" + "defaultmenuid", + element.menuId ); - } - - localStorage.setItem("showpopup", true); - localStorage.setItem( - "PageLanding", - element.pageId - ); - localStorage.setItem( - "defaultmenuid", - element.menuId - ); - localStorage.setItem( - "pageType", - element.pageType - ); - setState({ ...state, loading: false }); - navigate("/"); - } else { - extendedInfo.forEach((x) => { - if (x.TenantId) { - let obj = { - tenentId: x.TenantId.objectId, - tenentName: - x.TenantId.TenantName || "" + localStorage.setItem( + "pageType", + element.pageType + ); + setState({ ...state, loading: false }); + navigate("/"); + } else { + extendedInfo.forEach((x) => { + if (x.TenantId) { + let obj = { + tenentId: x.TenantId.objectId, + tenentName: + x.TenantId.TenantName || "" + }; + localStorage.setItem( + "TenantId", + x.TenantId.objectId + ); + tenentInfo.push(obj); + } + }); + if (tenentInfo.length) { + dispatch( + showTenant( + tenentInfo[0].tenentName || "" + ) + ); + localStorage.setItem( + "TenantName", + tenentInfo[0].tenentName || "" + ); + } + localStorage.setItem( + "PageLanding", + element.pageId + ); + localStorage.setItem( + "defaultmenuid", + element.menuId + ); + localStorage.setItem( + "pageType", + element.pageType + ); + setState({ ...state, loading: false }); + if (isEnableSubscription) { + const LocalUserDetails = { + name: results[0].get("Name"), + email: results[0].get("Email"), + phone: results[0]?.get("Phone") || "", + company: results[0].get("Company") }; localStorage.setItem( - "TenantId", - x.TenantId.objectId + "userDetails", + JSON.stringify(LocalUserDetails) ); - tenentInfo.push(obj); + 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); + } else { + navigate(`/subscription`, { + replace: true + }); + } + } else { + navigate(`/subscription`, { + replace: true + }); + } + } else { + // Redirect to the appropriate URL after successful login + navigate(redirectUrl); } - }); - if (tenentInfo.length) { - dispatch( - showTenant( - tenentInfo[0].tenentName || "" - ) - ); - localStorage.setItem( - "TenantName", - tenentInfo[0].tenentName || "" - ); } + } else { localStorage.setItem( "PageLanding", element.pageId @@ -234,35 +293,17 @@ function Login() { setState({ ...state, loading: false }); if (isEnableSubscription) { const LocalUserDetails = { - name: results[0].get("Name"), - email: results[0].get("Email"), - phone: results[0]?.get("Phone") || "", - company: results[0].get("Company") + name: _user.name, + email: email, + phone: _user?.phone || "" + // company: results.get("Company"), }; localStorage.setItem( "userDetails", JSON.stringify(LocalUserDetails) ); - 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); - } else { - navigate(`/subscription`, { - replace: true - }); - } - } else { + const billingDate = ""; + if (billingDate) { navigate(`/subscription`, { replace: true }); @@ -272,44 +313,9 @@ function Login() { navigate(redirectUrl); } } - } else { - localStorage.setItem( - "PageLanding", - element.pageId - ); - localStorage.setItem( - "defaultmenuid", - element.menuId - ); - localStorage.setItem( - "pageType", - element.pageType - ); - setState({ ...state, loading: false }); - if (isEnableSubscription) { - const LocalUserDetails = { - name: _user.name, - email: email, - phone: _user?.phone || "" - // company: results.get("Company"), - }; - localStorage.setItem( - "userDetails", - JSON.stringify(LocalUserDetails) - ); - const billingDate = ""; - if (billingDate) { - navigate(`/subscription`, { - replace: true - }); - } - } else { - // Redirect to the appropriate URL after successful login - navigate(redirectUrl); - } } - } - }); + }); + } } else { setState({ ...state, loading: false }); setIsModal(true); @@ -719,7 +725,6 @@ function Login() { .post(url, JSON.stringify(body), { headers: headers1 }) .then((axiosres) => { const roles = axiosres.data.result; - console.log("roles ", roles); if (roles && roles.length > 0) { userRoles = roles; let _currentRole = ""; @@ -729,7 +734,6 @@ function Login() { ); if (filterRoles.length > 0) { _currentRole = filterRoles?.[0]; - console.log("_currentRole ", _currentRole); let SettingsUser = userSettings; SettingsUser.forEach(async (item) => { if (item.role === _currentRole) { @@ -753,6 +757,10 @@ function Login() { const results = [result]; if (results) { let extendedInfo_stringify = JSON.stringify(results); + localStorage.setItem( + "Extand_Class", + extendedInfo_stringify + ); let extendedInfo = JSON.parse(extendedInfo_stringify); if (extendedInfo.length > 1) { extendedInfo.forEach((x) => { diff --git a/apps/OpenSign/src/pages/UserList.js b/apps/OpenSign/src/pages/UserList.js index 5f337c918..1f0d5df68 100644 --- a/apps/OpenSign/src/pages/UserList.js +++ b/apps/OpenSign/src/pages/UserList.js @@ -7,6 +7,9 @@ import ModalUi from "../primitives/ModalUi"; import pad from "../assets/images/pad.svg"; import Tooltip from "../primitives/Tooltip"; import AddUser from "../components/AddUser"; +import SubscribeCard from "../primitives/SubscribeCard"; +import { isEnableSubscription } from "../constant/const"; +import { checkIsSubscribedTeam } from "../constant/Utils"; const heading = [ "Sr.No", "Name", @@ -28,6 +31,7 @@ const UserList = () => { const [isAlert, setIsAlert] = useState({ type: "success", msg: "" }); const [isActiveModal, setIsActiveModal] = useState({}); const [isActLoader, setIsActLoader] = useState({}); + const [isSubscribe, setIsSubscribe] = useState(false); const recordperPage = 10; const startIndex = (currentPage - 1) * recordperPage; // user per page @@ -89,6 +93,10 @@ const UserList = () => { async function fetchUserList() { try { setIsLoader(true); + if (isEnableSubscription) { + const getIsSubscribe = await checkIsSubscribedTeam(); + setIsSubscribe(getIsSubscribe); + } const extUser = JSON.parse(localStorage.getItem("Extand_Class"))?.[0]; const res = await Parse.Cloud.run("getuserlistbyorg", { organizationId: extUser.OrganizationId.objectId @@ -170,7 +178,7 @@ const UserList = () => { return (
{isLoader && ( -
+
)} @@ -179,90 +187,95 @@ const UserList = () => {
)} -
- {isAlert.msg && ( - -
{isAlert.msg}
-
- )} -
-
- User list{" "} - - - + {isSubscribe && isEnableSubscription && !isLoader && ( +
+ {isAlert.msg && ( + +
{isAlert.msg}
+
+ )} +
+
+ User list{" "} + + + +
+
handleFormModal()}> + +
-
handleFormModal()}> - -
-
-
- - - - {heading?.map((item, index) => ( - - - - ))} - - - - {userList?.length > 0 && ( - <> - {userList.map((item, index) => ( - - {heading.includes("Sr.No") && ( - - )} - - - - - - + ))} + + )} + +
{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? -
-
-
- - -
-
-
+
+ + + + {heading?.map((item, index) => ( + + + + ))} + + + + {userList?.length > 0 && ( + <> + {userList.map((item, index) => ( + + {heading.includes("Sr.No") && ( + )} - - {/* + + + + + + {/* */} - - ))} - - )} - -
{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? +
+
+
+ + +
+
+
+ )} +
{actions?.length > 0 && actions.map((act, index) => (
-
-
- {userList.length > recordperPage && ( - - )} - {pageNumbers.map((x, i) => ( - - ))} - {userList.length > recordperPage && ( - - )} -
- {userList?.length <= 0 && ( -
-
- img -
-
No Data Available
+
- )} - - - -
+
+ {userList.length > recordperPage && ( + + )} + {pageNumbers.map((x, i) => ( + + ))} + {userList.length > recordperPage && ( + + )} +
+ {userList?.length <= 0 && ( +
+
+ img +
+
No Data Available
+
+ )} + + + +
+ )} + {!isSubscribe && isEnableSubscription && !isLoader && ( +
+ +
+ )}
); }; diff --git a/apps/OpenSign/src/primitives/DotLottieReact.js b/apps/OpenSign/src/primitives/DotLottieReact.js index 66ca3b8b3..79811cff9 100644 --- a/apps/OpenSign/src/primitives/DotLottieReact.js +++ b/apps/OpenSign/src/primitives/DotLottieReact.js @@ -30,8 +30,7 @@ const LottieWithLoader = () => { return (
{!isLoaded && !hasError && ( -
- {" "} +
)} @@ -39,9 +38,8 @@ const LottieWithLoader = () => { {isLoaded && animationSrc && ( )}
diff --git a/apps/OpenSign/src/primitives/GetReportDisplay.js b/apps/OpenSign/src/primitives/GetReportDisplay.js index f8e40ac22..847bed726 100644 --- a/apps/OpenSign/src/primitives/GetReportDisplay.js +++ b/apps/OpenSign/src/primitives/GetReportDisplay.js @@ -12,6 +12,7 @@ import Tour from "reactour"; import Parse from "parse"; import { saveAs } from "file-saver"; import { + checkIsSubscribedTeam, // copytoData, replaceMailVaribles } from "../constant/Utils"; @@ -25,6 +26,8 @@ import "react-quill/dist/quill.snow.css"; import BulkSendUi from "../components/BulkSendUi"; import Loader from "./Loader"; import Select from "react-select"; +import { isEnableSubscription } from "../constant/const"; +import SubscribeCard from "./SubscribeCard"; const ReportTable = (props) => { const navigate = useNavigate(); @@ -64,6 +67,9 @@ const ReportTable = (props) => { // const [isPublicProfile, setIsPublicProfile] = useState({}); // const [publicUserName, setIsPublicUserName] = useState(""); const [isViewShare, setIsViewShare] = useState({}); + const [isSubscribe, setIsSubscribe] = useState(true); + const Extand_Class = localStorage.getItem("Extand_Class"); + const extClass = Extand_Class && JSON.parse(Extand_Class); const startIndex = (currentPage - 1) * props.docPerPage; const { isMoreDocs, setIsNextRecord } = props; // For loop is used to calculate page numbers visible below table @@ -191,9 +197,7 @@ const ReportTable = (props) => { } else { setActLoader({ [`${item.objectId}_${act.btnId}`]: true }); try { - const params = { - templateId: item.objectId - }; + const params = { templateId: item.objectId }; const templateDeatils = await axios.post( `${localStorage.getItem("baseUrl")}functions/getTemplate`, params, @@ -224,6 +228,19 @@ const ReportTable = (props) => { }); } + // console.log("extClass ", extClass); + let extUserId = Doc.ExtUserPtr.objectId; + let creatorId = Doc.CreatedBy.objectId; + if (extClass && extClass.length > 0) { + if (Doc.ExtUserPtr?.objectId !== extClass[0].objectId) { + const Extand_Class = localStorage.getItem("Extand_Class"); + const extClass = Extand_Class && JSON.parse(Extand_Class); + if (extClass && extClass.length > 0) { + extUserId = extClass[0].objectId; + creatorId = extClass[0]?.UserId.objectId; + } + } + } let placeholdersArr = []; if (Doc.Placeholders?.length > 0) { placeholdersArr = Doc.Placeholders; @@ -238,12 +255,12 @@ const ReportTable = (props) => { ExtUserPtr: { __type: "Pointer", className: "contracts_Users", - objectId: Doc.ExtUserPtr.objectId + objectId: extUserId }, CreatedBy: { __type: "Pointer", className: "_User", - objectId: Doc.CreatedBy.objectId + objectId: creatorId }, Signers: signers, SendinOrder: Doc?.SendinOrder || false, @@ -254,7 +271,7 @@ const ReportTable = (props) => { const res = await axios.post( `${localStorage.getItem( "baseUrl" - )}classes/${localStorage.getItem("_appName")}_Document`, + )}classes/contracts_Document`, data, { headers: { @@ -315,7 +332,7 @@ const ReportTable = (props) => { } }; - const handleActionBtn = (act, item) => { + const handleActionBtn = async (act, item) => { if (act.action === "redirect") { handleURL(item, act); } else if (act.action === "delete") { @@ -331,6 +348,10 @@ const ReportTable = (props) => { } else if (act.action === "bulksend") { handleBulkSend(item); } else if (act.action === "sharewith") { + if (isEnableSubscription) { + const getIsSubscribe = await checkIsSubscribedTeam(); + setIsSubscribe(getIsSubscribe); + } if (item?.SharedWith && item?.SharedWith.length > 0) { // below code is used to get existing sharewith departments and formated them as per react-select const formatedList = item?.SharedWith.map((x) => ({ @@ -1331,106 +1352,126 @@ const ReportTable = (props) => {
{props.actions?.length > 0 && - props.actions.map((act, index) => ( -
handleActionBtn(act, item)} - title={act.hoverLabel} - className={ - act.action !== "option" - ? `${ - act?.btnColor ? act.btnColor : "" - } op-btn op-btn-sm mr-1` - : "text-base-content focus:outline-none text-lg mr-2 relative" - } - > - - {act.btnLabel && ( - - {act.btnLabel} - - )} - {isOption[item.objectId] && - act.action === "option" && ( -
    - {act.subaction?.map((subact) => ( -
  • - handleActionBtn(subact, item) - } - title={subact.hoverLabel} - > - - - {subact.btnLabel && ( - - {subact.btnLabel} + props.actions.map( + (act, index) => + (item.ExtUserPtr?.objectId === + extClass?.[0]?.objectId || + act.btnLabel === "Use") && ( +
    handleActionBtn(act, item)} + title={act.hoverLabel} + className={ + act.action !== "option" + ? `${ + act?.btnColor ? act.btnColor : "" + } op-btn op-btn-sm mr-1` + : "text-base-content focus:outline-none text-lg mr-2 relative" + } + > + + {act.btnLabel && ( + + {act.btnLabel} + + )} + {isOption[item.objectId] && + act.action === "option" && ( +
      + {act.subaction?.map((subact) => ( +
    • + handleActionBtn(subact, item) + } + title={subact.hoverLabel} + > + + + {subact.btnLabel && ( + + {subact.btnLabel} + + )} - )} - -
    • - ))} -
    - )} -
    - ))} +
  • + ))} +
+ )} +
+ ) + )}
{isShareWith[item.objectId] && (
-

- Share with -

-
setIsShareWith({})} - > - ✕ -
-
handleShareWith(e, item)} - > - + "Departments not found" + } + unstyled + classNames={{ + control: () => + "op-input op-input-bordered op-input-sm border-gray-400 focus:outline-none hover:border-base-content w-full h-full text-[11px]", + valueContainer: () => + "flex flex-row gap-x-[2px] gap-y-[2px] md:gap-y-0 w-full my-[2px]", + multiValue: () => + "op-badge op-badge-primary h-full text-[11px]", + multiValueLabel: () => "mb-[2px]", + menu: () => + "mt-1 shadow-md rounded-lg bg-base-200 text-base-content", + menuList: () => + "shadow-md rounded-lg overflow-hidden", + option: () => + "bg-base-200 text-base-content rounded-lg m-1 hover:bg-base-300 p-2", + noOptionsMessage: () => + "p-2 bg-base-200 rounded-lg m-1 p-2" + }} + /> + +
+ + )} + {!isSubscribe && isEnableSubscription && ( + <> +
setIsShareWith({})} + > + ✕ +
+ + + )}
)} diff --git a/apps/OpenSign/src/primitives/SubscribeCard.js b/apps/OpenSign/src/primitives/SubscribeCard.js index 84fdcc163..78f21001c 100644 --- a/apps/OpenSign/src/primitives/SubscribeCard.js +++ b/apps/OpenSign/src/primitives/SubscribeCard.js @@ -1,12 +1,12 @@ import React from "react"; import { useNavigate } from "react-router-dom"; -const SubscribeCard = () => { +const SubscribeCard = ({ plan }) => { const navigate = useNavigate(); return (
-

Upgrade to PRO Plan

+

Upgrade to {plan ? plan : "PRO"} Plan

$29.99/month: Sign 100 docs using API. Only $0.15/doc after that.