From 94eeceeaf99cfd124d6941474cc3f3ee9dcca809 Mon Sep 17 00:00:00 2001 From: RaktimaNXG Date: Mon, 15 Apr 2024 12:58:16 +0530 Subject: [PATCH] feat : add recipient button in placeholder flow to add new signers in document signer's list --- .../src/components/pdf/PlaceholderType.js | 20 ++++--- .../src/components/pdf/SignerListPlace.js | 15 ++++- .../src/components/pdf/WidgetComponent.js | 19 ++++++- apps/OpenSign/src/pages/PlaceHolderSign.js | 57 +++++++++---------- apps/OpenSign/src/primitives/LinkUserModal.js | 5 +- 5 files changed, 74 insertions(+), 42 deletions(-) diff --git a/apps/OpenSign/src/components/pdf/PlaceholderType.js b/apps/OpenSign/src/components/pdf/PlaceholderType.js index 918fdc129..b23f056e1 100644 --- a/apps/OpenSign/src/components/pdf/PlaceholderType.js +++ b/apps/OpenSign/src/components/pdf/PlaceholderType.js @@ -38,15 +38,17 @@ function PlaceholderType(props) { "December" ]; const validateExpression = (regexValidation) => { - let regexObject = regexValidation; - if (props.pos?.options.validation.type === "regex") { - regexObject = RegexParser(regexValidation); - } - // new RegExp(regexValidation); - let isValidate = regexObject.test(textValue); - if (!isValidate) { - props?.setValidateAlert(true); - inputRef.current.focus(); + if (textValue) { + let regexObject = regexValidation; + if (props.pos?.options.validation.type === "regex") { + regexObject = RegexParser(regexValidation); + } + // new RegExp(regexValidation); + let isValidate = regexObject.test(textValue); + if (!isValidate) { + props?.setValidateAlert(true); + inputRef.current.focus(); + } } }; diff --git a/apps/OpenSign/src/components/pdf/SignerListPlace.js b/apps/OpenSign/src/components/pdf/SignerListPlace.js index be9965bf4..9a8bab189 100644 --- a/apps/OpenSign/src/components/pdf/SignerListPlace.js +++ b/apps/OpenSign/src/components/pdf/SignerListPlace.js @@ -71,7 +71,7 @@ function SignerListPlace(props) {
- {props.handleAddSigner && ( + {props.handleAddSigner ? (
Add role
+ ) : ( +
props.setIsAddSigner(true)} + style={{ + opacity: props.isMailSend && "0.5", + pointerEvents: props.isMailSend && "none" + }} + > + + Add recipients +
)} ); diff --git a/apps/OpenSign/src/components/pdf/WidgetComponent.js b/apps/OpenSign/src/components/pdf/WidgetComponent.js index e9bff561a..9b0ba807f 100644 --- a/apps/OpenSign/src/components/pdf/WidgetComponent.js +++ b/apps/OpenSign/src/components/pdf/WidgetComponent.js @@ -38,7 +38,8 @@ function WidgetComponent({ sendInOrder, isTemplateFlow, setBlockColor, - blockColor + blockColor, + setIsAddSigner }) { const [isSignersModal, setIsSignersModal] = useState(false); @@ -319,7 +320,7 @@ function WidgetComponent({ )} - {handleAddSigner && ( + {handleAddSigner ? (
Add role
+ ) : ( +
setIsAddSigner(true)} + > + + Add recipients +
)}
{ + const newId = randomId(); + const newRole = `User ${signersdata?.length + 1} `; + + signersdata.push({ + ...data, + className: "contracts_Contactbook", + Id: newId, + Role: newRole + }); + setUniqueId(newId); + setIsSelectId(signersdata.length - 1); + setBlockColor(color[signersdata.length - 1]); + setRoleName(newRole); + setContractName("contracts_Contactbook"); + setSignerObjId(data.objectId); + }; + const closePopup = () => { setIsAddUser({}); + setIsAddSigner(false); }; //function for handle ontext change and save again text in delta in Request Email flow @@ -1984,6 +2005,7 @@ function PlaceHolderSign() { setSignersData={setSignersData} blockColor={blockColor} setBlockColor={setBlockColor} + setIsAddSigner={setIsAddSigner} />
) : ( @@ -2009,6 +2031,7 @@ function PlaceHolderSign() { blockColor={blockColor} setBlockColor={setBlockColor} isMailSend={isMailSend} + setIsAddSigner={setIsAddSigner} // handleAddSigner={handleAddSigner} />
@@ -2035,35 +2058,6 @@ function PlaceHolderSign() { )}
- {/* { - setSignerExistModal(false); - }} - > -
-

Please assign signers to all placeholders

- -
- -
-
*/} + { return (