🔥 The free & Open Source DocuSign alternative
JavaScript digital-signaturedocument-signingdocusign-alternativedocusign-freee-signatureelectronic-signatureelectronic-signaturesesignesignaturehacktoberfestjavascriptlegaltechmongodbnodejsopen-sourcepdf-signpdf-signaturereactjsself-hostedsign-pdf-files
feat: mover sidebarlist from server to local
prafull-opensignlabs89f67bfeebdd
diff --git a/apps/OpenSign/src/components/pdf/DropdownWidgetOption.js b/apps/OpenSign/src/components/pdf/DropdownWidgetOption.jsindex 9756a6df1..225baf1bb 100644--- a/apps/OpenSign/src/components/pdf/DropdownWidgetOption.js+++ b/apps/OpenSign/src/components/pdf/DropdownWidgetOption.js@@ -205,14 +205,14 @@ function DropdownWidgetOption(props) {/><i- className="fa-light fa-rectangle-xmark text-[25px] ml-[10px] text-error"+ className="fa-light fa-rectangle-xmark text-[25px] ml-[10px] text-accent cursor-pointer"onClick={() => handleDeleteInput(index)}></i></div>))}<ionClick={handleAddInput}- className="fa-light fa-square-plus text-[25px] ml-[10px] text-primary"+ className="fa-light fa-square-plus text-[25px] ml-[10px] op-text-primary cursor-pointer"></i><div>{props.type === "checkbox" && !props.isSignYourself && (diff --git a/apps/OpenSign/src/components/sidebar/Sidebar.js b/apps/OpenSign/src/components/sidebar/Sidebar.jsindex fddf6ac8a..4d7da0bff 100644--- a/apps/OpenSign/src/components/sidebar/Sidebar.js+++ b/apps/OpenSign/src/components/sidebar/Sidebar.js@@ -1,11 +1,9 @@import React, { useState, useEffect } from "react";-import Menu from "./Menu";import Submenu from "./SubMenu";import SocialMedia from "./SocialMedia";--import Parse from "parse";import dp from "../../assets/images/dp.png";+import sidebarList from "../../json/menuJson";const Sidebar = ({ isOpen, closeSidebar }) => {const [menuList, setmenuList] = useState([]);@@ -24,13 +22,32 @@ const Sidebar = ({ isOpen, closeSidebar }) => {const menuItem = async () => {try {- var sideMenu = Parse.Object.extend("w_menu");- var query = new Parse.Query(sideMenu);- query.equalTo("objectId", localStorage.getItem("defaultmenuid"));- const results = await query.first();- const resultjson = results.toJSON();- let result = resultjson;- setmenuList(result.menuItems);+ if (localStorage.getItem("defaultmenuid")) {+ const menuId = localStorage.getItem("defaultmenuid") !== "VPh91h0ZHk";+ if (menuId) {+ setmenuList(sidebarList);+ } else {+ const addUserForm = {+ icon: "fa-light fa-user",+ title: "Add User",+ target: "_self",+ pageType: "form",+ description: "",+ objectId: "lM0xRnM3iE"+ };+ const newSidebarList = sidebarList.map((item) => {+ if (item.title === "Settings") {+ // Make a shallow copy of the item+ const newItem = { ...item };+ // Insert addUserForm at the second position+ newItem.children.splice(1, 0, addUserForm);+ return newItem;+ }+ return item;+ });+ setmenuList(newSidebarList);+ }+ }} catch (e) {console.error("Problem", e);}diff --git a/apps/OpenSign/src/json/ReportJson.js b/apps/OpenSign/src/json/ReportJson.jsindex 3ced20de5..bd35f9312 100644--- a/apps/OpenSign/src/json/ReportJson.js+++ b/apps/OpenSign/src/json/ReportJson.js@@ -296,7 +296,7 @@ export default function reportJson(id) {{btnId: "2204",hoverLabel: "Delete",- btnColor: "op-btn-outline op-btn-error",+ btnColor: "op-btn-secondary",btnIcon: "fa-light fa-trash",action: "delete"}diff --git a/apps/OpenSign/src/json/menuJson.js b/apps/OpenSign/src/json/menuJson.jsnew file mode 100644index 000000000..c9b576221--- /dev/null+++ b/apps/OpenSign/src/json/menuJson.js@@ -0,0 +1,161 @@+const sidebarList = [+ {+ icon: "fa-light fa-tachometer-alt",+ title: "Dashboard",+ target: "",+ pageType: "dashboard",+ description: "",+ objectId: "35KBoSgoAK"+ },+ {+ icon: "fa-light fa-pen-nib",+ title: "Sign yourself",+ target: "_self",+ pageType: "form",+ description: "",+ objectId: "sHAnZphf69"+ },+ {+ icon: "fa-light fa-paper-plane",+ title: "Request signatures",+ target: "_self",+ pageType: "form",+ description: "",+ objectId: "8mZzFxbG1z"+ },+ {+ icon: "fa-light fa-newspaper",+ title: "Templates",+ target: "_self",+ pageType: null,+ description: null,+ objectId: null,+ children: [+ {+ icon: "fa-light fa-file-signature",+ title: "Create template",+ target: "_self",+ pageType: "form",+ description: "",+ objectId: "template"+ },+ {+ icon: "fa-light fa-file-contract",+ title: "Manage templates",+ target: "_self",+ pageType: "report",+ description: "",+ objectId: "6TeaPr321t"+ }+ ]+ },+ {+ icon: "fa-light fa-folder",+ title: "OpenSignâ„¢ Drive",+ target: "_self",+ pageType: "",+ description: "",+ objectId: "opensigndrive"+ },+ {+ icon: "fa-light fa-address-card",+ title: "Reports",+ target: "_self",+ pageType: null,+ description: "",+ objectId: null,+ children: [+ {+ icon: "fa-light fa-signature",+ title: "Need your sign",+ target: "_self",+ pageType: "report",+ description: "",+ objectId: "4Hhwbp482K"+ },+ {+ icon: "fa-light fa-tasks",+ title: "In Progress",+ target: "_self",+ pageType: "report",+ description: "",+ objectId: "1MwEuxLEkF"+ },+ {+ icon: "fa-light fa-check-circle",+ title: "Completed",+ target: "_self",+ pageType: "report",+ description: "",+ objectId: "kQUoW4hUXz"+ },+ {+ icon: "fa-light fa-edit",+ title: "Drafts",+ target: "_self",+ pageType: "report",+ description: "",+ objectId: "ByHuevtCFY"+ },+ {+ icon: "fa-light fa-times-circle",+ title: "Declined",+ target: "_self",+ pageType: "report",+ description: "",+ objectId: "UPr2Fm5WY3"+ },+ {+ icon: "fa-light fa-hourglass-end",+ title: "Expired",+ target: "_self",+ pageType: "report",+ description: "",+ objectId: "zNqBHXHsYH"+ },+ {+ icon: "fa-light fa-address-book",+ title: "Contactbook",+ target: "_self",+ pageType: "report",+ description: "",+ objectId: "5KhaPr482K"+ }+ ]+ },+ {+ icon: "fa-light fa-cog",+ title: "Settings",+ target: "_self",+ pageType: null,+ description: "",+ objectId: null,+ children: [+ {+ icon: "fa-light fa-pen-fancy",+ title: "My Signature",+ target: "_self",+ pageType: "",+ description: "",+ objectId: "managesign"+ },+ {+ icon: "fa-light fa-key",+ title: "API Token",+ target: "_self",+ pageType: "generatetoken",+ description: "",+ objectId: ""+ },+ {+ icon: "fa-light fa-globe",+ title: "Webhook",+ target: "_self",+ pageType: "webhook",+ description: "",+ objectId: ""+ }+ ]+ }+];+export default sidebarList;diff --git a/apps/OpenSign/src/pages/Form.js b/apps/OpenSign/src/pages/Form.jsindex 414535b16..12ad3f895 100644--- a/apps/OpenSign/src/pages/Form.js+++ b/apps/OpenSign/src/pages/Form.js@@ -645,9 +645,9 @@ const Forms = (props) => {</label>{fileupload.length > 0 ? (<div className="flex gap-2 justify-center items-center">- <div className="flex justify-between items-center op-input op-input-bordered op-input-sm w-full text-x text-[13px]">- <div className="break-all">- file selected : {getFileName(fileupload)}+ <div className="flex justify-between items-center op-input op-input-bordered op-input-sm w-full h-full text-x text-[13px]">+ <div className="break-all ">+ file selected: {getFileName(fileupload)}</div><divonClick={() => setFileUpload("")}