From d247c6d0e75a58b330f28a767d7ef5e7355075b9 Mon Sep 17 00:00:00 2001 From: RaktimaNXG Date: Mon, 22 Jul 2024 16:18:10 +0530 Subject: [PATCH] fix: signer selection removed after clicking widget settings, widget placeholder's name field text getting change issue --- .../src/components/pdf/PlaceholderCopy.js | 4 +-- .../src/components/pdf/PlaceholderType.js | 17 +++++++++--- .../src/components/pdf/WidgetNameModal.js | 27 +++++++------------ apps/OpenSign/src/constant/Utils.js | 2 +- apps/OpenSign/src/pages/PlaceHolderSign.js | 19 +++++++------ 5 files changed, 35 insertions(+), 34 deletions(-) diff --git a/apps/OpenSign/src/components/pdf/PlaceholderCopy.js b/apps/OpenSign/src/components/pdf/PlaceholderCopy.js index f0d148ca5..a7cdf26f8 100644 --- a/apps/OpenSign/src/components/pdf/PlaceholderCopy.js +++ b/apps/OpenSign/src/components/pdf/PlaceholderCopy.js @@ -189,9 +189,7 @@ function PlaceholderCopy(props) { { - props.setIsPageCopy(false); - }} + handleClose={() => handleUniqueId()} >
{copyType.map((data, key) => { diff --git a/apps/OpenSign/src/components/pdf/PlaceholderType.js b/apps/OpenSign/src/components/pdf/PlaceholderType.js index ae19a56a4..29d2d31d6 100644 --- a/apps/OpenSign/src/components/pdf/PlaceholderType.js +++ b/apps/OpenSign/src/components/pdf/PlaceholderType.js @@ -14,9 +14,9 @@ import "react-datepicker/dist/react-datepicker.css"; import "../../styles/signature.css"; import RegexParser from "regex-parser"; const textWidgetCls = - "w-full h-full md:min-w-full md:min-h-full z-[999] text-[12px] rounded-[2px] border-[1px] border-[#007bff] overflow-hidden resize-none outline-none text-base-content item-center bg-base-100 whitespace-pre-wrap"; + "w-full h-full md:min-w-full md:min-h-full z-[999] text-[12px] rounded-[2px] border-[1px] border-[#007bff] overflow-hidden resize-none outline-none text-base-content item-center whitespace-pre-wrap"; const selectWidgetCls = - "w-full h-full absolute left-0 top-0 border-[1px] border-[#007bff] rounded-[2px] focus:outline-none bg-base-100 text-base-content"; + "w-full h-full absolute left-0 top-0 border-[1px] border-[#007bff] rounded-[2px] focus:outline-none text-base-content"; function PlaceholderType(props) { const type = props?.pos?.type; const [selectOption, setSelectOption] = useState(""); @@ -618,7 +618,8 @@ function PlaceholderType(props) {
); case "date": - return ( + return props.isSignYourself || + (props.isNeedSign && props.data?.signerObjId === props.signerObjId) ? (
( @@ -675,6 +676,16 @@ function PlaceholderType(props) { } />
+ ) : ( +
+ + {props.selectDate + ? props.selectDate?.format + : props.pos?.options?.validation?.format + ? props.pos?.options?.validation?.format + : "MM/dd/yyyy"} + +
); case "image": return props.pos.SignUrl ? ( diff --git a/apps/OpenSign/src/components/pdf/WidgetNameModal.js b/apps/OpenSign/src/components/pdf/WidgetNameModal.js index 428660ad4..319272f94 100644 --- a/apps/OpenSign/src/components/pdf/WidgetNameModal.js +++ b/apps/OpenSign/src/components/pdf/WidgetNameModal.js @@ -23,7 +23,7 @@ const WidgetNameModal = (props) => { useEffect(() => { if (props.defaultdata) { setFormdata({ - name: props.defaultdata?.options?.name || props?.widgetName || "", + name: props.defaultdata?.options?.name || "", defaultValue: props.defaultdata?.options?.defaultValue || "", status: props.defaultdata?.options?.status || "required", hint: props.defaultdata?.options?.hint || "", @@ -35,11 +35,11 @@ const WidgetNameModal = (props) => { } else { setFormdata({ ...formdata, - name: props.defaultdata?.options?.name || props?.widgetName || "" + name: props.defaultdata?.options?.name || "" }); } // eslint-disable-next-line - }, [props.defaultdata, props.widgetName]); + }, [props.defaultdata]); const handleSubmit = (e) => { e.preventDefault(); if (props.handleData) { @@ -109,10 +109,7 @@ const WidgetNameModal = (props) => {
@@ -128,8 +125,7 @@ const WidgetNameModal = (props) => { required />
- {(props.defaultdata?.type === textInputWidget || - props.widgetName === textInputWidget) && ( + {props.defaultdata?.type === textInputWidget && ( <> {isEnableSubscription && (
@@ -248,8 +244,7 @@ const WidgetNameModal = (props) => { })}
- {(props.defaultdata?.type === textInputWidget || - props?.widgetName === textInputWidget) && ( + {props.defaultdata?.type === textInputWidget && (