diff --git a/microfrontends/SignDocuments/package-lock.json b/microfrontends/SignDocuments/package-lock.json index 4945bb084..4598b6dad 100644 --- a/microfrontends/SignDocuments/package-lock.json +++ b/microfrontends/SignDocuments/package-lock.json @@ -21547,4 +21547,4 @@ } } } -} \ No newline at end of file +} diff --git a/microfrontends/SignDocuments/src/Component/SignYourselfPdf.js b/microfrontends/SignDocuments/src/Component/SignYourselfPdf.js index 76b74b642..2460d6c36 100644 --- a/microfrontends/SignDocuments/src/Component/SignYourselfPdf.js +++ b/microfrontends/SignDocuments/src/Component/SignYourselfPdf.js @@ -15,7 +15,11 @@ import EmailComponent from "./component/emailComponent"; import FieldsComponent from "./component/fieldsComponent"; import Modal from "react-bootstrap/Modal"; import ModalHeader from "react-bootstrap/esm/ModalHeader"; -import { convertPNGtoJPEG, contractDocument, getBase64FromIMG } from "../utils/Utils"; +import { + convertPNGtoJPEG, + contractDocument, + getBase64FromIMG +} from "../utils/Utils"; import { useParams } from "react-router-dom"; import Tour from "reactour"; import { onSaveImage, onSaveSign } from "../utils/Utils"; @@ -26,7 +30,7 @@ import Header from "./component/header"; import RenderPdf from "./component/renderPdf"; import { contractUsers, contactBook, urlValidator } from "../utils/Utils"; import { modalAlign } from "../utils/Utils"; -import { $ } from 'select-dom'; +import { $ } from "select-dom"; //For signYourself inProgress section signer can add sign and complete doc sign. function SignYourSelf() { const [pdfDetails, setPdfDetails] = useState([]); @@ -169,12 +173,12 @@ function SignYourSelf() { //pdf from left and right component setPdfNewWidth(pdfWidth); if (documentId) { - getDocumentDetails(); + getDocumentDetails(true); } }, []); //function for get document details for perticular signer with signer'object id - const getDocumentDetails = async () => { + const getDocumentDetails = async (showComplete) => { //getting document details const documentData = await contractDocument(documentId); @@ -182,7 +186,7 @@ function SignYourSelf() { setPdfDetails(documentData); const isCompleted = documentData[0].IsCompleted && documentData[0].IsCompleted; - if (isCompleted) { + if (isCompleted && showComplete) { const docStatus = { isCompleted: isCompleted }; @@ -615,7 +619,7 @@ function SignYourSelf() { // console.log("json ", json); setPdfUrl(json.result.data); if (json.result.data) { - getDocumentDetails(); + getDocumentDetails(false); } }) .catch((err) => { diff --git a/microfrontends/SignDocuments/src/Component/component/emailComponent.js b/microfrontends/SignDocuments/src/Component/component/emailComponent.js index 532b3be4e..1158ff128 100644 --- a/microfrontends/SignDocuments/src/Component/component/emailComponent.js +++ b/microfrontends/SignDocuments/src/Component/component/emailComponent.js @@ -28,9 +28,7 @@ function EmailComponent({ setIsLoading(true); let sendMail; for (let i = 0; i < emailCount.length; i++) { - try { - const imgPng = "https://qikinnovation.ams3.digitaloceanspaces.com/logo.png"; // "https://qikinnovation.ams3.digitaloceanspaces.com/mailLogo_2023-08-18T12%3A51%3A31.573Z.png"; @@ -111,16 +109,22 @@ function EmailComponent({ const pdf = await getBase64FromUrl(pdfUrl); const isAndroidDevice = navigator.userAgent.match(/Android/i); - const isAppleDevice = (/iPad|iPhone|iPod/.test(navigator.platform) || (navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1)) && !window.MSStream + const isAppleDevice = + (/iPad|iPhone|iPod/.test(navigator.platform) || + (navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1)) && + !window.MSStream; if (isAndroidDevice || isAppleDevice) { - const byteArray = Uint8Array.from(atob(pdf).split('').map(char => char.charCodeAt(0))); - const blob = new Blob([byteArray], { type: 'application/pdf' }); + const byteArray = Uint8Array.from( + atob(pdf) + .split("") + .map((char) => char.charCodeAt(0)) + ); + const blob = new Blob([byteArray], { type: "application/pdf" }); const blobUrl = URL.createObjectURL(blob); - window.open(blobUrl, '_blank'); + window.open(blobUrl, "_blank"); } else { printModule({ printable: pdf, type: "pdf", base64: true }); } - }; //handle download signed pdf @@ -130,12 +134,11 @@ function EmailComponent({ const sanitizeFileName = (pdfName) => { // Replace spaces with underscore - return pdfName.replace(/ /g, '_'); - } + return pdfName.replace(/ /g, "_"); + }; const isAndroid = /Android/i.test(navigator.userAgent); - return (