Skip to content

Commit 97bd375

Browse files
authored
Merge pull request #550 from OpenSignLabs/patch-1
Patch 1
2 parents 748e219 + e2d450f commit 97bd375

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+1936
-1019
lines changed

apps/OpenSign/src/App.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import DraftDocument from "./components/pdf/DraftDocument";
1515
import PlaceHolderSign from "./pages/PlaceHolderSign";
1616
import PdfRequestFiles from "./pages/PdfRequestFiles";
1717
import LazyPage from "./primitives/LazyPage";
18+
import { isEnableSubscription } from "./constant/const";
1819
const DebugPdf = lazy(() => import("./pages/DebugPdf"));
1920
const ForgetPassword = lazy(() => import("./pages/ForgetPassword"));
2021
const GuestLogin = lazy(() => import("./pages/GuestLogin"));
@@ -113,7 +114,7 @@ function App() {
113114
path="/forgetpassword"
114115
element={<LazyPage Page={ForgetPassword} />}
115116
/>
116-
{process.env.REACT_APP_ENABLE_SUBSCRIPTION && (
117+
{isEnableSubscription && (
117118
<>
118119
<Route
119120
path="/pgsignup"

apps/OpenSign/src/components/AddSigner.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,11 @@ const AddSigner = (props) => {
5656
contactQuery.set("Email", email);
5757
contactQuery.set("UserRole", "contracts_Guest");
5858

59-
if (localStorage.getItem("TenetId")) {
59+
if (localStorage.getItem("TenantId")) {
6060
contactQuery.set("TenantId", {
6161
__type: "Pointer",
6262
className: "partners_Tenant",
63-
objectId: localStorage.getItem("TenetId")
63+
objectId: localStorage.getItem("TenantId")
6464
});
6565
}
6666

apps/OpenSign/src/components/AddUser.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,11 @@ const AddUser = (props) => {
4848
contactQuery.set("Email", email);
4949
contactQuery.set("UserRole", "contracts_User");
5050

51-
if (localStorage.getItem("TenetId")) {
51+
if (localStorage.getItem("TenantId")) {
5252
contactQuery.set("TenantId", {
5353
__type: "Pointer",
5454
className: "partners_Tenant",
55-
objectId: localStorage.getItem("TenetId")
55+
objectId: localStorage.getItem("TenantId")
5656
});
5757
}
5858

apps/OpenSign/src/components/Header.js

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,32 @@ import FullScreenButton from "./FullScreenButton";
44
import { useNavigate } from "react-router-dom";
55
import Parse from "parse";
66
import { useWindowSize } from "../hook/useWindowSize";
7-
import { openInNewTab } from "../constant/Utils";
7+
import { checkIsSubscribed, openInNewTab } from "../constant/Utils";
8+
import { isEnableSubscription } from "../constant/const";
9+
810
const Header = ({ showSidebar }) => {
9-
const navigation = useNavigate();
11+
const navigate = useNavigate();
1012
const { width } = useWindowSize();
1113
let applogo = localStorage.getItem("appLogo") || "";
1214
let username = localStorage.getItem("username");
1315
const image = localStorage.getItem("profileImg") || dp;
1416

1517
const [isOpen, setIsOpen] = useState(false);
18+
const [isSubscribe, setIsSubscribe] = useState(true);
1619

1720
const toggleDropdown = () => {
1821
setIsOpen(!isOpen);
1922
};
20-
23+
useEffect(() => {
24+
checkSubscription();
25+
// eslint-disable-next-line react-hooks/exhaustive-deps
26+
}, []);
27+
async function checkSubscription() {
28+
if (isEnableSubscription) {
29+
const getIsSubscribe = await checkIsSubscribed();
30+
setIsSubscribe(getIsSubscribe);
31+
}
32+
}
2133
const closeDropdown = () => {
2234
setIsOpen(false);
2335
Parse.User.logOut();
@@ -43,7 +55,7 @@ const Header = ({ showSidebar }) => {
4355
localStorage.setItem("baseUrl", baseUrl);
4456
localStorage.setItem("parseAppId", appid);
4557

46-
navigation("/");
58+
navigate("/");
4759
};
4860

4961
//handle to close profile drop down menu onclick screen
@@ -83,6 +95,16 @@ const Header = ({ showSidebar }) => {
8395
id="profile-menu"
8496
className="flex justify-between items-center gap-x-3"
8597
>
98+
{!isSubscribe && (
99+
<div>
100+
<button
101+
className="text-xs bg-[#002864] p-2 text-white rounded shadow"
102+
onClick={() => navigate("/subscription")}
103+
>
104+
Upgrade Now
105+
</button>
106+
</div>
107+
)}
86108
<div>
87109
<FullScreenButton />
88110
</div>
@@ -123,7 +145,7 @@ const Header = ({ showSidebar }) => {
123145
className="hover:bg-gray-100 py-1 px-2 cursor-pointer font-normal"
124146
onClick={() => {
125147
setIsOpen(false);
126-
navigation("/profile");
148+
navigate("/profile");
127149
}}
128150
>
129151
<i className="fa-regular fa-user"></i> Profile
@@ -132,7 +154,7 @@ const Header = ({ showSidebar }) => {
132154
className="hover:bg-gray-100 py-1 px-2 cursor-pointer font-normal"
133155
onClick={() => {
134156
setIsOpen(false);
135-
navigation("/changepassword");
157+
navigate("/changepassword");
136158
}}
137159
>
138160
<i className="fa-solid fa-lock"></i> Change Password

apps/OpenSign/src/components/pdf/AddRoleModal.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ const AddRoleModal = (props) => {
3030
margin: "10px 0 10px 5px"
3131
}}
3232
>
33-
e.g: Hr, Director, Manager, New joinee, Accountant, etc...
33+
e.g: Customer, Hr, Director, Manager, Student, etc...
3434
</p>
3535
<div>
3636
<div

apps/OpenSign/src/components/pdf/DropdownWidgetOption.js

Lines changed: 64 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import React, { useEffect, useState } from "react";
2-
import { themeColor } from "../../constant/const";
2+
import { isEnableSubscription, themeColor } from "../../constant/const";
33
import ModalUi from "../../primitives/ModalUi";
44
import { radioButtonWidget } from "../../constant/Utils";
55
import PremiumAlertHeader from "../../primitives/PremiumAlertHeader";
6+
import Upgrade from "../../primitives/Upgrade";
67
function DropdownWidgetOption(props) {
78
const [dropdownOptionList, setDropdownOptionList] = useState([
89
"option-1",
@@ -241,36 +242,59 @@ function DropdownWidgetOption(props) {
241242
}}
242243
className="fa-solid fa-square-plus"
243244
></i>
244-
{props.type === "checkbox" && !props.isSignYourself && (
245-
<>
246-
<label style={{ fontSize: "13px", fontWeight: "600" }}>
247-
Minimun check
248-
</label>
249-
<input
250-
required
251-
defaultValue={0}
252-
value={minCount}
253-
onChange={(e) => {
254-
const count = handleSetMinMax(e);
255-
setMinCount(count);
256-
}}
257-
className="drodown-input"
258-
/>
259-
<label style={{ fontSize: "13px", fontWeight: "600" }}>
260-
Maximum check
261-
</label>
262-
<input
263-
required
264-
defaultValue={0}
265-
value={maxCount}
266-
onChange={(e) => {
267-
const count = handleSetMinMax(e);
268-
setMaxCount(count);
269-
}}
270-
className="drodown-input"
271-
/>
272-
</>
273-
)}
245+
<div>
246+
{props.type === "checkbox" && !props.isSignYourself && (
247+
<>
248+
<label
249+
style={{
250+
fontSize: "13px",
251+
fontWeight: "600",
252+
color: !props.isSubscribe && "gray"
253+
}}
254+
>
255+
Minimun check
256+
</label>
257+
{!props.isSubscribe && isEnableSubscription && <Upgrade />}
258+
<input
259+
required
260+
defaultValue={0}
261+
value={minCount}
262+
onChange={(e) => {
263+
const count = handleSetMinMax(e);
264+
setMinCount(count);
265+
}}
266+
className={
267+
props.isSubscribe || !isEnableSubscription
268+
? "drodown-input"
269+
: "disabled drodown-input"
270+
}
271+
/>
272+
<label
273+
style={{
274+
fontSize: "13px",
275+
fontWeight: "600",
276+
color: !props.isSubscribe && "gray"
277+
}}
278+
>
279+
Maximum check
280+
</label>
281+
<input
282+
required
283+
defaultValue={0}
284+
value={maxCount}
285+
onChange={(e) => {
286+
const count = handleSetMinMax(e);
287+
setMaxCount(count);
288+
}}
289+
className={
290+
props.isSubscribe || !isEnableSubscription
291+
? "drodown-input"
292+
: "disabled drodown-input"
293+
}
294+
/>
295+
</>
296+
)}
297+
</div>
274298
</div>
275299
{["dropdown", radioButtonWidget].includes(props.type) && (
276300
<>
@@ -378,13 +402,15 @@ function DropdownWidgetOption(props) {
378402
</div>
379403
)}
380404
</div>
381-
{props.type === "checkbox" && !props.isSignYourself && (
382-
<PremiumAlertHeader
383-
message={
384-
"Field validations are free in beta, this feature will incur a fee later."
385-
}
386-
/>
387-
)}
405+
{props.type === "checkbox" &&
406+
!props.isSignYourself &&
407+
!isEnableSubscription && (
408+
<PremiumAlertHeader
409+
message={
410+
"Field validations are free in beta, this feature will incur a fee later."
411+
}
412+
/>
413+
)}
388414
<div
389415
className={`${
390416
props.type === "checkbox" && !props.isSignYourself

apps/OpenSign/src/components/pdf/EmailComponent.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ function EmailComponent({
1515
setSuccessEmail,
1616
pdfName,
1717
sender,
18-
setIsAlert
18+
setIsAlert,
19+
extUserId
1920
}) {
2021
const [emailList, setEmailList] = useState([]);
2122
const [emailValue, setEmailValue] = useState();
@@ -38,6 +39,7 @@ function EmailComponent({
3839
const openSignUrl = "https://www.opensignlabs.com/contact-us";
3940
const themeBGcolor = themeColor;
4041
let params = {
42+
extUserId: extUserId,
4143
pdfName: pdfName,
4244
url: pdfUrl,
4345
recipient: emailList[i],

apps/OpenSign/src/components/pdf/SignerListPlace.js

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import React from "react";
22
import { themeColor } from "../../constant/const";
33
import RecipientList from "./RecipientList";
4+
import { Tooltip } from "react-tooltip";
45

56
function SignerListPlace(props) {
67
return (
@@ -13,6 +14,58 @@ function SignerListPlace(props) {
1314
>
1415
<span className="signedStyle">
1516
{props.title ? props.title : "Recipients"}
17+
<span className="absolute text-xs z-[30] mt-1 ml-0.5">
18+
{props?.title === "Roles" && (
19+
<>
20+
<a data-tooltip-id="my-tooltip">
21+
<sup>
22+
<i
23+
className="fa-solid fa-question rounded-full"
24+
style={{
25+
borderColor: "white",
26+
color: "white",
27+
fontSize: 11,
28+
borderWidth: 1.5,
29+
padding: "1px 3px"
30+
}}
31+
></i>
32+
</sup>
33+
</a>
34+
<Tooltip id="my-tooltip">
35+
<div className="max-w-[450px]">
36+
<p className="font-bold">What are template roles?</p>
37+
<p>
38+
Begin by specifying each role needed for the completion of
39+
the document. Think about the parties involved in the
40+
signing process and what their responsibilities are.
41+
Common roles include HR for internal documents, Customer
42+
for agreements or Vendor for business agreements.{" "}
43+
</p>
44+
<p className="font-bold">
45+
Why pre-attach users to some roles?
46+
</p>
47+
<p>
48+
For roles that consistently involve the same individual
49+
(e.g., the CEO&apos;s signature on employee offer
50+
letters), you can pre-attach a user to a role within the
51+
template. This step is optional but recommended for
52+
efficiency and consistency across documents.
53+
</p>
54+
<p className="font-bold">
55+
When do i specify the user attached to each role?
56+
</p>
57+
<p>
58+
When you create a document from your template, you&apos;ll
59+
be prompted to attach users to each defined role. If a
60+
role already has a user attached, this will be pre-filled,
61+
but you can modify it as needed before sending out the
62+
document.
63+
</p>
64+
</div>
65+
</Tooltip>
66+
</>
67+
)}
68+
</span>
1669
</span>
1770
</div>
1871
<div className="signerList">

0 commit comments

Comments
 (0)