Skip to content

Commit 773e8b8

Browse files
Merge pull request #260 from OpenSignLabs/placeholder-block
fix: placeholder block issue for select multisigners
2 parents 91976d2 + 7704222 commit 773e8b8

File tree

9 files changed

+303
-108
lines changed

9 files changed

+303
-108
lines changed

microfrontends/SignDocuments/public/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css"
4848
/>
4949

50-
<title>OpenSign App</title>
50+
<title>OpenSign</title>
5151
</head>
5252
<body>
5353
<noscript>You need to enable JavaScript to run this app.</noscript>

microfrontends/SignDocuments/src/Component/LegaDrive/LegaDrive.css

Lines changed: 25 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -84,14 +84,10 @@
8484
color: var(--mauve-8);
8585
}
8686

87-
8887
.dropdown-menu {
89-
9088
min-width: 10rem;
91-
9289
}
9390

94-
9591
.dropdown-item {
9692
display: block;
9793
width: 100%;
@@ -103,21 +99,18 @@
10399
white-space: nowrap;
104100
background-color: transparent;
105101
border: 0;
102+
cursor: pointer;
106103
}
107104

108-
109105
.dropdown-item:hover {
110106
background-color: #dad9db;
111107
color: var(--violet-11);
112-
113108
}
114109

115110
.itemColor {
116111
font-size: 13px !important;
117112
}
118113

119-
120-
121114
.folderComponent {
122115
margin: 30px;
123116
height: 100%;
@@ -490,41 +483,52 @@ a {
490483
display: none;
491484
}
492485

493-
.folderPath{
486+
.folderPath {
494487
overflow-x: auto;
495488
white-space: nowrap;
496489

497490
cursor: pointer;
498491
user-select: none;
499-
}
500-
.folderPath::-webkit-scrollbar {
492+
}
493+
494+
.folderPath::-webkit-scrollbar {
501495
display: none;
502496
/* for Chrome, Safari, and Opera */
503497
}
504498

499+
@media screen and (max-width:766px) {
500+
.itemColor {
501+
font-size: 10px !important;
502+
}
503+
504+
}
505505
@media (min-width: 310px) and (max-width:550px) {
506-
506+
507507
.pdfContainer {
508508
justify-content: space-around;
509509
}
510+
510511
.sort {
511-
padding: 2px;
512+
padding: 2px;
512513
}
513-
.folderComponent{
514+
515+
.folderComponent {
514516
margin: 10px;
515517
}
516-
518+
517519
}
518520

519-
@media screen and (max-width:309px) {
520-
521+
@media screen and (max-width:309px) {
522+
521523
.pdfContainer {
522524
justify-content: center;
523525
}
526+
524527
.sort {
525528
padding: 2px;
526-
}
527-
.folderComponent{
528-
margin: 10px;
529-
}
529+
}
530+
531+
.folderComponent {
532+
margin: 10px;
533+
}
530534
}

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

Lines changed: 68 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@ import ModalHeader from "react-bootstrap/esm/ModalHeader";
88
import { themeColor, iconColor } from "../../utils/ThemeColor/backColor";
99
import { getDrive } from "../../utils/Utils";
1010
import AlertComponent from "../component/alertComponent";
11+
import { useNavigate } from "react-router-dom";
1112

1213
function PdfFile() {
14+
const navigate = useNavigate();
1315
const scrollRef = useRef(null);
1416
const [isList, setIsList] = useState(false);
1517
const [selectedSort, setSelectedSort] = useState("Date");
@@ -28,6 +30,7 @@ function PdfFile() {
2830
const [handleError, setHandleError] = useState();
2931
const [folderName, setFolderName] = useState([]);
3032
const [isAlert, setIsAlert] = useState({ isShow: false, alertMessage: "" });
33+
const [isNewFol, setIsNewFol] = useState(false);
3134
const currentUser =
3235
localStorage.getItem(
3336
`Parse/${localStorage.getItem("parseAppId")}/currentUser`
@@ -188,7 +191,6 @@ function PdfFile() {
188191
};
189192
}
190193

191-
// console.log("data", data);
192194
await axios
193195
.post(
194196
`${localStorage.getItem("baseUrl")}classes/${localStorage.getItem(
@@ -314,6 +316,8 @@ function PdfFile() {
314316
const closeMenuOnOutsideClick = (e) => {
315317
if (isShowSort && !e.target.closest("#menu-container")) {
316318
setIsShowSort(false);
319+
} else if (isNewFol && !e.target.closest("#folder-menu")) {
320+
setIsNewFol(false);
317321
}
318322
};
319323

@@ -502,6 +506,69 @@ function PdfFile() {
502506
})}
503507
</div>
504508
<div className="dropMenuBD">
509+
<div
510+
id="folder-menu"
511+
className={
512+
isNewFol ? "dropdown show dropDownStyle" : "dropdown"
513+
}
514+
onClick={() => setIsNewFol(!isNewFol)}
515+
>
516+
<div className="sort">
517+
<i
518+
className="fa fa-plus-square"
519+
aria-hidden="true"
520+
style={{ fontSize: "25px", color: `${iconColor()}` }}
521+
></i>
522+
</div>
523+
<div
524+
className={
525+
isNewFol ? "dropdown-menu show" : "dropdown-menu"
526+
}
527+
aria-labelledby="dropdownMenuButton"
528+
aria-expanded={isNewFol ? "true" : "false"}
529+
>
530+
{" "}
531+
<div
532+
style={{
533+
display: "flex",
534+
flexDirection: "column"
535+
}}
536+
>
537+
<span
538+
className="dropdown-item itemColor"
539+
onClick={() => getParentFolder()}
540+
>
541+
<i
542+
style={{ marginRight: "5px" }}
543+
className="fa fa-plus"
544+
aria-hidden="true"
545+
></i>
546+
Create folder
547+
</span>
548+
<span
549+
className="dropdown-item itemColor"
550+
onClick={() => navigate("/form/sHAnZphf69")}
551+
>
552+
<i
553+
style={{ marginRight: "5px" }}
554+
className="fas fa-pen-nib"
555+
></i>
556+
Sign Yourself
557+
</span>
558+
<span
559+
className="dropdown-item itemColor"
560+
onClick={() => navigate("/form/8mZzFxbG1z")}
561+
>
562+
{" "}
563+
<i
564+
style={{ marginRight: "5px" }}
565+
className="fa fa-file-signature"
566+
></i>
567+
Request Signatures{" "}
568+
</span>
569+
</div>
570+
</div>
571+
</div>
505572
<div
506573
id="menu-container"
507574
className={isShowSort ? "dropdown show" : "dropdown"}
@@ -645,14 +712,6 @@ function PdfFile() {
645712
</div>
646713
)}
647714
</div>
648-
649-
<div className="sort" onClick={() => getParentFolder()}>
650-
<i
651-
className="fa fa-plus-square"
652-
aria-hidden="true"
653-
style={{ fontSize: "25px", color: `${iconColor()}` }}
654-
></i>
655-
</div>
656715
</div>
657716
</div>
658717

microfrontends/SignDocuments/src/Component/PdfRequestFiles.js

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -494,6 +494,7 @@ function PdfRequestFiles() {
494494
data.key === signKey && data.Width && data.Height && data.SignUrl
495495
);
496496
let getIMGWH = calculateImgAspectRatio(imgWH);
497+
497498
if (updateFilter.length > 0) {
498499
const getXYdata = currentSigner[0].placeHolder[i].pos;
499500
const getPosData = getXYdata;
@@ -516,11 +517,17 @@ function PdfRequestFiles() {
516517
}
517518
return obj;
518519
});
519-
currentSigner[0].placeHolder.splice(i, 1, newUpdateUrl[0]);
520+
const getPlaceData = currentSigner[0].placeHolder;
521+
getPlaceData.splice(0, getPlaceData.length, ...newUpdateUrl);
522+
520523
const indexofSigner = signerPos.findIndex((object) => {
521524
return object.signerObjId === signerObjectId;
522525
});
523-
signerPos.splice(indexofSigner, 1, currentSigner[0]);
526+
setSignerPos((prevState) => {
527+
const newState = [...prevState]; // Create a copy of the state
528+
newState.splice(indexofSigner, 1, ...currentSigner); // Modify the copy
529+
return newState; // Update the state with the modified copy
530+
});
524531
} else {
525532
const getXYdata = currentSigner[0].placeHolder[i].pos;
526533

@@ -546,11 +553,17 @@ function PdfRequestFiles() {
546553
return obj;
547554
});
548555

549-
currentSigner[0].placeHolder.splice(i, 1, newUpdateUrl[0]);
556+
const getPlaceData = currentSigner[0].placeHolder;
557+
getPlaceData.splice(0, getPlaceData.length, ...newUpdateUrl);
558+
550559
const indexofSigner = signerPos.findIndex((object) => {
551560
return object.signerObjId === signerObjectId;
552561
});
553-
signerPos.splice(indexofSigner, 1, currentSigner[0]);
562+
setSignerPos((prevState) => {
563+
const newState = [...prevState]; // Create a copy of the state
564+
newState.splice(indexofSigner, 1, ...currentSigner); // Modify the copy
565+
return newState; // Update the state with the modified copy
566+
});
554567
}
555568
};
556569

@@ -586,6 +599,7 @@ function PdfRequestFiles() {
586599
updateFilter = currentSigner[0].placeHolder[i].pos.filter(
587600
(data) => data.key === signKey && data.SignUrl
588601
);
602+
589603
const getXYdata = currentSigner[0].placeHolder[i].pos;
590604
const getPosData = getXYdata;
591605
const posWidth = isDefaultSign
@@ -633,12 +647,15 @@ function PdfRequestFiles() {
633647
}
634648
return obj;
635649
});
636-
let signerupdate = [];
637-
signerupdate = signerPos.filter(
638-
(data) => data.signerObjId !== signerObjectId
650+
651+
const index = signerPos.findIndex(
652+
(data) => data.signerObjId === signerObjectId
639653
);
640-
signerupdate.push(newUpdatePos[0]);
641-
setSignerPos(signerupdate);
654+
setSignerPos((prevState) => {
655+
const newState = [...prevState]; // Create a copy of the state
656+
newState.splice(index, 1, ...newUpdatePos); // Modify the copy
657+
return newState; // Update the state with the modified copy
658+
});
642659
}
643660
};
644661

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ function EmailComponent({
3939
"X-Parse-Application-Id": localStorage.getItem("parseAppId"),
4040
sessionToken: localStorage.getItem("accesstoken")
4141
};
42-
42+
const openSignUrl = "https://www.opensignlabs.com/";
4343
const themeBGcolor = themeColor();
4444
let params = {
4545
pdfName: pdfName,
@@ -54,9 +54,11 @@ function EmailComponent({
5454
themeBGcolor +
5555
";'> <p style='font-size:20px;font-weight:400;color:white;padding-left:20px',> Document Copy</p></div><div><p style='padding:20px;font-family:system-ui;font-size:14px'>A copy of the document " +
5656
pdfName +
57-
" Standard is attached to this email. Kindly download the document from the attachment.</p></div> </div><div><p>This is an automated email from Open Sign. For any queries regarding this email, please contact the sender " +
57+
" Standard is attached to this email. Kindly download the document from the attachment.</p></div> </div><div><p>This is an automated email from OpenSign. For any queries regarding this email, please contact the sender " +
5858
sender.email +
59-
" directly. If you think this email is inappropriate or spam, you may file a complaint with Open Sign here.</p></div></div></body></html>"
59+
" directly. If you think this email is inappropriate or spam, you may file a complaint with OpenSign <a href= " +
60+
openSignUrl +
61+
" target=_blank>here</a> </p></div></div></body></html>"
6062
};
6163
sendMail = await axios.post(url, params, { headers: headers });
6264
} catch (error) {

0 commit comments

Comments
 (0)