From 3a55c35445d3e33a9fcc3ecfa94b07d7fffbbe36 Mon Sep 17 00:00:00 2001 From: prafull-opensignlabs Date: Fri, 15 Mar 2024 14:25:50 +0530 Subject: [PATCH 01/18] =?UTF-8?q?feat:=20add=20create=20document=20btn=20i?= =?UTF-8?q?n=20dashboard,=20update=20menu=20&=20change=20Root=20to=20=20Op?= =?UTF-8?q?ensign=E2=84=A2=20drive=20in=20folder=20input?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/dashboard/DashboardButton.js | 47 ++ .../src/components/dashboard/GetDashboard.js | 62 +- .../components/pdf/DropdownWidgetOption.js | 2 +- .../components/shared/fields/SelectFolder.js | 12 +- apps/OpenSign/src/layout/HomeLayout.js | 6 + .../20240315095256-change_forms_menu.cjs | 690 ++++++++++++++++++ 6 files changed, 808 insertions(+), 11 deletions(-) create mode 100644 apps/OpenSign/src/components/dashboard/DashboardButton.js create mode 100644 apps/OpenSignServer/databases/migrations/20240315095256-change_forms_menu.cjs diff --git a/apps/OpenSign/src/components/dashboard/DashboardButton.js b/apps/OpenSign/src/components/dashboard/DashboardButton.js new file mode 100644 index 000000000..d1f37ea7e --- /dev/null +++ b/apps/OpenSign/src/components/dashboard/DashboardButton.js @@ -0,0 +1,47 @@ +import React from "react"; +import "../../styles/loader.css"; +import { useNavigate } from "react-router-dom"; +import { openInNewTab } from "../../constant/Utils"; + +const DashboardButton = (props) => { + const navigate = useNavigate(); + + function openReport() { + if (props.Data && props.Data.Redirect_type) { + const Redirect_type = props.Data.Redirect_type; + const id = props.Data.Redirect_id; + if (Redirect_type === "Form") { + navigate(`/form/${id}`); + } else if (Redirect_type === "Report") { + navigate(`/report/${id}`); + } else if (Redirect_type === "Url") { + openInNewTab(id); + } + } + } + return ( +
openReport()} + className={`${ + props.Data && props.Data.Redirect_type + ? "cursor-pointer" + : "cursor-default" + } w-full px-3 py-2 flex text-white rounded-md shadow overflow-hidden`} + > +
+ + + +
+
{props.Label}
+
+
+
+ ); +}; + +export default DashboardButton; diff --git a/apps/OpenSign/src/components/dashboard/GetDashboard.js b/apps/OpenSign/src/components/dashboard/GetDashboard.js index a1e3cd063..5d8ed5989 100644 --- a/apps/OpenSign/src/components/dashboard/GetDashboard.js +++ b/apps/OpenSign/src/components/dashboard/GetDashboard.js @@ -1,14 +1,51 @@ import React, { Suspense, lazy } from "react"; +const DashboardButton = lazy(() => import("./DashboardButton")); const DashboardCard = lazy(() => import("./DashboardCard")); const DashboardReport = lazy(() => import("./DashboardReport")); - +const buttonList = [ + { + label: "Sign yourself", + redirectId: "sHAnZphf69", + redirectType: "Form" + }, + { + label: "Request signature", + redirectId: "8mZzFxbG1z", + redirectType: "Form" + } +]; const GetDashboard = (props) => { + const Button = ({ label, redirectId, redirectType }) => ( +
+ +
+
+ } + > + + + + ); const renderSwitchWithTour = (col) => { switch (col.widget.type) { case "Card": return (
@@ -42,7 +79,7 @@ const GetDashboard = (props) => { return (
please wait
}> -
+
@@ -58,7 +95,7 @@ const GetDashboard = (props) => { case "Card": return (
please wait
}> @@ -76,7 +113,7 @@ const GetDashboard = (props) => { case "report": { return ( please wait
}> -
+
@@ -88,6 +125,21 @@ const GetDashboard = (props) => { }; return (
+
+
+ {buttonList.map((btn) => ( +
+
{props.dashboard.map((val, key) => (
{val.columns.map((col, i) => diff --git a/apps/OpenSign/src/components/pdf/DropdownWidgetOption.js b/apps/OpenSign/src/components/pdf/DropdownWidgetOption.js index b4d3b1dd6..09abff5d4 100644 --- a/apps/OpenSign/src/components/pdf/DropdownWidgetOption.js +++ b/apps/OpenSign/src/components/pdf/DropdownWidgetOption.js @@ -377,7 +377,7 @@ function DropdownWidgetOption(props) { />
diff --git a/apps/OpenSign/src/components/shared/fields/SelectFolder.js b/apps/OpenSign/src/components/shared/fields/SelectFolder.js index eb4cac824..138648f03 100644 --- a/apps/OpenSign/src/components/shared/fields/SelectFolder.js +++ b/apps/OpenSign/src/components/shared/fields/SelectFolder.js @@ -93,7 +93,7 @@ const SelectFolder = ({ required, onSuccess, folderCls, isReset }) => { // `handleSubmit` is used to pass folderPtr to parent component const handleSubmit = () => { - let url = "Root"; + let url = "OpenSign™ Drive"; tabList.forEach((t) => { url = url + " / " + t.Name; }); @@ -180,7 +180,9 @@ const SelectFolder = ({ required, onSuccess, folderCls, isReset }) => {

- {selectFolder && selectFolder.Name ? selectFolder.Name : "Root"} + {selectFolder && selectFolder.Name + ? selectFolder.Name + : "OpenSign™ Drive"}

SetIsOpen(true)}> { isOpen={isOpen} handleClose={handleCancel} > -
+
removeTabListItem(e)} > - Root /{" "} + OpenSign™ Drive /{" "} {tabList && tabList.map((tab, i) => ( diff --git a/apps/OpenSign/src/layout/HomeLayout.js b/apps/OpenSign/src/layout/HomeLayout.js index 8f4c26379..d3cfd8188 100644 --- a/apps/OpenSign/src/layout/HomeLayout.js +++ b/apps/OpenSign/src/layout/HomeLayout.js @@ -94,6 +94,12 @@ const HomeLayout = () => { position: "top" // style: { backgroundColor: "#abd4d2" }, }, + { + selector: '[data-tut="tourbutton"]', + content: `To upload documents for self-signing or to request others’ signatures, simply select the respective buttons.`, + position: "top" + // style: { backgroundColor: "#abd4d2" }, + }, ...resArr, { selector: '[data-tut="reactourLast"]', diff --git a/apps/OpenSignServer/databases/migrations/20240315095256-change_forms_menu.cjs b/apps/OpenSignServer/databases/migrations/20240315095256-change_forms_menu.cjs new file mode 100644 index 000000000..d6894077f --- /dev/null +++ b/apps/OpenSignServer/databases/migrations/20240315095256-change_forms_menu.cjs @@ -0,0 +1,690 @@ +/** + * + * @param {Parse} Parse + */ +exports.up = async Parse => { + const className = 'w_menu'; + const userMenu = new Parse.Query(className); + const updateUserMenu = await userMenu.get('H9vRfEYKhT'); + updateUserMenu.set('menuItems', [ + { + icon: 'fas fa-tachometer-alt', + title: 'Dashboard', + target: '', + pageType: 'dashboard', + description: '', + objectId: '35KBoSgoAK', + }, + { + icon: 'fas fa-pen-nib', + title: 'Sign yourself', + target: '_self', + pageType: 'form', + description: '', + objectId: 'sHAnZphf69', + }, + { + icon: 'fa-solid fa-paper-plane', + title: 'Request signatures', + target: '_self', + pageType: 'form', + description: '', + objectId: '8mZzFxbG1z', + }, + { + icon: 'far fa-newspaper', + title: 'Templates', + target: '_self', + pageType: null, + description: null, + objectId: null, + children: [ + { + icon: 'fas fa-file-signature', + title: 'Create template', + target: '_self', + pageType: 'form', + description: '', + objectId: 'template', + }, + { + icon: 'fa-solid fa-file-contract', + title: 'Manage templates', + target: '_self', + pageType: 'report', + description: '', + objectId: '6TeaPr321t', + }, + ], + }, + { + icon: 'fas fa-folder', + title: 'OpenSign™ Drive', + target: '_self', + pageType: '', + description: '', + objectId: 'opensigndrive', + }, + { + icon: 'fas fa-address-card', + title: 'Reports', + target: '_self', + pageType: null, + description: '', + objectId: null, + children: [ + { + icon: 'fas fa-signature', + title: 'Need your sign', + target: '_self', + pageType: 'report', + description: '', + objectId: '4Hhwbp482K', + }, + { + icon: 'fas fa-tasks', + title: 'In Progress', + target: '_self', + pageType: 'report', + description: '', + objectId: '1MwEuxLEkF', + }, + { + icon: 'fas fa-check-circle', + title: 'Completed', + target: '_self', + pageType: 'report', + description: '', + objectId: 'kQUoW4hUXz', + }, + { + icon: 'fas fa-edit', + title: 'Drafts', + target: '_self', + pageType: 'report', + description: '', + objectId: 'ByHuevtCFY', + }, + { + icon: 'fas fa-times-circle', + title: 'Declined', + target: '_self', + pageType: 'report', + description: '', + objectId: 'UPr2Fm5WY3', + }, + { + icon: 'fas fa-hourglass-end', + title: 'Expired', + target: '_self', + pageType: 'report', + description: '', + objectId: 'zNqBHXHsYH', + }, + { + icon: 'fa-solid fa-address-book', + title: 'Contactbook', + target: '_self', + pageType: 'report', + description: '', + objectId: '5KhaPr482K', + }, + ], + }, + { + icon: 'fas fa-cog', + title: 'Settings', + target: '_self', + pageType: null, + description: '', + objectId: null, + children: [ + { + icon: 'fas fa-pen-fancy', + title: 'My Signature', + target: '_self', + pageType: '', + description: '', + objectId: 'managesign', + }, + { + icon: 'fa-solid fa-key', + title: 'API Token', + target: '_self', + pageType: 'generatetoken', + description: '', + objectId: '', + }, + { + icon: 'fa-solid fa-globe', + title: 'Webhook', + target: '_self', + pageType: 'webhook', + description: '', + objectId: '', + }, + ], + }, + ]); + + const AdminMenu = new Parse.Query(className); + const updateAdminMenu = await AdminMenu.get('VPh91h0ZHk'); + updateAdminMenu.set('menuItems', [ + { + icon: 'fas fa-tachometer-alt', + title: 'Dashboard', + target: '', + pageType: 'dashboard', + description: '', + objectId: '35KBoSgoAK', + }, + { + icon: 'fas fa-pen-nib', + title: 'Sign yourself', + target: '_self', + pageType: 'form', + description: '', + objectId: 'sHAnZphf69', + }, + { + icon: 'fa-solid fa-paper-plane', + title: 'Request signatures', + target: '_self', + pageType: 'form', + description: '', + objectId: '8mZzFxbG1z', + }, + { + icon: 'far fa-newspaper', + title: 'Templates', + target: '_self', + pageType: null, + description: null, + objectId: null, + children: [ + { + icon: 'fas fa-file-signature', + title: 'Create template', + target: '_self', + pageType: 'form', + description: '', + objectId: 'template', + }, + { + icon: 'fa-solid fa-file-contract', + title: 'Manage templates', + target: '_self', + pageType: 'report', + description: '', + objectId: '6TeaPr321t', + }, + ], + }, + { + icon: 'fas fa-folder', + title: 'OpenSign™ Drive', + target: '_self', + pageType: '', + description: '', + objectId: 'opensigndrive', + }, + { + icon: 'fas fa-address-card', + title: 'Reports', + target: '_self', + pageType: null, + description: '', + objectId: null, + children: [ + { + icon: 'fas fa-signature', + title: 'Need your sign', + target: '_self', + pageType: 'report', + description: '', + objectId: '4Hhwbp482K', + }, + { + icon: 'fas fa-tasks', + title: 'In Progress', + target: '_self', + pageType: 'report', + description: '', + objectId: '1MwEuxLEkF', + }, + { + icon: 'fas fa-check-circle', + title: 'Completed', + target: '_self', + pageType: 'report', + description: '', + objectId: 'kQUoW4hUXz', + }, + { + icon: 'fas fa-edit', + title: 'Drafts', + target: '_self', + pageType: 'report', + description: '', + objectId: 'ByHuevtCFY', + }, + { + icon: 'fas fa-times-circle', + title: 'Declined', + target: '_self', + pageType: 'report', + description: '', + objectId: 'UPr2Fm5WY3', + }, + { + icon: 'fas fa-hourglass-end', + title: 'Expired', + target: '_self', + pageType: 'report', + description: '', + objectId: 'zNqBHXHsYH', + }, + { + icon: 'fa-solid fa-address-book', + title: 'Contactbook', + target: '_self', + pageType: 'report', + description: '', + objectId: '5KhaPr482K', + }, + ], + }, + { + icon: 'fas fa-cog', + title: 'Settings', + target: '_self', + pageType: null, + description: '', + objectId: null, + children: [ + { + icon: 'fas fa-pen-fancy', + title: 'My Signature', + target: '_self', + pageType: '', + description: '', + objectId: 'managesign', + }, + { + icon: 'far fa-user', + title: 'Add User', + target: '_self', + pageType: 'form', + description: '', + objectId: 'lM0xRnM3iE', + }, + { + icon: 'fa-solid fa-key', + title: 'API Token', + target: '_self', + pageType: 'generatetoken', + description: '', + objectId: '', + }, + { + icon: 'fa-solid fa-globe', + title: 'Webhook', + target: '_self', + pageType: 'webhook', + description: '', + objectId: '', + }, + ], + }, + ]); + // TODO: Set the schema here + // Example: + // schema.addString('name').addNumber('cash'); + const batch = [updateUserMenu, updateAdminMenu]; + return Parse.Object.saveAll(batch, { useMasterKey: true }); +}; + +/** + * + * @param {Parse} Parse + */ +exports.down = async Parse => { + // TODO: set className here + const className = 'w_menu'; + const userMenu = new Parse.Query(className); + const revertUserMenu = await userMenu.get('H9vRfEYKhT'); + revertUserMenu.set('menuItems', [ + { + icon: 'fas fa-tachometer-alt', + title: 'Dashboard', + target: '', + pageType: 'dashboard', + description: '', + objectId: '35KBoSgoAK', + }, + { + icon: 'far fa-newspaper', + title: 'New Document', + target: '_self', + pageType: null, + description: null, + objectId: null, + children: [ + { + icon: 'fas fa-pen-nib', + title: 'Sign yourself', + target: '_self', + pageType: 'form', + description: '', + objectId: 'sHAnZphf69', + }, + { + icon: 'fa-solid fa-paper-plane', + title: 'Request signatures', + target: '_self', + pageType: 'form', + description: '', + objectId: '8mZzFxbG1z', + }, + { + icon: 'fas fa-file-signature', + title: 'New template', + target: '_self', + pageType: 'form', + description: '', + objectId: 'template', + }, + ], + }, + { + icon: 'fa-solid fa-file-contract', + title: 'Templates', + target: '_self', + pageType: 'report', + description: '', + objectId: '6TeaPr321t', + }, + { + icon: 'fas fa-folder', + title: 'OpenSign™ Drive', + target: '_self', + pageType: '', + description: '', + objectId: 'opensigndrive', + }, + { + icon: 'fas fa-address-card', + title: 'Reports', + target: '_self', + pageType: null, + description: '', + objectId: null, + children: [ + { + icon: 'fas fa-signature', + title: 'Need your sign', + target: '_self', + pageType: 'report', + description: '', + objectId: '4Hhwbp482K', + }, + { + icon: 'fas fa-tasks', + title: 'In Progress', + target: '_self', + pageType: 'report', + description: '', + objectId: '1MwEuxLEkF', + }, + { + icon: 'fas fa-check-circle', + title: 'Completed', + target: '_self', + pageType: 'report', + description: '', + objectId: 'kQUoW4hUXz', + }, + { + icon: 'fas fa-edit', + title: 'Drafts', + target: '_self', + pageType: 'report', + description: '', + objectId: 'ByHuevtCFY', + }, + { + icon: 'fas fa-times-circle', + title: 'Declined', + target: '_self', + pageType: 'report', + description: '', + objectId: 'UPr2Fm5WY3', + }, + { + icon: 'fas fa-hourglass-end', + title: 'Expired', + target: '_self', + pageType: 'report', + description: '', + objectId: 'zNqBHXHsYH', + }, + { + icon: 'fa-solid fa-address-book', + title: 'Contactbook', + target: '_self', + pageType: 'report', + description: '', + objectId: '5KhaPr482K', + }, + ], + }, + { + icon: 'fas fa-cog', + title: 'Settings', + target: '_self', + pageType: null, + description: '', + objectId: null, + children: [ + { + icon: 'fas fa-pen-fancy', + title: 'My Signature', + target: '_self', + pageType: '', + description: '', + objectId: 'managesign', + }, + { + icon: 'fa-solid fa-key', + title: 'API Token', + target: '_self', + pageType: 'generatetoken', + description: '', + objectId: '', + }, + { + icon: 'fa-solid fa-globe', + title: 'Webhook', + target: '_self', + pageType: 'webhook', + description: '', + objectId: '', + }, + ], + }, + ]); + + const adminMenu = new Parse.Query(className); + const revertAdminMenu = await adminMenu.get('VPh91h0ZHk'); + revertAdminMenu.set('menuItems', [ + { + icon: 'fas fa-tachometer-alt', + title: 'Dashboard', + target: '', + pageType: 'dashboard', + description: '', + objectId: '35KBoSgoAK', + }, + { + icon: 'far fa-newspaper', + title: 'New Document', + target: '_self', + pageType: null, + description: null, + objectId: null, + children: [ + { + icon: 'fas fa-pen-nib', + title: 'Sign yourself', + target: '_self', + pageType: 'form', + description: '', + objectId: 'sHAnZphf69', + }, + { + icon: 'fa-solid fa-paper-plane', + title: 'Request signatures', + target: '_self', + pageType: 'form', + description: '', + objectId: '8mZzFxbG1z', + }, + { + icon: 'fas fa-file-signature', + title: 'New template', + target: '_self', + pageType: 'form', + description: '', + objectId: 'template', + }, + ], + }, + { + icon: 'fa-solid fa-file-contract', + title: 'Templates', + target: '_self', + pageType: 'report', + description: '', + objectId: '6TeaPr321t', + }, + { + icon: 'fas fa-folder', + title: 'OpenSign™ Drive', + target: '_self', + pageType: '', + description: '', + objectId: 'opensigndrive', + }, + { + icon: 'fas fa-address-card', + title: 'Reports', + target: '_self', + pageType: null, + description: '', + objectId: null, + children: [ + { + icon: 'fas fa-signature', + title: 'Need your sign', + target: '_self', + pageType: 'report', + description: '', + objectId: '4Hhwbp482K', + }, + { + icon: 'fas fa-tasks', + title: 'In Progress', + target: '_self', + pageType: 'report', + description: '', + objectId: '1MwEuxLEkF', + }, + { + icon: 'fas fa-check-circle', + title: 'Completed', + target: '_self', + pageType: 'report', + description: '', + objectId: 'kQUoW4hUXz', + }, + { + icon: 'fas fa-edit', + title: 'Drafts', + target: '_self', + pageType: 'report', + description: '', + objectId: 'ByHuevtCFY', + }, + { + icon: 'fas fa-times-circle', + title: 'Declined', + target: '_self', + pageType: 'report', + description: '', + objectId: 'UPr2Fm5WY3', + }, + { + icon: 'fas fa-hourglass-end', + title: 'Expired', + target: '_self', + pageType: 'report', + description: '', + objectId: 'zNqBHXHsYH', + }, + { + icon: 'fa-solid fa-address-book', + title: 'Contactbook', + target: '_self', + pageType: 'report', + description: '', + objectId: '5KhaPr482K', + }, + ], + }, + { + icon: 'fas fa-cog', + title: 'Settings', + target: '_self', + pageType: null, + description: '', + objectId: null, + children: [ + { + icon: 'fas fa-pen-fancy', + title: 'My Signature', + target: '_self', + pageType: '', + description: '', + objectId: 'managesign', + }, + { + icon: 'far fa-user', + title: 'Add User', + target: '_self', + pageType: 'form', + description: '', + objectId: 'lM0xRnM3iE', + }, + { + icon: 'fa-solid fa-key', + title: 'API Token', + target: '_self', + pageType: 'generatetoken', + description: '', + objectId: '', + }, + { + icon: 'fa-solid fa-globe', + title: 'Webhook', + target: '_self', + pageType: 'webhook', + description: '', + objectId: '', + }, + ], + }, + ]); + + const batch = [revertUserMenu, revertAdminMenu]; + return Parse.Object.saveAll(batch, { useMasterKey: true }); +}; From 4fda5b45319b7cc6276faf16819d30e4a7a3ce86 Mon Sep 17 00:00:00 2001 From: prafull-opensignlabs Date: Fri, 15 Mar 2024 19:04:02 +0530 Subject: [PATCH 02/18] refactor: stop showing initial popup when wdigets drag --- apps/OpenSign/src/pages/PlaceHolderSign.js | 7 +------ apps/OpenSign/src/pages/TemplatePlaceholder.js | 8 +------- 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/apps/OpenSign/src/pages/PlaceHolderSign.js b/apps/OpenSign/src/pages/PlaceHolderSign.js index 35351be3e..8602e6505 100644 --- a/apps/OpenSign/src/pages/PlaceHolderSign.js +++ b/apps/OpenSign/src/pages/PlaceHolderSign.js @@ -487,12 +487,7 @@ function PlaceHolderSign() { setIsCheckbox(true); } else if (dragTypeValue === radioButtonWidget) { setIsRadio(true); - } else if ( - dragTypeValue !== textWidget && - dragTypeValue !== "signature" - ) { - setIsNameModal(true); - } + } setWidgetType(dragTypeValue); setSignKey(key); setCurrWidgetsDetails({}); diff --git a/apps/OpenSign/src/pages/TemplatePlaceholder.js b/apps/OpenSign/src/pages/TemplatePlaceholder.js index dc71aaa9c..c6069ac17 100644 --- a/apps/OpenSign/src/pages/TemplatePlaceholder.js +++ b/apps/OpenSign/src/pages/TemplatePlaceholder.js @@ -23,7 +23,6 @@ import { defaultWidthHeight, addWidgetOptions, textInputWidget, - textWidget, radioButtonWidget } from "../constant/Utils"; import RenderPdf from "../components/pdf/RenderPdf"; @@ -447,12 +446,7 @@ const TemplatePlaceholder = () => { setIsCheckbox(true); } else if (dragTypeValue === radioButtonWidget) { setIsRadio(true); - } else if ( - dragTypeValue !== textWidget && - dragTypeValue !== "signature" - ) { - setIsNameModal(true); - } + } setCurrWidgetsDetails({}); setWidgetType(dragTypeValue); setSignKey(key); From 1c4c2e87b4a4b56c6ec4777f56377726d7a6d8d7 Mon Sep 17 00:00:00 2001 From: prafull-opensignlabs Date: Fri, 15 Mar 2024 19:30:33 +0530 Subject: [PATCH 03/18] refactor: change design of widgets in mobile --- .../src/components/pdf/WidgetComponent.js | 12 +++---- .../OpenSign/src/components/pdf/WidgetList.js | 2 +- apps/OpenSign/src/constant/Utils.js | 32 ++++++------------- apps/OpenSign/src/styles/signature.css | 4 ++- 4 files changed, 18 insertions(+), 32 deletions(-) diff --git a/apps/OpenSign/src/components/pdf/WidgetComponent.js b/apps/OpenSign/src/components/pdf/WidgetComponent.js index 101095648..f59ca7117 100644 --- a/apps/OpenSign/src/components/pdf/WidgetComponent.js +++ b/apps/OpenSign/src/components/pdf/WidgetComponent.js @@ -239,8 +239,8 @@ function WidgetComponent({ const updateWidgets = isSignYourself ? filterWidgets : isTemplateFlow - ? textWidgetData - : widget; + ? textWidgetData + : widget; return ( <> @@ -264,11 +264,7 @@ function WidgetComponent({ alignItems: "center", justifyContent: "center" }} - onClick={() => { - // if (signersdata?.length) { - handleModal(); - // } - }} + onClick={() => handleModal()} > { return ( -
+
{ diff --git a/apps/OpenSign/src/constant/Utils.js b/apps/OpenSign/src/constant/Utils.js index ba6556930..11fa10f74 100644 --- a/apps/OpenSign/src/constant/Utils.js +++ b/apps/OpenSign/src/constant/Utils.js @@ -288,26 +288,14 @@ export const getWidgetType = (item, marginLeft) => { marginLeft: marginLeft && `${marginLeft}px` }} > -
- - +
+ {!isMobile && ( + + )} + {item.type}
@@ -1090,8 +1078,8 @@ export const multiSignEmbed = async ( position.type === radioButtonWidget ? 10 : position.type === "checkbox" - ? 10 - : newUpdateHeight; + ? 10 + : newUpdateHeight; const newHeight = ind ? (ind > 0 ? widgetHeight : 0) : widgetHeight; if (signyourself) { diff --git a/apps/OpenSign/src/styles/signature.css b/apps/OpenSign/src/styles/signature.css index 8229cdb05..246c82ffd 100644 --- a/apps/OpenSign/src/styles/signature.css +++ b/apps/OpenSign/src/styles/signature.css @@ -163,7 +163,6 @@ .signatureBtn { border: 1.5px solid #47a3ad; - border-radius: 3px; display: flex; padding: 0px; @@ -1192,6 +1191,9 @@ option { min-width: 90%; overflow-y: auto; } + .signatureBtn { + width: max-content; + } .dropdownModal { position: fixed; From c929b6b7a95e16b9b19113fb56e36591eb4d5ca9 Mon Sep 17 00:00:00 2001 From: Amol Date: Mon, 18 Mar 2024 00:19:06 +0530 Subject: [PATCH 04/18] Update Dockerhubfile --- apps/OpenSign/Dockerhubfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apps/OpenSign/Dockerhubfile b/apps/OpenSign/Dockerhubfile index ed756309b..98c41aef3 100644 --- a/apps/OpenSign/Dockerhubfile +++ b/apps/OpenSign/Dockerhubfile @@ -14,6 +14,9 @@ RUN npm install COPY apps/OpenSign/ . COPY apps/OpenSign/.husky . +# build +RUN npm run build + # Make port 3000 available to the world outside this container EXPOSE 3000 From c3ffda4dd256c60bd7b12460a8d830c335f227fe Mon Sep 17 00:00:00 2001 From: RaktimaNXG Date: Mon, 18 Mar 2024 12:45:08 +0530 Subject: [PATCH 05/18] fix: resolving width inconsistencies with of text widgets & default data for widgets information pop-ups in mobile display. --- .../OpenSign/src/components/pdf/Placeholder.js | 18 +++++++++++++++--- .../src/components/pdf/PlaceholderBorder.js | 2 +- .../src/components/pdf/PlaceholderType.js | 8 +++++++- apps/OpenSign/src/pages/PlaceHolderSign.js | 9 +++------ apps/OpenSign/src/styles/signature.css | 18 ++++++++++++++---- 5 files changed, 40 insertions(+), 15 deletions(-) diff --git a/apps/OpenSign/src/components/pdf/Placeholder.js b/apps/OpenSign/src/components/pdf/Placeholder.js index d786efa9b..c6d9051bb 100644 --- a/apps/OpenSign/src/components/pdf/Placeholder.js +++ b/apps/OpenSign/src/components/pdf/Placeholder.js @@ -215,7 +215,8 @@ function Placeholder(props) { "company", "job title", "date", - "email" + "email", + textWidget ].includes(props.pos.type); if (widgetTypeExist) { @@ -594,7 +595,8 @@ function Placeholder(props) { disableDragging={ props.isNeedSign ? true - : props.isPlaceholder && props.pos.type !== "date" + : props.isPlaceholder && + !["date", textWidget].includes(props.pos.type) ? false : !isDraggingEnabled } @@ -652,8 +654,18 @@ function Placeholder(props) { style={{ left: props.xPos(props.pos, props.isSignYourself), top: props.yPos(props.pos, props.isSignYourself), - width: "auto", //props.posWidth(props.pos, props.isSignYourself), + width: + props.pos.type === radioButtonWidget || + props.pos.type === "checkbox" + ? "auto" + : props.posWidth(props.pos, props.isSignYourself), + // "auto", //props.posWidth(props.pos, props.isSignYourself), // height: props.posHeight(props.pos, props.isSignYourself), + height: + props.pos.type === radioButtonWidget || + props.pos.type === "checkbox" + ? "auto" + : props.posHeight(props.pos, props.isSignYourself), zIndex: "10" }} onTouchEnd={() => handleOnClickPlaceholder()} diff --git a/apps/OpenSign/src/components/pdf/PlaceholderBorder.js b/apps/OpenSign/src/components/pdf/PlaceholderBorder.js index 182f85991..11ed92981 100644 --- a/apps/OpenSign/src/components/pdf/PlaceholderBorder.js +++ b/apps/OpenSign/src/components/pdf/PlaceholderBorder.js @@ -31,7 +31,7 @@ function PlaceholderBorder(props) { }; return (
!isMobile && props?.setDraggingEnabled(true)} className="borderResize" style={{ borderColor: themeColor, diff --git a/apps/OpenSign/src/components/pdf/PlaceholderType.js b/apps/OpenSign/src/components/pdf/PlaceholderType.js index 0b851f258..52137b19a 100644 --- a/apps/OpenSign/src/components/pdf/PlaceholderType.js +++ b/apps/OpenSign/src/components/pdf/PlaceholderType.js @@ -2,6 +2,7 @@ import React, { useEffect, useState, forwardRef, useRef } from "react"; import { getMonth, getYear, + isMobile, onChangeInput, radioButtonWidget, range, @@ -741,6 +742,7 @@ function PlaceholderType(props) { placeholder="Enter label" rows={1} value={textValue} + onBlur={handleInputBlur} onChange={(e) => { setTextValue(e.target.value); onChangeInput( @@ -753,7 +755,11 @@ function PlaceholderType(props) { false ); }} - className="labelTextArea" + className={ + isMobile + ? "labelTextArea labelWidthMobile" + : "labelTextArea labelWidthDesktop" + } style={{ whiteSpace: "pre-wrap" }} cols="50" /> diff --git a/apps/OpenSign/src/pages/PlaceHolderSign.js b/apps/OpenSign/src/pages/PlaceHolderSign.js index 8602e6505..7909fecb3 100644 --- a/apps/OpenSign/src/pages/PlaceHolderSign.js +++ b/apps/OpenSign/src/pages/PlaceHolderSign.js @@ -317,9 +317,6 @@ function PlaceHolderSign() { //function for setting position after drop signature button over pdf const addPositionOfSignature = (item, monitor) => { - if (item && item.text) { - setWidgetName(item.text); - } getSignerPos(item, monitor); }; @@ -336,7 +333,7 @@ function PlaceHolderSign() { let dropData = []; let placeHolder; const dragTypeValue = item?.text ? item.text : monitor.type; - + console.log("option", dragTypeValue); if (item === "onclick") { const dropObj = { //onclick put placeholder center on pdf @@ -487,10 +484,11 @@ function PlaceHolderSign() { setIsCheckbox(true); } else if (dragTypeValue === radioButtonWidget) { setIsRadio(true); - } + } setWidgetType(dragTypeValue); setSignKey(key); setCurrWidgetsDetails({}); + setWidgetName(dragTypeValue); } } }; @@ -1755,7 +1753,6 @@ function PlaceHolderSign() {
- Date: Mon, 18 Mar 2024 15:14:23 +0530 Subject: [PATCH 06/18] fix: handle uncaught error of SMTP --- apps/OpenSignServer/index.js | 51 ++++++++++++++++++++++-------------- 1 file changed, 32 insertions(+), 19 deletions(-) diff --git a/apps/OpenSignServer/index.js b/apps/OpenSignServer/index.js index a5d627607..427afe85a 100644 --- a/apps/OpenSignServer/index.js +++ b/apps/OpenSignServer/index.js @@ -54,26 +54,39 @@ if (process.env.USE_LOCAL !== 'TRUE') { let transporterMail; let mailgunClient; let mailgunDomain; - +let isMailAdapter = false; if (process.env.SMTP_ENABLE) { - transporterMail = createTransport({ - host: process.env.SMTP_HOST, - port: process.env.SMTP_PORT || 465, - secure: process.env.SMTP_SECURE || true, - auth: { - user: process.env.SMTP_USER_EMAIL, - pass: process.env.SMTP_PASS, - }, - }); + try { + transporterMail = createTransport({ + host: process.env.SMTP_HOST, + port: process.env.SMTP_PORT || 465, + secure: process.env.SMTP_SECURE || true, + auth: { + user: process.env.SMTP_USER_EMAIL, + pass: process.env.SMTP_PASS, + }, + }); + await transporterMail.verify(); + isMailAdapter = true; + } catch (err) { + console.dir('Please provide valid SMTP credentials'); + isMailAdapter = false; + } } else if (process.env.MAILGUN_API_KEY) { - const mailgun = new Mailgun(formData); - mailgunClient = mailgun.client({ - username: 'api', - key: process.env.MAILGUN_API_KEY, - }); - - mailgunDomain = process.env.MAILGUN_DOMAIN; + try { + const mailgun = new Mailgun(formData); + mailgunClient = mailgun.client({ + username: 'api', + key: process.env.MAILGUN_API_KEY, + }); + mailgunDomain = process.env.MAILGUN_DOMAIN; + isMailAdapter = true; + } catch (error) { + isMailAdapter = false; + console.dir('Please provide valid Mailgun credentials'); + } } + export const config = { databaseURI: process.env.DATABASE_URI || process.env.MONGODB_URI || 'mongodb://localhost:27017/dev', @@ -85,14 +98,14 @@ export const config = { masterKey: process.env.MASTER_KEY, //Add your master key here. Keep it secret! masterKeyIps: ['0.0.0.0/0', '::/0'], // '::1' serverURL: process.env.SERVER_URL || 'http://localhost:8080/app', // Don't forget to change to https if needed - verifyUserEmails: process.env.SMTP_ENABLE || process.env.MAILGUN_API_KEY ? true : false, + verifyUserEmails: isMailAdapter === true ? true : false, publicServerURL: process.env.SERVER_URL || 'http://localhost:8080/app', // Your apps name. This will appear in the subject and body of the emails that are sent. appName: 'Open Sign', allowClientClassCreation: false, allowExpiredAuthDataToken: false, encodeParseObjectInCloudFunction: true, - ...(process.env.SMTP_ENABLE || process.env.MAILGUN_API_KEY + ...(isMailAdapter === true ? { emailAdapter: { module: 'parse-server-api-mail-adapter', From 4af3d8f78bbf7485ec9517055e9c0b92c52d31c9 Mon Sep 17 00:00:00 2001 From: RaktimaNXG Date: Mon, 18 Mar 2024 16:21:14 +0530 Subject: [PATCH 07/18] fix: dragging issue of text widget in mobile view --- apps/OpenSign/src/components/pdf/PlaceholderBorder.js | 6 +++++- apps/OpenSign/src/pages/PlaceHolderSign.js | 1 - 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/OpenSign/src/components/pdf/PlaceholderBorder.js b/apps/OpenSign/src/components/pdf/PlaceholderBorder.js index 11ed92981..d64aab3c2 100644 --- a/apps/OpenSign/src/components/pdf/PlaceholderBorder.js +++ b/apps/OpenSign/src/components/pdf/PlaceholderBorder.js @@ -4,7 +4,8 @@ import { defaultWidthHeight, isMobile, radioButtonWidget, - resizeBorderExtraWidth + resizeBorderExtraWidth, + textWidget } from "../../constant/Utils"; function PlaceholderBorder(props) { const getResizeBorderExtraWidth = resizeBorderExtraWidth(); @@ -32,6 +33,9 @@ function PlaceholderBorder(props) { return (
!isMobile && props?.setDraggingEnabled(true)} + onTouchEnd={() => + props.pos.type === textWidget && props?.setDraggingEnabled(true) + } className="borderResize" style={{ borderColor: themeColor, diff --git a/apps/OpenSign/src/pages/PlaceHolderSign.js b/apps/OpenSign/src/pages/PlaceHolderSign.js index 7909fecb3..cffa2d77d 100644 --- a/apps/OpenSign/src/pages/PlaceHolderSign.js +++ b/apps/OpenSign/src/pages/PlaceHolderSign.js @@ -333,7 +333,6 @@ function PlaceHolderSign() { let dropData = []; let placeHolder; const dragTypeValue = item?.text ? item.text : monitor.type; - console.log("option", dragTypeValue); if (item === "onclick") { const dropObj = { //onclick put placeholder center on pdf From f1cf39576157e4a359365858268445bd89278e75 Mon Sep 17 00:00:00 2001 From: RaktimaNXG Date: Mon, 18 Mar 2024 17:05:15 +0530 Subject: [PATCH 08/18] fix: textInput widget popup select arrow key design --- .../src/components/pdf/Placeholder.js | 3 +-- .../src/components/pdf/WidgetNameModal.js | 16 ++--------- apps/OpenSign/src/styles/AddUser.css | 27 +++++++++++++++++++ 3 files changed, 30 insertions(+), 16 deletions(-) diff --git a/apps/OpenSign/src/components/pdf/Placeholder.js b/apps/OpenSign/src/components/pdf/Placeholder.js index c6d9051bb..41f96a550 100644 --- a/apps/OpenSign/src/components/pdf/Placeholder.js +++ b/apps/OpenSign/src/components/pdf/Placeholder.js @@ -595,8 +595,7 @@ function Placeholder(props) { disableDragging={ props.isNeedSign ? true - : props.isPlaceholder && - !["date", textWidget].includes(props.pos.type) + : props.isPlaceholder && ![textWidget].includes(props.pos.type) ? false : !isDraggingEnabled } diff --git a/apps/OpenSign/src/components/pdf/WidgetNameModal.js b/apps/OpenSign/src/components/pdf/WidgetNameModal.js index 329dea3e6..4471af317 100644 --- a/apps/OpenSign/src/components/pdf/WidgetNameModal.js +++ b/apps/OpenSign/src/components/pdf/WidgetNameModal.js @@ -129,18 +129,7 @@ const WidgetNameModal = (props) => { >
{ // onBlur={() => handleBlurRegex()} />