@@ -334,7 +342,9 @@ const Forms = (props) => {
onChange={(e) => handleStrInput(e)}
/>
- {props.signers &&
@@ -399,10 +413,10 @@ const Forms = (props) => {
type="submit"
disabled={isSubmit}
>
- Submit
+ Next
handleReset()}
>
Reset
diff --git a/apps/OpenSign/src/pages/GuestLogin.js b/apps/OpenSign/src/pages/GuestLogin.js
index 5ddf29b65..6f048a64a 100644
--- a/apps/OpenSign/src/pages/GuestLogin.js
+++ b/apps/OpenSign/src/pages/GuestLogin.js
@@ -4,6 +4,7 @@ import "../styles/loginPage.css";
import loader from "../assets/images/loader2.gif";
import axios from "axios";
import { themeColor } from "../constant/const";
+import { contractUsers } from "../constant/Utils";
function GuestLogin() {
const { id, userMail, contactBookId, serverUrl } = useParams();
@@ -103,11 +104,19 @@ function GuestLogin() {
} else {
let _user = user.data.result;
const parseId = localStorage.getItem("parseAppId");
+ const contractUserDetails = await contractUsers(_user.email);
localStorage.setItem("UserInformation", JSON.stringify(_user));
localStorage.setItem(
`Parse/${parseId}/currentUser`,
JSON.stringify(_user)
);
+ if (contractUserDetails) {
+ localStorage.setItem(
+ "Extand_Class",
+ JSON.stringify(contractUserDetails)
+ );
+ }
+
localStorage.setItem("username", _user.name);
localStorage.setItem("accesstoken", _user.sessionToken);
//save isGuestSigner true in local to handle login flow header in mobile view
diff --git a/apps/OpenSign/src/pages/PdfRequestFiles.js b/apps/OpenSign/src/pages/PdfRequestFiles.js
index 2c8c7e241..bdb017394 100644
--- a/apps/OpenSign/src/pages/PdfRequestFiles.js
+++ b/apps/OpenSign/src/pages/PdfRequestFiles.js
@@ -19,7 +19,8 @@ import {
onImageSelect,
onSaveSign,
onSaveImage,
- addDefaultSignatureImg
+ addDefaultSignatureImg,
+ radioButtonWidget
} from "../constant/Utils";
import Loader from "../primitives/LoaderWithMsg";
import HandleError from "../primitives/HandleError";
@@ -48,6 +49,7 @@ function PdfRequestFiles() {
const [imgWH, setImgWH] = useState({});
const imageRef = useRef(null);
const [handleError, setHandleError] = useState();
+ const [selectWidgetId, setSelectWidgetId] = useState("");
const [isLoading, setIsLoading] = useState({
isLoad: true,
message: "This might take some time"
@@ -385,7 +387,8 @@ function PdfRequestFiles() {
for (let j = 0; j < checkUser[0].placeHolder[i].pos.length; j++) {
checkboxExist =
checkUser[0].placeHolder[i].pos[j].type === "checkbox";
- radioExist = checkUser[0].placeHolder[i].pos[j].type === "radio";
+ radioExist =
+ checkUser[0].placeHolder[i].pos[j].type === radioButtonWidget;
if (checkboxExist) {
requiredCheckbox = checkUser[0].placeHolder[i].pos.filter(
(position) =>
@@ -434,7 +437,8 @@ function PdfRequestFiles() {
} else if (radioExist) {
requiredRadio = checkUser[0].placeHolder[i].pos.filter(
(position) =>
- !position.options?.isReadOnly && position.type === "radio"
+ !position.options?.isReadOnly &&
+ position.type === radioButtonWidget
);
if (requiredRadio && requiredRadio?.length > 0) {
let checkSigned;
@@ -457,7 +461,7 @@ function PdfRequestFiles() {
const requiredWidgets = checkUser[0].placeHolder[i].pos.filter(
(position) =>
position.options?.status === "required" &&
- position.type !== "radio" &&
+ position.type !== radioButtonWidget &&
position.type !== "checkbox"
);
if (requiredWidgets && requiredWidgets?.length > 0) {
@@ -1173,6 +1177,8 @@ function PdfRequestFiles() {
setIsInitial={setIsInitial}
setValidateAlert={setValidateAlert}
unSignedWidgetId={unSignedWidgetId}
+ setSelectWidgetId={setSelectWidgetId}
+ selectWidgetId={selectWidgetId}
/>
)}
diff --git a/apps/OpenSign/src/pages/PlaceHolderSign.js b/apps/OpenSign/src/pages/PlaceHolderSign.js
index 9b46961c8..35351be3e 100644
--- a/apps/OpenSign/src/pages/PlaceHolderSign.js
+++ b/apps/OpenSign/src/pages/PlaceHolderSign.js
@@ -24,7 +24,10 @@ import {
randomId,
defaultWidthHeight,
multiSignEmbed,
- addWidgetOptions
+ addWidgetOptions,
+ textInputWidget,
+ textWidget,
+ radioButtonWidget
} from "../constant/Utils";
import RenderPdf from "../components/pdf/RenderPdf";
import { useNavigate } from "react-router-dom";
@@ -76,6 +79,7 @@ function PlaceHolderSign() {
const [isResize, setIsResize] = useState(false);
const [zIndex, setZIndex] = useState(1);
const [signKey, setSignKey] = useState();
+ const [tempSignerId, setTempSignerId] = useState("");
const [pdfLoadFail, setPdfLoadFail] = useState({
status: false,
type: "load"
@@ -380,18 +384,16 @@ function PlaceHolderSign() {
pos: dropData
};
}
-
setSelectWidgetId(key);
if (signer) {
let filterSignerPos;
- if (dragTypeValue === "label") {
+ if (dragTypeValue === textWidget) {
filterSignerPos = signerPos.filter((data) => data.Role === "prefill");
} else {
filterSignerPos = signerPos.filter((data) => data.Id === uniqueId);
}
const { blockColor, Role } = signer;
-
//adding placholder in existing signer pos array (placaholder)
if (filterSignerPos.length > 0) {
const getPlaceHolder = filterSignerPos[0].placeHolder;
@@ -412,7 +414,7 @@ function PlaceHolderSign() {
};
updatePlace.push(xyPos);
let updatesignerPos;
- if (dragTypeValue === "label") {
+ if (dragTypeValue === textWidget) {
updatesignerPos = signerPos.map((x) =>
x.Role === "prefill" ? { ...x, placeHolder: updatePlace } : x
);
@@ -425,7 +427,7 @@ function PlaceHolderSign() {
setSignerPos(updatesignerPos);
} else {
let updatesignerPos;
- if (dragTypeValue === "label") {
+ if (dragTypeValue === textWidget) {
updatesignerPos = signerPos.map((x) =>
x.Role === "prefill"
? { ...x, placeHolder: [...x.placeHolder, placeHolder] }
@@ -442,9 +444,8 @@ function PlaceHolderSign() {
}
} else {
//adding new placeholder for selected signer in pos array (placeholder)
- // const signerData = signerPos;
let placeHolderPos;
- if (dragTypeValue === "label") {
+ if (dragTypeValue === textWidget) {
placeHolderPos = {
signerPtr: {},
signerObjId: "",
@@ -484,9 +485,12 @@ function PlaceHolderSign() {
setShowDropdown(true);
} else if (dragTypeValue === "checkbox") {
setIsCheckbox(true);
- } else if (dragTypeValue === "radio") {
+ } else if (dragTypeValue === radioButtonWidget) {
setIsRadio(true);
- } else if (dragTypeValue !== "label" && dragTypeValue !== "signature") {
+ } else if (
+ dragTypeValue !== textWidget &&
+ dragTypeValue !== "signature"
+ ) {
setIsNameModal(true);
}
setWidgetType(dragTypeValue);
@@ -736,7 +740,7 @@ function PlaceHolderSign() {
if (getPrefill && isLabel) {
const alert = {
- mssg: "label",
+ mssg: textWidget,
alert: true
};
setIsSendAlert(alert);
@@ -1051,7 +1055,8 @@ function PlaceHolderSign() {
addOption,
deleteOption,
status,
- defaultValue
+ defaultValue,
+ isHideLabel
) => {
const filterSignerPos = signerPos.filter((data) => data.Id === uniqueId);
if (filterSignerPos.length > 0) {
@@ -1067,7 +1072,7 @@ function PlaceHolderSign() {
const getPosData = getXYdata;
const addSignPos = getPosData.map((position) => {
if (position.key === signKey) {
- if (widgetType === "radio") {
+ if (widgetType === radioButtonWidget) {
if (addOption) {
return {
...position,
@@ -1089,7 +1094,8 @@ function PlaceHolderSign() {
...position.options,
name: dropdownName,
values: dropdownOptions,
- isReadOnly: isReadOnly,
+ isReadOnly: isReadOnly || false,
+ isHideLabel: isHideLabel || false,
defaultValue: defaultValue
}
};
@@ -1121,7 +1127,8 @@ function PlaceHolderSign() {
maxRequiredCount: maxCount
},
defaultValue: defaultValue,
- isReadOnly: isReadOnly
+ isReadOnly: isReadOnly || false,
+ isHideLabel: isHideLabel || false
}
};
}
@@ -1186,7 +1193,7 @@ function PlaceHolderSign() {
const getPosData = getXYdata;
const addSignPos = getPosData.map((position) => {
if (position.key === signKey) {
- if (position.type === "text") {
+ if (position.type === textInputWidget) {
return {
...position,
options: {
@@ -1406,13 +1413,13 @@ function PlaceHolderSign() {
{isSendAlert.mssg === "sure" ? (
Please add field for all recipients.
- ) : isSendAlert.mssg === "label" ? (
+ ) : isSendAlert.mssg === textWidget ? (
Please confirm that you have filled label widget.
) : (
isSendAlert.mssg === "confirm" && (
@@ -1553,11 +1560,14 @@ function PlaceHolderSign() {
allPages={allPages}
pageNumber={pageNumber}
signKey={signKey}
- // signerObjId={signerObjId}
Id={uniqueId}
+ widgetType={widgetType}
+ setUniqueId={setUniqueId}
+ tempSignerId={tempSignerId}
+ setTempSignerId={setTempSignerId}
/>
)}
diff --git a/apps/OpenSign/src/pages/SignyourselfPdf.js b/apps/OpenSign/src/pages/SignyourselfPdf.js
index 4b7501c56..1d4803e9f 100644
--- a/apps/OpenSign/src/pages/SignyourselfPdf.js
+++ b/apps/OpenSign/src/pages/SignyourselfPdf.js
@@ -3,7 +3,6 @@ import { PDFDocument } from "pdf-lib";
import "../styles/signature.css";
import { themeColor } from "../constant/const";
import axios from "axios";
-import moment from "moment";
import Loader from "../primitives/LoaderWithMsg";
import loader from "../assets/images/loader2.gif";
import RenderAllPdfPage from "../components/pdf/RenderAllPdfPage";
@@ -25,7 +24,9 @@ import {
onSaveSign,
contractUsers,
contactBook,
- randomId
+ randomId,
+ getDate,
+ textInputWidget
} from "../constant/Utils";
import { useParams } from "react-router-dom";
import Tour from "reactour";
@@ -308,13 +309,6 @@ function SignYourSelf() {
setIsLoading(loadObj);
}
};
-
- const getDate = () => {
- const date = new Date();
- const milliseconds = date.getTime();
- const newDate = moment(milliseconds).format("MM/DD/YYYY");
- return newDate;
- };
const getWidgetValue = (type) => {
switch (type) {
case "name":
@@ -333,6 +327,7 @@ function SignYourSelf() {
return "";
}
};
+
const addWidgetOptions = (type) => {
switch (type) {
case "signature":
@@ -348,7 +343,7 @@ function SignYourSelf() {
name: "checkbox"
};
- case "text":
+ case textInputWidget:
return {
name: "text"
};
@@ -386,7 +381,8 @@ function SignYourSelf() {
case "date":
return {
name: "date",
- defaultValue: getDate()
+ response: getDate(),
+ validation: { format: "MM/dd/yyyy", type: "date-format" }
};
case "image":
return {
@@ -596,7 +592,6 @@ function SignYourSelf() {
await signPdfFun(pdfBytes, documentId);
}
}
-
//function for get digital signature
const signPdfFun = async (base64Url, documentId) => {
let singleSign = {
@@ -875,7 +870,10 @@ function SignYourSelf() {
maxCount,
isReadOnly,
addOption,
- deleteOption
+ deleteOption,
+ status,
+ defaultValue,
+ isHideLabel
) => {
const getPageNumer = xyPostion.filter(
(data) => data.pageNumber === pageNumber
@@ -907,7 +905,8 @@ function SignYourSelf() {
...position.options,
name: dropdownName,
values: dropdownOptions,
- isReadOnly: isReadOnly
+ isReadOnly: isReadOnly,
+ isHideLabel: isHideLabel || false
}
};
}
diff --git a/apps/OpenSign/src/pages/TemplatePlaceholder.js b/apps/OpenSign/src/pages/TemplatePlaceholder.js
index 41b43ecbd..dc71aaa9c 100644
--- a/apps/OpenSign/src/pages/TemplatePlaceholder.js
+++ b/apps/OpenSign/src/pages/TemplatePlaceholder.js
@@ -21,7 +21,10 @@ import {
addZIndex,
createDocument,
defaultWidthHeight,
- addWidgetOptions
+ addWidgetOptions,
+ textInputWidget,
+ textWidget,
+ radioButtonWidget
} from "../constant/Utils";
import RenderPdf from "../components/pdf/RenderPdf";
import "../styles/AddUser.css";
@@ -442,9 +445,12 @@ const TemplatePlaceholder = () => {
setShowDropdown(true);
} else if (dragTypeValue === "checkbox") {
setIsCheckbox(true);
- } else if (dragTypeValue === "radio") {
+ } else if (dragTypeValue === radioButtonWidget) {
setIsRadio(true);
- } else if (dragTypeValue !== "label" && dragTypeValue !== "signature") {
+ } else if (
+ dragTypeValue !== textWidget &&
+ dragTypeValue !== "signature"
+ ) {
setIsNameModal(true);
}
setCurrWidgetsDetails({});
@@ -970,7 +976,8 @@ const TemplatePlaceholder = () => {
addOption,
deleteOption,
status,
- defaultValue
+ defaultValue,
+ isHideLabel
) => {
const filterSignerPos = signerPos.filter((data) => data.Id === uniqueId);
if (filterSignerPos.length > 0) {
@@ -986,11 +993,10 @@ const TemplatePlaceholder = () => {
const getPosData = getXYdata;
const addSignPos = getPosData.map((position) => {
if (position.key === signKey) {
- if (widgetType === "radio") {
+ if (widgetType === radioButtonWidget) {
if (addOption) {
return {
...position,
-
Height: position.Height
? position.Height + 15
: defaultWidthHeight(widgetType).height + 15
@@ -1010,7 +1016,9 @@ const TemplatePlaceholder = () => {
name: dropdownName,
values: dropdownOptions,
status: status,
- defaultValue: defaultValue
+ defaultValue: defaultValue,
+ isReadOnly: isReadOnly || false,
+ isHideLabel: isHideLabel || false
}
};
}
@@ -1040,8 +1048,9 @@ const TemplatePlaceholder = () => {
minRequiredCount: minCount,
maxRequiredCount: maxCount
},
- isReadOnly: isReadOnly,
- defaultValue: defaultValue
+ isReadOnly: isReadOnly || false,
+ defaultValue: defaultValue,
+ isHideLabel: isHideLabel || false
}
};
}
@@ -1106,7 +1115,7 @@ const TemplatePlaceholder = () => {
const getPosData = getXYdata;
const addSignPos = getPosData.map((position) => {
if (position.key === signKey) {
- if (position.type === "text") {
+ if (position.type === textInputWidget) {
return {
...position,
options: {
@@ -1305,7 +1314,7 @@ const TemplatePlaceholder = () => {