diff --git a/apps/OpenSign/src/primitives/TemplateForm.js b/apps/OpenSign/src/primitives/TemplateForm.js index fe433af24..d478f670b 100644 --- a/apps/OpenSign/src/primitives/TemplateForm.js +++ b/apps/OpenSign/src/primitives/TemplateForm.js @@ -4,7 +4,7 @@ import Parse from "parse"; import DropboxChooser from "../components/fields/DropboxChoose"; import Alert from "./Alert"; import SelectFolder from "../components/fields/SelectFolder"; -import SignersInput from "../components/fields/SignersInput"; +// import SignersInput from "../components/fields/SignersInput"; import Title from "../components/Title"; import { useNavigate } from "react-router-dom"; import { templateCls } from '../constant/const' @@ -14,7 +14,7 @@ const TemplateForm = () => { const [signers, setSigners] = useState([]); const [folder, setFolder] = useState({ ObjectId: "", Name: "" }); const [formData, setFormData] = useState({ - Name: "", + Name: "Please review and sign this document", Description: "", Note: "" }); @@ -179,16 +179,16 @@ const TemplateForm = () => { const handleFolder = (data) => { setFolder(data); }; - const handleSigners = (data) => { - if (data && data.length > 0) { - const updateSigners = data.map((x) => ({ - __type: "Pointer", - className: "contracts_Contactbook", - objectId: x - })); - setSigners(updateSigners); - } - }; + // const handleSigners = (data) => { + // if (data && data.length > 0) { + // const updateSigners = data.map((x) => ({ + // __type: "Pointer", + // className: "contracts_Contactbook", + // objectId: x + // })); + // setSigners(updateSigners); + // } + // }; const handleReset = () => { setSigners([]); @@ -281,6 +281,7 @@ const TemplateForm = () => { className="px-3 py-2 w-full border-[1px] border-gray-300 rounded focus:outline-none text-xs" value={formData.Note} onChange={(e) => handleStrInput(e)} + required />
Digital Signature Request
" + - signersdata.ExtUserPtr.Name + + pdfDetails?.[0].ExtUserPtr.Name + " has requested you to review and sign " + - signersdata.Name + + pdfDetails?.[0].Name + "
| Sender | " + sender + " | |
| Organization Name | __ | |
| Expire on | " +
@@ -675,10 +795,19 @@ function PlaceHolderSign() {
}
if (sendMail.data.result.status === "success") {
+ const signers = signersdata?.map((x) => {
+ return {
+ __type: "Pointer",
+ className: "contracts_Contactbook",
+ objectId: x.objectId
+ };
+ });
+ // console.log("signers ", signers);
try {
const data = {
Placeholders: signerPos,
- SignedUrl: pdfDetails[0].URL
+ SignedUrl: pdfDetails[0].URL,
+ Signers: signers
};
await axios
@@ -789,125 +918,194 @@ function PlaceHolderSign() {
`${hostUrl}recipientSignPdf/${documentId}/${currentEmail[0].objectId}`
);
};
+
+ const handleLinkUser = (id) => {
+ setIsAddUser({ [id]: true });
+ };
+ const handleAddUser = (data) => {
+ // console.log("hello", data);
+ const signerPtr = {
+ __type: "Pointer",
+ className: "contracts_Contactbook",
+ objectId: data.objectId
+ };
+ const updatePlaceHolder = signerPos.map((x) => {
+ if (x.Id === uniqueId) {
+ return { ...x, signerPtr: signerPtr, signerObjId: data.objectId };
+ }
+ return { ...x };
+ });
+ // console.log("updatePlaceHolder ", updatePlaceHolder);
+ setSignerPos(updatePlaceHolder);
+
+ const updateSigner = signersdata.map((x) => {
+ if (x.Id === uniqueId) {
+ return { ...x, ...data };
+ }
+ return { ...x };
+ });
+ // console.log("updateSigner ", updateSigner);
+
+ setSignersData(updateSigner);
+ };
+
+ const closePopup = () => {
+ setIsAddUser({});
+ };
+
+ // console.log("isAddUser", isAddUser);
+ // console.log("signerdata", signersdata);
+ // console.log("signerPos", signerPos);
+
return (
-
- {/* this component used for UI interaction and show their functionality */}
- {!checkTourStatus && (
- //this tour component used in your html component where you want to put
- //onRequestClose function to close tour
- //steps is defined what will be your messages and style also
- //isOpen is takes boolean value to open
-
+ {/* this component used for UI interaction and show their functionality */}
+ {!checkTourStatus && (
+ //this tour component used in your html component where you want to put
+ //onRequestClose function to close tour
+ //steps is defined what will be your messages and style also
+ //isOpen is takes boolean value to open
+ 500 && "20px",
- marginRight: !isMobile && pdfOriginalWidth > 500 && "20px"
- }}
- >
- {/* this modal is used show alert set placeholder for all signers before send mail */}
+ {/* pdf render view */}
+ 500 && "20px",
+ marginRight: !isMobile && pdfOriginalWidth > 500 && "20px"
+ }}
+ >
+ {/* this modal is used show alert set placeholder for all signers before send mail */}
-
-
- {/* signature button */}
- {isMobile ? (
- Please Add field for all recipients. - ) : ( - isSendAlert.mssg === "confirm" && ( -- Are you sure you want to send out this document for - signatures? - - ) - )} -Please Add field for all recipients. + ) : ( + isSendAlert.mssg === "confirm" && ( ++ Are you sure you want to send out this document for + signatures? + + ) + )} +You have successfully sent mails to all recipients! - {currentEmail.length > 0 && ( -Do you want to sign documents right now ? - )} -You have successfully sent mails to all recipients! + {currentEmail?.length > 0 && ( +Do you want to sign documents right now ? + )} +
- {containerWH && (
-
-
-
- ) : (
-
+ {containerWH && (
+
-
+ )}
+
+
-
- )}
-
+ )}
+
-
- )}
-
+
-
+
+
+
+ >
);
}
diff --git a/microfrontends/SignDocuments/src/css/AddUser.css b/microfrontends/SignDocuments/src/css/AddUser.css
new file mode 100644
index 000000000..712df7668
--- /dev/null
+++ b/microfrontends/SignDocuments/src/css/AddUser.css
@@ -0,0 +1,72 @@
+.addusercontainer {
+ height: 100%;
+ padding: 20px;
+}
+
+.loaderdiv {
+ position: fixed;
+ top: 0;
+ right: 0;
+ bottom: 0;
+ left: 0;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ background-color: rgba(0, 0, 0, 0.3);
+
+}
+
+.form-wrapper {
+ width: 100%;
+ margin-left: auto;
+ margin-right: auto;
+ padding: 8px;
+}
+
+.form-section {
+ margin-bottom: 0.75rem;
+}
+
+.checkbox-label {
+ margin-left: 0.5rem;
+ color: #4b5563;
+}
+
+.addUserInput {
+ padding: 0.5rem 0.75rem;
+ width: 100%;
+ border-width: 1px;
+ border-color: #d1d5db;
+ border-radius: 0.375rem;
+ outline: none;
+ font-size: 0.75rem;
+}
+
+
+.buttoncontainer {
+ margin-top: 1rem;
+ display: flex;
+ justify-content: flex-start;
+}
+
+.submitbutton {
+ background-color: #1ab6ce;
+ font-size: 0.875rem;
+ color: white;
+ padding: 0.5rem 1rem;
+ border-radius: 0.5rem;
+ box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.2);
+ outline: none;
+}
+
+/* For classes: bg-[#188ae2] text-sm text-white px-4 py-2 rounded ml-2 shadow focus:outline-none */
+.resetbutton {
+ background-color: #188ae2;
+ font-size: 0.875rem;
+ color: white;
+ padding: 0.5rem 1rem;
+ border-radius: 0.5rem;
+ box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.2);
+ margin-left: 0.5rem;
+ outline: none;
+}
\ No newline at end of file
diff --git a/microfrontends/SignDocuments/src/css/signature.css b/microfrontends/SignDocuments/src/css/signature.css
index b4aed0610..7fc117746 100644
--- a/microfrontends/SignDocuments/src/css/signature.css
+++ b/microfrontends/SignDocuments/src/css/signature.css
@@ -174,6 +174,28 @@
padding: 0px 5.1px 1px 5px;
}
+.signCloseBtn{
+ position: absolute;
+ right: -1px;
+ top: -9px;
+ border-radius: 100%;
+ font-size: 14px;
+ cursor: pointer;
+ padding: 0px 5.1px 1px 5px;
+ z-index: 2;
+}
+
+.signCopy {
+ position: absolute;
+ right: 24px;
+ top: -9px;
+ font-size: 13px;
+ cursor: pointer;
+ z-index: 2;
+
+}
+
+
.placeholderBlock {
padding: 0px;
position: absolute;
@@ -185,6 +207,16 @@
justify-content: center;
border-width: 0.2px;
+}
+.signWidgetblock {
+ padding: 0px;
+ border-style: dashed;
+ display: flex !important;
+ text-align: center !important;
+ justify-content: center !important;
+ align-items: center !important;
+ border-width: 0.2px;
+
}
.finishBtn {
diff --git a/microfrontends/SignDocuments/src/utils/Utils.js b/microfrontends/SignDocuments/src/utils/Utils.js
index 5deab7dee..1dbd6047a 100644
--- a/microfrontends/SignDocuments/src/utils/Utils.js
+++ b/microfrontends/SignDocuments/src/utils/Utils.js
@@ -1004,19 +1004,26 @@ export const signPdfFun = async (
export const randomId = () => Math.floor(1000 + Math.random() * 9000);
-export const createDocument = async (template) => {
+export const createDocument = async (template, placeholders, signerData) => {
if (template && template.length > 0) {
const Doc = template[0];
- let signers;
- console.log("Doc.Placholders ", Doc)
- if (Doc.Signers && Doc.Signers.length > 0) {
- signers = Doc.Signers.map((x) => ({
- __type: "Pointer",
- className: "contracts_Contactbook",
- objectId: x.objectId
- }));
- } else {
- signers = [];
+
+ let placeholdersArr = []
+ if(placeholders?.length > 0 ){
+ placeholdersArr= placeholders
+ }
+ let signers = []
+ if(signerData?.length > 0){
+ signerData.forEach((x) => {
+ if(x.objectId){
+ const obj = {
+ __type: "Pointer",
+ className: "contracts_Contactbook",
+ objectId: x.objectId
+ };
+ signers.push(obj)
+ }
+ });
}
const data = {
Name: Doc.Name,
@@ -1024,7 +1031,7 @@ export const createDocument = async (template) => {
SignedUrl: Doc.SignedUrl,
Description: Doc.Description,
Note: Doc.Note,
- Placeholders: Doc.Placeholders,
+ Placeholders: placeholdersArr,
ExtUserPtr: {
__type: "Pointer",
className: "contracts_Users",
|