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"
}}
>
) : (
@@ -385,7 +381,7 @@ function PdfFileComponent({
style={{
display: "flex",
flexDirection: "column",
- cursor: "pointer",
+ cursor: "pointer"
}}
>
) : (
@@ -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 ? (
-
-
+
+
| Name |
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 (
@@ -663,11 +691,47 @@ function PdfRequestFiles() {
)}
-
+
{
+ setIsAlert({
+ isShow: false,
+ alertMessage: ""
+ });
+ }}
+ >
+
+
{isAlert.alertMessage}
+
+
+
+
+
+
{/* this modal is used to show decline alert */}
+
{
+ setDefaultSignAlert({
+ isShow: false,
+ alertMessage: ""
+ });
+ }}
+ >
+
+
{defaultSignAlert.alertMessage}
+
+
+ {defaultSignImg ? (
+ <>
+
+
+ >
+ ) : (
+
+ )}
+
+
{/* this component used to render all pdf pages in left side */}
- {signedSigners.length > 0 && (
- <>
-
- Signed by
-
-
- {signedSigners.map((obj, ind) => {
- return (
-
+
+ {signedSigners.length > 0 && (
+ <>
+
+ Signed by
+
+
+ {signedSigners.map((obj, ind) => {
+ return (
-
- {getFirstLetter(obj.Name)}
-
+
+ {getFirstLetter(obj.Name)}
+
+
+
+ {obj.Name}
+ {obj.Email}
+
-
- {obj.Name}
- {obj.Email}
-
-
- );
- })}
-
- >
- )}
+ );
+ })}
+
+ >
+ )}
- {unsignedSigners.length > 0 && (
- <>
-
0 && "20px"
- }}
- >
- Yet to sign
-
-
- {unsignedSigners.map((obj, ind) => {
- return (
-
+ {unsignedSigners.length > 0 && (
+ <>
+
0 && "20px"
+ }}
+ >
+ Yet to sign
+
+
+ {unsignedSigners.map((obj, ind) => {
+ return (
-
- {getFirstLetter(obj.Name)}
-
+
+ {getFirstLetter(obj.Name)}
+
+
+
+ {obj.Name}
+ {obj.Email}
+
+
-
- {obj.Name}
- {obj.Email}
-
-
-
- );
- })}
-
- >
- )}
+ );
+ })}
+
+ >
+ )}
+ {defaultSignImg && !alreadySign && (
+
+ )}
+
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: () => (
),
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({
{headMsg && headMsg}
{bodyMssg && bodyMssg}
+
+
+ {footerMessage && (
+
+
+
+
+ )}
- {footerMessage && (
-
-
-
-
- )}
)
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 (
-
+
Signature
@@ -38,41 +43,34 @@ function DefaultSignature({
fontWeight: "600"
}}
>
- {defaultSignImg ? (
- <>
-
Your Signature
-
-

-
-
);
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 (
-
+
{isMobile && isShowHeader ? (
{signerPos.length === 0 ? (
- Add {signersdata.length - signerPos.length}{" "}
- recipients signature
+ Add {signersdata.length - signerPos.length} recipients
+ signature
) : (
@@ -554,7 +551,14 @@ function Header({
{setIsEditTemplate && (
-
setIsEditTemplate(true)} style={{border:"none", outline:"none", textAlign:"center"}}>
+ setIsEditTemplate(true)}
+ style={{
+ border: "none",
+ outline: "none",
+ textAlign: "center"
+ }}
+ >
)}
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}
+
+ {pos.isStamp ? "stamp" : "signature"}
+
)
);
@@ -411,474 +418,352 @@ function RenderPdf({
>
{pdfLoadFail.status &&
- (recipient
- ? !pdfUrl &&
- !isAlreadySign.mssg &&
- xyPostion.length > 0 &&
- xyPostion.map((data, ind) => {
+ (pdfRequest
+ ? signerPos.map((data, key) => {
return (
-
- {data.pageNumber === pageNumber &&
- data.pos.map((pos) => {
- return (
- pos && (
- {
- 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
- );
- }}
- >
-
- {pos.SignUrl ? (
-
{
- setIsSignPad(true);
- setSignKey(pos.key);
- }}
- src={pos.SignUrl}
- style={{
- width: "99%",
- height: "100%",
- objectFit: "contain"
- }}
- />
- ) : (
-
- {pos.isStamp ? (
-
stamp
- ) : (
-
signature
- )}
- {handleUserName(
- data.signerObjId,
- data.Role
- )}
-
- )}
-
- )
- );
- })}
+
+ {checkSignedSignes(data)}
);
})
- : pdfRequest
- ? signerPos.map((data, key) => {
+ : placeholder // placeholder mobile
+ ? signerPos.map((data, ind) => {
return (
-
- {checkSignedSignes(data)}
-
- );
- })
- : placeholder // placeholder mobile
- ? signerPos.map((data, ind) => {
- return (
-
- {data.placeHolder.map((placeData, index) => {
- return (
-
- {placeData.pageNumber === pageNumber &&
- placeData.pos.map((pos) => {
- return (
- 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,
- data.Id,
- position,
- signerPos,
- pageNumber,
- setSignerPos,
- pdfOriginalWidth,
- containerWH,
- true
- );
- }}
- >
-
-
- {
- const dataNewPlace = addZIndex(
- signerPos,
- pos.key,
- setZIndex
- );
- setSignerPos((prevState) => {
- const newState = [...prevState];
- newState.splice(
- 0,
- signerPos.length,
- ...dataNewPlace
- );
- return newState;
- });
- }}
- >
-
{
- e.stopPropagation();
- handleLinkUser(data.Id);
- setUniqueId(data.Id);
- }}
- onClick={(e) => {
- e.stopPropagation();
- handleLinkUser(data.Id);
- setUniqueId(data.Id);
- }}
- style={{
- color: "#188ae2"
- }}
- >
-
{
- 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"
- }}
- >
-
{
- e.stopPropagation();
- handleDeleteSign(
- pos.key,
- data.Id
- );
- // data.signerObjId
- }}
- onClick={(e) => {
- e.stopPropagation();
- handleDeleteSign(
- pos.key,
- data.Id
- );
- // data.signerObjId
- }}
- style={{
- color: "#188ae2"
- }}
- >
-
-
- {pos.isStamp ? (
-
stamp
- ) : (
-
signature
- )}
- {handleUserName(
- data.signerObjId,
- data.Role
- )}
-
-
-
- );
- })}
-
- );
- })}
-
- );
- })
- : xyPostion.map((data, ind) => {
- return (
-
- {data.pageNumber === pageNumber &&
- data.pos.map((pos) => {
- return (
- pos && (
- handleTabDrag(pos.key)}
- onDragStop={handleStop}
- onResize={(
- e,
- direction,
- ref,
- delta,
- position
- ) => {
- handleSignYourselfImageResize(
- ref,
- pos.key,
- xyPostion,
- index,
- setXyPostion
- );
- }}
- >
-
-
-
+ {data.placeHolder.map((placeData, index) => {
+ return (
+
+ {placeData.pageNumber === pageNumber &&
+ placeData.pos.map((pos) => {
+ return (
+ {
- if (!isDragging && isMobile) {
- setTimeout(() => {
- e.stopPropagation();
- setIsSignPad(true);
- setSignKey(pos.key);
- setIsStamp(pos.isStamp);
- }, 500);
- }
+ 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,
+ data.Id,
+ position,
+ signerPos,
+ pageNumber,
+ setSignerPos,
+ pdfOriginalWidth,
+ containerWH,
+ true
+ );
}}
>
- {
- e.stopPropagation();
- setIsPageCopy(true);
- setSignKey(pos.key);
- }}
- style={{
- color: "#188ae2"
- }}
- >
- {
- e.stopPropagation();
- if (data) {
- handleDeleteSign(
- pos.key,
- data.signerObjId
+
+
+ {
+ const dataNewPlace = addZIndex(
+ signerPos,
+ pos.key,
+ setZIndex
+ );
+ setSignerPos((prevState) => {
+ const newState = [...prevState];
+ newState.splice(
+ 0,
+ signerPos.length,
+ ...dataNewPlace
);
- } else {
- handleDeleteSign(pos.key);
- setIsStamp(false);
- }
+ return newState;
+ });
}}
- style={{
- color: "#188ae2"
- }}
- >
+ >
+
{
+ e.stopPropagation();
+ handleLinkUser(data.Id);
+ setUniqueId(data.Id);
+ }}
+ onClick={(e) => {
+ e.stopPropagation();
+ handleLinkUser(data.Id);
+ setUniqueId(data.Id);
+ }}
+ style={{
+ color: "#188ae2"
+ }}
+ >
+
{
+ 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"
+ }}
+ >
+
{
+ e.stopPropagation();
+ handleDeleteSign(pos.key, data.Id);
+ // data.signerObjId
+ }}
+ onClick={(e) => {
+ e.stopPropagation();
+ handleDeleteSign(pos.key, data.Id);
+ // data.signerObjId
+ }}
+ style={{
+ color: "#188ae2"
+ }}
+ >
- {pos.SignUrl ? (
-
-

-
- ) : (
- {pos.isStamp ? "stamp" : "signature"}
+ {pos.isStamp ? (
+
stamp
+ ) : (
+
signature
+ )}
+ {handleUserName(
+ data.signerObjId,
+ data.Role
+ )}
- )}
-
-
- )
- );
- })}
-
- );
- }))}
+
+
+ );
+ })}
+
+ );
+ })}
+
+ );
+ })
+ : xyPostion.map((data, ind) => {
+ return (
+
+ {data.pageNumber === pageNumber &&
+ data.pos.map((pos) => {
+ return (
+ pos && (
+ handleTabDrag(pos.key)}
+ onDragStop={handleStop}
+ onResize={(
+ e,
+ direction,
+ ref,
+ delta,
+ position
+ ) => {
+ handleSignYourselfImageResize(
+ ref,
+ pos.key,
+ xyPostion,
+ index,
+ setXyPostion
+ );
+ }}
+ >
+
+
+ {
+ if (!isDragging && isMobile) {
+ setTimeout(() => {
+ e.stopPropagation();
+ setIsSignPad(true);
+ setSignKey(pos.key);
+ setIsStamp(pos.isStamp);
+ }, 500);
+ }
+ }}
+ >
+
{
+ e.stopPropagation();
+ setIsPageCopy(true);
+ setSignKey(pos.key);
+ }}
+ style={{
+ color: "#188ae2"
+ }}
+ >
+
{
+ e.stopPropagation();
+ if (data) {
+ handleDeleteSign(
+ pos.key,
+ data.signerObjId
+ );
+ } else {
+ handleDeleteSign(pos.key);
+ setIsStamp(false);
+ }
+ }}
+ style={{
+ color: "#188ae2"
+ }}
+ >
+
+ {pos.SignUrl ? (
+
+

+
+ ) : (
+
+ {pos.isStamp ? "stamp" : "signature"}
+
+ )}
+
+
+ )
+ );
+ })}
+
+ );
+ }))}
{/* this component for render pdf document is in middle of the component */}
{
- if (recipient) {
- setPdfLoadFail(true);
- }
+ setPdfLoadFail(true);
}}
onLoadSuccess={pageDetails}
ref={pdfRef}
@@ -942,396 +825,276 @@ function RenderPdf({
>
{pdfLoadFail.status &&
- (recipient
- ? !pdfUrl &&
- !isAlreadySign.mssg &&
- xyPostion.length > 0 &&
- xyPostion.map((data, ind) => {
+ (pdfRequest
+ ? signerPos.map((data, key) => {
return (
-
- {data.pageNumber === pageNumber &&
- data.pos.map((pos) => {
- return (
- pos && (
- {
- 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
- );
- }}
- >
-
-
- {pos.SignUrl ? (
-
![no img]()
{
- setIsSignPad(true);
- setSignKey(pos.key);
- }}
- src={pos.SignUrl}
- style={{
- width: "99%",
- height: "100%",
- objectFit: "contain"
- }}
- />
- ) : (
-
- {pos.isStamp ? (
-
stamp
- ) : (
-
signature
- )}
- {handleUserName(
- data.signerObjId,
- data.Role
- )}
-
- )}
-
-
- )
- );
- })}
+
+ {checkSignedSignes(data)}
);
})
- : pdfRequest
- ? signerPos.map((data, key) => {
+ : placeholder
+ ? signerPos.map((data, ind) => {
return (
-
- {checkSignedSignes(data)}
+
+ {data.placeHolder.map((placeData, index) => {
+ return (
+
+ {placeData.pageNumber === pageNumber &&
+ placeData.pos.map((pos) => {
+ return (
+ {
+ 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
+ );
+ }}
+ >
+
+
+
+
{
+ e.stopPropagation();
+ handleLinkUser(data.Id);
+ setUniqueId(data.Id);
+ }}
+ style={{
+ color: "#188ae2"
+ }}
+ >
+
{
+ e.stopPropagation();
+ setIsPageCopy(true);
+ setSignKey(pos.key);
+ setUniqueId(data.Id);
+ setSignerObjId(data.signerObjId);
+ }}
+ style={{
+ color: "#188ae2"
+ }}
+ >
+
{
+ e.stopPropagation();
+ handleDeleteSign(
+ pos.key,
+ data.Id
+ );
+ // data.signerObjId
+ }}
+ style={{
+ color: "#188ae2"
+ }}
+ >
+
+
+ {pos.isStamp ? (
+
stamp
+ ) : (
+
signature
+ )}
+ {handleUserName(
+ data.signerObjId,
+ data.Role
+ )}
+
+
+
+ );
+ })}
+
+ );
+ })}
);
})
- : placeholder
- ? signerPos.map((data, ind) => {
- return (
-
- {data.placeHolder.map((placeData, index) => {
+ : xyPostion.map((data, ind) => {
+ return (
+
+ {data.pageNumber === pageNumber &&
+ data.pos.map((pos) => {
return (
-
- {placeData.pageNumber === pageNumber &&
- placeData.pos.map((pos) => {
- return (
- {
- 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
- );
- }}
- >
-
-
-
-
{
- e.stopPropagation();
- handleLinkUser(data.Id);
- setUniqueId(data.Id);
- }}
- style={{
- color: "#188ae2"
- }}
- >
-
{
- e.stopPropagation();
- setIsPageCopy(true);
- setSignKey(pos.key);
- setUniqueId(data.Id);
- setSignerObjId(
- data.signerObjId
- );
- }}
- style={{
- color: "#188ae2"
- }}
- >
-
{
- e.stopPropagation();
- handleDeleteSign(
- pos.key,
- data.Id
- );
- // data.signerObjId
- }}
- style={{
- color: "#188ae2"
- }}
- >
-
-
- {pos.isStamp ? (
-
stamp
- ) : (
-
signature
- )}
- {handleUserName(
- data.signerObjId,
- data.Role
- )}
-
-
-
+ pos && (
+ 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
);
- })}
-
+ }}
+ >
+
+
+
+
+ )
);
})}
-
- );
- })
- : xyPostion.map((data, ind) => {
- return (
-
- {data.pageNumber === pageNumber &&
- data.pos.map((pos) => {
- return (
- pos && (
- 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
- );
- }}
- >
-
-
-
-
- )
- );
- })}
-
- );
- }))}
+
+ );
+ }))}
{/* this component for render pdf document is in middle of the component */}
{
- 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..59aea3c0b 100644
--- a/microfrontends/SignDocuments/src/Component/placeHolderSign.js
+++ b/microfrontends/SignDocuments/src/Component/placeHolderSign.js
@@ -722,7 +722,7 @@ function PlaceHolderSign() {
});
const currentUser = signersdata.find((x) => x.Email === currentId);
setCurrentId(currentUser?.objectId);
- // console.log("signers ", signers);
+
try {
const data = {
Placeholders: signerPos,
@@ -898,7 +898,11 @@ function PlaceHolderSign() {
}
return { ...x };
});
- // console.log("updateSigner ", updateSigner);
+ // console.log("updateSigner ", updateSigner);
+ if (updateSigner && updateSigner.length > 0) {
+ setCurrentId(updateSigner[0].Email);
+ }
+
setSignersData(updateSigner);
const index = signersdata.findIndex((x) => x.Id === uniqueId);
setIsSelectId(index);
@@ -987,16 +991,7 @@ function PlaceHolderSign() {
marginBottom: "15px"
}}
>
- setIsSendAlert({})}
- style={{
- color: "black"
- }}
- type="button"
- className="finishBtn"
- >
- Close
-
+
{isSendAlert.mssg === "confirm" && (
sendEmailToSigners()}
@@ -1009,6 +1004,16 @@ function PlaceHolderSign() {
Yes
)}
+ setIsSendAlert({})}
+ style={{
+ color: "black"
+ }}
+ type="button"
+ className="finishBtn"
+ >
+ Close
+
@@ -1037,20 +1042,6 @@ function PlaceHolderSign() {
>
{currentId ? (
<>
-
{
- setIsSend(false);
- setSignerPos([]);
- }}
- style={{
- color: "black"
- }}
- type="button"
- className="finishBtn"
- >
- No
-
-
{
handleRecipientSign();
@@ -1064,6 +1055,19 @@ function PlaceHolderSign() {
>
Yes
+
{
+ setIsSend(false);
+ setSignerPos([]);
+ }}
+ style={{
+ color: "black"
+ }}
+ type="button"
+ className="finishBtn"
+ >
+ No
+
>
) : (
-
-
- Users required
-
+ {
+ setSignerExistModal(false);
+ }}
+ >
+
+
Please assign signers to all placeholders
- {/* signature modal */}
-
- Please attach users to all fields
-
-
+
setSignerExistModal(false)}
style={{
@@ -1245,8 +1259,9 @@ function PlaceHolderSign() {
>
Close
-
-
+
+
+
} />
{/* recipient signature route with no rowlevel data using docId from url */}
}
+ path="/recipientSignPdf/:docId/:contactBookId"
+ // element={
+ element={}
/>
{/* recipient placeholder set route with rowlevel data */}
} />{" "}
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