diff --git a/src/components/client/SignDocument.tsx b/src/components/client/SignDocument.tsx index 2c3e692..056e112 100644 --- a/src/components/client/SignDocument.tsx +++ b/src/components/client/SignDocument.tsx @@ -626,22 +626,29 @@ const SignDocument = () => { useEffect(() => { const allRequiredFields = droppedItems.filter((item, idx) => { if (!item.required) return false - if ((item.required && item.value && item.type != "SIGNATURE" && item.type != "INITIALS") || - - ( + if (item.type == "SIGNATURE" || item.type == "INITIALS") { + if ( (item.id != null && item.id != undefined && item.id != "") ? ( (`${item.id}`) in signConfObj && signConfObj[`${item.id}`].accepted ) : ( (`${idx}`) in signConfObj && signConfObj[`${idx}`].accepted ) - ) + ) { + return false + } else { + return true + } + } + if (!("value" in item)) { + return true + } else if (item.value === null || item.value === undefined || item.value === "") { + return true + } - - ) return false - return true + return false; }) const totalRequiredFields = droppedItems.reduce((acc, obj) => { @@ -1043,7 +1050,9 @@ const SignDocument = () => { doc.pages && doc.pages.length > 0 && doc.pages.map((page, indx) => { const key = `${doc.documentId}_${page.index}`; // const tagJsonData = [...droppedItems]; - const currDocTags = droppedItems.filter((val) => val.pageIndex == page.index) + const currDocTags = droppedItems + .map((val, index) => ({ ...val, originalIndex: index })) // add original index + .filter(val => val.pageIndex === page.index); let scale: { x: number | null, y: number | null } = { x: null, y: null } return (
{
+ onChange={(e) => {
const val = e.currentTarget.textContent;
- handleTagUpdate(index, val as string);
+ handleTagUpdate(item.originalIndex, val as string);
}}
onKeyDown={(e) => {
if (e.key == "Enter") e.preventDefault();
@@ -408,7 +409,7 @@ const TagsCon: React.FC {
// const val = e.currentTarget.textContent;
- // handleTagUpdate(index, val as string);
+ // handleTagUpdate(item.originalIndex, val as string);
// }}
onKeyDown={(e) => {
if (e.key == "Enter") e.preventDefault();
@@ -427,7 +428,7 @@ const TagsCon: React.FC = ({
)) ?
= ({
className="outline-none"
onInput={(e) => {
const val = e.currentTarget.value;
- handleTagUpdate(index, val as string);
+ handleTagUpdate(item.originalIndex, val as string);
}}
>
@@ -797,7 +803,7 @@ const TagsCon: React.FC
+
- { - selectedRecipient.firstName.length == 0 && selectedRecipient.lastName.length == 0 ? - (selectedRecipient.email.length == 0 ? selectedRecipient.roleName : selectedRecipient.email) : - `${selectedRecipient.firstName + " " + selectedRecipient.lastName}` - } -
++ { + selectedRecipient.firstName.length == 0 && selectedRecipient.lastName.length == 0 ? + (selectedRecipient.email.length == 0 ? selectedRecipient.roleName : selectedRecipient.email) : + `${selectedRecipient.firstName + " " + selectedRecipient.lastName}` + } +
++ { + recipient.firstName.length == 0 && recipient.lastName.length == 0 ? + (recipient.email.length == 0 ? recipient.roleName : recipient.email) : + `${recipient.firstName + " " + recipient.lastName}` + } +
+- { - recipient.firstName.length == 0 && recipient.lastName.length == 0 ? - (recipient.email.length == 0 ? recipient.roleName : recipient.email) : - `${recipient.firstName + " " + recipient.lastName}` - } -
-- P - A - G - E - S -
-- T - A - G - S -
-