Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
128 changes: 70 additions & 58 deletions microfrontends/SignDocuments/src/Component/TemplatePlaceholder.js
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,6 @@ const TemplatePlaceholder = () => {
// `getSignerPos` is used to get placeholder position when user place it and save it in array
const getSignerPos = (item, monitor) => {
const singer = signersdata.find((x) => x.Id === uniqueId);

if (singer) {
const posZIndex = zIndex + 1;
setZIndex(posZIndex);
Expand Down Expand Up @@ -710,67 +709,72 @@ const TemplatePlaceholder = () => {
}
};
const handleSaveTemplate = async () => {
const loadObj = {
isLoad: true,
message: "This might take some time"
};
setIsLoading(loadObj);
setIsSendAlert(false);
let signers = [];
if (signersdata?.length > 0) {
signersdata.forEach((x) => {
if (x.objectId) {
const obj = {
__type: "Pointer",
className: "contracts_Contactbook",
objectId: x.objectId
};
signers.push(obj);
}
});
}
try {
const data = {
Placeholders: signerPos,
SignedUrl: pdfDetails[0].URL,
Signers: signers
const singer = signersdata.find((x) => x.Id === uniqueId);
if (singer) {
const loadObj = {
isLoad: true,
message: "This might take some time"
};

await axios
.put(
`${localStorage.getItem("baseUrl")}classes/${localStorage.getItem(
"_appName"
)}_Template/${templateId}`,
data,
{
headers: {
"Content-Type": "application/json",
"X-Parse-Application-Id": localStorage.getItem("parseAppId"),
"X-Parse-Session-Token": localStorage.getItem("accesstoken")
}
setIsLoading(loadObj);
setIsSendAlert(false);
let signers = [];
if (signersdata?.length > 0) {
signersdata.forEach((x) => {
if (x.objectId) {
const obj = {
__type: "Pointer",
className: "contracts_Contactbook",
objectId: x.objectId
};
signers.push(obj);
}
)
.then((result) => {
setIsCreateDocModal(true);
setIsMailSend(true);
const loadObj = {
isLoad: false
};
setIsLoading(loadObj);
})
.catch((err) => {
console.log("axois err ", err);
});
} catch (e) {
console.log("error", e);
}
try {
const data = {
Placeholders: signerPos,
SignedUrl: pdfDetails[0].URL,
Signers: signers
};

await axios
.put(
`${localStorage.getItem("baseUrl")}classes/${localStorage.getItem(
"_appName"
)}_Template/${templateId}`,
data,
{
headers: {
"Content-Type": "application/json",
"X-Parse-Application-Id": localStorage.getItem("parseAppId"),
"X-Parse-Session-Token": localStorage.getItem("accesstoken")
}
}
)
.then((result) => {
setIsCreateDocModal(true);
setIsMailSend(true);
const loadObj = {
isLoad: false
};
setIsLoading(loadObj);
})
.catch((err) => {
console.log("axois err ", err);
});
} catch (e) {
console.log("error", e);
}
} else {
setIsReceipent(false);
}
};
//here you can add your messages in content and selector is key of particular steps

const tourConfig = [
{
selector: '[data-tut="reactourAddbtn"]',
content: `Clicking "Add" button will show you popup of Add Role, fill role name or it will take by default name and create new receipent.`,
content: `Clicking "Add role" button will allow you to add various signer roles. You can attach users to each role in subsequent steps.`,
position: "top",
observe: '[data-tut="reactourAddbtn--observe"]',
style: { fontSize: "13px" }
Expand Down Expand Up @@ -873,7 +877,7 @@ const TemplatePlaceholder = () => {
e.preventDefault();
const count = signersdata.length > 0 ? signersdata.length + 1 : 1;
const Id = randomId();
const index = signersdata?.length || 0;
const index = signersdata.length;
const obj = {
Role: roleName || "User " + count,
Id: Id,
Expand All @@ -889,13 +893,19 @@ const TemplatePlaceholder = () => {
// `handleDeleteUser` function is used to delete record and placeholder when user click on delete which is place next user name in recipients list
const handleDeleteUser = (Id) => {
const updateSigner = signersdata
.filter((x) => x.Id !== Id)
.map((x, i) => ({ ...x, blockColor: color[i] }));
.filter((x) => x.Id !== Id)
.map((x, i) => ({ ...x, blockColor: color[i] }));
setSignersData(updateSigner);
const updatePlaceholderUser = signerPos
.filter((x) => x.Id !== Id)
.map((x, i) => ({ ...x, blockColor: color[i] }));
.filter((x) => x.Id !== Id)
.map((x, i) => ({ ...x, blockColor: color[i] }));
// console.log("removePlaceholderUser ", removePlaceholderUser)

const index = signersdata.findIndex((x)=> x.Id === Id)
setUniqueId(updateSigner[index]?.Id ||"");
// setIsSelectId(index === -1 ? 0: index);
setIsSelectId(0);

setSignerPos(updatePlaceholderUser);
setIsMailSend(false);
};
Expand Down Expand Up @@ -1051,7 +1061,7 @@ const TemplatePlaceholder = () => {
handleClose={() => setIsCreateDocModal(false)}
>
<div style={{ height: "100%", padding: 20 }}>
<p>Do you want to create document right now ?</p>
<p>Do you want to create a document using the template you just created ?</p>
<div
style={{
height: "1px",
Expand Down Expand Up @@ -1193,6 +1203,8 @@ const TemplatePlaceholder = () => {
setSelectedEmail={setSelectedEmail}
selectedEmail={selectedEmail}
handleAddSigner={handleAddSigner}
setUniqueId={setUniqueId}
setRoleName={setRoleName}
/>
</div>
) : (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ function FieldsComponent({
isMailSend,
selectedEmail,
setSelectedEmail,
handleAddSigner
handleAddSigner,
setUniqueId,
setRoleName
}) {
const signStyle = pdfUrl ? "disableSign" : "signatureBtn";

Expand Down Expand Up @@ -104,6 +106,8 @@ function FieldsComponent({
setIsSelectId(selectedKey);
setContractName(parseData.className);
setSelectedEmail(true);
setUniqueId(parseData.Id);
setRoleName(parseData.Role);
}}
>
<Select.Trigger
Expand Down Expand Up @@ -158,7 +162,7 @@ function FieldsComponent({
value={`${ind}|${JSON.stringify(obj)}`}
// value={(obj)}
>
{obj.Role ? obj.Role : obj.Email}
{obj.Email ? obj.Email : obj.Role }
</SelectItem>
);
})}
Expand Down Expand Up @@ -193,7 +197,7 @@ function FieldsComponent({
onClick={() => handleAddSigner()}
>
<i className="fa-solid fa-plus"></i>
<span style={{ marginLeft: 2 }}>Add</span>
<span style={{ marginLeft: 2 }}>Add role</span>
</div>
)}
<div
Expand Down
47 changes: 26 additions & 21 deletions microfrontends/SignDocuments/src/Component/component/renderPdf.js
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ function RenderPdf({
) : (
<div
style={{
fontSize: "12px",
fontSize: "10px",
color: "black",
justifyContent: "center"
}}
Expand All @@ -366,12 +366,12 @@ function RenderPdf({
(sign) => sign.objectId === signerId
);
if (checkSign.length > 0) {
return <p style={{ color: "black" }}> {checkSign[0].Name} </p>;
return <p style={{ color: "black", fontSize: 11 }}> {checkSign[0].Name} </p>;
} else {
return <p style={{ color: "black" }}> {Role} </p>;
return <p style={{ color: "black", fontSize: 11 }}> {Role} </p>;
}
} else {
return <p style={{ color: "black" }}> {Role} </p>;
return <p style={{ color: "black", fontSize: 11 }}> {Role} </p>;
}
};
return (
Expand Down Expand Up @@ -619,6 +619,11 @@ function RenderPdf({
>
<i
className="fa-regular fa-user signUserIcon"
onTouchEnd={(e) => {
e.stopPropagation();
handleLinkUser(data.Id);
setUniqueId(data.Id);
}}
onClick={(e) => {
e.stopPropagation();
handleLinkUser(data.Id);
Expand All @@ -635,19 +640,30 @@ function RenderPdf({
setIsPageCopy(true);
setSignKey(pos.key);
setSignerObjId(data.signerObjId);
setUniqueId(data.Id)
}}
onClick={(e) => {
e.stopPropagation();
setIsPageCopy(true);
setSignKey(pos.key);
setSignerObjId(data.signerObjId);
setUniqueId(data.Id)
}}
style={{
color: "#188ae2"
}}
></i>
<i
className="fa-regular fa-circle-xmark signCloseBtn"
onTouchStart={(e) => {
onTouchEnd={(e) => {
e.stopPropagation();
handleDeleteSign(
pos.key,
data.Id
);
// data.signerObjId
}}
onClick={(e) => {
e.stopPropagation();
handleDeleteSign(
pos.key,
Expand All @@ -662,9 +678,9 @@ function RenderPdf({

<div
style={{
fontSize: "12px",
fontSize: "10px",
color: "black",
fontWeight: "600",
fontWeight: "500",
marginTop: "0px"
}}
>
Expand Down Expand Up @@ -772,17 +788,6 @@ function RenderPdf({
}
}}
>
<i
className="fa-regular fa-user signUserIcon"
onClick={(e) => {
e.stopPropagation();
handleLinkUser(data.Id);
setUniqueId(data.Id);
}}
style={{
color: "#188ae2"
}}
></i>
<i
className="fa-regular fa-copy signCopy"
onTouchEnd={(e) => {
Expand Down Expand Up @@ -828,7 +833,7 @@ function RenderPdf({
) : (
<div
style={{
fontSize: "12px",
fontSize: "10px",
color: "black",
justifyContent: "center"
}}
Expand Down Expand Up @@ -1003,7 +1008,7 @@ function RenderPdf({
) : (
<div
style={{
fontSize: "12px",
fontSize: "10px",
color: "black",
fontWeight: "600",
justifyContent: "center",
Expand Down Expand Up @@ -1176,7 +1181,7 @@ function RenderPdf({

<div
style={{
fontSize: "12px",
fontSize: "10px",
color: "black",
justifyContent: "center"
}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ function SignerListPlace({
{handleAddSigner && (
<div data-tut="reactourAddbtn" className="addSignerBtn" onClick={() => handleAddSigner()}>
<i className="fa-solid fa-plus"></i>
<span style={{ marginLeft: 2 }}>Add</span>
<span style={{ marginLeft: 2 }}>Add role</span>
</div>
)}
</div>
Expand Down
4 changes: 4 additions & 0 deletions microfrontends/SignDocuments/src/Component/placeHolderSign.js
Original file line number Diff line number Diff line change
Expand Up @@ -912,6 +912,7 @@ function PlaceHolderSign() {
setIsAddUser({ [id]: true });
};
const handleAddUser = (data) => {
if(data && data.objectId){
const signerPtr = {
__type: "Pointer",
className: "contracts_Contactbook",
Expand All @@ -935,6 +936,7 @@ function PlaceHolderSign() {
// console.log("updateSigner ", updateSigner);

setSignersData(updateSigner);
}
};

const closePopup = () => {
Expand Down Expand Up @@ -1206,6 +1208,8 @@ function PlaceHolderSign() {
isMailSend={isMailSend}
setSelectedEmail={setSelectedEmail}
selectedEmail={selectedEmail}
setUniqueId={setUniqueId}
setRoleName={setRoleName}
/>
</div>
) : (
Expand Down
1 change: 1 addition & 0 deletions microfrontends/SignDocuments/src/css/ModalUi.css
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
z-index: 1000;
max-height: 80%;
min-width: 90%;
overflow-y: auto;
}
}
Loading