Skip to content

Commit 3f23bdd

Browse files
authored
Merge pull request #622 from OpenSignLabs/staging
v1.5.1
2 parents 493731a + 440d253 commit 3f23bdd

File tree

8 files changed

+111
-59
lines changed

8 files changed

+111
-59
lines changed

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ function PlaceholderType(props) {
4040
const validateExpression = (regexValidation) => {
4141
if (textValue) {
4242
let regexObject = regexValidation;
43-
if (props.pos?.options.validation.type === "regex") {
43+
if (props.pos?.options?.validation?.type === "regex") {
4444
regexObject = RegexParser(regexValidation);
4545
}
4646
// new RegExp(regexValidation);
@@ -63,7 +63,7 @@ function PlaceholderType(props) {
6363
validateExpression(regexValidation);
6464
break;
6565
case "number":
66-
regexValidation = /^\d+$/;
66+
regexValidation = /^[0-9\s]*$/;
6767
validateExpression(regexValidation);
6868
break;
6969
case "text":
@@ -89,11 +89,11 @@ function PlaceholderType(props) {
8989
case "number":
9090
setValidatePlaceholder("12345");
9191
break;
92-
case textInputWidget:
93-
setValidatePlaceholder("enter text");
92+
case "text":
93+
setValidatePlaceholder("please enter text");
9494
break;
9595
default:
96-
setValidatePlaceholder("enter text");
96+
setValidatePlaceholder("please enter value");
9797
}
9898
}
9999

@@ -407,7 +407,7 @@ function PlaceholderType(props) {
407407
(props.isNeedSign && props.data?.signerObjId === props.signerObjId) ? (
408408
<textarea
409409
ref={inputRef}
410-
placeholder={validatePlaceholder}
410+
placeholder={validatePlaceholder || "please enter value"}
411411
rows={1}
412412
onKeyDown={handleEnterPress}
413413
value={textValue}
@@ -710,7 +710,7 @@ function PlaceholderType(props) {
710710
(props.isNeedSign && props.data?.signerObjId === props.signerObjId) ? (
711711
<textarea
712712
ref={inputRef}
713-
placeholder={"email"}
713+
placeholder={"enter email"}
714714
rows={1}
715715
onKeyDown={handleEnterPress}
716716
value={textValue}
@@ -782,7 +782,7 @@ function PlaceholderType(props) {
782782
case textWidget:
783783
return (
784784
<textarea
785-
placeholder="Enter label"
785+
placeholder="Enter text"
786786
rows={1}
787787
onKeyDown={handleEnterPress}
788788
value={textValue}

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const WidgetNameModal = (props) => {
1313
defaultValue: "",
1414
status: "required",
1515
hint: "",
16-
textvalidate: "text"
16+
textvalidate: ""
1717
});
1818
const [isValid, setIsValid] = useState(true);
1919
const statusArr = ["Required", "Optional"];
@@ -48,7 +48,7 @@ const WidgetNameModal = (props) => {
4848
defaultValue: "",
4949
status: "required",
5050
hint: "",
51-
textvalidate: "text"
51+
textvalidate: ""
5252
});
5353
}
5454
};
@@ -82,7 +82,7 @@ const WidgetNameModal = (props) => {
8282

8383
function handleBlurRegex() {
8484
if (!formdata.textvalidate) {
85-
setFormdata({ ...formdata, textvalidate: "text" });
85+
setFormdata({ ...formdata, textvalidate: "" });
8686
} else {
8787
if (formdata.defaultValue) {
8888
const regexObject = RegexParser(

apps/OpenSign/src/constant/Utils.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -323,15 +323,15 @@ export const addWidgetOptions = (type) => {
323323
options: { isReadOnly: false, isHideLabel: false }
324324
};
325325
case textInputWidget:
326-
return { ...defaultOpt, validation: { type: "text", pattern: "" } };
326+
return { ...defaultOpt };
327327
case "initials":
328328
return defaultOpt;
329329
case "name":
330-
return { ...defaultOpt, validation: { type: "text", pattern: "" } };
330+
return { ...defaultOpt };
331331
case "company":
332-
return { ...defaultOpt, validation: { type: "text", pattern: "" } };
332+
return { ...defaultOpt };
333333
case "job title":
334-
return { ...defaultOpt, validation: { type: "text", pattern: "" } };
334+
return { ...defaultOpt };
335335
case "date":
336336
return {
337337
...defaultOpt,

apps/OpenSign/src/constant/saveFileSize.js

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
import axios from "axios";
2-
const parseAppId = localStorage.getItem("parseAppId");
3-
const serverUrl = localStorage.getItem("baseUrl");
2+
const parseAppId = process.env.REACT_APP_APPID
3+
? process.env.REACT_APP_APPID
4+
: "opensign";
5+
const serverUrl = process.env.REACT_APP_SERVERURL
6+
? process.env.REACT_APP_SERVERURL
7+
: window.location.origin + "/api/app";
48

59
export const SaveFileSize = async (size, imageUrl, tenantId) => {
610
//checking server url and save file's size
@@ -12,7 +16,7 @@ export const SaveFileSize = async (size, imageUrl, tenantId) => {
1216
const _tenantPtr = JSON.stringify(tenantPtr);
1317
try {
1418
const res = await axios.get(
15-
`${serverUrl}classes/partners_TenantCredits?where={"PartnersTenant":${_tenantPtr}}`,
19+
`${serverUrl}/classes/partners_TenantCredits?where={"PartnersTenant":${_tenantPtr}}`,
1620
{
1721
headers: {
1822
"Content-Type": "application/json",
@@ -30,7 +34,7 @@ export const SaveFileSize = async (size, imageUrl, tenantId) => {
3034
: size
3135
};
3236
await axios.put(
33-
`${serverUrl}classes/partners_TenantCredits/${response[0].objectId}`,
37+
`${serverUrl}/classes/partners_TenantCredits/${response[0].objectId}`,
3438
data,
3539
{
3640
headers: {
@@ -41,7 +45,7 @@ export const SaveFileSize = async (size, imageUrl, tenantId) => {
4145
);
4246
} else {
4347
data = { usedStorage: size, PartnersTenant: tenantPtr };
44-
await axios.post(`${serverUrl}classes/partners_TenantCredits`, data, {
48+
await axios.post(`${serverUrl}/classes/partners_TenantCredits`, data, {
4549
headers: {
4650
"Content-Type": "application/json",
4751
"X-Parse-Application-Id": parseAppId
@@ -64,7 +68,7 @@ const saveDataFile = async (size, imageUrl, tenantPtr) => {
6468

6569
// console.log("data save",file, data)
6670
try {
67-
await axios.post(`${serverUrl}classes/partners_DataFiles`, data, {
71+
await axios.post(`${serverUrl}/classes/partners_DataFiles`, data, {
6872
headers: {
6973
"Content-Type": "application/json",
7074
"X-Parse-Application-Id": parseAppId
@@ -74,4 +78,3 @@ const saveDataFile = async (size, imageUrl, tenantPtr) => {
7478
console.log("err in save usage ", err);
7579
}
7680
};
77-

apps/OpenSign/src/pages/PdfRequestFiles.js

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -593,15 +593,21 @@ function PdfRequestFiles() {
593593
setSignedSigners([]);
594594
setUnSignedSigners([]);
595595
getDocumentDetails();
596+
const index = pdfDetails?.[0].Signers.findIndex(
597+
(x) => x.Email === jsonSender.email
598+
);
599+
const newIndex = index + 1;
600+
const user = pdfDetails?.[0].Signers[newIndex];
601+
if (user) {
602+
setIsCompleted({
603+
isModal: true,
604+
message:
605+
"You have successfully signed the document. You can download or print a copy of the partially signed document. A copy of the digitally signed document will be sent to the owner over email once it is signed by all signers."
606+
});
607+
}
596608
if (sendInOrder) {
597-
const index = pdfDetails?.[0].Signers.findIndex(
598-
(x) => x.Email === jsonSender.email
599-
);
600609
const requestBody = pdfDetails?.[0]?.RequestBody;
601610
const requestSubject = pdfDetails?.[0]?.RequestSubject;
602-
603-
const newIndex = index + 1;
604-
const user = pdfDetails?.[0].Signers[newIndex];
605611
if (user) {
606612
const expireDate = pdfDetails?.[0].ExpiryDate.iso;
607613
const newDate = new Date(expireDate);
@@ -1207,7 +1213,11 @@ function PdfRequestFiles() {
12071213
}}
12081214
>
12091215
<div style={{ height: "100%", padding: 20 }}>
1210-
<p>This document has been signed by all Signers.</p>
1216+
<p>
1217+
{" "}
1218+
{isCompleted?.message ||
1219+
"This document has been signed by all Signers."}
1220+
</p>
12111221

12121222
<div
12131223
style={{

apps/OpenSign/src/pages/PlaceHolderSign.js

Lines changed: 36 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -987,26 +987,32 @@ function PlaceHolderSign() {
987987
return shareLinkList.map((data, ind) => {
988988
return (
989989
<div
990-
className="flex flex-col md:flex-row justify-between mb-1"
990+
className="flex flex-row justify-between items-center mb-1"
991991
key={ind}
992992
>
993993
{copied && <Alert type="success">Copied</Alert>}
994-
<span className="w-[200px] md:w-[300px] whitespace-nowrap overflow-hidden text-ellipsis ">
994+
<span className="w-[220px] md:w-[300px] whitespace-nowrap overflow-hidden text-ellipsis ">
995995
{data.signerEmail}
996996
</span>
997-
<div className=" ">
998-
<span
999-
className="mr-3 underline text-blue-700 cursor-pointer "
997+
<div className="flex flex-row items-center gap-3 ">
998+
<button
1000999
onClick={() => copytoclipboard(data.url)}
1000+
type="button"
1001+
className="flex flex-row items-center text-white font-[500]"
10011002
>
1002-
<i className="fa-solid fa-link "></i> copy link
1003-
</span>
1003+
<i
1004+
className="fa-solid fa-link underline text-blue-700"
1005+
aria-hidden="true"
1006+
></i>
1007+
<span className=" hidden md:block ml-1 underline text-blue-700">
1008+
Copy link
1009+
</span>
1010+
</button>
10041011
<RWebShare
10051012
data={{
10061013
url: data.url,
10071014
title: "Sign url"
10081015
}}
1009-
// onClick={() => console.log("shared successfully!")}
10101016
>
10111017
<i
10121018
className="fa-solid fa-share-from-square cursor-pointer "
@@ -1369,10 +1375,7 @@ function PlaceHolderSign() {
13691375
inputype = options.includes(defaultdata.textvalidate)
13701376
? defaultdata.textvalidate
13711377
: "regex";
1372-
} else {
1373-
inputype = "text";
13741378
}
1375-
13761379
const filterSignerPos = signerPos.filter((data) => data.Id === uniqueId);
13771380
if (filterSignerPos.length > 0) {
13781381
const getPlaceHolder = filterSignerPos[0].placeHolder;
@@ -1395,11 +1398,14 @@ function PlaceHolderSign() {
13951398
status: defaultdata?.status || "required",
13961399
hint: defaultdata?.hint || "",
13971400
defaultValue: defaultdata?.defaultValue || "",
1398-
validation: {
1399-
type: inputype,
1400-
pattern:
1401-
inputype === "regex" ? defaultdata.textvalidate : ""
1402-
}
1401+
validation:
1402+
(isSubscribe || !isEnableSubscription) && inputype
1403+
? {
1404+
type: inputype,
1405+
pattern:
1406+
inputype === "regex" ? defaultdata.textvalidate : ""
1407+
}
1408+
: {}
14031409
}
14041410
};
14051411
} else {
@@ -1565,7 +1571,7 @@ function PlaceHolderSign() {
15651571
{
15661572
selector: '[data-tut="assignSigner"]',
15671573
content:
1568-
" Please assign a new signer to use this icon for the placeholder. ",
1574+
" You need to attach a Signer to every role. You can do that by clicking this icon. Once you select a Signer it will be attached to all the fields associated with that role which appear in the same colour. ",
15691575
position: "top",
15701576
style: { fontSize: "13px" }
15711577
}
@@ -1689,7 +1695,10 @@ function PlaceHolderSign() {
16891695
style={{ padding: 20 }}
16901696
>
16911697
{isSendAlert.mssg === "sure" ? (
1692-
<span>Please add field for all recipients.</span>
1698+
<span>
1699+
Please add at least one signature field for all
1700+
recipients.
1701+
</span>
16931702
) : isSendAlert.mssg === textWidget ? (
16941703
<p>Please confirm that you have filled the text field.</p>
16951704
) : (
@@ -1727,7 +1736,7 @@ function PlaceHolderSign() {
17271736
)}
17281737
<div
17291738
className={
1730-
"flex flex-col md:flex-row md:items-center md:gap-6 mt-2 "
1739+
"flex flex-row md:items-center gap-2 md:gap-6 mt-2 "
17311740
}
17321741
>
17331742
<div className="flex flex-row gap-2">
@@ -1768,10 +1777,12 @@ function PlaceHolderSign() {
17681777
)}
17691778

17701779
{!isSubscribe && isEnableSubscription && (
1771-
<Upgrade
1772-
message="Upgrade to customize Email"
1773-
newWindow={true}
1774-
/>
1780+
<div className="mt-2">
1781+
<Upgrade
1782+
message="Upgrade to customize Email"
1783+
newWindow={true}
1784+
/>
1785+
</div>
17751786
)}
17761787
</div>
17771788
</>
@@ -1781,7 +1792,7 @@ function PlaceHolderSign() {
17811792

17821793
{isSendAlert.mssg === "confirm" && (
17831794
<>
1784-
<div className="flex justify-center items-center mt-4">
1795+
<div className="flex justify-center items-center mt-3">
17851796
<span
17861797
style={{
17871798
height: 1,
@@ -1798,7 +1809,7 @@ function PlaceHolderSign() {
17981809
}}
17991810
></span>
18001811
</div>
1801-
<div className="mt-4 mb-3">{handleShareList()}</div>
1812+
<div className="mt-3 mb-3">{handleShareList()}</div>
18021813
</>
18031814
)}
18041815
</div>

apps/OpenSign/src/pages/PlanSubscriptions.js

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,22 @@ const PlanSubscriptions = () => {
1919

2020
const userDetails = JSON.parse(localStorage.getItem("userDetails"));
2121
const name =
22-
userDetails && userDetails.name ? "first_name=" + userDetails.name : "";
22+
userDetails && userDetails.name
23+
? "first_name=" + encodeURIComponent(userDetails.name)
24+
: "";
2325
const email =
24-
userDetails && userDetails.email ? "&email=" + userDetails.email : "";
26+
userDetails && userDetails.email
27+
? "&email=" + encodeURIComponent(userDetails.email)
28+
: "";
2529
const company =
2630
userDetails && userDetails.company
27-
? "&company_name=" + userDetails.company
31+
? "&company_name=" + encodeURIComponent(userDetails.company)
2832
: "";
2933
const phone =
30-
userDetails && userDetails.phone ? "&mobile=" + userDetails.phone : "";
34+
userDetails && userDetails.phone
35+
? "&mobile=" + encodeURIComponent(userDetails.phone)
36+
: "";
37+
3138
const details =
3239
"?shipping_country_code=US&billing_country_code=US&billing_state_code=CA&" +
3340
name +

0 commit comments

Comments
 (0)