Merge pull request #622 from OpenSignLabs/staging

v1.5.1
This commit is contained in:
Amol
2024-04-18 22:07:23 +05:30
committed by GitHub
8 changed files with 111 additions and 59 deletions
@@ -40,7 +40,7 @@ function PlaceholderType(props) {
const validateExpression = (regexValidation) => {
if (textValue) {
let regexObject = regexValidation;
if (props.pos?.options.validation.type === "regex") {
if (props.pos?.options?.validation?.type === "regex") {
regexObject = RegexParser(regexValidation);
}
// new RegExp(regexValidation);
@@ -63,7 +63,7 @@ function PlaceholderType(props) {
validateExpression(regexValidation);
break;
case "number":
regexValidation = /^\d+$/;
regexValidation = /^[0-9\s]*$/;
validateExpression(regexValidation);
break;
case "text":
@@ -89,11 +89,11 @@ function PlaceholderType(props) {
case "number":
setValidatePlaceholder("12345");
break;
case textInputWidget:
setValidatePlaceholder("enter text");
case "text":
setValidatePlaceholder("please enter text");
break;
default:
setValidatePlaceholder("enter text");
setValidatePlaceholder("please enter value");
}
}
@@ -407,7 +407,7 @@ function PlaceholderType(props) {
(props.isNeedSign && props.data?.signerObjId === props.signerObjId) ? (
<textarea
ref={inputRef}
placeholder={validatePlaceholder}
placeholder={validatePlaceholder || "please enter value"}
rows={1}
onKeyDown={handleEnterPress}
value={textValue}
@@ -710,7 +710,7 @@ function PlaceholderType(props) {
(props.isNeedSign && props.data?.signerObjId === props.signerObjId) ? (
<textarea
ref={inputRef}
placeholder={"email"}
placeholder={"enter email"}
rows={1}
onKeyDown={handleEnterPress}
value={textValue}
@@ -782,7 +782,7 @@ function PlaceholderType(props) {
case textWidget:
return (
<textarea
placeholder="Enter label"
placeholder="Enter text"
rows={1}
onKeyDown={handleEnterPress}
value={textValue}
@@ -13,7 +13,7 @@ const WidgetNameModal = (props) => {
defaultValue: "",
status: "required",
hint: "",
textvalidate: "text"
textvalidate: ""
});
const [isValid, setIsValid] = useState(true);
const statusArr = ["Required", "Optional"];
@@ -48,7 +48,7 @@ const WidgetNameModal = (props) => {
defaultValue: "",
status: "required",
hint: "",
textvalidate: "text"
textvalidate: ""
});
}
};
@@ -82,7 +82,7 @@ const WidgetNameModal = (props) => {
function handleBlurRegex() {
if (!formdata.textvalidate) {
setFormdata({ ...formdata, textvalidate: "text" });
setFormdata({ ...formdata, textvalidate: "" });
} else {
if (formdata.defaultValue) {
const regexObject = RegexParser(
+4 -4
View File
@@ -323,15 +323,15 @@ export const addWidgetOptions = (type) => {
options: { isReadOnly: false, isHideLabel: false }
};
case textInputWidget:
return { ...defaultOpt, validation: { type: "text", pattern: "" } };
return { ...defaultOpt };
case "initials":
return defaultOpt;
case "name":
return { ...defaultOpt, validation: { type: "text", pattern: "" } };
return { ...defaultOpt };
case "company":
return { ...defaultOpt, validation: { type: "text", pattern: "" } };
return { ...defaultOpt };
case "job title":
return { ...defaultOpt, validation: { type: "text", pattern: "" } };
return { ...defaultOpt };
case "date":
return {
...defaultOpt,
+10 -7
View File
@@ -1,6 +1,10 @@
import axios from "axios";
const parseAppId = localStorage.getItem("parseAppId");
const serverUrl = localStorage.getItem("baseUrl");
const parseAppId = process.env.REACT_APP_APPID
? process.env.REACT_APP_APPID
: "opensign";
const serverUrl = process.env.REACT_APP_SERVERURL
? process.env.REACT_APP_SERVERURL
: window.location.origin + "/api/app";
export const SaveFileSize = async (size, imageUrl, tenantId) => {
//checking server url and save file's size
@@ -12,7 +16,7 @@ export const SaveFileSize = async (size, imageUrl, tenantId) => {
const _tenantPtr = JSON.stringify(tenantPtr);
try {
const res = await axios.get(
`${serverUrl}classes/partners_TenantCredits?where={"PartnersTenant":${_tenantPtr}}`,
`${serverUrl}/classes/partners_TenantCredits?where={"PartnersTenant":${_tenantPtr}}`,
{
headers: {
"Content-Type": "application/json",
@@ -30,7 +34,7 @@ export const SaveFileSize = async (size, imageUrl, tenantId) => {
: size
};
await axios.put(
`${serverUrl}classes/partners_TenantCredits/${response[0].objectId}`,
`${serverUrl}/classes/partners_TenantCredits/${response[0].objectId}`,
data,
{
headers: {
@@ -41,7 +45,7 @@ export const SaveFileSize = async (size, imageUrl, tenantId) => {
);
} else {
data = { usedStorage: size, PartnersTenant: tenantPtr };
await axios.post(`${serverUrl}classes/partners_TenantCredits`, data, {
await axios.post(`${serverUrl}/classes/partners_TenantCredits`, data, {
headers: {
"Content-Type": "application/json",
"X-Parse-Application-Id": parseAppId
@@ -64,7 +68,7 @@ const saveDataFile = async (size, imageUrl, tenantPtr) => {
// console.log("data save",file, data)
try {
await axios.post(`${serverUrl}classes/partners_DataFiles`, data, {
await axios.post(`${serverUrl}/classes/partners_DataFiles`, data, {
headers: {
"Content-Type": "application/json",
"X-Parse-Application-Id": parseAppId
@@ -74,4 +78,3 @@ const saveDataFile = async (size, imageUrl, tenantPtr) => {
console.log("err in save usage ", err);
}
};
+17 -7
View File
@@ -593,15 +593,21 @@ function PdfRequestFiles() {
setSignedSigners([]);
setUnSignedSigners([]);
getDocumentDetails();
const index = pdfDetails?.[0].Signers.findIndex(
(x) => x.Email === jsonSender.email
);
const newIndex = index + 1;
const user = pdfDetails?.[0].Signers[newIndex];
if (user) {
setIsCompleted({
isModal: true,
message:
"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."
});
}
if (sendInOrder) {
const index = pdfDetails?.[0].Signers.findIndex(
(x) => x.Email === jsonSender.email
);
const requestBody = pdfDetails?.[0]?.RequestBody;
const requestSubject = pdfDetails?.[0]?.RequestSubject;
const newIndex = index + 1;
const user = pdfDetails?.[0].Signers[newIndex];
if (user) {
const expireDate = pdfDetails?.[0].ExpiryDate.iso;
const newDate = new Date(expireDate);
@@ -1207,7 +1213,11 @@ function PdfRequestFiles() {
}}
>
<div style={{ height: "100%", padding: 20 }}>
<p>This document has been signed by all Signers.</p>
<p>
{" "}
{isCompleted?.message ||
"This document has been signed by all Signers."}
</p>
<div
style={{
+36 -25
View File
@@ -987,26 +987,32 @@ function PlaceHolderSign() {
return shareLinkList.map((data, ind) => {
return (
<div
className="flex flex-col md:flex-row justify-between mb-1"
className="flex flex-row justify-between items-center mb-1"
key={ind}
>
{copied && <Alert type="success">Copied</Alert>}
<span className="w-[200px] md:w-[300px] whitespace-nowrap overflow-hidden text-ellipsis ">
<span className="w-[220px] md:w-[300px] whitespace-nowrap overflow-hidden text-ellipsis ">
{data.signerEmail}
</span>
<div className=" ">
<span
className="mr-3 underline text-blue-700 cursor-pointer "
<div className="flex flex-row items-center gap-3 ">
<button
onClick={() => copytoclipboard(data.url)}
type="button"
className="flex flex-row items-center text-white font-[500]"
>
<i className="fa-solid fa-link "></i> copy link
</span>
<i
className="fa-solid fa-link underline text-blue-700"
aria-hidden="true"
></i>
<span className=" hidden md:block ml-1 underline text-blue-700">
Copy link
</span>
</button>
<RWebShare
data={{
url: data.url,
title: "Sign url"
}}
// onClick={() => console.log("shared successfully!")}
>
<i
className="fa-solid fa-share-from-square cursor-pointer "
@@ -1369,10 +1375,7 @@ function PlaceHolderSign() {
inputype = options.includes(defaultdata.textvalidate)
? defaultdata.textvalidate
: "regex";
} else {
inputype = "text";
}
const filterSignerPos = signerPos.filter((data) => data.Id === uniqueId);
if (filterSignerPos.length > 0) {
const getPlaceHolder = filterSignerPos[0].placeHolder;
@@ -1395,11 +1398,14 @@ function PlaceHolderSign() {
status: defaultdata?.status || "required",
hint: defaultdata?.hint || "",
defaultValue: defaultdata?.defaultValue || "",
validation: {
type: inputype,
pattern:
inputype === "regex" ? defaultdata.textvalidate : ""
}
validation:
(isSubscribe || !isEnableSubscription) && inputype
? {
type: inputype,
pattern:
inputype === "regex" ? defaultdata.textvalidate : ""
}
: {}
}
};
} else {
@@ -1565,7 +1571,7 @@ function PlaceHolderSign() {
{
selector: '[data-tut="assignSigner"]',
content:
" Please assign a new signer to use this icon for the placeholder. ",
" 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. ",
position: "top",
style: { fontSize: "13px" }
}
@@ -1689,7 +1695,10 @@ function PlaceHolderSign() {
style={{ padding: 20 }}
>
{isSendAlert.mssg === "sure" ? (
<span>Please add field for all recipients.</span>
<span>
Please add at least one signature field for all
recipients.
</span>
) : isSendAlert.mssg === textWidget ? (
<p>Please confirm that you have filled the text field.</p>
) : (
@@ -1727,7 +1736,7 @@ function PlaceHolderSign() {
)}
<div
className={
"flex flex-col md:flex-row md:items-center md:gap-6 mt-2 "
"flex flex-row md:items-center gap-2 md:gap-6 mt-2 "
}
>
<div className="flex flex-row gap-2">
@@ -1768,10 +1777,12 @@ function PlaceHolderSign() {
)}
{!isSubscribe && isEnableSubscription && (
<Upgrade
message="Upgrade to customize Email"
newWindow={true}
/>
<div className="mt-2">
<Upgrade
message="Upgrade to customize Email"
newWindow={true}
/>
</div>
)}
</div>
</>
@@ -1781,7 +1792,7 @@ function PlaceHolderSign() {
{isSendAlert.mssg === "confirm" && (
<>
<div className="flex justify-center items-center mt-4">
<div className="flex justify-center items-center mt-3">
<span
style={{
height: 1,
@@ -1798,7 +1809,7 @@ function PlaceHolderSign() {
}}
></span>
</div>
<div className="mt-4 mb-3">{handleShareList()}</div>
<div className="mt-3 mb-3">{handleShareList()}</div>
</>
)}
</div>
+11 -4
View File
@@ -19,15 +19,22 @@ const PlanSubscriptions = () => {
const userDetails = JSON.parse(localStorage.getItem("userDetails"));
const name =
userDetails && userDetails.name ? "first_name=" + userDetails.name : "";
userDetails && userDetails.name
? "first_name=" + encodeURIComponent(userDetails.name)
: "";
const email =
userDetails && userDetails.email ? "&email=" + userDetails.email : "";
userDetails && userDetails.email
? "&email=" + encodeURIComponent(userDetails.email)
: "";
const company =
userDetails && userDetails.company
? "&company_name=" + userDetails.company
? "&company_name=" + encodeURIComponent(userDetails.company)
: "";
const phone =
userDetails && userDetails.phone ? "&mobile=" + userDetails.phone : "";
userDetails && userDetails.phone
? "&mobile=" + encodeURIComponent(userDetails.phone)
: "";
const details =
"?shipping_country_code=US&billing_country_code=US&billing_state_code=CA&" +
name +
+22 -1
View File
@@ -145,6 +145,7 @@ const TemplatePlaceholder = () => {
const [currWidgetsDetails, setCurrWidgetsDetails] = useState([]);
const [isCheckbox, setIsCheckbox] = useState(false);
const [widgetName, setWidgetName] = useState(false);
const [isAddRole, setIsAddRole] = useState(false);
const senderUser =
localStorage.getItem(
`Parse/${localStorage.getItem("parseAppId")}/currentUser`
@@ -481,9 +482,20 @@ const TemplatePlaceholder = () => {
} else {
setIsReceipent(false);
}
} else {
setIsAddRole(true);
}
};
const tourAddRole = [
{
selector: '[data-tut="reactourAddbtn"]',
content: "You need to add a role before you can add fields for it. ",
position: "top",
style: { fontSize: "13px" }
}
];
//function for get pdf page details
const pageDetails = async (pdf) => {
const load = {
@@ -1218,6 +1230,15 @@ const TemplatePlaceholder = () => {
closeWithMask={false}
/>
)}
{isAddRole && (
<Tour
onRequestClose={() => setIsAddRole(false)}
steps={tourAddRole}
isOpen={isAddRole}
rounded={5}
closeWithMask={false}
/>
)}
{/* this component used to render all pdf pages in left side */}
<RenderAllPdfPage
signPdfUrl={pdfDetails[0].URL}
@@ -1243,7 +1264,7 @@ const TemplatePlaceholder = () => {
handleClose={() => setIsSendAlert(false)}
>
<div style={{ height: "100%", padding: 20 }}>
<p>Please add field for all recipients.</p>
<p>Please add at least one signature field for all roles.</p>
</div>
</ModalUi>
<ModalUi