🔥 The free & Open Source DocuSign alternative
JavaScript digital-signaturedocument-signingdocusign-alternativedocusign-freee-signatureelectronic-signatureelectronic-signaturesesignesignaturehacktoberfestjavascriptlegaltechmongodbnodejsopen-sourcepdf-signpdf-signaturereactjsself-hostedsign-pdf-files
fix: decline alert header message, add icon for right click menu on opensign-drive,on enter create folder
RaktimaNXG27d3297d61e9
diff --git a/microfrontends/SignDocuments/src/Component/LegaDrive/FolderDrive/legaDriveComponent.js b/microfrontends/SignDocuments/src/Component/LegaDrive/FolderDrive/legaDriveComponent.jsindex 4520262df..2a784a66b 100644--- a/microfrontends/SignDocuments/src/Component/LegaDrive/FolderDrive/legaDriveComponent.js+++ b/microfrontends/SignDocuments/src/Component/LegaDrive/FolderDrive/legaDriveComponent.js@@ -28,7 +28,12 @@ function PdfFileComponent({const [isOpenMoveModal, setIsOpenMoveModal] = useState(false);const [selectDoc, setSelectDoc] = useState();const [isDeleteDoc, setIsDeleteDoc] = useState(false);- const contextMenu = ["Download", "Rename", "Move", "Delete"];+ const contextMenu = [+ { type: "Download", icon: "fa-solid fa-arrow-down" },+ { type: "Rename", icon: "fa-solid fa-font" },+ { type: "Move", icon: "fa-solid fa-file-export" },+ { type: "Delete", icon: "fa-solid fa-trash" }+ ];const navigate = useNavigate();//to focus input box on press rename to change doc name@@ -478,7 +483,8 @@ function PdfFileComponent({onClick={() => handleMenuItemClick("Rename", data)}className="ContextMenuItem">- Rename+ <i class="fa-solid fa-font"></i>+ <span style={{ marginLeft: "8px" }}>Rename</span></ContextMenu.Item></ContextMenu.Content></ContextMenu.Portal>@@ -542,7 +548,8 @@ function PdfFileComponent({onClick={() => handleMenuItemClick("Rename", data)}className="ContextMenuItem">- Rename+ <i class="fa-solid fa-font"></i>+ <span style={{ marginLeft: "8px" }}>Rename</span></ContextMenu.Item></ContextMenu.Content></ContextMenu.Portal>@@ -620,15 +627,15 @@ function PdfFileComponent({sideOffset={5}align="end">- {contextMenu.map((menuType, ind) => {+ {contextMenu.map((menu, ind) => {return (<ContextMenu.Itemkey={ind}- onClick={() => handleMenuItemClick(menuType, data)}- // onSelect={(e) => console.log("event", e)}+ onClick={() => handleMenuItemClick(menu, data)}className="ContextMenuItem">- {menuType}+ <i class={menu.icon}></i>+ <span style={{ marginLeft: "8px" }}>{menu.type}</span></ContextMenu.Item>);})}diff --git a/microfrontends/SignDocuments/src/Component/LegaDrive/LegaDrive.css b/microfrontends/SignDocuments/src/Component/LegaDrive/LegaDrive.cssindex 1d8e4149d..2997553ce 100644--- a/microfrontends/SignDocuments/src/Component/LegaDrive/LegaDrive.css+++ b/microfrontends/SignDocuments/src/Component/LegaDrive/LegaDrive.css@@ -6,7 +6,7 @@.ContextMenuContent,.ContextMenuSubContent {- min-width: 150px;+ min-width: 135px;background-color: white;border-radius: 6px;overflow: hidden;@@ -28,7 +28,7 @@height: 25px;padding: 0 5px;position: relative;- padding-left: 25px;+ padding-left: 15px;user-select: none;outline: none;}diff --git a/microfrontends/SignDocuments/src/Component/LegaDrive/LegaDrive.js b/microfrontends/SignDocuments/src/Component/LegaDrive/LegaDrive.jsindex 21d6a9e4c..8a37610dd 100644--- a/microfrontends/SignDocuments/src/Component/LegaDrive/LegaDrive.js+++ b/microfrontends/SignDocuments/src/Component/LegaDrive/LegaDrive.js@@ -64,6 +64,7 @@ function PdfFile() {if (driveDetails) {if (driveDetails.length > 0) {setPdfData(driveDetails);+ sortApps(null, null, driveDetails);}const data = [{@@ -98,6 +99,7 @@ function PdfFile() {if (driveDetails) {if (driveDetails.length > 0) {setPdfData(driveDetails);+ sortApps(null, null, driveDetails);} else {setPdfData([]);}@@ -120,11 +122,6 @@ function PdfFile() {};//function for handle folder name pathconst handleRoute = (index) => {- let loadObj = {- isLoad: true,- message: "This might take some time"- };-const updateFolderName = folderName.filter((x, i) => {if (i <= index) {return x;@@ -217,11 +214,11 @@ function PdfFile() {}};- const sortApps = () => {- const selectedSortType = selectedSort;- const sortOrder = sortingOrder;+ const sortApps = (type, order, driveDetails) => {+ const selectedSortType = type ? type : "Date";+ const sortOrder = order ? order : "Decending";- let sortingData = pdfData;+ let sortingData = pdfData?.length === 0 ? driveDetails : pdfData;if (selectedSortType === "Name") {sortingApp(sortingData, "Name", sortOrder);} else if (selectedSortType === "Date") {@@ -283,9 +280,9 @@ function PdfFile() {useEffect(() => {const closeMenuOnOutsideClick = (e) => {if (isShowSort && !e.target.closest("#menu-container")) {- setIsShowSort(false);+ setIsShowSort(!isShowSort);} else if (isNewFol && !e.target.closest("#folder-menu")) {- setIsNewFol(false);+ setIsNewFol(!isNewFol);}};@@ -295,14 +292,13 @@ function PdfFile() {// Cleanup the event listener when the component unmountsdocument.removeEventListener("click", closeMenuOnOutsideClick);};- }, [isShowSort]);+ }, [isShowSort || isNewFol]);const handleFolderTab = (folderData, isMove) => {return folderData.map((data, id) => {return (- <>+ <React.Fragment><span- key={id}onClick={() => handleRoute(id)}style={{color: "#a64b4e",@@ -322,7 +318,7 @@ function PdfFile() {></span></span>- </>+ </React.Fragment>);});};@@ -363,7 +359,13 @@ function PdfFile() {</span></div>) : (- <div style={{ display: "flex", flexDirection: "column" }}>+ <form+ onSubmit={(e) => {+ e.preventDefault();+ handleAddFolder();+ }}+ style={{ display: "flex", flexDirection: "column" }}+ ><labelstyle={{margin: "10px 0px 10px 0px",@@ -382,11 +384,7 @@ function PdfFile() {onChange={(e) => handleFolderName(e)}// className="addFolderInput"/>- <span- style={{ color: "red", fontSize: "12px", marginTop: "6px" }}- >- {error}- </span>+<divstyle={{height: "1px",@@ -398,11 +396,10 @@ function PdfFile() {></div><div style={{ display: "flex", flexDirection: "row" }}><button- onClick={() => handleAddFolder()}style={{background: themeColor()}}- type="button"+ type="submit"className="finishBtn">Add@@ -418,7 +415,7 @@ function PdfFile() {Close</button></div>- </div>+ </form>)}</div></ModalUi>@@ -568,7 +565,7 @@ function PdfFile() {<spanonClick={() => {setSelectedSort("Name");- sortApps();+ sortApps("Name");}}className="dropdown-item itemColor">@@ -590,7 +587,7 @@ function PdfFile() {<spanonClick={() => {setSelectedSort("Date");- sortApps();+ sortApps("Date");}}className="dropdown-item itemColor">@@ -613,7 +610,7 @@ function PdfFile() {<spanonClick={() => {setSortingOrder("Accending");- sortApps();+ sortApps(null, "Accending", null);}}className="dropdown-item itemColor">@@ -635,7 +632,7 @@ function PdfFile() {<spanonClick={() => {setSortingOrder("Decending");- sortApps();+ sortApps(null, "Decending", null);}}className="dropdown-item itemColor">diff --git a/microfrontends/SignDocuments/src/Component/PdfRequestFiles.js b/microfrontends/SignDocuments/src/Component/PdfRequestFiles.jsindex 0e0a1f129..471d2bf1f 100644--- a/microfrontends/SignDocuments/src/Component/PdfRequestFiles.js+++ b/microfrontends/SignDocuments/src/Component/PdfRequestFiles.js@@ -736,7 +736,7 @@ function PdfRequestFiles() {<CustomModalcontainerWH={containerWH}show={isDecline.isDeclined}- headMsg="Document Declined Alert!"+ headMsg="Document Declined"bodyMssg={isDecline.currnt === "Sure" ? (<p className="pTagBody">