+
+
+
+
{(selectedRecipients.length > 0 && selectedDocuments.length > 0) ?
-
+
{/* Header */}
@@ -342,7 +343,7 @@ const DocumentCompletionScreen = () => {
{/* Signers List */}
-
+
diff --git a/src/components/process/processStepOne/ProcessStepOne.tsx b/src/components/process/processStepOne/ProcessStepOne.tsx
index a6eda9b..4d2b0b0 100644
--- a/src/components/process/processStepOne/ProcessStepOne.tsx
+++ b/src/components/process/processStepOne/ProcessStepOne.tsx
@@ -168,6 +168,7 @@ const ProcessStepOne = () => {
const recipientsData = selectedRecipients.map((recipient, index) => ({
id: "id" in recipient ? recipient.id : null,
routingOrder: "routingOrder" in recipient && recipient.routingOrder ? recipient.routingOrder : 1,
+ provideOwnTags: userData.email === recipient.email ? true : false,
type: recipient.type,
firstName: recipient.firstName,
lastName: recipient.lastName,
@@ -225,18 +226,15 @@ const ProcessStepOne = () => {
}
} else {
- dispatch(addRecipientAsync({ recipientsData: recipientsDataTemp, accountId, transactionId }));
+ await dispatch(addRecipientAsync({ recipientsData: recipientsDataTemp, accountId, transactionId }));
}
dispatch(showLoader("Processing Message..."));
- console.log(`1/api/accounts/${accountId}/${transactionTemplateToggle}/${transactionId}`)
-
let res = await api.put(`/api/accounts/${accountId}/${transactionTemplateToggle}/${transactionId}`, {
subject: emailDtls.subject, message: emailDtls.message,
status: "CREATED"
})
- console.log("Line 158", res.data)
if (isSendNow) {
dispatch(updateTransactionStatus(TRANSACTION_STATUS_ENUMS.TRANSACTION_SEND_SUCCESS));
setTimeout(() => {
diff --git a/src/components/process/processStepTwo/DocumentContainer.tsx b/src/components/process/processStepTwo/DocumentContainer.tsx
index 2284e4d..22f1b3a 100644
--- a/src/components/process/processStepTwo/DocumentContainer.tsx
+++ b/src/components/process/processStepTwo/DocumentContainer.tsx
@@ -20,6 +20,7 @@ import Loader from '../../dashboard/Loader';
// import { TRANSACTION_TEMPLATE_TOGGLE } from "../../../store/slices/selectedRecipientsSlice";
import { handleGroupBorderPosition } from '../../../utlity/tagGroupConUtils';
import { hideLoader, showLoader } from '../../../store/slices/loaderSlice';
+import { IsSendInterface } from './ProcessStepTwo';
export interface DroppedItemsObj {
[key: string]: DroppedItem[]
@@ -65,7 +66,7 @@ const DocumentContainer: React.FC
= ({ isSend }) => {
const selectedRecipients = useSelector((state: RootState) => state.selectedRecipients.recipients);
// const selectedDocuments = useSelector((state: RootState) => state.selectedDocuments.selectedDocuments)
const selectedDocuments = useSelector((state: RootState) => state.documents.documents)
-
+
const [droppedItems, setDroppedItems] = useState({});
@@ -74,9 +75,12 @@ const DocumentContainer: React.FC = ({ isSend }) => {
selectedDocuments.length === 0 && dispatch(fetchDocuments({ accountId, transactionId }));
}, [])
+ console.log(droppedItems, "line 78")
+
// FETCHING TAG - START
useEffect(() => {
if (selectedRecipients.length === 0) return;
+
const fetchTags = async () => {
try {
const requests = selectedRecipients.map((recipient) =>
@@ -176,17 +180,22 @@ const DocumentContainer: React.FC = ({ isSend }) => {
return [recipientId, tags.map(tag => ({ ...tag, update: false }))];
})
)
+
+ console.log(droppedItemsUpdateFalse, "Line 182")
+
setDroppedItems(droppedItemsUpdateFalse);
} catch (error) {
console.error("Error submitting recipient tags:", error);
}
};
- // Save Tags - START
- useEffect(() => {
- if (isSend === null) return;
- dispatch(showLoader("Loading ..."))
+ const handleTransactionProcess = async (save: boolean = false) => {
+ console.log(droppedItems, "called Line 189");
+
+ if (!save && isSend === null) return;
+
+ !save && dispatch(showLoader("Loading ..."))
let updatedTags = { ...droppedItems }
@@ -291,17 +300,37 @@ const DocumentContainer: React.FC = ({ isSend }) => {
tagsData = groupByRecipientId(tagsData);
- sendTagsToRecipients(tagsData, accountId, transactionId);
+ console.log(tagsData, "Line 302");
- (async () => {
- const res = await api.put(`/api/accounts/${accountId}/${transactionTemplateToggle}/${transactionId}`, { status: "SENT" })
- // const res = await api.put(`/api/accounts/${accountId}/transactions/${transactionId}`, { status: "SENT" })
- console.log(res, "Check123")
- dispatch(hideLoader())
- })()
+ await sendTagsToRecipients(tagsData, accountId, transactionId);
+
+
+ // SENDING Transaction - START
+ // if (!save) {
+ // const res = await api.put(`/api/accounts/${accountId}/${transactionTemplateToggle}/${transactionId}`, { status: "SENT" })
+ // // const res = await api.put(`/api/accounts/${accountId}/transactions/${transactionId}`, { status: "SENT" })
+ // console.log(res, "Check123")
+ // dispatch(hideLoader())
+ // }
+
+ // SENDING Transaction - END
+
+ }
+
+ // Save Tags - START
+ useEffect(() => {
+ handleTransactionProcess()
}, [isSend])
// Save Tags - END
+ // useEffect(() => {
+ // setTimeout(() => {
+ // setInterval(async () => {
+ // await handleTransactionProcess(true);
+ // }, 8000)
+ // }, 8000)
+ // }, [])
+
const handleDragOver = (event: React.DragEvent) => {
event.preventDefault(); // Allows the drop event to work
};
@@ -1026,9 +1055,9 @@ const DocumentContainer: React.FC = ({ isSend }) => {
const IconComponent = typeToIconMap[type] || ;
const selectedRecipient = selectedRecipients.filter((obj, indx) => obj.id === item.recipientId);
return (
- <>
+
handleTagClick(key, index)}
@@ -1090,20 +1119,22 @@ const DocumentContainer: React.FC = ({ isSend }) => {
- {
- "group" in item && item.group && "isGroupExist" in item && !item.isGroupExist &&
- <>
-
-
-
-
handleAddGroupItemClicked(key, item)}>
-
-
- >
+ <>
+ {
+ "group" in item && item.group && "isGroupExist" in item && !item.isGroupExist &&
+ <>
+
+
+
+
handleAddGroupItemClicked(key, item)}>
+
+
+ >
- }
+ }
+ >
- >
+
)
}
@@ -1146,7 +1177,11 @@ const DocumentContainer: React.FC = ({ isSend }) => {