diff --git a/.env.local_dev b/.env.local_dev index e8ecd6df1..05b67ea82 100644 --- a/.env.local_dev +++ b/.env.local_dev @@ -20,7 +20,7 @@ appName=open_sign_server # A 12 character long random secret key that allows access to all the data. It is used in Parse dashboard config to view all the data in the database. MASTER_KEY=XnAadwKxxByMr # Mongodb URI to connect to -MONGODB_URI=mongodb://host.docker.internal:27017/OpenSignDB +MONGODB_URI=mongodb://localhost:27017/OpenSignDB # Path on which APIs should be mounted. Do not change this. This variable shall be removed & value hardcoded in the source code in coming versions. PARSE_MOUNT=/app # Set it to the URL from where APIs will be accessible to the NodeJS functions, for local development it should be localhost:3000/api/app (use your local port number instead) 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 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/pdf/Placeholder.js b/apps/OpenSign/src/components/pdf/Placeholder.js index d786efa9b..41f96a550 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,7 @@ function Placeholder(props) { disableDragging={ props.isNeedSign ? true - : props.isPlaceholder && props.pos.type !== "date" + : props.isPlaceholder && ![textWidget].includes(props.pos.type) ? false : !isDraggingEnabled } @@ -652,8 +653,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..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(); @@ -31,7 +32,10 @@ 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/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/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/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()} />