+
+ {/*

*/}
{loaderData.message != undefined ? `${loaderData.message}` : 'Loading ...'}
diff --git a/src/components/dashboard/SendForSign.tsx b/src/components/dashboard/SendForSign.tsx
index 4606871..fe4a877 100644
--- a/src/components/dashboard/SendForSign.tsx
+++ b/src/components/dashboard/SendForSign.tsx
@@ -110,7 +110,7 @@ const SendForSign: React.FC = ({ showSideBar }) => {
-
handleStartSectionClick(SignTypeEnum.multipleSign)}
className={`
flex items-center justify-center
@@ -128,7 +128,7 @@ const SendForSign: React.FC
= ({ showSideBar }) => {
) : (
)}
-
+
*/}
{/* {showSideBar && (
= ({ showSideBar, setShowSideBar, isMobile
const [showLogoutModal, setShowLogoutModal] = useState(false);
const handleLogoutConfirm = async () => {
- try {
- await axios.post(`${import.meta.env.VITE_BASE_URI}/api/v1/auth/logout`,
- {},
- {
- withCredentials: true,
- headers: { "ngrok-skip-browser-warning": "69420" }
- }
- );
+
+ api.get(`${import.meta.env.VITE_BASE_URI}/api/v1/auth/logout`).then((res) => {
sessionStorage.clear();
+ localStorage.clear();
// Redirect to login or refresh the page after logout
+ // window.location.href = '/login';
+ }).catch((err) => {
+ sessionStorage.clear();
+ localStorage.clear();
window.location.href = '/login';
- } catch (err) {
- console.error('Logout failed:', err);
- }
+ });
+
};
return (
@@ -59,8 +58,8 @@ const SideBar: React.FC
= ({ showSideBar, setShowSideBar, isMobile
= ({ showSideBar, setShowSideBar, isMobile
{/* Menu */}
-
+
SME
@@ -91,13 +90,13 @@ const SideBar: React.FC
= ({ showSideBar, setShowSideBar, isMobile
onClick={() => setShowSideBar(!showSideBar)}
className={`
absolute top-[95%] translate-y-[-60%]
- ${isMobile
- ? (showSideBar ? 'right-2' : 'right-2')
+ ${isMobile
+ ? (showSideBar ? 'right-2' : 'right-2')
: 'right-0 top-[100%] translate-y-[-100%]'
}
bg-[var(--dashBoardBg)] p-1
- ${isMobile
- ? 'rounded-md'
+ ${isMobile
+ ? 'rounded-md'
: (showSideBar ? 'rounded-tl-sm rounded-bl-sm' : 'rounded-tl-sm rounded-bl-sm')
}
cursor-pointer transition-colors
diff --git a/src/components/home/Cards.tsx b/src/components/home/Cards.tsx
index c333c03..11bdd1f 100644
--- a/src/components/home/Cards.tsx
+++ b/src/components/home/Cards.tsx
@@ -10,6 +10,7 @@ import {
FaFilter,
FaCalendarAlt
} from 'react-icons/fa';
+import { useNavigate } from 'react-router-dom';
// Define a type for card data
interface CardData {
@@ -97,7 +98,9 @@ const filters = ['Last 7 Days', 'Last 30 Days', 'Last 6 Months', 'This Year'];
const accounts = ['All Accounts', 'Account 1', 'Account 2', 'Account 3'];
const Cards: React.FC = ({ type = 'dashboard', onOpenModal, onDateRangeChange, cards, isLoading }) => {
+ const navigate = useNavigate();
const [selectedFilter, setSelectedFilter] = useState('Last 7 Days');
+
// const [isLoading, setIsLoading] = useState(true);
// useEffect(() => {
@@ -205,6 +208,7 @@ const Cards: React.FC = ({ type = 'dashboard', onOpenModal, onDateRa
{cards.map((card, index) => (
navigate(card.navigateTo)}
className={`flex items-center justify-between bg-white px-4 py-3.5 transition-all duration-300 cursor-pointer ${index > 0 ? "border-l-1 border-gray-200" : ""}`}
style={{
animationDelay: `${index * 100}ms`,
diff --git a/src/components/home/Home.tsx b/src/components/home/Home.tsx
index d6fc766..75560c4 100644
--- a/src/components/home/Home.tsx
+++ b/src/components/home/Home.tsx
@@ -1,4 +1,4 @@
-import React, { useEffect, useState, useCallback } from 'react';
+import React, { useEffect, useState, useCallback, JSX } from 'react';
import AccountNav from '../accounts/AccountNav';
import Cards from './Cards';
import StartSection from './StartSection';
@@ -18,6 +18,7 @@ interface CardData {
textColor: string;
percentage?: number;
trend?: 'up' | 'down' | 'stable';
+ navigateTo: string;
}
const Home = () => {
@@ -26,38 +27,42 @@ const Home = () => {
{
title: "Action Required",
count: data.actionNeeded || 0,
- icon:
,
- iconBg: "bg-[#F3F9FF]",
+ icon:
,
+ iconBg: "bg-sky-100 border-sky-200",
textColor: "text-sky-600",
gradient: "bg-white",
shadowColor: "shadow-sky-100",
+ navigateTo: "/transactions/action_required"
},
{
title: "Waiting for Response",
count: data.waitingForOthers || 0,
icon:
,
- iconBg: "bg-[#FFF9EB]",
+ iconBg: "bg-yellow-100 border-yellow-200",
textColor: "text-yellow-600",
gradient: "bg-white",
shadowColor: "shadow-yellow-100",
+ navigateTo: "/transactions/waiting_for_response"
},
{
title: "Expiring Soon",
count: data.expiring || 0,
icon:
,
- iconBg: "bg-[#FFF8F8]",
+ iconBg: "bg-red-100 border-red-200",
textColor: "text-red-600",
gradient: "bg-white",
shadowColor: "shadow-red-100",
+ navigateTo: "/transactions/expiring_soon"
},
{
title: "Completed",
count: data.completed || 0,
icon:
,
- iconBg: "bg-[#F1FFEF]",
+ iconBg: "bg-green-100 border-green-200",
textColor: "text-green-600",
gradient: "bg-white",
shadowColor: "shadow-green-100",
+ navigateTo: "/transactions/completed"
},
];
};
diff --git a/src/components/home/StartNow.tsx b/src/components/home/StartNow.tsx
index ad42a55..3c5fd97 100644
--- a/src/components/home/StartNow.tsx
+++ b/src/components/home/StartNow.tsx
@@ -32,7 +32,7 @@ const StartNow = () => {
const subject = filesToUpload[0].name ? filesToUpload[0].name : "Untitled"
- const transactionRes = await api.post(`/api/v1/accounts/${userData.account?.id}/transactions`, { subject });
+ const transactionRes = await api.post(`/api/v1/accounts/${userData.account?.id}/transactions`, { subject: "Sign Document - " + subject });
const transactionId = transactionRes.data.id
const formData = new FormData();
diff --git a/src/components/process/CompletionScreen/TransactionSentSuccess.tsx b/src/components/process/CompletionScreen/TransactionSentSuccess.tsx
index 8b2cc33..99f31be 100644
--- a/src/components/process/CompletionScreen/TransactionSentSuccess.tsx
+++ b/src/components/process/CompletionScreen/TransactionSentSuccess.tsx
@@ -82,7 +82,7 @@ const TransactionSentSuccess = () => {
className="flex items-center text-gray-600 hover:text-[var(--primary)] transition-colors duration-200"
>
{/*
*/}
-

+

{/*
*/}
{/*
diff --git a/src/components/process/processStepOne/DocumentCard.tsx b/src/components/process/processStepOne/DocumentCard.tsx
index ac0d19f..0e9755e 100644
--- a/src/components/process/processStepOne/DocumentCard.tsx
+++ b/src/components/process/processStepOne/DocumentCard.tsx
@@ -40,7 +40,7 @@ const DocumentCard: React.FC = ({ id, name, isCompleted, tran
let lastUpdate = 0;
const delay = 1000;
- const docProgSSE = new EventSource(`http://10.10.1.99:8083/api/v1/progress/${id}`);
+ const docProgSSE = new EventSource(`${import.meta.env.VITE_SSE_URI}/api/v1/progress/${id}`);
docProgSSE.addEventListener('progress', (event) => {
const jsonData = JSON.parse(event.data);
diff --git a/src/components/process/processStepOne/ProcessStepOne.tsx b/src/components/process/processStepOne/ProcessStepOne.tsx
index c61f676..07c5d05 100644
--- a/src/components/process/processStepOne/ProcessStepOne.tsx
+++ b/src/components/process/processStepOne/ProcessStepOne.tsx
@@ -337,7 +337,7 @@ const ProcessStepOne = () => {
(async () => {
try {
await api.put(`/api/v1/accounts/${accountId}/${transactionTemplateToggle}/${transactionId}`, { status: "SENT" })
- if(accountId && transactionId) signSessionRedirect(accountId, transactionId, recipientId);
+ if (accountId && transactionId) signSessionRedirect(accountId, transactionId, recipientId);
dispatch(hideLoader());
} catch (err) {
console.log("Error Transaction Sent", err.message);
@@ -367,7 +367,13 @@ const ProcessStepOne = () => {
const handleClose = () => {
dispatch(resetDocuments())
- navigate('/')
+
+ if (window.location.href.includes("template") || window.location.href.includes("useTemplate")) {
+ navigate('/templates')
+ } else {
+ navigate('/')
+ }
+
}
useEffect(() => {
diff --git a/src/components/process/processStepOne/RecipientCards.tsx b/src/components/process/processStepOne/RecipientCards.tsx
index 5749848..e9e0320 100644
--- a/src/components/process/processStepOne/RecipientCards.tsx
+++ b/src/components/process/processStepOne/RecipientCards.tsx
@@ -160,7 +160,8 @@ const RecipientCards = ({
placeholder={placeholder}
onFocus={() => handleFieldFocus(identifier, fieldName)}
onBlur={(e) => handleFieldBlur(recipient, fieldName, e.target.value)}
- onChange={(e) => handleFieldChange(recipient, fieldName, e.target.value)}
+ // onChange={(e) => handleFieldChange(recipient, fieldName, e.target.value)}
+ onInput={(e) => handleFieldChange(recipient, fieldName, (e.target as HTMLInputElement).value)}
onKeyPress={(e) => {
if (e.key === "Enter") {
e.currentTarget.blur();
@@ -450,10 +451,16 @@ const RecipientCards = ({
{/* Role Name and Permissions Row */}
- {transactionTemplateToggle === TRANSACTION_TEMPLATE_TOGGLE.TEMPLATES &&
-
- {renderEditableField(recipient, "roleName", "Role name")}
-
+ {
+ {transactionTemplateToggle === TRANSACTION_TEMPLATE_TOGGLE.TEMPLATES ?
+
+ {renderEditableField(recipient, "roleName", "Role name")}
+
+ :
+
+ {recipient.roleName}
+
+ }
}
{/* Permissions - Mobile: Below role, Desktop: Right side */}
diff --git a/src/components/process/processStepTwo/DocumentContainer.tsx b/src/components/process/processStepTwo/DocumentContainer.tsx
index d4f372f..5c788f5 100644
--- a/src/components/process/processStepTwo/DocumentContainer.tsx
+++ b/src/components/process/processStepTwo/DocumentContainer.tsx
@@ -191,7 +191,7 @@ const DocumentContainer: React.FC
= ({ transactionSaving
}
}
- updatedData[recipientId] = updateTags
+ updatedData[recipientId] = updateTags.filter((tag, indx) => !tag.isDeleted);
}
const requests = Object.entries(updatedData)
@@ -459,12 +459,6 @@ const DocumentContainer: React.FC = ({ transactionSaving
}
- const handleLazyLoad = (docId: string, pageId: string) => {
- api.get(`http://10.10.1.99:8083/api/v1/${accountId}/transactions/${transactionId}/documents/${docId}/pages/${pageId}`).then(res => {
- console.log(res)
- })
- }
-
return (
<>
{/* Center Doc Container - START */}
diff --git a/src/components/process/processStepTwo/FieldList.tsx b/src/components/process/processStepTwo/FieldList.tsx
index 92f2d37..c3ca6ff 100644
--- a/src/components/process/processStepTwo/FieldList.tsx
+++ b/src/components/process/processStepTwo/FieldList.tsx
@@ -7,6 +7,7 @@ import { FaQuestionCircle } from 'react-icons/fa';
import { TagsProperties, TagsTypes } from '../../../utlity/types';
import { v4 as uuidv4 } from "uuid";
import axios from 'axios';
+import api from '../../../config/api';
const handlePointerDown = (event: React.DragEvent, label: string, recipientId: number, recipientIndx: number, tagsProperties: TagsProperties) => {
const dragElemRect = event.currentTarget.getBoundingClientRect();
@@ -119,8 +120,8 @@ const FieldList: React.FC = ({ color, recipientId, recipientIndx
}
useEffect(() => {
- axios
- .get(`${import.meta.env.VITE_BASE_URI}/api/v1/accounts/${accountId}/tags`, {
+ api
+ .get(`/api/v1/accounts/${accountId}/tags`, {
headers: {
"ngrok-skip-browser-warning": "69420",
}
diff --git a/src/components/process/processStepTwo/NavTwo.tsx b/src/components/process/processStepTwo/NavTwo.tsx
index 03df70b..5718da8 100644
--- a/src/components/process/processStepTwo/NavTwo.tsx
+++ b/src/components/process/processStepTwo/NavTwo.tsx
@@ -149,8 +149,32 @@ const NavTwo: React.FC = ({
const [nav2RecToggle, setNav2RecToggle] = useState(false);
const [nav2DocToggle, setNav2DocToggle] = useState(false);
+
+ const transactionSendValidation = () => {
+
+ const transactionSendValidationObj = {
+ oneSignerIsRequiredError: true
+ }
+
+ // One Signer is required - Validation
+ for (const recipient of selectedRecipients) {
+ if (recipient.type == recipientType.SIGNER || recipient.type == recipientType.INPERSONSIGNER) {
+ transactionSendValidationObj.oneSignerIsRequiredError = false; break
+ };
+ }
+
+ if (!transactionSendValidationObj.oneSignerIsRequiredError) return false;
+ return transactionSendValidationObj;
+ }
+
function handleSend(isSignSend: boolean = false) {
// dispatch(showLoader("Loading ..."));
+
+ const transactionSendValidationObj = transactionSendValidation()
+ if(transactionSendValidationObj.oneSignerIsRequiredError) {
+ return
+ }
+
if (isSend === null) {
setIsSend(false);
}
@@ -181,6 +205,7 @@ const NavTwo: React.FC = ({
}, 1000)
}
+
// const handleSetIsFields = (setTo: boolean) => {
// if (setTo !== undefined && setTo !== isFields) {
// setIsFields(setTo)
diff --git a/src/components/process/processStepTwo/rightSideBar/RightSideBar.tsx b/src/components/process/processStepTwo/rightSideBar/RightSideBar.tsx
index 7430c5c..bd17bd1 100644
--- a/src/components/process/processStepTwo/rightSideBar/RightSideBar.tsx
+++ b/src/components/process/processStepTwo/rightSideBar/RightSideBar.tsx
@@ -83,16 +83,14 @@ export enum DROPDOWNTOGGLE {
}
const defaultStyles: StylesInterface = {
- font: "",
+ font: "sans-serif",
italic: false,
bold: false,
underline: false,
color: "#000000",
- textSize: 0
+ textSize: 14
};
-
-
const RightSideBar: React.FC = (
{
droppedItems,
diff --git a/src/components/setting/Signature/DrawSignatureCanvas.tsx b/src/components/setting/Signature/DrawSignatureCanvas.tsx
index 25b4247..bd5028e 100644
--- a/src/components/setting/Signature/DrawSignatureCanvas.tsx
+++ b/src/components/setting/Signature/DrawSignatureCanvas.tsx
@@ -109,7 +109,7 @@ const DrawSignatureCanvas: React.FC = ({ onSignatureChange, initialSignat
const handleMouseMove = (e: React.MouseEvent, type: "SIGNATURE" | "INITIAL") => {
if (!isDrawing) return;
setIsDrawingType((prev) => {
- return {...prev, signatureDrawn: type === "SIGNATURE" ? true : prev.signatureDrawn, initialDrawn: type === "INITIAL" ? true : prev.initialDrawn }
+ return { ...prev, signatureDrawn: type === "SIGNATURE" ? true : prev.signatureDrawn, initialDrawn: type === "INITIAL" ? true : prev.initialDrawn }
})
const rect = e.currentTarget.getBoundingClientRect();
const point = { x: e.clientX - rect.left, y: e.clientY - rect.top };
@@ -147,7 +147,7 @@ const DrawSignatureCanvas: React.FC = ({ onSignatureChange, initialSignat
const handleMouseUp = () => {
setIsDrawing(false);
-
+
if (currentPath.length === 0 || !activeCanvas) return;
if (activeCanvas === 'full') {
@@ -206,6 +206,8 @@ const DrawSignatureCanvas: React.FC = ({ onSignatureChange, initialSignat
ctx2?.clearRect(0, 0, canvasRef2.current.width, canvasRef2.current.height);
}
+ setIsDrawingType({ signatureDrawn: false, initialDrawn: false })
+
setPaths1([]);
setPaths2([]);
setInitialImage1(null);
@@ -241,11 +243,12 @@ const DrawSignatureCanvas: React.FC = ({ onSignatureChange, initialSignat
{/* Controls */}
-
+
diff --git a/src/components/templates/Templates.tsx b/src/components/templates/Templates.tsx
index c941b81..aac445f 100644
--- a/src/components/templates/Templates.tsx
+++ b/src/components/templates/Templates.tsx
@@ -4,11 +4,13 @@ import { Bounce, toast } from "react-toastify";
import api from "../../config/api";
import { IoMdAdd } from "react-icons/io";
import { useNavigate } from "react-router-dom";
-import { useSelector } from "react-redux";
+import { useDispatch, useSelector } from "react-redux";
import { FaSpinner } from "react-icons/fa";
import LoaderUi from "../../helper/LoaderUi";
import TemplateTable from "./TemplateTable";
+import { resetRecipients } from "../../store/slices/selectedRecipientsSlice";
+import { resetDocuments } from "../../store/slices/documentSlice";
@@ -25,13 +27,14 @@ const Templates = () => {
);
const navigate = useNavigate();
+ const dispatch = useDispatch();
const filters = ["All", "My Templates", "Shared"];
-
-
const handleAddTemplate = async () => {
try {
+ await dispatch(resetRecipients())
+ await dispatch(resetDocuments())
const res = await api.post(`/api/v1/accounts/${activeAccountId}/templates`);
navigate(`/process-step-one/${activeAccountId}/template/${res.data.id}`)
} catch (error) {
diff --git a/src/components/transactions/AuditModal.tsx b/src/components/transactions/AuditModal.tsx
index c29fe16..fb5aa73 100644
--- a/src/components/transactions/AuditModal.tsx
+++ b/src/components/transactions/AuditModal.tsx
@@ -49,7 +49,7 @@ const AuditModal: React.FC
= ({ closeModal }) => {
const getAuditDetails = async () => {
// setLoading(true)
try {
- let res = await api.get(`/api/v1/accounts/${accountId}/transactions/${transactionId}/audit?lang=${userDetails.language || ''}`)
+ let res = await api.get(`/api/v1/accounts/${accountId}/transactions/${transactionId}/audit/events?lang=${userDetails.language || ''}`)
// let res = await api.get(`/api/v1/accounts/${accountId}/transactions/${transactionId}/audit?lang=hi`)
if (res?.status === 200) {
// console.log(res?.data?.events)
diff --git a/src/components/transactions/TransactionView.tsx b/src/components/transactions/TransactionView.tsx
index dbc5004..406c650 100644
--- a/src/components/transactions/TransactionView.tsx
+++ b/src/components/transactions/TransactionView.tsx
@@ -216,7 +216,7 @@ const TransactionView = () => {
{transactionDetails.transaction.status === "SENT" && recipient.email === user.email && recipient.status !== "COMPLETED" && (
diff --git a/src/helper/LoaderUi.tsx b/src/helper/LoaderUi.tsx
index d0f7730..7033217 100644
--- a/src/helper/LoaderUi.tsx
+++ b/src/helper/LoaderUi.tsx
@@ -15,6 +15,7 @@ const LoaderUi = ({ classStyle = '' }: StyleProps) => {
{/* Loader box */}
+ {/*

*/}
Loading...!