Skip to content

🔥 The free & Open Source DocuSign alternative

fix: placeholder display issue of all signers after save placeholder and login flow

RaktimaNXGf9e6f49edec5
diff --git a/microfrontends/SignDocuments/src/Component/LegaDrive/FolderDrive/legaDriveComponent.js b/microfrontends/SignDocuments/src/Component/LegaDrive/FolderDrive/legaDriveComponent.js
index df62c822d..1c7ae57c1 100644
--- a/microfrontends/SignDocuments/src/Component/LegaDrive/FolderDrive/legaDriveComponent.js
+++ b/microfrontends/SignDocuments/src/Component/LegaDrive/FolderDrive/legaDriveComponent.js
@@ -17,7 +17,7 @@ function PdfFileComponent({
setDocId,
setIsLoading,
setPdfData,
- isList,
+ isList
}) {
const [rename, setRename] = useState("");
const [renameValue, setRenameValue] = useState("");
@@ -39,12 +39,12 @@ function PdfFileComponent({
const handleOnclikFolder = (data) => {
const folderData = {
name: data.Name,
- objectId: data.objectId,
+ objectId: data.objectId
};
setFolderName((prev) => [...prev, folderData]);
const loadObj = {
isLoad: true,
- message: "This might take some time",
+ message: "This might take some time"
};
setIsLoading(loadObj);
@@ -57,7 +57,7 @@ function PdfFileComponent({
if (trimmedValue.length > 0) {
const updateName = {
- Name: renameValue,
+ Name: renameValue
};
const docId = data.objectId;
@@ -83,8 +83,8 @@ function PdfFileComponent({
headers: {
"Content-Type": "application/json",
"X-Parse-Application-Id": localStorage.getItem("parseAppId"),
- "X-Parse-Session-Token": localStorage.getItem("accesstoken"),
- },
+ "X-Parse-Session-Token": localStorage.getItem("accesstoken")
+ }
}
)
.then((result) => {
@@ -99,7 +99,6 @@ function PdfFileComponent({
//function for navigate user to microapp-signature component
const checkPdfStatus = async (data) => {
-
const hostUrl = getHostUrl();
const expireDate = data.ExpiryDate.iso;
const expireUpdateDate = new Date(expireDate).getTime();
@@ -116,10 +115,7 @@ function PdfFileComponent({
// window.location.hash = `/pdfRequestFiles/${data.objectId}`;
} else if (data.IsCompleted && !signerExist) {
- navigate(
- `${hostUrl}signaturePdf/${data.objectId}`
- );
- // window.location.hash = `/recipientSignPdf/${data.objectId}/${data.ExtUserPtr.Phone}`;
+ navigate(`${hostUrl}signaturePdf/${data.objectId}`);
}
//checking if document has declined by someone
else if (isDecline) {
@@ -231,8 +227,8 @@ function PdfFileComponent({
const sanitizeFileName = (pdfName) => {
// Replace spaces with underscore
- return pdfName.replace(/ /g, '_');
- }
+ return pdfName.replace(/ /g, "_");
+ };
const handleEnterPress = (e, data) => {
if (e.key === "Enter") {
@@ -312,7 +308,7 @@ function PdfFileComponent({
style={{
display: "flex",
flexDirection: "column",
- cursor: "pointer",
+ cursor: "pointer"
}}
>
<img
@@ -344,7 +340,7 @@ function PdfFileComponent({
width: "100px",
border: "1.5px solid black",
borderRadius: "2px",
- fontSize: "10px",
+ fontSize: "10px"
}}
/>
) : (
@@ -385,7 +381,7 @@ function PdfFileComponent({
style={{
display: "flex",
flexDirection: "column",
- cursor: "pointer",
+ cursor: "pointer"
}}
>
<img
@@ -417,7 +413,7 @@ function PdfFileComponent({
width: "100px",
border: "1.5px solid black",
borderRadius: "2px",
- fontSize: "10px",
+ fontSize: "10px"
}}
/>
) : (
@@ -484,7 +480,7 @@ function PdfFileComponent({
width: "100px",
border: "1.5px solid black",
borderRadius: "2px",
- fontSize: "10px",
+ fontSize: "10px"
}}
/>
) : (
@@ -576,8 +572,8 @@ function PdfFileComponent({
//component to handle type of document and render according to type
return isList ? (
- <div className="container" style={{overflowX:"auto"}}>
- <Table striped bordered hover >
+ <div className="container" style={{ overflowX: "auto" }}>
+ <Table striped bordered hover>
<thead>
<tr>
<th>Name</th>
diff --git a/microfrontends/SignDocuments/src/Component/PdfRequestFiles.js b/microfrontends/SignDocuments/src/Component/PdfRequestFiles.js
index f0e7980dc..0e0a1f129 100644
--- a/microfrontends/SignDocuments/src/Component/PdfRequestFiles.js
+++ b/microfrontends/SignDocuments/src/Component/PdfRequestFiles.js
@@ -23,7 +23,8 @@ import {
signPdfFun,
onImageSelect,
onSaveSign,
- onSaveImage
+ onSaveImage,
+ addDefaultSignatureImg
} from "../utils/Utils";
import Loader from "./component/loader";
import HandleError from "./component/HandleError";
@@ -33,6 +34,8 @@ import RenderPdf from "./component/renderPdf";
import CustomModal from "./component/CustomModal";
import AlertComponent from "./component/alertComponent";
import Title from "./component/Title";
+import DefaultSignature from "./component/defaultSignature";
+import ModalUi from "../premitives/ModalUi";
function PdfRequestFiles() {
const { docId } = useParams();
@@ -67,6 +70,10 @@ function PdfRequestFiles() {
const [isDecline, setIsDecline] = useState({ isDeclined: false });
const [currentSigner, setCurrentSigner] = useState(false);
const [isAlert, setIsAlert] = useState({ isShow: false, alertMessage: "" });
+ const [defaultSignAlert, setDefaultSignAlert] = useState({
+ isShow: false,
+ alertMessage: ""
+ });
const [isCompleted, setIsCompleted] = useState({
isCertificate: false,
isModal: false
@@ -195,7 +202,7 @@ function PdfRequestFiles() {
for (let i = 0; i < signerRes.length; i++) {
const signerId = signerRes[i].objectId;
- let isSigned = false;
+ let isSignedSignature = false;
for (let j = 0; j < checkDocIdExist.length; j++) {
const signedExist =
checkDocIdExist[j] && checkDocIdExist[j].UserPtr.objectId;
@@ -204,12 +211,12 @@ function PdfRequestFiles() {
if (signerId === signedExist) {
signers.push({ ...signerRes[i], ...signerRes[i] });
- isSigned = true;
+ isSignedSignature = true;
break;
}
// if does not match then add unsigned data in unSignedSigner array
}
- if (!isSigned) {
+ if (!isSignedSignature) {
unSignedSigner.push({ ...signerRes[i], ...signerRes[i] });
}
}
@@ -624,6 +631,27 @@ function PdfRequestFiles() {
console.log("error updating field is decline ", err);
});
};
+ //function to add default signature for all requested placeholder of sign
+ const addDefaultSignature = () => {
+ //get current signers placeholder position data
+ const currentSignerPosition = signerPos.filter(
+ (data) => data.signerObjId === signerObjectId
+ );
+ //function for save default signature url for all placeholder position
+ const updatePlace = addDefaultSignatureImg(
+ currentSignerPosition[0].placeHolder,
+ defaultSignImg
+ );
+
+ const updatesignerPos = signerPos.map((x) =>
+ x.signerObjId === signerObjectId ? { ...x, placeHolder: updatePlace } : x
+ );
+ setSignerPos(updatesignerPos);
+ setDefaultSignAlert({
+ isShow: false,
+ alertMessage: ""
+ });
+ };
return (
<DndProvider backend={HTML5Backend}>
@@ -663,11 +691,47 @@ function PdfRequestFiles() {
)}
<div className="signatureContainer" ref={divRef}>
- <AlertComponent
- isShow={isAlert.isShow}
- alertMessage={isAlert.alertMessage}
- setIsAlert={setIsAlert}
- />
+ <ModalUi
+ headerColor={"#dc3545"}
+ isOpen={isAlert.isShow}
+ title={"Alert message"}
+ handleClose={() => {
+ setIsAlert({
+ isShow: false,
+ alertMessage: ""
+ });
+ }}
+ >
+ <div style={{ height: "100%", padding: 20 }}>
+ <p>{isAlert.alertMessage}</p>
+
+ <div
+ style={{
+ height: "1px",
+ backgroundColor: "#9f9f9f",
+ width: "100%",
+ marginTop: "15px",
+ marginBottom: "15px"
+ }}
+ ></div>
+
+ <button
+ onClick={() => {
+ setIsAlert({
+ isShow: false,
+ alertMessage: ""
+ });
+ }}
+ style={{
+ color: "black"
+ }}
+ type="button"
+ className="finishBtn"
+ >
+ Ok
+ </button>
+ </div>
+ </ModalUi>
{/* this modal is used to show decline alert */}
<CustomModal
containerWH={containerWH}
@@ -700,6 +764,76 @@ function PdfRequestFiles() {
headMsg="Document Expired!"
bodyMssg="This Document is no longer available."
/>
+ <ModalUi
+ headerColor={defaultSignImg ? themeColor() : "#dc3545"}
+ isOpen={defaultSignAlert.isShow}
+ title={"Auto sign"}
+ handleClose={() => {
+ setDefaultSignAlert({
+ isShow: false,
+ alertMessage: ""
+ });
+ }}
+ >
+ <div style={{ height: "100%", padding: 20 }}>
+ <p>{defaultSignAlert.alertMessage}</p>
+
+ <div
+ style={{
+ height: "1px",
+ backgroundColor: "#9f9f9f",
+ width: "100%",
+ marginTop: "15px",
+ marginBottom: "15px"
+ }}
+ ></div>
+ {defaultSignImg ? (
+ <>
+ <button
+ onClick={() => addDefaultSignature()}
+ style={{
+ background: themeColor()
+ }}
+ type="button"
+ className="finishBtn"
+ >
+ Yes
+ </button>
+ <button
+ onClick={() => {
+ setDefaultSignAlert({
+ isShow: false,
+ alertMessage: ""
+ });
+ }}
+ style={{
+ color: "black"
+ }}
+ type="button"
+ className="finishBtn"
+ >
+ Close
+ </button>
+ </>
+ ) : (
+ <button
+ onClick={() => {
+ setIsAlert({
+ isShow: false,
+ alertMessage: ""
+ });
+ }}
+ style={{
+ color: "black"
+ }}
+ type="button"
+ className="finishBtn"
+ >
+ Ok
+ </button>
+ )}
+ </div>
+ </ModalUi>
{/* this component used to render all pdf pages in left side */}
<RenderAllPdfPage
signPdfUrl={pdfDetails[0].URL}
@@ -805,137 +939,153 @@ function PdfRequestFiles() {
</div>
<div>
<div className="signerComponent">
- {signedSigners.length > 0 && (
- <>
- <div
- style={{
- background: themeColor()
- }}
- className="signedStyle"
- >
- Signed by
- </div>
- <div style={{ marginTop: "2px" }}>
- {signedSigners.map((obj, ind) => {
- return (
- <div
- style={{
- display: "flex",
- flexDirection: "row",
- alignItems: "center",
- padding: "10px 0",
- background: checkSignerBackColor(obj)
- }}
- key={ind}
- >
+ <div
+ style={{ maxHeight: window.innerHeight - 70 + "px" }}
+ className="autoSignScroll"
+ >
+ {signedSigners.length > 0 && (
+ <>
+ <div
+ style={{
+ background: themeColor()
+ }}
+ className="signedStyle"
+ >
+ Signed by
+ </div>
+ <div style={{ marginTop: "2px" }}>
+ {signedSigners.map((obj, ind) => {
+ return (
<div
- className="signerStyle"
style={{
- background: "#abd1d0",
- width: 30,
- height: 30,
display: "flex",
- borderRadius: 30 / 2,
- justifyContent: "center",
+ flexDirection: "row",
alignItems: "center",
- margin: "0 10px 0 5px"
+ padding: "10px 0",
+ background: checkSignerBackColor(obj)
}}
+ key={ind}
>
- <span
+ <div
+ className="signerStyle"
style={{
- fontSize: "12px",
- textAlign: "center",
- fontWeight: "bold",
- color: "black",
- textTransform: "uppercase"
+ background: "#abd1d0",
+ width: 30,
+ height: 30,
+ display: "flex",
+ borderRadius: 30 / 2,
+ justifyContent: "center",
+ alignItems: "center",
+ margin: "0 10px 0 5px"
}}
>
- {getFirstLetter(obj.Name)}
- </span>
- </div>
- <div
- style={{
- display: "flex",
- flexDirection: "column"
- }}
- >
- <span className="userName">{obj.Name}</span>
- <span className="useEmail">{obj.Email}</span>
+ <span
+ style={{
+ fontSize: "12px",
+ textAlign: "center",
+ fontWeight: "bold",
+ color: "black",
+ textTransform: "uppercase"
+ }}
+ >
+ {getFirstLetter(obj.Name)}
+ </span>
+ </div>
+ <div
+ style={{
+ display: "flex",
+ flexDirection: "column"
+ }}
+ >
+ <span className="userName">{obj.Name}</span>
+ <span className="useEmail">{obj.Email}</span>
+ </div>
</div>
- </div>
- );
- })}
- </div>
- </>
- )}
+ );
+ })}
+ </div>
+ </>
+ )}
- {unsignedSigners.length > 0 && (
- <>
- <div
- style={{
- background: themeColor(),
- color: "white",
- padding: "5px",
- fontFamily: "sans-serif",
- marginTop: signedSigners.length > 0 && "20px"
- }}
- >
- Yet to sign
- </div>
- <div style={{ marginTop: "5px" }}>
- {unsignedSigners.map((obj, ind) => {
- return (
- <div
- style={{
- display: "flex",
- flexDirection: "row",
- alignItems: "center",
- padding: "10px 0",
- background: checkSignerBackColor(obj)
- }}
- key={ind}
- >
+ {unsignedSigners.length > 0 && (
+ <>
+ <div
+ style={{
+ background: themeColor(),
+ color: "white",
+ padding: "5px",
+ fontFamily: "sans-serif",
+ marginTop: signedSigners.length > 0 && "20px"
+ }}
+ >
+ Yet to sign
+ </div>
+ <div style={{ marginTop: "5px" }}>
+ {unsignedSigners.map((obj, ind) => {
+ return (
<div
- className="signerStyle"
style={{
- background: "#abd1d0",
- width: 30,
- height: 30,
display: "flex",
- borderRadius: 30 / 2,
- justifyContent: "center",
+ flexDirection: "row",
alignItems: "center",
- margin: "0 10px 0 5px"
+ padding: "10px 0",
+ background: checkSignerBackColor(obj)
}}
+ key={ind}
>
- <span
+ <div
+ className="signerStyle"
style={{
- fontSize: "12px",
- textAlign: "center",
- fontWeight: "bold",
- color: "black",
- textTransform: "uppercase"
+ background: "#abd1d0",
+ width: 30,
+ height: 30,
+ display: "flex",
+ borderRadius: 30 / 2,
+ justifyContent: "center",
+ alignItems: "center",
+ margin: "0 10px 0 5px"
}}
>
- {getFirstLetter(obj.Name)}
- </span>
- </div>
- <div
- style={{
- display: "flex",
- flexDirection: "column"
- }}
- >
- <span className="userName">{obj.Name}</span>
- <span className="useEmail">{obj.Email}</span>
+ <span
+ style={{
+ fontSize: "12px",
+ textAlign: "center",
+ fontWeight: "bold",
+ color: "black",
+ textTransform: "uppercase"
+ }}
+ >
+ {getFirstLetter(obj.Name)}
+ </span>
+ </div>
+ <div
+ style={{
+ display: "flex",
+ flexDirection: "column"
+ }}
+ >
+ <span className="userName">{obj.Name}</span>
+ <span className="useEmail">{obj.Email}</span>
+ </div>
+ <hr />
</div>
- <hr />
- </div>
- );
- })}
- </div>
- </>
- )}
+ );
+ })}
+ </div>
+ </>
+ )}
+ {defaultSignImg && !alreadySign && (
+ <DefaultSignature
+ themeColor={themeColor}
+ defaultSignImg={defaultSignImg}
+ setDefaultSignImg={setDefaultSignImg}
+ userObjectId={signerObjectId}
+ setIsLoading={setIsLoading}
+ xyPostion={signerPos}
+ setDefaultSignAlert={setDefaultSignAlert}
+ />
+ )}
+ </div>
</div>
</div>
</div>
diff --git a/microfrontends/SignDocuments/src/Component/TemplatePlaceholder.js b/microfrontends/SignDocuments/src/Component/TemplatePlaceholder.js
index 61c1dd5ae..87a4cd27e 100644
--- a/microfrontends/SignDocuments/src/Component/TemplatePlaceholder.js
+++ b/microfrontends/SignDocuments/src/Component/TemplatePlaceholder.js
@@ -741,7 +741,7 @@ const TemplatePlaceholder = () => {
selector: '[data-tut="reactourThird"]',
content: () => (
<TourContentWithBtn
- message={`The PDF content area already displays the template's existing placeholders. For your convenience, these placeholders will match the color of the recipient's name, making them easily identifiable.`}
+ message={`Drag the placeholder for a recipient anywhere on the document.Remember, it will appear in the same colour as the name of the recipient for easy reference.`}
isChecked={handleDontShow}
/>
),
diff --git a/microfrontends/SignDocuments/src/Component/component/CustomModal.js b/microfrontends/SignDocuments/src/Component/component/CustomModal.js
index bdf5fef6e..eee88a834 100644
--- a/microfrontends/SignDocuments/src/Component/component/CustomModal.js
+++ b/microfrontends/SignDocuments/src/Component/component/CustomModal.js
@@ -25,31 +25,41 @@ function CustomModal({
<div className="modalHeadDiv bg-danger">{headMsg && headMsg}</div>
<div className="modalBodyDIv">
<p className="pTagBody">{bodyMssg && bodyMssg}</p>
+ <div
+ style={{
+ height: "1px",
+ backgroundColor: "#9f9f9f",
+ width: "100%",
+ marginTop: "15px",
+ marginBottom: "15px"
+ }}
+ ></div>
+
+ {footerMessage && (
+ <div className="modalFooterDiv">
+ <button
+ style={{
+ background: "#de4337"
+ }}
+ type="button"
+ className="finishBtn"
+ onClick={() => declineDoc()}
+ >
+ Yes
+ </button>
+ <button
+ style={{
+ color: "black"
+ }}
+ type="button"
+ className="finishBtn"
+ onClick={() => setIsDecline({ isDeclined: false })}
+ >
+ Close
+ </button>
+ </div>
+ )}
</div>
- {footerMessage && (
- <div className="modalFooterDiv">
- <button
- style={{
- color: "black"
- }}
- type="button"
- className="finishBtn"
- onClick={() => setIsDecline({ isDeclined: false })}
- >
- Close
- </button>
- <button
- style={{
- background: "#de4337"
- }}
- type="button"
- className="finishBtn"
- onClick={() => declineDoc()}
- >
- Yes
- </button>
- </div>
- )}
</div>
</div>
)
diff --git a/microfrontends/SignDocuments/src/Component/component/defaultSignature.js b/microfrontends/SignDocuments/src/Component/component/defaultSignature.js
index c79d0f8d6..1fbee6604 100644
--- a/microfrontends/SignDocuments/src/Component/component/defaultSignature.js
+++ b/microfrontends/SignDocuments/src/Component/component/defaultSignature.js
@@ -4,27 +4,32 @@ function DefaultSignature({
themeColor,
defaultSignImg,
xyPostion,
- setIsAlert
+ setDefaultSignAlert
}) {
const confirmToaddDefaultSign = () => {
if (xyPostion.length > 0) {
- setIsAlert({
+ setDefaultSignAlert({
isShow: true,
- alertMessage: "Are you sure you want to sign at requested locations?"
+ alertMessage:
+ "Are you sure you want to auto sign at requested all locations?"
});
} else {
- alert("please select position!");
+ setDefaultSignAlert({
+ isShow: true,
+ alertMessage: "please select position!"
+ });
}
};
return (
- <div className="signerComponent">
+ <div>
<div
style={{
background: themeColor(),
color: "white",
padding: "5px",
- fontFamily: "sans-serif"
+ fontFamily: "sans-serif",
+ marginTop: "5px"
}}
>
Signature
@@ -38,41 +43,34 @@ function DefaultSignature({
fontWeight: "600"
}}
>
- {defaultSignImg ? (
- <>
- <p>Your Signature</p>
- <div className="defaultSignBox">
- <img
- alt="default img"
- style={{
- width: "100%",
- height: "100%",
- objectFit: "contain"
- }}
- src={defaultSignImg}
- />
- </div>
- <button
+ <>
+ <p>Your Signature</p>
+ <div className="defaultSignBox">
+ <img
+ alt="default img"
style={{
- background: themeColor(),
- color: "white",
- marginTop: "20px",
- cursor: "pointer"
+ width: "100%",
+ height: "100%",
+ objectFit: "contain"
}}
- type="button"
- className="finishBtn finishnHover"
- onClick={() => confirmToaddDefaultSign()}
- >
- Auto Sign All
- </button>
- </>
- ) : (
- <div style={{ margin: "10px" }}>
- <span>
- Click a signature placeholder to start signing the document!
- </span>
+ src={defaultSignImg}
+ />
</div>
- )}
+ <button
+ style={{
+ background: themeColor(),
+ color: "white",
+ marginTop: "20px",
+ cursor: "pointer",
+ marginBottom: "10px"
+ }}
+ type="button"
+ className="finishBtn finishnHover"
+ onClick={() => confirmToaddDefaultSign()}
+ >
+ Auto Sign All
+ </button>
+ </>
</div>
</div>
);
diff --git a/microfrontends/SignDocuments/src/Component/component/header.js b/microfrontends/SignDocuments/src/Component/component/header.js
index b92dfff72..c8bc5d37d 100644
--- a/microfrontends/SignDocuments/src/Component/component/header.js
+++ b/microfrontends/SignDocuments/src/Component/component/header.js
@@ -225,10 +225,7 @@ function Header({
);
};
return (
- <div
- style={{ padding: !isGuestSigner && "5px 0px 5px 0px" }}
- className="mobileHead"
- >
+ <div style={{ padding: "5px 0px 5px 0px" }} className="mobileHead">
{isMobile && isShowHeader ? (
<div
id="navbar"
@@ -540,8 +537,8 @@ function Header({
<div>
{signerPos.length === 0 ? (
<span style={{ fontSize: "13px", color: "#f5405e" }}>
- Add {signersdata.length - signerPos.length}{" "}
- recipients signature
+ Add {signersdata.length - signerPos.length} recipients
+ signature
</span>
) : (
<span style={{ fontSize: "13px", color: "#f5405e" }}>
@@ -554,7 +551,14 @@ function Header({
<div>
{setIsEditTemplate && (
- <button onClick={() => setIsEditTemplate(true)} style={{border:"none", outline:"none", textAlign:"center"}}>
+ <button
+ onClick={() => setIsEditTemplate(true)}
+ style={{
+ border: "none",
+ outline: "none",
+ textAlign: "center"
+ }}
+ >
<i className="fa-solid fa-gear fa-lg"></i>
</button>
)}
diff --git a/microfrontends/SignDocuments/src/Component/component/renderPdf.js b/microfrontends/SignDocuments/src/Component/component/renderPdf.js
index 5b0c6b41c..d87a2c9f2 100644
--- a/microfrontends/SignDocuments/src/Component/component/renderPdf.js
+++ b/microfrontends/SignDocuments/src/Component/component/renderPdf.js
@@ -35,8 +35,6 @@ function RenderPdf({
pdfUrl,
numPages,
pageDetails,
- recipient,
- isAlreadySign,
pdfRequest,
setCurrentSigner,
signerObjectId,
@@ -306,6 +304,15 @@ function RenderPdf({
}}
>
{signerData.Name}
+ <div
+ style={{
+ fontSize: "10px",
+ color: "black",
+ justifyContent: "center"
+ }}
+ >
+ {pos.isStamp ? "stamp" : "signature"}
+ </div>
</div>
)
);
@@ -411,474 +418,352 @@ function RenderPdf({
>
<EmailToast isShow={successEmail} />
{pdfLoadFail.status &&
- (recipient
- ? !pdfUrl &&
- !isAlreadySign.mssg &&
- xyPostion.length > 0 &&
- xyPostion.map((data, ind) => {
+ (pdfRequest
+ ? signerPos.map((data, key) => {
return (
- <React.Fragment key={ind}>
- {data.pageNumber === pageNumber &&
- data.pos.map((pos) => {
- return (
- pos && (
- <Rnd
- data-tut="reactourSecond"
- disableDragging={true}
- enableResizing={{
- top: false,
- right: false,
- bottom: false,
- left: false,
- topRight: false,
- bottomRight: true,
- bottomLeft: false,
- topLeft: false
- }}
- key={pos.key}
- bounds="parent"
- style={{
- cursor: "all-scroll",
- borderColor: themeColor(),
- borderStyle: "dashed",
- borderWidth: "0.1px",
- zIndex: "1",
- background: data.blockColor
- ? data.blockColor
- : "#daebe0"
- }}
- className="signYourselfBlock"
- onResize={(
- e,
- direction,
- ref,
- delta,
- position
- ) => {
- handleSignYourselfImageResize(
- ref,
- pos.key,
- xyPostion,
- index,
- setXyPostion
- );
- }}
- size={{
- width: posWidth(pos),
- height: posHeight(pos)
- }}
- lockAspectRatio={
- pos.Width ? pos.Width / pos.Height : 2.5
- }
- default={{
- x: xPos(pos),
- y: yPos(pos)
- }}
- onClick={() => {
- setIsSignPad(true);
- setSignKey(pos.key);
- setIsStamp(
- pos?.isStamp ? pos.isStamp : false
- );
- }}
- >
- <BorderResize />
- {pos.SignUrl ? (
- <img
- alt="no img"
- onClick={() => {
- setIsSignPad(true);
- setSignKey(pos.key);
- }}
- src={pos.SignUrl}
- style={{
- width: "99%",
- height: "100%",
- objectFit: "contain"
- }}
- />
- ) : (
- <div
- style={{
- fontSize: "10px",
- color: "black",
-
- justifyContent: "center",
- marginTop: "0px"
- }}
- >
- {pos.isStamp ? (
- <div>stamp</div>
- ) : (
- <div>signature</div>
- )}
- {handleUserName(
- data.signerObjId,
- data.Role
- )}
- </div>
- )}
- </Rnd>
- )
- );
- })}
+ <React.Fragment key={key}>
+ {checkSignedSignes(data)}
</React.Fragment>
);
})
- : pdfRequest
- ? signerPos.map((data, key) => {
+ : placeholder // placeholder mobile
+ ? signerPos.map((data, ind) => {
return (
- <React.Fragment key={key}>
- {checkSignedSignes(data)}
- </React.Fragment>
- );
- })
- : placeholder // placeholder mobile
- ? signerPos.map((data, ind) => {
- return (
- <React.Fragment key={ind}>
- {data.placeHolder.map((placeData, index) => {
- return (
- <React.Fragment key={index}>
- {placeData.pageNumber === pageNumber &&
- placeData.pos.map((pos) => {
- return (
- <Rnd
- bounds="parent"
- enableResizing={{
- top: false,
- right: false,
- bottom: false,
- left: false,
- topRight: false,
- bottomRight: true,
- bottomLeft: false,
- topLeft: false
- }}
- key={pos.key}
- style={{
- cursor: "all-scroll",
- background: data.blockColor,
- borderColor: data.bac,
- zIndex: pos.zIndex
- }}
- className="signYourselfBlock"
- onDrag={() => handleTabDrag(pos.key)}
- size={{
- width: posWidth(pos),
- height: posHeight(pos)
- }}
- // size={{
- // width: pos.Width ? pos.Width : 150,
- // height: pos.Height ? pos.Height : 60
- // }}
- lockAspectRatio={
- pos.Width
- ? pos.Width / pos.Height
- : 2.5
- }
- onDragStop={
- (event, dragElement) =>
- handleStop(
- event,
- dragElement,
- data.Id,
- pos.key
- )
- // data.signerObjId,
- }
- // default={{
- // x: pos.xPosition,
- // y: pos.yPosition
- // }}
- default={{
- x: xPos(pos),
- y: yPos(pos)
- }}
- onResizeStart={() => {
- setIsResize(true);
- }}
- onResizeStop={() => {
- setIsResize && setIsResize(false);
- }}
- onResize={(
- e,
- direction,
- ref,
- delta,
- position
- ) => {
- handleImageResize(
- ref,
- pos.key,
+ <React.Fragment key={ind}>
+ {data.placeHolder.map((placeData, index) => {
+ return (
+ <React.Fragment key={index}>
+ {placeData.pageNumber === pageNumber &&
+ placeData.pos.map((pos) => {
+ return (
+ <Rnd
+ bounds="parent"
+ enableResizing={{
+ top: false,
+ right: false,
+ bottom: false,
+ left: false,
+ topRight: false,
+ bottomRight: true,
+ bottomLeft: false,
+ topLeft: false
+ }}
+ key={pos.key}
+ style={{
+ cursor: "all-scroll",
+ background: data.blockColor,
+ borderColor: data.bac,
+ zIndex: pos.zIndex
+ }}
+ className="signYourselfBlock"
+ onDrag={() => handleTabDrag(pos.key)}
+ size={{
+ width: posWidth(pos),
+ height: posHeight(pos)
+ }}
+ // size={{
+ // width: pos.Width ? pos.Width : 150,
+ // height: pos.Height ? pos.Height : 60
+ // }}
+ lockAspectRatio={
+ pos.Width ? pos.Width / pos.Height : 2.5
+ }
+ onDragStop={
+ (event, dragElement) =>
+ handleStop(
+ event,
+ dragElement,
data.Id,
- position,
+ pos.key
+ )
+ // data.signerObjId,
+ }
+ // default={{
+ // x: pos.xPosition,
+ // y: pos.yPosition
+ // }}
+ default={{
+ x: xPos(pos),
+ y: yPos(pos)
+ }}
+ onResizeStart={() => {
+ setIsResize(true);
+ }}
+ onResizeStop={() => {
+ setIsResize && setIsResize(false);
+ }}
+ onResize={(
+ e,
+ direction,
+ ref,
+ delta,
+ position
+ ) => {
+ handleImageResize(
+ ref,
+ pos.key,
+ data.Id,
+ position,
+ signerPos,
+ pageNumber,
+ setSignerPos,
+ pdfOriginalWidth,
+ containerWH,
+ true
+ );
+ }}
+ >
+ <BorderResize right={-12} top={-11} />
+ <PlaceholderBorder
+ pos={pos}
+ posWidth={posWidth}
+ posHeight={posHeight}
+ />
+ <div
+ onTouchEnd={() => {
+ const dataNewPlace = addZIndex(
signerPos,
- pageNumber,
- setSignerPos,
- pdfOriginalWidth,
- containerWH,
- true
+ pos.key,
+ setZIndex
);
+ setSignerPos((prevState) => {
+ const newState = [...prevState];
+ newState.splice(
+ 0,
+ signerPos.length,
+ ...dataNewPlace
+ );
+ return newState;
+ });
}}
>
- <BorderResize right={-12} top={-11} />
- <PlaceholderBorder
- pos={pos}
- posWidth={posWidth}
- posHeight={posHeight}
- />
+ <i
+ data-tut="reactourLinkUser"
+ className="fa-regular fa-user signUserIcon"
+ onTouchEnd={(e) => {
+ e.stopPropagation();
+ handleLinkUser(data.Id);
+ setUniqueId(data.Id);
+ }}
+ onClick={(e) => {
+ e.stopPropagation();
+ handleLinkUser(data.Id);
+ setUniqueId(data.Id);
+ }}
+ style={{
+ color: "#188ae2"
+ }}
+ ></i>
+ <i
+ className="fa-regular fa-copy signCopy"
+ onTouchEnd={(e) => {
+ e.stopPropagation();
+ setIsPageCopy(true);
+ setSignKey(pos.key);
+ setSignerObjId(data.signerObjId);
+ setUniqueId(data.Id);
+ }}
+ onClick={(e) => {
+ e.stopPropagation();
+ setIsPageCopy(true);
+ setSignKey(pos.key);
+ setSignerObjId(data.signerObjId);
+ setUniqueId(data.Id);
+ }}
+ style={{
+ color: "#188ae2"
+ }}
+ ></i>
+ <i
+ className="fa-regular fa-circle-xmark signCloseBtn"
+ onTouchEnd={(e) => {
+ e.stopPropagation();
+ handleDeleteSign(pos.key, data.Id);
+ // data.signerObjId
+ }}
+ onClick={(e) => {
+ e.stopPropagation();
+ handleDeleteSign(pos.key, data.Id);
+ // data.signerObjId
+ }}
+ style={{
+ color: "#188ae2"
+ }}
+ ></i>
+
<div
- onTouchEnd={() => {
- const dataNewPlace = addZIndex(
- signerPos,
- pos.key,
- setZIndex
- );
- setSignerPos((prevState) => {
- const newState = [...prevState];
- newState.splice(
- 0,
- signerPos.length,
- ...dataNewPlace
- );
- return newState;
- });
+ style={{
+ fontSize: "10px",
+ color: "black",
+ fontWeight: "500",
+ marginTop: "0px"
}}
>
- <i
- data-tut="reactourLinkUser"
- className="fa-regular fa-user signUserIcon"
- onTouchEnd={(e) => {
- e.stopPropagation();
- handleLinkUser(data.Id);
- setUniqueId(data.Id);
- }}
- onClick={(e) => {
- e.stopPropagation();
- handleLinkUser(data.Id);
- setUniqueId(data.Id);
- }}
- style={{
- color: "#188ae2"
- }}
- ></i>
- <i
- className="fa-regular fa-copy signCopy"
- onTouchEnd={(e) => {
- e.stopPropagation();
- setIsPageCopy(true);
- setSignKey(pos.key);
- setSignerObjId(data.signerObjId);
- setUniqueId(data.Id);
- }}
- onClick={(e) => {
- e.stopPropagation();
- setIsPageCopy(true);
- setSignKey(pos.key);
- setSignerObjId(data.signerObjId);
- setUniqueId(data.Id);
- }}
- style={{
- color: "#188ae2"
- }}
- ></i>
- <i
- className="fa-regular fa-circle-xmark signCloseBtn"
- onTouchEnd={(e) => {
- e.stopPropagation();
- handleDeleteSign(
- pos.key,
- data.Id
- );
- // data.signerObjId
- }}
- onClick={(e) => {
- e.stopPropagation();
- handleDeleteSign(
- pos.key,
- data.Id
- );
- // data.signerObjId
- }}
- style={{
- color: "#188ae2"
- }}
- ></i>
-
- <div
- style={{
- fontSize: "10px",
- color: "black",
- fontWeight: "500",
- marginTop: "0px"
- }}
- >
- {pos.isStamp ? (
- <div>stamp</div>
- ) : (
- <div>signature</div>
- )}
- {handleUserName(
- data.signerObjId,
- data.Role
- )}
- </div>
+ {pos.isStamp ? (
+ <div>stamp</div>
+ ) : (
+ <div>signature</div>
+ )}
+ {handleUserName(
+ data.signerObjId,
+ data.Role
+ )}
</div>
- </Rnd>
+ </div>
+ </Rnd>
+ );
+ })}
+ </React.Fragment>
+ );
+ })}
+ </React.Fragment>
+ );
+ })
+ : xyPostion.map((data, ind) => {
+ return (
+ <React.Fragment key={ind}>
+ {data.pageNumber === pageNumber &&
+ data.pos.map((pos) => {
+ return (
+ pos && (
+ <Rnd
+ allowAnyClick
+ enableResizing={{
+ top: false,
+ right: false,
+ bottom: false,
+ left: false,
+ topRight: false,
+ bottomRight: true,
+ bottomLeft: false,
+ topLeft: false
+ }}
+ lockAspectRatio={
+ pos.Width ? pos.Width / pos.Height : 2.5
+ }
+ bounds="parent"
+ ref={nodeRef}
+ key={pos.key}
+ className="signYourselfBlock"
+ style={{
+ border: "1px solid red",
+ cursor: "all-scroll",
+ zIndex: "1",
+ background: "#daebe0"
+ }}
+ size={{
+ width: posWidth(pos, true),
+ height: posHeight(pos, true)
+ }}
+ default={{
+ x: xPos(pos, true),
+ y: yPos(pos, true)
+ }}
+ onDrag={() => handleTabDrag(pos.key)}
+ onDragStop={handleStop}
+ onResize={(
+ e,
+ direction,
+ ref,
+ delta,
+ position
+ ) => {
+ handleSignYourselfImageResize(
+ ref,
+ pos.key,
+ xyPostion,
+ index,
+ setXyPostion
);
- })}
- </React.Fragment>
- );
- })}
- </React.Fragment>
- );
- })
- : xyPostion.map((data, ind) => {
- return (
- <React.Fragment key={ind}>
- {data.pageNumber === pageNumber &&
- data.pos.map((pos) => {
- return (
- pos && (
- <Rnd
- allowAnyClick
- enableResizing={{
- top: false,
- right: false,
- bottom: false,
- left: false,
- topRight: false,
- bottomRight: true,
- bottomLeft: false,
- topLeft: false
- }}
- lockAspectRatio={
- pos.Width ? pos.Width / pos.Height : 2.5
- }
- bounds="parent"
- ref={nodeRef}
- key={pos.key}
- className="signYourselfBlock"
+ }}
+ >
+ <BorderResize right={-12} top={-11} />
+ <PlaceholderBorder
+ pos={pos}
+ posWidth={posWidth}
+ isSignYourself={true}
+ posHeight={posHeight}
+ />
+ <div
style={{
- border: "1px solid red",
- cursor: "all-scroll",
- zIndex: "1",
- background: "#daebe0"
- }}
- size={{
+ left: xPos(pos, true),
+ top: yPos(pos, true),
width: posWidth(pos, true),
- height: posHeight(pos, true)
- }}
- default={{
- x: xPos(pos, true),
- y: yPos(pos, true)
+ height: posHeight(pos, true),
+ zIndex: "10"
}}
- onDrag={() => handleTabDrag(pos.key)}
- onDragStop={handleStop}
- onResize={(
- e,
- direction,
- ref,
- delta,
- position
- ) => {
- handleSignYourselfImageResize(
- ref,
- pos.key,
- xyPostion,
- index,
- setXyPostion
- );
+ onTouchEnd={(e) => {
+ if (!isDragging && isMobile) {
+ setTimeout(() => {
+ e.stopPropagation();
+ setIsSignPad(true);
+ setSignKey(pos.key);
+ setIsStamp(pos.isStamp);
+ }, 500);
+ }
}}
>
- <BorderResize right={-12} top={-11} />
- <PlaceholderBorder
- pos={pos}
- posWidth={posWidth}
- isSignYourself={true}
- posHeight={posHeight}
- />
- <div
+ <i
+ className="fa-regular fa-copy signCopy"
+ onTouchEnd={(e) => {
+ e.stopPropagation();
+ setIsPageCopy(true);
+ setSignKey(pos.key);
+ }}
style={{
- left: xPos(pos, true),
- top: yPos(pos, true),
- width: posWidth(pos, true),
- height: posHeight(pos, true),
- zIndex: "10"
+ color: "#188ae2"
}}
+ ></i>
+ <i
+ className="fa-regular fa-circle-xmark signCloseBtn"
onTouchEnd={(e) => {
- if (!isDragging && isMobile) {
- setTimeout(() => {
- e.stopPropagation();
- setIsSignPad(true);
- setSignKey(pos.key);
- setIsStamp(pos.isStamp);
- }, 500);
+ e.stopPropagation();
+ if (data) {
+ handleDeleteSign(
+ pos.key,
+ data.signerObjId
+ );
+ } else {
+ handleDeleteSign(pos.key);
+ setIsStamp(false);
}
}}
- >
- <i
- className="fa-regular fa-copy signCopy"
- onTouchEnd={(e) => {
- e.stopPropagation();
- setIsPageCopy(true);
- setSignKey(pos.key);
- }}
- style={{
- color: "#188ae2"
- }}
- ></i>
- <i
- className="fa-regular fa-circle-xmark signCloseBtn"
- onTouchEnd={(e) => {
- e.stopPropagation();
- if (data) {
- handleDeleteSign(
- pos.key,
- data.signerObjId
- );
- } else {
- handleDeleteSign(pos.key);
- setIsStamp(false);
- }
- }}
- style={{
- color: "#188ae2"
- }}
- ></i>
+ style={{
+ color: "#188ae2"
+ }}
+ ></i>
- {pos.SignUrl ? (
- <div style={{ pointerEvents: "none" }}>
- <img
- alt="signimg"
- src={pos.SignUrl}
- style={{
- width: "100%",
- height: "100%",
- objectFit: "contain"
- }}
- />
- </div>
- ) : (
- <div
+ {pos.SignUrl ? (
+ <div style={{ pointerEvents: "none" }}>
+ <img
+ alt="signimg"
+ src={pos.SignUrl}
style={{
- fontSize: "10px",
- color: "black",
- justifyContent: "center"
+ width: "100%",
+ height: "100%",
+ objectFit: "contain"
}}
- >
- {pos.isStamp ? "stamp" : "signature"}
- </div>
- )}
- </div>
- </Rnd>
- )
- );
- })}
- </React.Fragment>
- );
- }))}
+ />
+ </div>
+ ) : (
+ <div
+ style={{
+ fontSize: "10px",
+ color: "black",
+ justifyContent: "center"
+ }}
+ >
+ {pos.isStamp ? "stamp" : "signature"}
+ </div>
+ )}
+ </div>
+ </Rnd>
+ )
+ );
+ })}
+ </React.Fragment>
+ );
+ }))}
{/* this component for render pdf document is in middle of the component */}
<div
@@ -890,9 +775,7 @@ function RenderPdf({
>
<Document
onLoadError={(e) => {
- if (recipient) {
- setPdfLoadFail(true);
- }
+ setPdfLoadFail(true);
}}
onLoadSuccess={pageDetails}
ref={pdfRef}
@@ -942,396 +825,276 @@ function RenderPdf({
>
<EmailToast isShow={successEmail} />
{pdfLoadFail.status &&
- (recipient
- ? !pdfUrl &&
- !isAlreadySign.mssg &&
- xyPostion.length > 0 &&
- xyPostion.map((data, ind) => {
+ (pdfRequest
+ ? signerPos.map((data, key) => {
return (
- <React.Fragment key={ind}>
- {data.pageNumber === pageNumber &&
- data.pos.map((pos) => {
+ <React.Fragment key={key}>
+ {checkSignedSignes(data)}
+ </React.Fragment>
+ );
+ })
+ : placeholder
+ ? signerPos.map((data, ind) => {
+ return (
+ <React.Fragment key={ind}>
+ {data.placeHolder.map((placeData, index) => {
return (
- pos && (
- <Rnd
- data-tut="reactourSecond"
- disableDragging={true}
- enableResizing={{
- top: false,
- right: false,
- bottom: false,
- left: false,
- topRight: false,
- bottomRight: true,
- bottomLeft: false,
- topLeft: false
- }}
- onResize={(
- e,
- direction,
- ref,
- delta,
- position
- ) => {
- handleSignYourselfImageResize(
- ref,
- pos.key,
- xyPostion,
- index,
- setXyPostion
- );
- }}
- key={pos.key}
- bounds="parent"
- style={{
- cursor: "all-scroll",
- borderColor: themeColor(),
- borderStyle: "dashed",
- borderWidth: "0.1px",
- zIndex: "1",
- background: data.blockColor
- ? data.blockColor
- : "#daebe0"
- }}
- className="signYourselfBlock"
- size={{
- width: posWidth(pos),
- height: posHeight(pos)
- }}
- lockAspectRatio={
- pos.Width ? pos.Width / pos.Height : 2.5
- }
- default={{
- x: xPos(pos),
- y: yPos(pos)
- }}
- onClick={() => {
- setIsSignPad(true);
- setSignKey(pos.key);
- setIsStamp(
- pos?.isStamp ? pos.isStamp : false
- );
- }}
- >
- <div style={{ pointerEvents: "none" }}>
- <BorderResize />
- {pos.SignUrl ? (
- <img
- alt="no img"
+ <React.Fragment key={index}>
+ {placeData.pageNumber === pageNumber &&
+ placeData.pos.map((pos) => {
+ return (
+ <Rnd
onClick={() => {
- setIsSignPad(true);
- setSignKey(pos.key);
+ const dataNewPlace = addZIndex(
+ signerPos,
+ pos.key,
+ setZIndex
+ );
+ setSignerPos((prevState) => {
+ const newState = [...prevState];
+ newState.splice(
+ 0,
+ signerPos.length,
+ ...dataNewPlace
+ );
+ return newState;
+ });
}}
- src={pos.SignUrl}
- style={{
- width: "99%",
- height: "100%",
- objectFit: "contain"
+ key={pos.key}
+ enableResizing={{
+ top: false,
+ right: false,
+ bottom: false,
+ left: false,
+ topRight: false,
+ bottomRight: true,
+ bottomLeft: false,
+ topLeft: false
}}
- />
- ) : (
- <div
+ bounds="parent"
style={{
- fontSize: "10px",
- color: "black",
- fontWeight: "600",
- justifyContent: "center",
- marginTop: "0px"
+ cursor: "all-scroll",
+ background: data.blockColor,
+ zIndex: pos.zIndex
+ }}
+ className="signYourselfBlock"
+ onDrag={() => handleTabDrag(pos.key)}
+ size={{
+ width: posWidth(pos),
+ height: posHeight(pos)
+ }}
+ lockAspectRatio={
+ pos.Width
+ ? pos.Width / pos.Height
+ : 2.5
+ }
+ onDragStop={
+ (event, dragElement) =>
+ handleStop(
+ event,
+ dragElement,
+ data.Id,
+ pos.key
+ )
+ // data.signerObjId,
+ }
+ // default={{
+ // x: pos.xPosition,
+ // y: pos.yPosition
+ // }}
+ default={{
+ x: xPos(pos),
+ y: yPos(pos)
+ }}
+ onResizeStart={() => {
+ setIsResize(true);
+ }}
+ onResizeStop={() => {
+ setIsResize && setIsResize(false);
+ }}
+ onResize={(
+ e,
+ direction,
+ ref,
+ delta,
+ position
+ ) => {
+ e.stopPropagation();
+ handleImageResize(
+ ref,
+ pos.key,
+ data.Id, //data.signerObjId,
+ position,
+ signerPos,
+ pageNumber,
+ setSignerPos,
+ pdfOriginalWidth,
+ containerWH,
+ false
+ );
}}
>
- {pos.isStamp ? (
- <div>stamp</div>
- ) : (
- <div>signature</div>
- )}
- {handleUserName(
- data.signerObjId,
- data.Role
- )}
- </div>
- )}
- </div>
- </Rnd>
- )
+ <BorderResize right={-12} top={-11} />
+ <PlaceholderBorder
+ pos={pos}
+ posWidth={posWidth}
+ posHeight={posHeight}
+ />
+ <div>
+ <i
+ data-tut="reactourLinkUser"
+ className="fa-regular fa-user signUserIcon"
+ onClick={(e) => {
+ e.stopPropagation();
+ handleLinkUser(data.Id);
+ setUniqueId(data.Id);
+ }}
+ style={{
+ color: "#188ae2"
+ }}
+ ></i>
+ <i
+ className="fa-regular fa-copy signCopy"
+ onClick={(e) => {
+ e.stopPropagation();
+ setIsPageCopy(true);
+ setSignKey(pos.key);
+ setUniqueId(data.Id);
+ setSignerObjId(data.signerObjId);
+ }}
+ style={{
+ color: "#188ae2"
+ }}
+ ></i>
+ <i
+ className="fa-regular fa-circle-xmark signCloseBtn"
+ onClick={(e) => {
+ e.stopPropagation();
+ handleDeleteSign(
+ pos.key,
+ data.Id
+ );
+ // data.signerObjId
+ }}
+ style={{
+ color: "#188ae2"
+ }}
+ ></i>
+
+ <div
+ style={{
+ fontSize: "10px",
+ color: "black",
+ justifyContent: "center"
+ }}
+ >
+ {pos.isStamp ? (
+ <div>stamp</div>
+ ) : (
+ <div>signature</div>
+ )}
+ {handleUserName(
+ data.signerObjId,
+ data.Role
+ )}
+ </div>
+ </div>
+ </Rnd>
+ );
+ })}
+ </React.Fragment>
);
})}
- </React.Fragment>
- );
- })
- : pdfRequest
- ? signerPos.map((data, key) => {
- return (
- <React.Fragment key={key}>
- {checkSignedSignes(data)}
</React.Fragment>
);
})
- : placeholder
- ? signerPos.map((data, ind) => {
- return (
- <React.Fragment key={ind}>
- {data.placeHolder.map((placeData, index) => {
+ : xyPostion.map((data, ind) => {
+ return (
+ <React.Fragment key={ind}>
+ {data.pageNumber === pageNumber &&
+ data.pos.map((pos) => {
return (
- <React.Fragment key={index}>
- {placeData.pageNumber === pageNumber &&
- placeData.pos.map((pos) => {
- return (
- <Rnd
- onClick={() => {
- const dataNewPlace = addZIndex(
- signerPos,
- pos.key,
- setZIndex
- );
- setSignerPos((prevState) => {
- const newState = [...prevState];
- newState.splice(
- 0,
- signerPos.length,
- ...dataNewPlace
- );
- return newState;
- });
- }}
- key={pos.key}
- enableResizing={{
- top: false,
- right: false,
- bottom: false,
- left: false,
- topRight: false,
- bottomRight: true,
- bottomLeft: false,
- topLeft: false
- }}
- bounds="parent"
- style={{
- cursor: "all-scroll",
- background: data.blockColor,
- zIndex: pos.zIndex
- }}
- className="signYourselfBlock"
- onDrag={() => handleTabDrag(pos.key)}
- size={{
- width: posWidth(pos),
- height: posHeight(pos)
- }}
- lockAspectRatio={
- pos.Width
- ? pos.Width / pos.Height
- : 2.5
- }
- onDragStop={
- (event, dragElement) =>
- handleStop(
- event,
- dragElement,
- data.Id,
- pos.key
- )
- // data.signerObjId,
- }
- // default={{
- // x: pos.xPosition,
- // y: pos.yPosition
- // }}
- default={{
- x: xPos(pos),
- y: yPos(pos)
- }}
- onResizeStart={() => {
- setIsResize(true);
- }}
- onResizeStop={() => {
- setIsResize && setIsResize(false);
- }}
- onResize={(
- e,
- direction,
- ref,
- delta,
- position
- ) => {
- e.stopPropagation();
- handleImageResize(
- ref,
- pos.key,
- data.Id, //data.signerObjId,
- position,
- signerPos,
- pageNumber,
- setSignerPos,
- pdfOriginalWidth,
- containerWH,
- false
- );
- }}
- >
- <BorderResize right={-12} top={-11} />
- <PlaceholderBorder
- pos={pos}
- posWidth={posWidth}
- posHeight={posHeight}
- />
- <div>
- <i
- data-tut="reactourLinkUser"
- className="fa-regular fa-user signUserIcon"
- onClick={(e) => {
- e.stopPropagation();
- handleLinkUser(data.Id);
- setUniqueId(data.Id);
- }}
- style={{
- color: "#188ae2"
- }}
- ></i>
- <i
- className="fa-regular fa-copy signCopy"
- onClick={(e) => {
- e.stopPropagation();
- setIsPageCopy(true);
- setSignKey(pos.key);
- setUniqueId(data.Id);
- setSignerObjId(
- data.signerObjId
- );
- }}
- style={{
- color: "#188ae2"
- }}
- ></i>
- <i
- className="fa-regular fa-circle-xmark signCloseBtn"
- onClick={(e) => {
- e.stopPropagation();
- handleDeleteSign(
- pos.key,
- data.Id
- );
- // data.signerObjId
- }}
- style={{
- color: "#188ae2"
- }}
- ></i>
-
- <div
- style={{
- fontSize: "10px",
- color: "black",
- justifyContent: "center"
- }}
- >
- {pos.isStamp ? (
- <div>stamp</div>
- ) : (
- <div>signature</div>
- )}
- {handleUserName(
- data.signerObjId,
- data.Role
- )}
- </div>
- </div>
- </Rnd>
+ pos && (
+ <Rnd
+ ref={nodeRef}
+ key={pos.key}
+ lockAspectRatio={
+ pos.Width ? pos.Width / pos.Height : 2.5
+ }
+ enableResizing={{
+ top: false,
+ right: false,
+ bottom: false,
+ left: false,
+ topRight: false,
+ bottomRight: true,
+ bottomLeft: false,
+ topLeft: false
+ }}
+ bounds="parent"
+ className="signYourselfBlock"
+ style={{
+ border: "1px solid red",
+ cursor: "all-scroll",
+ zIndex: "1",
+ background: "#daebe0"
+ }}
+ onDrag={() => handleTabDrag(pos.key)}
+ size={{
+ width: pos.Width ? pos.Width : 150,
+ height: pos.Height ? pos.Height : 60
+ }}
+ onDragStop={handleStop}
+ default={{
+ x: pos.xPosition,
+ y: pos.yPosition
+ }}
+ onClick={() => {
+ if (!isDragging) {
+ setIsSignPad(true);
+ setSignKey(pos.key);
+ setIsStamp(pos.isStamp);
+ }
+ }}
+ onResize={(
+ e,
+ direction,
+ ref,
+ delta,
+ position
+ ) => {
+ e.stopPropagation();
+ handleSignYourselfImageResize(
+ ref,
+ pos.key,
+ xyPostion,
+ index,
+ setXyPostion
);
- })}
- </React.Fragment>
+ }}
+ >
+ <BorderResize right={-12} top={-11} />
+ <PlaceholderBorder
+ pos={pos}
+ posWidth={posWidth}
+ posHeight={posHeight}
+ />
+ <PlaceholderDesign pos={pos} />
+ </Rnd>
+ )
);
})}
- </React.Fragment>
- );
- })
- : xyPostion.map((data, ind) => {
- return (
- <React.Fragment key={ind}>
- {data.pageNumber === pageNumber &&
- data.pos.map((pos) => {
- return (
- pos && (
- <Rnd
- ref={nodeRef}
- key={pos.key}
- lockAspectRatio={
- pos.Width ? pos.Width / pos.Height : 2.5
- }
- enableResizing={{
- top: false,
- right: false,
- bottom: false,
- left: false,
- topRight: false,
- bottomRight: true,
- bottomLeft: false,
- topLeft: false
- }}
- bounds="parent"
- className="signYourselfBlock"
- style={{
- border: "1px solid red",
- cursor: "all-scroll",
- zIndex: "1",
- background: "#daebe0"
- }}
- onDrag={() => handleTabDrag(pos.key)}
- size={{
- width: pos.Width ? pos.Width : 150,
- height: pos.Height ? pos.Height : 60
- }}
- onDragStop={handleStop}
- default={{
- x: pos.xPosition,
- y: pos.yPosition
- }}
- onClick={() => {
- if (!isDragging) {
- setIsSignPad(true);
- setSignKey(pos.key);
- setIsStamp(pos.isStamp);
- }
- }}
- onResize={(
- e,
- direction,
- ref,
- delta,
- position
- ) => {
- e.stopPropagation();
- handleSignYourselfImageResize(
- ref,
- pos.key,
- xyPostion,
- index,
- setXyPostion
- );
- }}
- >
- <BorderResize right={-12} top={-11} />
- <PlaceholderBorder
- pos={pos}
- posWidth={posWidth}
- posHeight={posHeight}
- />
- <PlaceholderDesign pos={pos} />
- </Rnd>
- )
- );
- })}
- </React.Fragment>
- );
- }))}
+ </React.Fragment>
+ );
+ }))}
{/* this component for render pdf document is in middle of the component */}
<Document
onLoadError={(e) => {
- if (recipient) {
- const load = {
- status: false,
- type: "failed"
- };
- setPdfLoadFail(load);
- }
+ const load = {
+ status: false,
+ type: "failed"
+ };
+ setPdfLoadFail(load);
}}
onLoadSuccess={pageDetails}
ref={pdfRef}
diff --git a/microfrontends/SignDocuments/src/Component/login.js b/microfrontends/SignDocuments/src/Component/login.js
index 8050485c3..7fadc7776 100644
--- a/microfrontends/SignDocuments/src/Component/login.js
+++ b/microfrontends/SignDocuments/src/Component/login.js
@@ -103,7 +103,12 @@ function Login() {
setLoading(false);
} else {
let _user = user.data.result;
+ const parseId = localStorage.getItem("parseAppId");
localStorage.setItem("UserInformation", JSON.stringify(_user));
+ localStorage.setItem(
+ `Parse/${parseId}/currentUser`,
+ JSON.stringify(_user)
+ );
localStorage.setItem("username", _user.name);
localStorage.setItem("accesstoken", _user.sessionToken);
//save isGuestSigner true in local to handle login flow header in mobile view
diff --git a/microfrontends/SignDocuments/src/Component/placeHolderSign.js b/microfrontends/SignDocuments/src/Component/placeHolderSign.js
index 9808cbf91..1c5ebdc59 100644
--- a/microfrontends/SignDocuments/src/Component/placeHolderSign.js
+++ b/microfrontends/SignDocuments/src/Component/placeHolderSign.js
@@ -987,16 +987,7 @@ function PlaceHolderSign() {
marginBottom: "15px"
}}
></div>
- <button
- onClick={() => setIsSendAlert({})}
- style={{
- color: "black"
- }}
- type="button"
- className="finishBtn"
- >
- Close
- </button>
+
{isSendAlert.mssg === "confirm" && (
<button
onClick={() => sendEmailToSigners()}
@@ -1009,6 +1000,16 @@ function PlaceHolderSign() {
Yes
</button>
)}
+ <button
+ onClick={() => setIsSendAlert({})}
+ style={{
+ color: "black"
+ }}
+ type="button"
+ className="finishBtn"
+ >
+ Close
+ </button>
</div>
</ModalUi>
@@ -1039,30 +1040,29 @@ function PlaceHolderSign() {
<>
<button
onClick={() => {
- setIsSend(false);
- setSignerPos([]);
+ handleRecipientSign();
}}
style={{
- color: "black"
+ background: themeColor(),
+ color: "white"
}}
type="button"
className="finishBtn"
>
- No
+ Yes
</button>
-
<button
onClick={() => {
- handleRecipientSign();
+ setIsSend(false);
+ setSignerPos([]);
}}
style={{
- background: themeColor(),
- color: "white"
+ color: "black"
}}
type="button"
className="finishBtn"
>
- Yes
+ No
</button>
</>
) : (
@@ -1225,16 +1225,26 @@ function PlaceHolderSign() {
)}
</DndProvider>
<div>
- <Modal show={signerExistModal}>
- <Modal.Header className="bg-danger">
- <span style={{ color: "white" }}>Users required</span>
- </Modal.Header>
-
- {/* signature modal */}
- <Modal.Body>
- <p>Please attach users to all fields</p>
- </Modal.Body>
- <Modal.Footer>
+ <ModalUi
+ headerColor={"#dc3545"}
+ isOpen={signerExistModal}
+ title={"Users required"}
+ handleClose={() => {
+ setSignerExistModal(false);
+ }}
+ >
+ <div style={{ height: "100%", padding: 20 }}>
+ <p>Please assign signers to all placeholders</p>
+
+ <div
+ style={{
+ height: "1px",
+ backgroundColor: "#9f9f9f",
+ width: "100%",
+ marginTop: "15px",
+ marginBottom: "15px"
+ }}
+ ></div>
<button
onClick={() => setSignerExistModal(false)}
style={{
@@ -1245,8 +1255,9 @@ function PlaceHolderSign() {
>
Close
</button>
- </Modal.Footer>
- </Modal>
+ </div>
+ </ModalUi>
+
<LinkUserModal
handleAddUser={handleAddUser}
isAddUser={isAddUser}
diff --git a/microfrontends/SignDocuments/src/Routes.js b/microfrontends/SignDocuments/src/Routes.js
index e9dd50915..e9f7adf92 100644
--- a/microfrontends/SignDocuments/src/Routes.js
+++ b/microfrontends/SignDocuments/src/Routes.js
@@ -25,8 +25,9 @@ function AppRoutes() {
<Route path="/signaturePdf/:docId" element={<SignYourselfPdf />} />
{/* recipient signature route with no rowlevel data using docId from url */}
<Route
- path="/recipientSignPdf/:id/:contactBookId"
- element={<RecipientSignPdf />}
+ path="/recipientSignPdf/:docId/:contactBookId"
+ // element={<RecipientSignPdf />
+ element={<PdfRequestFiles />}
/>
{/* recipient placeholder set route with rowlevel data */}
<Route path="/placeHolderSign" element={<PlaceHolderSign />} />{" "}
diff --git a/microfrontends/SignDocuments/src/css/customModal.css b/microfrontends/SignDocuments/src/css/customModal.css
index 5687ed9b0..4cdd0e2d6 100644
--- a/microfrontends/SignDocuments/src/css/customModal.css
+++ b/microfrontends/SignDocuments/src/css/customModal.css
@@ -5,11 +5,12 @@
background-color: rgba(0, 0, 0, 0.75);
display: flex;
flex-direction: column;
- align-items: center;
+ align-items: center;
+ justify-content: center;
}
.childDiv {
- width: 50%;
+ width: 40%;
display: flex;
flex-direction: column;
justify-content: center;
@@ -27,7 +28,7 @@
border-top-left-radius: 0.3rem;
border-top-right-radius: 0.3rem;
font-size: 17px;
- font-weight: 500;
+ font-weight: 400;
}
.modalBodyDIv {
@@ -48,12 +49,12 @@
.modalFooterDiv {
margin: 10px;
display: flex;
- justify-content: flex-end;
+ justify-content: flex-start;
}
@media screen and (max-width:500px) {
.childDiv {
margin: 50px 7px;
- width: 90%;
+ width: 80%;
}
}
\ No newline at end of file
diff --git a/microfrontends/SignDocuments/src/css/signature.css b/microfrontends/SignDocuments/src/css/signature.css
index 2eb4f834a..53298e180 100644
--- a/microfrontends/SignDocuments/src/css/signature.css
+++ b/microfrontends/SignDocuments/src/css/signature.css
@@ -2,7 +2,6 @@
@import url('https://fonts.googleapis.com/css2?family=Dancing+Script&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Delicious+Handrawn&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Cedarville+Cursive&display=swap');
-
.signatureCanvas {
border: 2px solid #888;
background-color: rgb(255, 255, 255);
@@ -266,7 +265,7 @@
.defaultSignBox {
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.18);
- width: 180px;
+ width: 90%;
height: 111px;
padding: 8px 20px;
color: white;
@@ -444,6 +443,7 @@
width: 180px;
background-color: white;
height: 100%;
+
}
.modalBody {
@@ -678,6 +678,12 @@ option {
.dropDownStyle {
width: auto;
}
+.autoSignScroll{
+ overflow-y: auto;
+}
+.autoSignScroll::-webkit-scrollbar {
+ display: none;
+}
@media screen and (max-width:766px) {
diff --git a/microfrontends/SignDocuments/src/utils/Utils.js b/microfrontends/SignDocuments/src/utils/Utils.js
index dec3f024a..9950cfccc 100644
--- a/microfrontends/SignDocuments/src/utils/Utils.js
+++ b/microfrontends/SignDocuments/src/utils/Utils.js
@@ -95,19 +95,19 @@ export function onSaveImage(xyPostion, index, signKey, imgWH, image) {
let getIMGWH;
//get current page position
const getXYData = xyPostion[index].pos;
- const updateXYData = getXYData.map((url) => {
- if (url.key === signKey) {
- getIMGWH = calculateImgAspectRatio(imgWH, url);
+ const updateXYData = getXYData.map((position) => {
+ if (position.key === signKey) {
+ getIMGWH = calculateImgAspectRatio(imgWH, position);
return {
- ...url,
+ ...position,
Width: getIMGWH.newWidth,
Height: getIMGWH.newHeight,
SignUrl: image.src,
ImageType: image.imgType
};
}
- return url;
+ return position;
});
const updateXYposition = xyPostion.map((obj, ind) => {
@@ -215,18 +215,18 @@ export const addDefaultSignatureImg = (xyPostion, defaultSignImg) => {
const getPageNo = xyPostion[i].pageNumber;
const getPosData = getXYdata;
- const addSign = getPosData.map((url, ind) => {
- getIMGWH = calculateImgAspectRatio(imgWH, url);
- if (url) {
+ const addSign = getPosData.map((position, ind) => {
+ getIMGWH = calculateImgAspectRatio(imgWH, position);
+ if (position && !position.isStamp) {
return {
- ...url,
+ ...position,
SignUrl: defaultSignImg,
Width: getIMGWH.newWidth,
Height: getIMGWH.newHeight,
ImageType: "default"
};
}
- return url;
+ return position;
});
const newXypos = {
@@ -764,8 +764,7 @@ export const handleSignYourselfImageResize = (
key,
xyPostion,
index,
- setXyPostion
-
+ setXyPostion
) => {
// const updateFilter = xyPostion[index].pos.filter(
// (data) => data.key === key && data.Width && data.Height