- {isUiLoading && (
-
-

-
- This might take some time
-
-
- )}
-
-
-
{
- setIsAlert({
- isShow: false,
- alertMessage: ""
- });
- }}
- >
-
-
{isAlert.alertMessage}
-
+ <>
+ {isLoading.isLoad ? (
+
+ ) : handleError ? (
+
+ ) : (
+
+ {isUiLoading && (
+ >
+

+
+ This might take some time
+
+
+ )}
-
-
- )}
+ )}
-
{
- setValidateAlert(false);
- }}
- >
-
-
- The input does not meet the criteria set by the regular expression.
-
-
-
{
+ setValidateAlert(false);
}}
- >
-
setValidateAlert(false)}
- type="button"
- className="finishBtn cancelBtn"
>
- Close
-
-
-
+
+
+ The input does not meet the criteria set by the regular
+ expression.
+
+
+
+
setValidateAlert(false)}
+ type="button"
+ className="finishBtn cancelBtn"
+ >
+ Close
+
+
+
+ >
+ )}
);
}
diff --git a/apps/OpenSign/src/pages/PlaceHolderSign.js b/apps/OpenSign/src/pages/PlaceHolderSign.js
index 3228e963b..d46683711 100644
--- a/apps/OpenSign/src/pages/PlaceHolderSign.js
+++ b/apps/OpenSign/src/pages/PlaceHolderSign.js
@@ -3,7 +3,7 @@ import axios from "axios";
import Parse from "parse";
import "../styles/signature.css";
import { PDFDocument } from "pdf-lib";
-import { themeColor } from "../constant/const";
+import { isEnableSubscription, themeColor } from "../constant/const";
import { DndProvider } from "react-dnd";
import { HTML5Backend } from "react-dnd-html5-backend";
import { useDrag, useDrop } from "react-dnd";
@@ -108,7 +108,6 @@ function PlaceHolderSign() {
status: false,
message: ""
});
-
const isMobile = window.innerWidth < 767;
const [, drop] = useDrop({
accept: "BOX",
@@ -180,11 +179,30 @@ function PlaceHolderSign() {
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [divRef.current]);
+ async function checkIsSubscribed(email) {
+ const user = await Parse.Cloud.run("getUserDetails", {
+ email: email
+ });
+ const billingDate =
+ user?.get("Next_billing_date") && user?.get("Next_billing_date");
+ if (billingDate) {
+ if (billingDate > new Date()) {
+ return true;
+ } else {
+ navigate(`/subscription`);
+ }
+ } else {
+ navigate(`/subscription`);
+ }
+ }
//function for get document details
const getDocumentDetails = async () => {
//getting document details
const documentData = await contractDocument(documentId);
if (documentData && documentData.length > 0) {
+ if (isEnableSubscription) {
+ checkIsSubscribed(documentData[0]?.ExtUserPtr?.Email);
+ }
const alreadyPlaceholder = documentData[0]?.SignedUrl;
// Check if document is sent for signing
if (alreadyPlaceholder) {
diff --git a/apps/OpenSign/src/pages/Signup.js b/apps/OpenSign/src/pages/Signup.js
index 620db1632..ace1b1f75 100644
--- a/apps/OpenSign/src/pages/Signup.js
+++ b/apps/OpenSign/src/pages/Signup.js
@@ -9,7 +9,8 @@ import Alert from "../primitives/Alert";
import { appInfo } from "../constant/appinfo";
import { useDispatch } from "react-redux";
import { fetchAppInfo } from "../redux/reducers/infoReducer";
-import { showTenant } from "../redux/reducers/ShowTenant";
+import { showTenant } from "../redux/reducers/ShowTenant";
+import { isEnableSubscription } from "../constant/const";
const Signup = () => {
const { width } = useWindowSize();
const navigate = useNavigate();
@@ -259,9 +260,7 @@ const Signup = () => {
});
if (tenentInfo.length) {
dispatch(
- showTenant(
- tenentInfo[0].tenentName || ""
- )
+ showTenant(tenentInfo[0].tenentName || "")
);
localStorage.setItem(
"TenantName",
@@ -325,7 +324,7 @@ const Signup = () => {
element.pageType
);
setState({ loading: false });
- if (process.env.REACT_APP_ENABLE_SUBSCRIPTION) {
+ if (isEnableSubscription) {
navigate(`/subscription`, { replace: true });
} else {
alert("Registered user successfully");
@@ -343,7 +342,7 @@ const Signup = () => {
);
localStorage.setItem("pageType", element.pageType);
setState({ loading: false });
- if (process.env.REACT_APP_ENABLE_SUBSCRIPTION) {
+ if (isEnableSubscription) {
navigate(`/subscription`, { replace: true });
} else {
navigate(
@@ -661,4 +660,4 @@ const Signup = () => {
);
};
-export default Signup
+export default Signup;
diff --git a/apps/OpenSign/src/pages/TemplatePlaceholder.js b/apps/OpenSign/src/pages/TemplatePlaceholder.js
index 82fe4d40e..93fef3bb4 100644
--- a/apps/OpenSign/src/pages/TemplatePlaceholder.js
+++ b/apps/OpenSign/src/pages/TemplatePlaceholder.js
@@ -3,7 +3,7 @@ import RenderAllPdfPage from "../components/pdf/RenderAllPdfPage";
import { useParams, useNavigate } from "react-router-dom";
import axios from "axios";
import "../styles/signature.css";
-import { themeColor } from "../constant/const";
+import { isEnableSubscription, themeColor } from "../constant/const";
import { DndProvider } from "react-dnd";
import { HTML5Backend } from "react-dnd-html5-backend";
import { useDrag, useDrop } from "react-dnd";
@@ -35,6 +35,7 @@ import AddRoleModal from "../components/pdf/AddRoleModal";
import PlaceholderCopy from "../components/pdf/PlaceholderCopy";
import TourContentWithBtn from "../primitives/TourContentWithBtn";
import DropdownWidgetOption from "../components/pdf/DropdownWidgetOption";
+import Parse from "parse";
const TemplatePlaceholder = () => {
const navigate = useNavigate();
const { templateId } = useParams();
@@ -168,7 +169,22 @@ const TemplatePlaceholder = () => {
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [divRef.current]);
-
+ async function checkIsSubscribed(email) {
+ const user = await Parse.Cloud.run("getUserDetails", {
+ email: email
+ });
+ const billingDate =
+ user?.get("Next_billing_date") && user?.get("Next_billing_date");
+ if (billingDate) {
+ if (billingDate > new Date()) {
+ return true;
+ } else {
+ navigate(`/subscription`);
+ }
+ } else {
+ navigate(`/subscription`);
+ }
+ }
// `fetchTemplate` function in used to get Template from server and setPlaceholder ,setSigner if present
const fetchTemplate = async () => {
try {
@@ -190,6 +206,9 @@ const TemplatePlaceholder = () => {
: [];
if (documentData && documentData.length > 0) {
+ if (isEnableSubscription) {
+ checkIsSubscribed(documentData[0]?.ExtUserPtr?.Email);
+ }
setPdfDetails(documentData);
setIsSigners(true);
if (documentData[0].Signers && documentData[0].Signers.length > 0) {
diff --git a/apps/OpenSign/src/primitives/Validate.js b/apps/OpenSign/src/primitives/Validate.js
index 21fd208c5..c2920b631 100644
--- a/apps/OpenSign/src/primitives/Validate.js
+++ b/apps/OpenSign/src/primitives/Validate.js
@@ -15,7 +15,7 @@ const Validate = () => {
sessionToken: localStorage.getItem("accesstoken")
});
if (user) {
- checkIsSubscribed();
+ setIsUserValid(true);
} else {
setIsUserValid(false);
}
@@ -27,30 +27,6 @@ const Validate = () => {
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
- async function checkIsSubscribed() {
- const currentUser = Parse.User.current();
- console.log("currentUser ", currentUser)
- const user = await Parse.Cloud.run("getUserDetails", {
- email: currentUser.get("email")
- });
- const _user = user?.toJSON();
-
- if (process.env.REACT_APP_ENABLE_SUBSCRIPTION) {
- const billingDate = _user.Next_billing_date && _user.Next_billing_date;
- if (billingDate) {
- if (billingDate > new Date()) {
- setIsUserValid(true);
- return true;
- } else {
- // navigate(`/subscription`);
- }
- } else {
- // navigate(`/subscription`);
- }
- } else {
- setIsUserValid(true);
- }
- }
const handleLoginBtn = () => {
try {
Parse.User.logOut();
diff --git a/apps/OpenSignServer/index.js b/apps/OpenSignServer/index.js
index 7812b0c6d..9ae7cce6b 100644
--- a/apps/OpenSignServer/index.js
+++ b/apps/OpenSignServer/index.js
@@ -147,6 +147,14 @@ export const config = {
google: {
enabled: true,
},
+ ldap: {
+ enabled: true,
+ url: 'ldap://ldap.forumsys.com:389',
+ suffix: 'dc=example,dc=com',
+ // dn: 'ou=mathematicians, dc=example, dc=com',
+ groupCn: 'mathematicians',
+ groupFilter: '(&(uniqueMember=uid=,dc=example,dc=com)(objectClass=groupOfUniqueNames))',
+ },
},
};
// Client-keys like the javascript key or the .NET key are not necessary with parse-server