{obj.Name}
diff --git a/microfrontends/SignDocuments/src/Component/SignYourselfPdf.js b/microfrontends/SignDocuments/src/Component/SignYourselfPdf.js
index 4b761d7ff..4e91eab20 100644
--- a/microfrontends/SignDocuments/src/Component/SignYourselfPdf.js
+++ b/microfrontends/SignDocuments/src/Component/SignYourselfPdf.js
@@ -1,5 +1,4 @@
import React, { useState, useRef, useEffect } from "react";
-
import { PDFDocument, rgb } from "pdf-lib";
import "../css/./signature.css";
import sign from "../assests/sign3.png";
@@ -58,7 +57,7 @@ function SignYourSelf() {
const [documentStatus, setDocumentStatus] = useState({ isCompleted: false });
const [isLoading, setIsLoading] = useState({
isLoad: true,
- message: "This might take some time",
+ message: "This might take some time"
});
const [handleError, setHandleError] = useState();
const [isDragging, setIsDragging] = useState(false);
@@ -70,7 +69,11 @@ function SignYourSelf() {
const [noData, setNoData] = useState(false);
const [contractName, setContractName] = useState("");
const [showAlreadySignDoc, setShowAlreadySignDoc] = useState({
+ status: false
+ });
+ const [pdfLoadFail, setPdfLoadFail] = useState({
status: false,
+ type: "load"
});
const nodeRef = useRef(null);
@@ -78,8 +81,8 @@ function SignYourSelf() {
accept: "BOX",
drop: (item, monitor) => addPositionOfSignature(item, monitor),
collect: (monitor) => ({
- isOver: !!monitor.isOver(),
- }),
+ isOver: !!monitor.isOver()
+ })
});
const pdfRef = useRef();
@@ -90,11 +93,11 @@ function SignYourSelf() {
item: {
type: "BOX",
id: 1,
- text: "drag me",
+ text: "drag me"
},
collect: (monitor) => ({
- isDragSign: !!monitor.isDragging(),
- }),
+ isDragSign: !!monitor.isDragging()
+ })
});
const [{ isDragStamp }, dragStamp] = useDrag({
@@ -103,11 +106,11 @@ function SignYourSelf() {
item: {
type: "BOX",
id: 2,
- text: "drag me",
+ text: "drag me"
},
collect: (monitor) => ({
- isDragStamp: !!monitor.isDragging(),
- }),
+ isDragStamp: !!monitor.isDragging()
+ })
});
const [{ isDragSignatureSS }, dragSignatureSS] = useDrag({
type: "BOX",
@@ -115,11 +118,11 @@ function SignYourSelf() {
item: {
type: "BOX",
id: 3,
- text: "drag me",
+ text: "drag me"
},
collect: (monitor) => ({
- isDragSignatureSS: !!monitor.isDragging(),
- }),
+ isDragSignatureSS: !!monitor.isDragging()
+ })
});
const [{ isDragStampSS }, dragStampSS] = useDrag({
@@ -128,11 +131,11 @@ function SignYourSelf() {
item: {
type: "BOX",
id: 4,
- text: "drag me",
+ text: "drag me"
},
collect: (monitor) => ({
- isDragStampSS: !!monitor.isDragging(),
- }),
+ isDragStampSS: !!monitor.isDragging()
+ })
});
const index = xyPostion.findIndex((object) => {
@@ -181,8 +184,8 @@ function SignYourSelf() {
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((Listdata) => {
@@ -194,13 +197,13 @@ function SignYourSelf() {
const isCompleted = res[0].IsCompleted && res[0].IsCompleted;
if (isCompleted) {
const docStatus = {
- isCompleted: isCompleted,
+ isCompleted: isCompleted
};
setDocumentStatus(docStatus);
const alreadySign = {
status: true,
- mssg: "You have successfully signed the document!",
+ mssg: "You have successfully signed the document!"
};
setShowAlreadySignDoc(alreadySign);
setPdfUrl(res[0].SignedUrl);
@@ -209,14 +212,14 @@ function SignYourSelf() {
setNoData(true);
const loadObj = {
- isLoad: false,
+ isLoad: false
};
setIsLoading(loadObj);
}
})
.catch((err) => {
const loadObj = {
- isLoad: false,
+ isLoad: false
};
setHandleError("Error: Something went wrong!");
setIsLoading(loadObj);
@@ -232,8 +235,8 @@ function SignYourSelf() {
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((Listdata) => {
@@ -246,14 +249,18 @@ function SignYourSelf() {
})
.catch((err) => {
const loadObj = {
- isLoad: false,
+ isLoad: false
};
setHandleError("Error: Something went wrong!");
setIsLoading(loadObj);
});
const contractUsersRes = await contractUsers(jsonSender.objectId);
- if (contractUsersRes && contractUsersRes[0]) {
+ if (
+ contractUsersRes !== "Error: Something went wrong!" &&
+ contractUsersRes &&
+ contractUsersRes[0]
+ ) {
setContractName("_Users");
setSignerUserId(contractUsersRes[0].objectId);
const tourstatuss =
@@ -269,12 +276,12 @@ function SignYourSelf() {
}
}
const loadObj = {
- isLoad: false,
+ isLoad: false
};
setIsLoading(loadObj);
} else if (contractUsersRes === "Error: Something went wrong!") {
const loadObj = {
- isLoad: false,
+ isLoad: false
};
setHandleError("Error: Something went wrong!");
setIsLoading(loadObj);
@@ -299,7 +306,7 @@ function SignYourSelf() {
}
}
const loadObj = {
- isLoad: false,
+ isLoad: false
};
setIsLoading(loadObj);
}
@@ -366,7 +373,7 @@ function SignYourSelf() {
key: key,
isStamp: monitor,
- yBottom: window.innerHeight / 2 - 60,
+ yBottom: window.innerHeight / 2 - 60
};
dropData.push(dropObj);
@@ -395,7 +402,7 @@ function SignYourSelf() {
isStamp: isDragStamp || isDragStampSS ? true : false,
firstXPos: signBtnPosition[0] && signBtnPosition[0].xPos,
firstYPos: signBtnPosition[0] && signBtnPosition[0].yPos,
- yBottom: ybottom,
+ yBottom: ybottom
};
dropData.push(dropObj);
@@ -416,7 +423,7 @@ function SignYourSelf() {
const newSignPos = updateData.concat(dropData);
let xyPos = {
pageNumber: pageNumber,
- pos: newSignPos,
+ pos: newSignPos
};
xyPostion.splice(index, 1, xyPos);
setIsSignPad(true);
@@ -425,7 +432,7 @@ function SignYourSelf() {
} else {
const xyPos = {
pageNumber: pageNumber,
- pos: dropData,
+ pos: dropData
};
setXyPostion((prev) => [...prev, xyPos]);
setIsSignPad(true);
@@ -456,7 +463,7 @@ function SignYourSelf() {
}, 3000);
const loadObj = {
isLoad: true,
- message: "This might take some time",
+ message: "This might take some time"
};
setIsLoading(loadObj);
const url = pdfDetails[0] && pdfDetails[0].URL;
@@ -467,7 +474,7 @@ function SignYourSelf() {
// Load a PDFDocument from the existing PDF bytes
const pdfDoc = await PDFDocument.load(existingPdfBytes, {
- ignoreEncryption: true,
+ ignoreEncryption: true
});
const pngUrl = xyPostion;
//checking if signature is only one then send image url in jpeg formate to server
@@ -488,11 +495,11 @@ function SignYourSelf() {
y: page.getHeight() - 10,
size: fontSize,
font,
- color: rgb(0.5, 0.5, 0.5),
+ color: rgb(0.5, 0.5, 0.5)
});
}
const pdfBase64 = await pdfDoc.saveAsBase64({
- useObjectStreams: false,
+ useObjectStreams: false
});
for (let i = 0; i < xyPostion.length; i++) {
const imgUrlList = xyPostion[i].pos;
@@ -568,7 +575,7 @@ function SignYourSelf() {
y: page.getHeight() - 10,
size: fontSize,
font,
- color: rgb(0.5, 0.5, 0.5),
+ color: rgb(0.5, 0.5, 0.5)
});
}
for (let i = 0; i < pngUrl.length; i++) {
@@ -621,7 +628,7 @@ function SignYourSelf() {
y:
page.getHeight() - imgUrlList[id].yPosition * scale - imgHeight,
width: imgWidth,
- height: imgHeight,
+ height: imgHeight
});
});
}
@@ -668,13 +675,13 @@ function SignYourSelf() {
Bottom: bottomY,
Width: xyPosData.Width ? xyPosData.Width : 150,
Height: height,
- Page: pageNo,
- },
+ Page: pageNo
+ }
};
} else if (xyPostion.length > 0 && xyPostion[0].pos.length > 0) {
singleSign = {
pdfFile: base64Url,
- docId: documentId,
+ docId: documentId
};
}
// console.log("data",singleSign)
@@ -683,9 +690,9 @@ function SignYourSelf() {
headers: {
"Content-Type": "application/json",
"X-Parse-Application-Id": localStorage.getItem("parseAppId"),
- sessionToken: localStorage.getItem("accesstoken"),
+ sessionToken: localStorage.getItem("accesstoken")
// sessiontoken,
- },
+ }
})
.then((Listdata) => {
const json = Listdata.data;
@@ -693,12 +700,12 @@ function SignYourSelf() {
setPdfUrl(json.result.data);
if (json.result.data) {
const docStatus = {
- isCompleted: true,
+ isCompleted: true
};
setDocumentStatus(docStatus);
const loadObj = {
- isLoad: false,
+ isLoad: false
};
setIsLoading(loadObj);
}
@@ -741,7 +748,7 @@ function SignYourSelf() {
xPosition: dragElement.x,
yPosition: dragElement.y,
isDrag: true,
- yBottom: ybottom,
+ yBottom: ybottom
};
}
return url;
@@ -764,6 +771,10 @@ function SignYourSelf() {
//function for get pdf page details
const pageDetails = async (pdf) => {
+ const load = {
+ status: true
+ };
+ setPdfLoadFail(load);
pdf.getPage(1).then((pdfPage) => {
const pageWidth = pdfPage.view[2];
@@ -848,7 +859,7 @@ function SignYourSelf() {
const xyPosition = {
xPos: mouseX,
- yPos: mouseY,
+ yPos: mouseY
};
setXYSignature(xyPosition);
@@ -877,7 +888,7 @@ function SignYourSelf() {
...url,
Width: ref.offsetWidth,
Height: ref.offsetHeight,
- xPosition: position.x,
+ xPosition: position.x
};
}
return url;
@@ -901,7 +912,7 @@ function SignYourSelf() {
return {
...url,
Width: ref.offsetWidth,
- Height: ref.offsetHeight,
+ Height: ref.offsetHeight
};
}
return url;
@@ -975,7 +986,7 @@ function SignYourSelf() {
const newXypos = {
pageNumber: getPageNo,
- pos: addSign,
+ pos: addSign
};
xyDefaultPos.push(newXypos);
}
@@ -989,14 +1000,14 @@ function SignYourSelf() {
selector: '[data-tut="reactourFirst"]',
content: `Drag the signature or stamp placeholder onto the PDF to choose your desired signing location.`,
position: "top",
- style: { fontSize: "13px" },
+ style: { fontSize: "13px" }
},
{
selector: '[data-tut="reactourSecond"]',
content: `Drag and drop anywhere in this area. You can resize and move it later.`,
position: "top",
- style: { fontSize: "13px" },
- },
+ style: { fontSize: "13px" }
+ }
];
//function for update TourStatus
@@ -1023,14 +1034,14 @@ function SignYourSelf() {
"_appName"
)}${contractName}/${signerUserId}`,
{
- TourStatus: updatedTourStatus,
+ TourStatus: updatedTourStatus
},
{
headers: {
"Content-Type": "application/json",
"X-Parse-Application-Id": localStorage.getItem("parseAppId"),
- sessionToken: localStorage.getItem("accesstoken"),
- },
+ sessionToken: localStorage.getItem("accesstoken")
+ }
}
)
.then((Listdata) => {
@@ -1054,7 +1065,7 @@ function SignYourSelf() {
) : (
{/* this component used for UI interaction and show their functionality */}
- {!checkTourStatus && (
+ {pdfLoadFail && !checkTourStatus && (
500 && "20px",
- marginRight: pdfOriginalWidth > 500 && "20px",
+ marginRight: pdfOriginalWidth > 500 && "20px"
}}
>
{/* this modal is used show this document is already sign */}
@@ -1099,7 +1110,7 @@ function SignYourSelf() {
borderRadius: "0px",
border: "1.5px solid #e3e2e1",
fontWeight: "600",
- color: "black",
+ color: "black"
}}
className="btn"
onClick={() => setShowAlreadySignDoc({ status: false })}
@@ -1110,7 +1121,7 @@ function SignYourSelf() {
diff --git a/microfrontends/SignDocuments/src/Component/component/fieldsComponent.js b/microfrontends/SignDocuments/src/Component/component/fieldsComponent.js
index 7fc4cd005..828266f2e 100644
--- a/microfrontends/SignDocuments/src/Component/component/fieldsComponent.js
+++ b/microfrontends/SignDocuments/src/Component/component/fieldsComponent.js
@@ -1,4 +1,4 @@
-import React, { useState } from "react";
+import React from "react";
import * as Select from "@radix-ui/react-select";
import classnames from "classnames";
diff --git a/microfrontends/SignDocuments/src/Component/component/header.js b/microfrontends/SignDocuments/src/Component/component/header.js
index a6c36f6bd..7b8858197 100644
--- a/microfrontends/SignDocuments/src/Component/component/header.js
+++ b/microfrontends/SignDocuments/src/Component/component/header.js
@@ -224,11 +224,13 @@ function Header({
)}
{isPlaceholder ? (
{
if (!isMailSend) {
alertSendEmail();
}
}}
+
style={{
color: isMailSend ? "gray" : themeColor(),
border: "none",
@@ -241,6 +243,7 @@ function Header({
) : (
{
if (!pdfUrl) {
embedImages();
diff --git a/microfrontends/SignDocuments/src/Component/component/renderPdf.js b/microfrontends/SignDocuments/src/Component/component/renderPdf.js
index 03258c263..aaa10a785 100644
--- a/microfrontends/SignDocuments/src/Component/component/renderPdf.js
+++ b/microfrontends/SignDocuments/src/Component/component/renderPdf.js
@@ -39,6 +39,7 @@ function RenderPdf({
signedSigners,
setPdfLoadFail,
placeholder,
+ pdfLoadFail
}) {
const isMobile = window.innerWidth < 712;
@@ -72,7 +73,7 @@ function RenderPdf({
topRight: false,
bottomRight: false,
bottomLeft: false,
- topLeft: false,
+ topLeft: false
}}
bounds="parent"
style={{
@@ -87,16 +88,18 @@ function RenderPdf({
background: "#daebe0",
textAlign: "center",
justifyContent: "center",
- borderWidth: "0.2px",
+ borderWidth: "0.2px"
}}
size={{
width: pos.Width ? pos.Width : 150,
- height: pos.Height ? pos.Height : 60,
+ height: pos.Height ? pos.Height : 60
}}
lockAspectRatio={pos.Width && 2.5}
default={{
- x: pos.xPosition,
- y: pos.yPosition,
+ x: pos.scale
+ ? pos.xPosition * pos.scale
+ : pos.xPosition,
+ y: pos.scale ? pos.yPosition * pos.scale : pos.yPosition
}}
onClick={() => {
setIsSignPad(true);
@@ -114,7 +117,7 @@ function RenderPdf({
style={{
width: "100%",
height: "100%",
- objectFit: "contain",
+ objectFit: "contain"
}}
/>
@@ -131,7 +134,7 @@ function RenderPdf({
topRight: false,
bottomRight: false,
bottomLeft: false,
- topLeft: false,
+ topLeft: false
}}
key={pos.key}
bounds="parent"
@@ -154,15 +157,15 @@ function RenderPdf({
background: data.blockColor,
textAlign: "center",
justifyContent: "center",
- borderWidth: "0.2px",
+ borderWidth: "0.2px"
}}
default={{
- x: pos.xPosition,
- y: pos.yPosition,
+ x: pos.scale ? pos.xPosition * pos.scale : pos.xPosition,
+ y: pos.scale ? pos.yPosition * pos.scale : pos.yPosition
}}
size={{
width: pos.Width ? pos.Width : 150,
- height: pos.Height ? pos.Height : 60,
+ height: pos.Height ? pos.Height : 60
}}
lockAspectRatio={pos.Width ? pos.Width / pos.Height : 2.5}
>
@@ -172,7 +175,7 @@ function RenderPdf({
color: "black",
fontWeight: "600",
// justifyContent: "center",
- marginTop: "0px",
+ marginTop: "0px"
}}
>
{pos.isStamp ? "stamp" : "signature"}
@@ -203,7 +206,7 @@ function RenderPdf({
// >