Skip to content

Commit db4b8ec

Browse files
fix two modal overlap during signyourself flow
1 parent 2ee9ae1 commit db4b8ec

File tree

3 files changed

+36
-23
lines changed

3 files changed

+36
-23
lines changed

microfrontends/SignDocuments/package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

microfrontends/SignDocuments/src/Component/SignYourselfPdf.js

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@ import EmailComponent from "./component/emailComponent";
1515
import FieldsComponent from "./component/fieldsComponent";
1616
import Modal from "react-bootstrap/Modal";
1717
import ModalHeader from "react-bootstrap/esm/ModalHeader";
18-
import { convertPNGtoJPEG, contractDocument, getBase64FromIMG } from "../utils/Utils";
18+
import {
19+
convertPNGtoJPEG,
20+
contractDocument,
21+
getBase64FromIMG
22+
} from "../utils/Utils";
1923
import { useParams } from "react-router-dom";
2024
import Tour from "reactour";
2125
import { onSaveImage, onSaveSign } from "../utils/Utils";
@@ -26,7 +30,7 @@ import Header from "./component/header";
2630
import RenderPdf from "./component/renderPdf";
2731
import { contractUsers, contactBook, urlValidator } from "../utils/Utils";
2832
import { modalAlign } from "../utils/Utils";
29-
import { $ } from 'select-dom';
33+
import { $ } from "select-dom";
3034
//For signYourself inProgress section signer can add sign and complete doc sign.
3135
function SignYourSelf() {
3236
const [pdfDetails, setPdfDetails] = useState([]);
@@ -169,20 +173,20 @@ function SignYourSelf() {
169173
//pdf from left and right component
170174
setPdfNewWidth(pdfWidth);
171175
if (documentId) {
172-
getDocumentDetails();
176+
getDocumentDetails(true);
173177
}
174178
}, []);
175179

176180
//function for get document details for perticular signer with signer'object id
177-
const getDocumentDetails = async () => {
181+
const getDocumentDetails = async (showComplete) => {
178182
//getting document details
179183
const documentData = await contractDocument(documentId);
180184

181185
if (documentData && documentData.length > 0) {
182186
setPdfDetails(documentData);
183187
const isCompleted =
184188
documentData[0].IsCompleted && documentData[0].IsCompleted;
185-
if (isCompleted) {
189+
if (isCompleted && showComplete) {
186190
const docStatus = {
187191
isCompleted: isCompleted
188192
};
@@ -615,7 +619,7 @@ function SignYourSelf() {
615619
// console.log("json ", json);
616620
setPdfUrl(json.result.data);
617621
if (json.result.data) {
618-
getDocumentDetails();
622+
getDocumentDetails(false);
619623
}
620624
})
621625
.catch((err) => {

microfrontends/SignDocuments/src/Component/component/emailComponent.js

Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,7 @@ function EmailComponent({
2828
setIsLoading(true);
2929
let sendMail;
3030
for (let i = 0; i < emailCount.length; i++) {
31-
3231
try {
33-
3432
const imgPng =
3533
"https://qikinnovation.ams3.digitaloceanspaces.com/logo.png";
3634
// "https://qikinnovation.ams3.digitaloceanspaces.com/mailLogo_2023-08-18T12%3A51%3A31.573Z.png";
@@ -111,16 +109,22 @@ function EmailComponent({
111109

112110
const pdf = await getBase64FromUrl(pdfUrl);
113111
const isAndroidDevice = navigator.userAgent.match(/Android/i);
114-
const isAppleDevice = (/iPad|iPhone|iPod/.test(navigator.platform) || (navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1)) && !window.MSStream
112+
const isAppleDevice =
113+
(/iPad|iPhone|iPod/.test(navigator.platform) ||
114+
(navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1)) &&
115+
!window.MSStream;
115116
if (isAndroidDevice || isAppleDevice) {
116-
const byteArray = Uint8Array.from(atob(pdf).split('').map(char => char.charCodeAt(0)));
117-
const blob = new Blob([byteArray], { type: 'application/pdf' });
117+
const byteArray = Uint8Array.from(
118+
atob(pdf)
119+
.split("")
120+
.map((char) => char.charCodeAt(0))
121+
);
122+
const blob = new Blob([byteArray], { type: "application/pdf" });
118123
const blobUrl = URL.createObjectURL(blob);
119-
window.open(blobUrl, '_blank');
124+
window.open(blobUrl, "_blank");
120125
} else {
121126
printModule({ printable: pdf, type: "pdf", base64: true });
122127
}
123-
124128
};
125129

126130
//handle download signed pdf
@@ -130,12 +134,11 @@ function EmailComponent({
130134

131135
const sanitizeFileName = (pdfName) => {
132136
// Replace spaces with underscore
133-
return pdfName.replace(/ /g, '_');
134-
}
137+
return pdfName.replace(/ /g, "_");
138+
};
135139

136140
const isAndroid = /Android/i.test(navigator.userAgent);
137141

138-
139142
return (
140143
<div>
141144
{/* isEmail */}
@@ -167,7 +170,7 @@ function EmailComponent({
167170
)}
168171

169172
<ModalHeader style={{ background: themeColor() }}>
170-
<span style={{ color: "white" }}>Email Documents</span>
173+
<span style={{ color: "white" }}>Successfully signed!</span>
171174

172175
<div style={{ display: "flex", flexDirection: "row" }}>
173176
<div></div>
@@ -259,14 +262,20 @@ function EmailComponent({
259262
>
260263
{emailCount.map((data, ind) => {
261264
return (
262-
<div className="emailChip"
263-
style={{display:"flex", flexDirection:"row", alignItems:"center"}}
264-
key={ind}>
265+
<div
266+
className="emailChip"
267+
style={{
268+
display: "flex",
269+
flexDirection: "row",
270+
alignItems: "center"
271+
}}
272+
key={ind}
273+
>
265274
<span
266275
style={{
267276
color: "white",
268277
fontSize: "13px",
269-
marginRight: "20px"
278+
marginTop: "2px"
270279
}}
271280
>
272281
{data}
@@ -278,7 +287,7 @@ function EmailComponent({
278287
src={close}
279288
width={10}
280289
height={10}
281-
style={{ fontWeight: "600" }}
290+
style={{ fontWeight: "600", margin: "0 0 10px 2px" }}
282291
/>
283292
</div>
284293
);

0 commit comments

Comments
 (0)