diff --git a/apps/OpenSign/src/components/pdf/Placeholder.js b/apps/OpenSign/src/components/pdf/Placeholder.js index 87312ae99..ca337cc1b 100644 --- a/apps/OpenSign/src/components/pdf/Placeholder.js +++ b/apps/OpenSign/src/components/pdf/Placeholder.js @@ -2,7 +2,12 @@ import React, { useState, useEffect } from "react"; import BorderResize from "./BorderResize"; import PlaceholderBorder from "./PlaceholderBorder"; import { Rnd } from "react-rnd"; -import { defaultWidthHeight, isMobile } from "../../constant/Utils"; +import { + defaultWidthHeight, + isMobile, + textInputWidget, + textWidget +} from "../../constant/Utils"; import PlaceholderType from "./PlaceholderType"; import moment from "moment"; import "../../styles/opensigndrive.css"; @@ -202,7 +207,7 @@ function Placeholder(props) { } const widgetTypeExist = [ - "text", + textInputWidget, "checkbox", "name", "company", @@ -238,7 +243,7 @@ function Placeholder(props) { } else if ( props.isPlaceholder && !props.isDragging && - props.pos.type !== "label" + props.pos.type !== textWidget ) { if (props.pos.key === props.selectWidgetId) { props.handleLinkUser(props.data.Id); @@ -277,7 +282,7 @@ function Placeholder(props) { props?.handleNameModal(true); } - if (props.isPlaceholder && props.type !== "label") { + if (props.isPlaceholder && props.type !== textWidget) { props.setUniqueId(props.data.Id); } props.setSignKey(props.pos.key); @@ -285,10 +290,10 @@ function Placeholder(props) { props.setCurrWidgetsDetails(props.pos); }; const handleCopyPlaceholder = (e) => { - if (props.data && props?.pos?.type !== "label") { + if (props.data && props?.pos?.type !== textWidget) { props.setSignerObjId(props?.data?.signerObjId); props.setUniqueId(props?.data?.Id); - } else if (props.data && props.pos.type === "label") { + } else if (props.data && props.pos.type === textWidget) { props.setTempSignerId(props.uniqueId); props.setSignerObjId(props?.data?.signerObjId); props.setUniqueId(props?.data?.Id); @@ -324,7 +329,9 @@ function Placeholder(props) { ) : ( ((!props?.pos?.type && props.pos.isStamp) || (props?.pos?.type && - !["date", "label", "signature"].includes(props.pos.type) && + !["date", textWidget, "signature"].includes( + props.pos.type + ) && !props.isSignYourself)) && ( { @@ -349,7 +356,7 @@ function Placeholder(props) { ) )} - {props.pos.type !== "label" && !props.isSignYourself && ( + {props.pos.type !== textWidget && !props.isSignYourself && ( { - if (props.widgetType === "label") { + if (props.widgetType === textWidget) { props.setUniqueId(props?.tempSignerId); props.setTempSignerId(""); } diff --git a/apps/OpenSign/src/components/pdf/PlaceholderType.js b/apps/OpenSign/src/components/pdf/PlaceholderType.js index 5c93135e0..c575bcd47 100644 --- a/apps/OpenSign/src/components/pdf/PlaceholderType.js +++ b/apps/OpenSign/src/components/pdf/PlaceholderType.js @@ -1,5 +1,12 @@ import React, { useEffect, useState, forwardRef, useRef } from "react"; -import { getMonth, getYear, onChangeInput, range } from "../../constant/Utils"; +import { + getMonth, + getYear, + onChangeInput, + range, + textInputWidget, + textWidget +} from "../../constant/Utils"; import DatePicker from "react-datepicker"; import "react-datepicker/dist/react-datepicker.css"; import "../../styles/signature.css"; @@ -77,7 +84,7 @@ function PlaceholderType(props) { case "number": setValidatePlaceholder("12345"); break; - case "text": + case textInputWidget: setValidatePlaceholder("enter text"); break; default: @@ -132,7 +139,7 @@ function PlaceholderType(props) { useEffect(() => { if (type && type === "date") { if (props?.selectDate) { - let updateDate; + // let updateDate; // if (props?.selectDate.format === "dd-MM-yyyy") { // // console.log('saveDateformat',props.saveDateFormat) // const [day, month, year] = props.saveDateFormat.split("-"); @@ -410,7 +417,7 @@ function PlaceholderType(props) { })} ); - case "text": + case textInputWidget: return props.isSignYourself || (props.isNeedSign && props.data?.signerObjId === props.signerObjId) ? ( ); - case "label": + case textWidget: return (