Skip to content

Commit 1ec10fb

Browse files
fix: modal-ui,replace loading pdf to loading document, onclick placeholder open user details popup
1 parent 274620d commit 1ec10fb

File tree

10 files changed

+875
-708
lines changed

10 files changed

+875
-708
lines changed

microfrontends/SignDocuments/src/Component/LegaDrive/FolderDrive/legaDriveComponent.js

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ function PdfFileComponent({
2020
setDocId,
2121
setIsLoading,
2222
setPdfData,
23-
isList
23+
isList,
24+
setIsAlert
2425
}) {
2526
const [rename, setRename] = useState("");
2627
const [renameValue, setRenameValue] = useState("");
@@ -103,7 +104,10 @@ function PdfFileComponent({
103104
// console.log("res", res);
104105
})
105106
.catch((err) => {
106-
console.log("error updating field is decline ", err);
107+
setIsAlert({
108+
isShow: true,
109+
alertMessage: "something went wrong"
110+
});
107111
});
108112
}
109113
};
@@ -191,7 +195,10 @@ function PdfFileComponent({
191195
setPdfData(updatedData);
192196
})
193197
.catch((err) => {
194-
console.log("err", err);
198+
setIsAlert({
199+
isShow: true,
200+
alertMessage: "something went wrong"
201+
});
195202
});
196203
};
197204
const handleMoveDocument = async (docData) => {

microfrontends/SignDocuments/src/Component/LegaDrive/LegaDrive.js

Lines changed: 98 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
11
import React, { useEffect, useState, useRef } from "react";
2-
import axios from "axios";
32
import "./LegaDrive.css";
43
import loader from "../../assests/loader2.gif";
54
import PdfFileComponent from "./FolderDrive/legaDriveComponent";
6-
import Modal from "react-bootstrap/Modal";
7-
import ModalHeader from "react-bootstrap/esm/ModalHeader";
85
import { themeColor, iconColor } from "../../utils/ThemeColor/backColor";
96
import { getDrive } from "../../utils/Utils";
10-
import AlertComponent from "../component/alertComponent";
117
import { useNavigate } from "react-router-dom";
128
import Title from "../component/Title";
139
import Parse from "parse";
@@ -57,32 +53,38 @@ function PdfFile() {
5753
isLoad: true,
5854
message: "This might take some time"
5955
};
60-
56+
let driveDetails;
6157
setIsLoading(load);
62-
63-
const driveDetails = await getDrive();
64-
if (driveDetails) {
65-
if (driveDetails.length > 0) {
66-
setPdfData(driveDetails);
67-
sortApps(null, null, driveDetails);
68-
}
69-
const data = [
70-
{
71-
name: "OpenSign™ Drive",
72-
objectId: ""
58+
try {
59+
driveDetails = await getDrive();
60+
if (driveDetails) {
61+
if (driveDetails.length > 0) {
62+
setPdfData(driveDetails);
63+
sortApps(null, null, driveDetails);
7364
}
74-
];
75-
setFolderName(data);
76-
const loadObj = {
77-
isLoad: false
78-
};
79-
setIsLoading(loadObj);
80-
} else if (driveDetails === "Error: Something went wrong!") {
81-
const loadObj = {
82-
isLoad: false
83-
};
84-
setHandleError("Error: Something went wrong!");
85-
setIsLoading(loadObj);
65+
const data = [
66+
{
67+
name: "OpenSign™ Drive",
68+
objectId: ""
69+
}
70+
];
71+
setFolderName(data);
72+
const loadObj = {
73+
isLoad: false
74+
};
75+
setIsLoading(loadObj);
76+
} else if (driveDetails === "Error: Something went wrong!") {
77+
const loadObj = {
78+
isLoad: false
79+
};
80+
setHandleError("Error: Something went wrong!");
81+
setIsLoading(loadObj);
82+
}
83+
} catch (e) {
84+
setIsAlert({
85+
isShow: true,
86+
alertMessage: "something went wrong"
87+
});
8688
}
8789
};
8890
//function for get parent folder document list
@@ -92,24 +94,33 @@ function PdfFile() {
9294
message: "This might take some time"
9395
};
9496
setIsLoading(load);
95-
const driveDetails = await getDrive(docId);
96-
if (driveDetails) {
97-
if (driveDetails.length > 0) {
98-
setPdfData(driveDetails);
99-
sortApps(null, null, driveDetails);
100-
} else {
101-
setPdfData([]);
97+
let driveDetails;
98+
try {
99+
driveDetails = await getDrive(docId);
100+
101+
if (driveDetails) {
102+
if (driveDetails.length > 0) {
103+
setPdfData(driveDetails);
104+
sortApps(null, null, driveDetails);
105+
} else {
106+
setPdfData([]);
107+
}
108+
const loadObj = {
109+
isLoad: false
110+
};
111+
setIsLoading(loadObj);
112+
} else if (driveDetails === "Error: Something went wrong!") {
113+
const loadObj = {
114+
isLoad: false
115+
};
116+
setHandleError("Error: Something went wrong!");
117+
setIsLoading(loadObj);
102118
}
103-
const loadObj = {
104-
isLoad: false
105-
};
106-
setIsLoading(loadObj);
107-
} else if (driveDetails === "Error: Something went wrong!") {
108-
const loadObj = {
109-
isLoad: false
110-
};
111-
setHandleError("Error: Something went wrong!");
112-
setIsLoading(loadObj);
119+
} catch (e) {
120+
setIsAlert({
121+
isShow: true,
122+
alertMessage: "something went wrong!"
123+
});
113124
}
114125
};
115126

@@ -187,7 +198,7 @@ function PdfFile() {
187198
} catch (e) {
188199
setIsAlert({
189200
isShow: true,
190-
alertMessage: "something went wrong"
201+
alertMessage: "something went wrong!"
191202
});
192203
}
193204
} else {
@@ -328,11 +339,46 @@ function PdfFile() {
328339
<div className="folderComponent ">
329340
<Title title={"OpenSign™ Drive"} drive={true} />
330341
<div>
331-
<AlertComponent
332-
isShow={isAlert.isShow}
333-
alertMessage={isAlert.alertMessage}
334-
setIsAlert={setIsAlert}
335-
/>
342+
<ModalUi
343+
headerColor={"#dc3545"}
344+
isOpen={isAlert.isShow}
345+
title={"Alert"}
346+
handleClose={() => {
347+
setIsAlert({
348+
isShow: false,
349+
alertMessage: ""
350+
});
351+
}}
352+
>
353+
<div style={{ height: "100%", padding: 20 }}>
354+
<p>{isAlert.alertMessage}</p>
355+
356+
<div
357+
style={{
358+
height: "1px",
359+
backgroundColor: "#9f9f9f",
360+
width: "100%",
361+
marginTop: "15px",
362+
marginBottom: "15px"
363+
}}
364+
></div>
365+
<button
366+
onClick={() =>
367+
setIsAlert({
368+
isShow: false,
369+
alertMessage: ""
370+
})
371+
}
372+
style={{
373+
color: "black"
374+
}}
375+
type="button"
376+
className="finishBtn"
377+
>
378+
Close
379+
</button>
380+
</div>
381+
</ModalUi>
336382
<ModalUi
337383
isOpen={isFolder}
338384
title={"Add New Folder"}
@@ -704,6 +750,7 @@ function PdfFile() {
704750
isDocId={docId}
705751
setPdfData={setPdfData}
706752
isList={isList}
753+
setIsAlert={setIsAlert}
707754
/>
708755
)}
709756
</>

microfrontends/SignDocuments/src/Component/PdfRequestFiles.js

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -851,19 +851,25 @@ function PdfRequestFiles() {
851851
}}
852852
>
853853
{/* this modal is used show this document is already sign */}
854+
<ModalUi
855+
isOpen={isCompleted.isModal}
856+
title={"Sign Documents"}
857+
handleClose={() => {
858+
setIsCompleted({ isModal: false, isCertificate: true });
859+
}}
860+
>
861+
<div style={{ height: "100%", padding: 20 }}>
862+
<p>This document has been signed by all Signers.</p>
854863

855-
<Modal show={isCompleted.isModal}>
856-
<ModalHeader style={{ background: themeColor() }}>
857-
<span className="spanTagHead"> Sign Documents</span>
858-
</ModalHeader>
859-
860-
<Modal.Body>
861-
<p className="pTagBody">
862-
This document has been signed by all Signers.
863-
</p>
864-
</Modal.Body>
865-
866-
<Modal.Footer>
864+
<div
865+
style={{
866+
height: "1px",
867+
backgroundColor: "#9f9f9f",
868+
width: "100%",
869+
marginTop: "15px",
870+
marginBottom: "15px"
871+
}}
872+
></div>
867873
<button
868874
style={{
869875
color: "black"
@@ -876,8 +882,9 @@ function PdfRequestFiles() {
876882
>
877883
Close
878884
</button>
879-
</Modal.Footer>
880-
</Modal>
885+
</div>
886+
</ModalUi>
887+
881888
{/* this component is used for signature pad modal */}
882889
<SignPad
883890
isSignPad={isSignPad}

0 commit comments

Comments
 (0)