Skip to content

Commit 27d3297

Browse files
fix: decline alert header message, add icon for right click menu on opensign-drive,on enter create folder
1 parent 72431b2 commit 27d3297

File tree

4 files changed

+42
-38
lines changed

4 files changed

+42
-38
lines changed

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

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,12 @@ function PdfFileComponent({
2828
const [isOpenMoveModal, setIsOpenMoveModal] = useState(false);
2929
const [selectDoc, setSelectDoc] = useState();
3030
const [isDeleteDoc, setIsDeleteDoc] = useState(false);
31-
const contextMenu = ["Download", "Rename", "Move", "Delete"];
31+
const contextMenu = [
32+
{ type: "Download", icon: "fa-solid fa-arrow-down" },
33+
{ type: "Rename", icon: "fa-solid fa-font" },
34+
{ type: "Move", icon: "fa-solid fa-file-export" },
35+
{ type: "Delete", icon: "fa-solid fa-trash" }
36+
];
3237
const navigate = useNavigate();
3338

3439
//to focus input box on press rename to change doc name
@@ -478,7 +483,8 @@ function PdfFileComponent({
478483
onClick={() => handleMenuItemClick("Rename", data)}
479484
className="ContextMenuItem"
480485
>
481-
Rename
486+
<i class="fa-solid fa-font"></i>
487+
<span style={{ marginLeft: "8px" }}>Rename</span>
482488
</ContextMenu.Item>
483489
</ContextMenu.Content>
484490
</ContextMenu.Portal>
@@ -542,7 +548,8 @@ function PdfFileComponent({
542548
onClick={() => handleMenuItemClick("Rename", data)}
543549
className="ContextMenuItem"
544550
>
545-
Rename
551+
<i class="fa-solid fa-font"></i>
552+
<span style={{ marginLeft: "8px" }}>Rename</span>
546553
</ContextMenu.Item>
547554
</ContextMenu.Content>
548555
</ContextMenu.Portal>
@@ -620,15 +627,15 @@ function PdfFileComponent({
620627
sideOffset={5}
621628
align="end"
622629
>
623-
{contextMenu.map((menuType, ind) => {
630+
{contextMenu.map((menu, ind) => {
624631
return (
625632
<ContextMenu.Item
626633
key={ind}
627-
onClick={() => handleMenuItemClick(menuType, data)}
628-
// onSelect={(e) => console.log("event", e)}
634+
onClick={() => handleMenuItemClick(menu, data)}
629635
className="ContextMenuItem"
630636
>
631-
{menuType}
637+
<i class={menu.icon}></i>
638+
<span style={{ marginLeft: "8px" }}>{menu.type}</span>
632639
</ContextMenu.Item>
633640
);
634641
})}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
.ContextMenuContent,
88
.ContextMenuSubContent {
9-
min-width: 150px;
9+
min-width: 135px;
1010
background-color: white;
1111
border-radius: 6px;
1212
overflow: hidden;
@@ -28,7 +28,7 @@
2828
height: 25px;
2929
padding: 0 5px;
3030
position: relative;
31-
padding-left: 25px;
31+
padding-left: 15px;
3232
user-select: none;
3333
outline: none;
3434
}

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

Lines changed: 25 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ function PdfFile() {
6464
if (driveDetails) {
6565
if (driveDetails.length > 0) {
6666
setPdfData(driveDetails);
67+
sortApps(null, null, driveDetails);
6768
}
6869
const data = [
6970
{
@@ -98,6 +99,7 @@ function PdfFile() {
9899
if (driveDetails) {
99100
if (driveDetails.length > 0) {
100101
setPdfData(driveDetails);
102+
sortApps(null, null, driveDetails);
101103
} else {
102104
setPdfData([]);
103105
}
@@ -120,11 +122,6 @@ function PdfFile() {
120122
};
121123
//function for handle folder name path
122124
const handleRoute = (index) => {
123-
let loadObj = {
124-
isLoad: true,
125-
message: "This might take some time"
126-
};
127-
128125
const updateFolderName = folderName.filter((x, i) => {
129126
if (i <= index) {
130127
return x;
@@ -217,11 +214,11 @@ function PdfFile() {
217214
}
218215
};
219216

220-
const sortApps = () => {
221-
const selectedSortType = selectedSort;
222-
const sortOrder = sortingOrder;
217+
const sortApps = (type, order, driveDetails) => {
218+
const selectedSortType = type ? type : "Date";
219+
const sortOrder = order ? order : "Decending";
223220

224-
let sortingData = pdfData;
221+
let sortingData = pdfData?.length === 0 ? driveDetails : pdfData;
225222
if (selectedSortType === "Name") {
226223
sortingApp(sortingData, "Name", sortOrder);
227224
} else if (selectedSortType === "Date") {
@@ -283,9 +280,9 @@ function PdfFile() {
283280
useEffect(() => {
284281
const closeMenuOnOutsideClick = (e) => {
285282
if (isShowSort && !e.target.closest("#menu-container")) {
286-
setIsShowSort(false);
283+
setIsShowSort(!isShowSort);
287284
} else if (isNewFol && !e.target.closest("#folder-menu")) {
288-
setIsNewFol(false);
285+
setIsNewFol(!isNewFol);
289286
}
290287
};
291288

@@ -295,14 +292,13 @@ function PdfFile() {
295292
// Cleanup the event listener when the component unmounts
296293
document.removeEventListener("click", closeMenuOnOutsideClick);
297294
};
298-
}, [isShowSort]);
295+
}, [isShowSort || isNewFol]);
299296

300297
const handleFolderTab = (folderData, isMove) => {
301298
return folderData.map((data, id) => {
302299
return (
303-
<>
300+
<React.Fragment>
304301
<span
305-
key={id}
306302
onClick={() => handleRoute(id)}
307303
style={{
308304
color: "#a64b4e",
@@ -322,7 +318,7 @@ function PdfFile() {
322318
&gt;
323319
</span>
324320
</span>
325-
</>
321+
</React.Fragment>
326322
);
327323
});
328324
};
@@ -363,7 +359,13 @@ function PdfFile() {
363359
</span>
364360
</div>
365361
) : (
366-
<div style={{ display: "flex", flexDirection: "column" }}>
362+
<form
363+
onSubmit={(e) => {
364+
e.preventDefault();
365+
handleAddFolder();
366+
}}
367+
style={{ display: "flex", flexDirection: "column" }}
368+
>
367369
<label
368370
style={{
369371
margin: "10px 0px 10px 0px",
@@ -382,11 +384,7 @@ function PdfFile() {
382384
onChange={(e) => handleFolderName(e)}
383385
// className="addFolderInput"
384386
/>
385-
<span
386-
style={{ color: "red", fontSize: "12px", marginTop: "6px" }}
387-
>
388-
{error}
389-
</span>
387+
390388
<div
391389
style={{
392390
height: "1px",
@@ -398,11 +396,10 @@ function PdfFile() {
398396
></div>
399397
<div style={{ display: "flex", flexDirection: "row" }}>
400398
<button
401-
onClick={() => handleAddFolder()}
402399
style={{
403400
background: themeColor()
404401
}}
405-
type="button"
402+
type="submit"
406403
className="finishBtn"
407404
>
408405
Add
@@ -418,7 +415,7 @@ function PdfFile() {
418415
Close
419416
</button>
420417
</div>
421-
</div>
418+
</form>
422419
)}
423420
</div>
424421
</ModalUi>
@@ -568,7 +565,7 @@ function PdfFile() {
568565
<span
569566
onClick={() => {
570567
setSelectedSort("Name");
571-
sortApps();
568+
sortApps("Name");
572569
}}
573570
className="dropdown-item itemColor"
574571
>
@@ -590,7 +587,7 @@ function PdfFile() {
590587
<span
591588
onClick={() => {
592589
setSelectedSort("Date");
593-
sortApps();
590+
sortApps("Date");
594591
}}
595592
className="dropdown-item itemColor"
596593
>
@@ -613,7 +610,7 @@ function PdfFile() {
613610
<span
614611
onClick={() => {
615612
setSortingOrder("Accending");
616-
sortApps();
613+
sortApps(null, "Accending", null);
617614
}}
618615
className="dropdown-item itemColor"
619616
>
@@ -635,7 +632,7 @@ function PdfFile() {
635632
<span
636633
onClick={() => {
637634
setSortingOrder("Decending");
638-
sortApps();
635+
sortApps(null, "Decending", null);
639636
}}
640637
className="dropdown-item itemColor"
641638
>

microfrontends/SignDocuments/src/Component/PdfRequestFiles.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -736,7 +736,7 @@ function PdfRequestFiles() {
736736
<CustomModal
737737
containerWH={containerWH}
738738
show={isDecline.isDeclined}
739-
headMsg="Document Declined Alert!"
739+
headMsg="Document Declined"
740740
bodyMssg={
741741
isDecline.currnt === "Sure" ? (
742742
<p className="pTagBody">

0 commit comments

Comments
 (0)