diff --git a/src/SigningOrderDiagram .tsx b/src/SigningOrderDiagram .tsx index f04f611..a0839ad 100644 --- a/src/SigningOrderDiagram .tsx +++ b/src/SigningOrderDiagram .tsx @@ -58,15 +58,11 @@ const getInitials = (name: string) => { const SigningOrderDiagram : React.FC = (signers) => { - console.log(signers, "Line 59") - const grouped = groupByRoutingOrder(signers.signers); const sortedOrders = Object.keys(grouped) .map(Number) .sort((a, b) => a - b); - console.log("sortedOrders",sortedOrders,grouped) - const currentProcessingOrder = sortedOrders.find((order) => grouped[order].some((signer) => !signer.completed) diff --git a/src/components/CommonNav.tsx b/src/components/CommonNav.tsx index 794f18f..07e52d2 100644 --- a/src/components/CommonNav.tsx +++ b/src/components/CommonNav.tsx @@ -49,7 +49,6 @@ const CommonNav: React.FC = ({ }) => { const activeAccountId = JSON.parse(sessionStorage.getItem('activeAccountId') || 'null'); const userDetails = JSON.parse(sessionStorage.getItem('userDetails') || '{}'); - console.log("activeAccountId", activeAccountId); const [open, setOpen] = useState(false); const [accountsOpen, setAccountsOpen] = useState(false); @@ -70,12 +69,10 @@ const CommonNav: React.FC = ({ }, }); - console.log("user", user) const getAccountDetails = async () => { try { let res = await api.get('/api/user/accounts'); let items = res?.data; - console.log('items', items); const cleanedData: AccountDataArray[] = items.map((item: any) => ({ userId: item.userId, @@ -109,7 +106,6 @@ const CommonNav: React.FC = ({ }; const handleAccountSwitch = (account: any) => { - console.log("handleAccountSwitch", account); // Update sessionStorage sessionStorage.setItem('activeAccountId', JSON.stringify(account.accountId)); @@ -151,7 +147,7 @@ const CommonNav: React.FC = ({ const getUserDetails = async () => { try { let res = await api.get(`/api/user/details`); - console.log("getuser", res); + const item = res?.data; if (item) { const userData = { @@ -166,8 +162,6 @@ const CommonNav: React.FC = ({ }, }; - console.log("userData", userData) - setUser(userData); sessionStorage.setItem('userDetails', JSON.stringify(userData)); sessionStorage.setItem('activeAccountId', JSON.stringify(userData.account.id)); @@ -175,7 +169,6 @@ const CommonNav: React.FC = ({ // Dispatch event for initial load dispatchSessionStorageChange('activeAccountId', userData.account.id); - console.log("Data is saved in sessionStorage"); } } catch (error) { console.error("Error fetching user details:", error); diff --git a/src/components/accounts/Account.tsx b/src/components/accounts/Account.tsx index 5fca92c..01dbe47 100644 --- a/src/components/accounts/Account.tsx +++ b/src/components/accounts/Account.tsx @@ -108,7 +108,6 @@ const Account = () => { JSON.parse(sessionStorage.getItem('activeAccountId') || 'null') ); - console.log("activeAccountId Trans.", activeAccountId) // const { accountId } = useParams<{ accountId: string }>(); const [transactions, setTransactions] = useState([]); const [accountsData, setAccountsData] = useState([]) diff --git a/src/components/accounts/AccountNav.tsx b/src/components/accounts/AccountNav.tsx index ccfc83b..a9098f0 100644 --- a/src/components/accounts/AccountNav.tsx +++ b/src/components/accounts/AccountNav.tsx @@ -42,7 +42,6 @@ const dispatchSessionStorageChange = (key: string, newValue: any) => { const AccountNav: React.FC = ({ accountName = null, transactionName = null }) => { const activeAccountId = JSON.parse(sessionStorage.getItem('activeAccountId') || 'null'); const userDetails = JSON.parse(sessionStorage.getItem('userDetails') || '{}'); - console.log("activeAccountId", activeAccountId); const [open, setOpen] = useState(false); const [accountsOpen, setAccountsOpen] = useState(false); @@ -63,12 +62,10 @@ const AccountNav: React.FC = ({ accountName = null, transaction }, }); - console.log("user", user) const getAccountDetails = async () => { try { let res = await api.get('/api/user/accounts'); let items = res?.data; - console.log('items', items); const cleanedData: AccountDataArray[] = items.map((item: any) => ({ userId: item.userId, @@ -102,7 +99,6 @@ const AccountNav: React.FC = ({ accountName = null, transaction }; const handleAccountSwitch = (account: any) => { - console.log("handleAccountSwitch", account); // Update sessionStorage sessionStorage.setItem('activeAccountId', JSON.stringify(account.accountId)); @@ -146,7 +142,7 @@ const AccountNav: React.FC = ({ accountName = null, transaction const getUserDetails = async () => { try { let res = await api.get(`/api/user/details`); - console.log("getuser", res); + const item = res?.data; if (item) { const userData = { @@ -161,16 +157,12 @@ const AccountNav: React.FC = ({ accountName = null, transaction }, }; - console.log("userData",userData) - setUser(userData); sessionStorage.setItem('userDetails', JSON.stringify(userData)); sessionStorage.setItem('activeAccountId', JSON.stringify(userData.account.id)); // Dispatch event for initial load dispatchSessionStorageChange('activeAccountId', userData.account.id); - - console.log("Data is saved in sessionStorage"); } diff --git a/src/components/accounts/Accounts.tsx b/src/components/accounts/Accounts.tsx index 89e6da3..3537389 100644 --- a/src/components/accounts/Accounts.tsx +++ b/src/components/accounts/Accounts.tsx @@ -99,7 +99,6 @@ const Accounts = () => { const handleAction = async (accountId: string, action: 'accept' | 'reject') => { try { let response = await api.post(`/api/accounts/${accountId}/accept/invite`) - console.log(response) if (response.data.status === 202) { toast.success("Login Successful", { position: "top-center", diff --git a/src/components/accounts/TransactionDataTable.tsx b/src/components/accounts/TransactionDataTable.tsx index 61471d5..3f8d2af 100644 --- a/src/components/accounts/TransactionDataTable.tsx +++ b/src/components/accounts/TransactionDataTable.tsx @@ -25,7 +25,6 @@ const statusColorMap = { const TransactionDataTable = ({activeAccountId}) => { const navigate = useNavigate() const loaction = useLocation() - console.log("loaction", loaction.pathname); const [currentEmailId, setCurrentEmailId] = useState('null'); const [selectedTransactions, setSelectedTransactions] = useState([]); diff --git a/src/components/auth/LoginForm.tsx b/src/components/auth/LoginForm.tsx index 8ad99b8..733933c 100644 --- a/src/components/auth/LoginForm.tsx +++ b/src/components/auth/LoginForm.tsx @@ -6,7 +6,6 @@ import { Link, useNavigate } from "react-router-dom"; import OAuthGoogle from "./OAuthGoogle"; import { Bounce, toast } from "react-toastify"; // import Cookies from "js-cookie"; -import { updateUser } from "../../store/slices/userSlice"; import { useDispatch } from "react-redux"; import { AppDispatch } from "../../store/store"; // import api from "../../config/api"; @@ -27,18 +26,15 @@ function LoginForm() { const handleNextClick = () => { - console.log('Next Button Clicked'); // Validation Starts if (formData.email === "") { - console.log('All Fields are Required'); return; } // Validate Email Format const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/; if (!emailRegex.test(formData.email)) { - console.log("Invalid email format"); return; } // Validation Ends @@ -47,18 +43,14 @@ function LoginForm() { axios.get(`${import.meta.env.VITE_BASE_URI}/api/auth/user?email=${formData.email}`, { headers: { "ngrok-skip-browser-warning": "69420" } }) .then((res) => { - console.log(res, "Cache Key res", formData.email) - console.log(res.data, "Cache Key res 2", formData.email) if (res.status === 200) { toast.dismiss(); - console.log('User Exists'); setCacheKey(res.data); setNextClick(true); } }) .catch((err) => { - console.log('User Does Not Exists'); toast.dismiss(); toast.error("User Does Not Exists", { position: "top-center", @@ -76,25 +68,20 @@ function LoginForm() { } const handleFormLoginClick = () => { - console.log('Login Function Called Line 7 LoginForm.tsx'); // Validation Starts if (formData.email === "" || formData.password === "") { - console.log('All Fields are Required'); return; } // Validate Email Format const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/; if (!emailRegex.test(formData.email)) { - console.log("Invalid email format"); return; } // Validation Ends // Login API Call - console.log('Login API Call'); - console.log(formData, "Submitting Data :", { cacheKey: cacheKey, password: formData.password }); axios.post(`${import.meta.env.VITE_BASE_URI}/api/auth/login`, { cacheKey: cacheKey, password: formData.password }, { @@ -106,11 +93,9 @@ function LoginForm() { } ) .then((res) => { - console.log(res.status, "Response Status Line 42 LoginForm.tsx", res); if (res.status === 200) { toast.dismiss(); - // console.log('User Logined Successfully Line 45 LoginForm.tsx headerCookie:', res.headers.authorization); // Cookies.set("authorization", res.headers.authorization, { // path: "/", // secure: true, // Required for HTTPS @@ -133,9 +118,7 @@ function LoginForm() { } }) .catch((err) => { - console.log(err, "ERROR") if (err.status === 401) { - console.log('Unauthorized'); toast.dismiss(); toast.error("Credentials Not Match", { position: "top-center", @@ -149,7 +132,6 @@ function LoginForm() { transition: Bounce, }); } else { - console.log('Some Error Occurred'); toast.dismiss(); toast.error("Some Error Occurred", { position: "top-center", @@ -207,7 +189,7 @@ function LoginForm() {

or login with social platforms

- +
diff --git a/src/components/auth/OAuthGoogle.tsx b/src/components/auth/OAuthGoogle.tsx index 9d2de8b..29a4234 100644 --- a/src/components/auth/OAuthGoogle.tsx +++ b/src/components/auth/OAuthGoogle.tsx @@ -19,16 +19,14 @@ interface OAuthGoogleProps { isLogin: boolean } -const OAuthGoogle: React.FC = ({isLogin}) => { +const OAuthGoogle: React.FC = ({ isLogin }) => { const dispatch = useDispatch(); const navigate = useNavigate(); // Define the success handler type (based on the Google login response) const responseMessage = (response: GoogleResponse) => { - console.log(response, "OAuthGoogle .tsx Line 23 Response from Google"); const token = response.credential; - console.log(token, 'token'); axios.get(`${import.meta.env.VITE_BASE_URI}/api/oauth2/authorization/google?token=${token}`, { headers: { @@ -38,7 +36,6 @@ const OAuthGoogle: React.FC = ({isLogin}) => { .then((res) => { if (res.status === 200 || res.status === 201) { toast.dismiss(); - console.log('User Logined Successfully Line 45 LoginForm.tsx headerCookie:', res.headers.authorization); dispatch(updateUser({ ...res.data, authorized: true, accessToken: res.headers.authorization })); @@ -52,8 +49,6 @@ const OAuthGoogle: React.FC = ({isLogin}) => { const decoded = jwtDecode(token); - - console.log(decoded, 'decoded'); }; // Define the error handler type (error can be of any type) diff --git a/src/components/auth/RegisterForm.tsx b/src/components/auth/RegisterForm.tsx index 5fca512..6e02a69 100644 --- a/src/components/auth/RegisterForm.tsx +++ b/src/components/auth/RegisterForm.tsx @@ -22,14 +22,12 @@ interface FormDataState { function RegisterForm() { - console.log("RegisterForm Component Rendered"); const [formData, setForm] = useState({ email: "", password: "", confirmPassword: "", firstName: "", lastName: "" }); const dispatch = useDispatch(); const navigate = useNavigate(); const handleFormRegisterClick = () => { - console.log('Register Function Called Line 7 RegisterForm.tsx'); formData.firstName = formData.firstName.trim(); formData.lastName = formData.lastName.trim(); // Validation Starts @@ -48,7 +46,6 @@ function RegisterForm() { // Register API Call - console.log('Register API Call'); console.dir(formData); axios.post(`${import.meta.env.VITE_BASE_URI}/api/auth/signup`, { firstName: formData.firstName, lastName: formData.lastName, email: formData.email, password: formData.password }, { @@ -59,10 +56,8 @@ function RegisterForm() { } }) .then((res) => { - console.log(res.status, "Response Status Line 42 RegisterForm.tsx"); if (res.status === 201) { - console.log(res, "line 58"); toast.dismiss(); // dispatch(updateUser({ ...res.data, authorized: true, accessToken: res.headers.authorization })); // dispatch(updateUser({ ...res.data, authorized: true })); @@ -71,7 +66,6 @@ function RegisterForm() { }) .catch((err) => { if (err.status === 409) { - console.log('User Already Exists'); toast.dismiss(); toast.error("User Already Exists", { position: "top-center", @@ -85,7 +79,6 @@ function RegisterForm() { transition: Bounce, }); } else { - console.log('Some Error Occurred'); toast.dismiss(); toast.error("Some Error Occurred", { position: "top-center", diff --git a/src/components/client/DocumentPages.tsx b/src/components/client/DocumentPages.tsx index 64532e7..6e6c0e5 100644 --- a/src/components/client/DocumentPages.tsx +++ b/src/components/client/DocumentPages.tsx @@ -1,26 +1,34 @@ -import React from 'react' -import { MdKeyboardArrowDown } from 'react-icons/md'; +import React, { useState } from 'react' +import { MdKeyboardArrowDown, MdOutlineNavigateNext } from 'react-icons/md'; +import { DocumentType } from './SignDocument'; +import { GrFormPrevious } from 'react-icons/gr'; interface DocumentPagesInterface { - selectedDocuments: DocumentType[]; + selectedDocuments: DocumentType[] | null; setDropDownTogglePage: React.Dispatch>; dropDownTogglePage: string; } const DocumentPages = ({ selectedDocuments, setDropDownTogglePage, dropDownTogglePage }: DocumentPagesInterface) => { + + const [currentPage, setCurrentPage] = useState(0); + return (
{selectedDocuments && selectedDocuments.length && selectedDocuments.map((document, indx) => { - return ( + return (
setDropDownTogglePage('')} >
(`${(dropDownTogglePage === 'pageDropDown' + indx) ? '' : 'pageDropDown' + indx}`)} + onClick={() => { + setDropDownTogglePage(`${(dropDownTogglePage === 'pageDropDown' + indx) ? '' : 'pageDropDown' + indx}`) + } + } className={`p-2 ${(dropDownTogglePage === 'pageDropDown' + indx) ? "bg-[var(--primary)]" : "bg-slate-200"} flex flex-col justify-center items-center gap-2 rounded`}> { document.pages != undefined && - {document.pages != undefined && document.pages.map((img, indx) => ( - -

{indx + 1}

-
- ))} +
+ {/* Prev Button */} + { + if (currentPage === 0) e.preventDefault(); + else setCurrentPage(currentPage - 1); + }} + > + + + + {/* Page Selector */} + + + + / {document.pages?.length} + + + {/* Next Button */} + { + if (currentPage === document.pages?.length - 1) e.preventDefault(); + else setCurrentPage(currentPage + 1); + }} + > + +
} diff --git a/src/components/client/SignDocument.tsx b/src/components/client/SignDocument.tsx index 9d33213..39850d4 100644 --- a/src/components/client/SignDocument.tsx +++ b/src/components/client/SignDocument.tsx @@ -59,7 +59,7 @@ interface pagesType { height: number; width: number; } -interface DocumentType { +export interface DocumentType { documentId: string; pages: pagesType[]; name: string; @@ -157,7 +157,6 @@ const SignDocument = () => { const [stamp, setStamp] = useState({ open: false, blob: "" }); - console.log(recSignStatus, "recSignStatus") // Handling Date Opacity const [dateValues, setDateValues] = useState<{ [key: string]: string }>({}); @@ -414,7 +413,6 @@ const SignDocument = () => { return; } - console.log(droppedItems, "Line 417") for (const tag of droppedItems) { if ("required" in tag && tag.required && ((tag.type !== "SIGNATURE" && tag.type !== "INITIALS") && (tag.value === undefined || tag.value === null || tag.value === "" || !("value" in tag)))) { handleToastError(`${tag.label} is required`) @@ -442,7 +440,6 @@ const SignDocument = () => { } } - console.log(submitData, "submitData Line 491"); // return; dispatch(showLoader("Signing ...")); @@ -543,7 +540,6 @@ const SignDocument = () => { const handleTagUpdate = (updateIndx: number, updateValue: string) => { - console.log(updateIndx, updateValue, "LINEE636") if (droppedItems && droppedItems.length) { const updatedTag = droppedItems.map((val, indx) => { if (indx === updateIndx) { @@ -611,11 +607,9 @@ const SignDocument = () => { setDroppedItems(updatedItems); } - console.log(droppedItems, "droppedItems Line 652") useEffect(() => { if (droppedItems.length > 0) { - console.log("Dropped Items handlePrefillValues:") handlePrefillValues(); } }, [droppedItems.length]) @@ -943,7 +937,6 @@ const SignDocument = () => { })() }; - console.log(droppedItems, "droppedItems Line 934") // const [showTerms, setShowTerms] = useState(true); @@ -1106,166 +1099,147 @@ const SignDocument = () => { {!hideTags && <> - {currDocTags.map((item, index) => { if (item.pageIndex !== page.index || item.documentId != doc.documentId) return <>; return ( - <> - -
{ - setSelectedTag({ key, index }) - setFocusElement({ ...item, focusElementIndx: index }) - } - } - key={item.id} - // onPointerDown={(e) => handleTagMouseDown(e, key, index)} - className="absolute rounded dropped-item text-sm" - // onClick={() => handleTagClick(key, index)} - style={{ - left: `${item.dimensions.left}px`, - top: `${item.dimensions.top}px`, - width: `${item.dimensions.width}px`, - height: `${item.dimensions.height}px`, - border: `${((!hideTags && focusElement) && !transparentTags && focusElement.documentId === item.documentId && focusElement.focusElementIndx === index) ? '2px dashed #1c398e' : 'none'}`, - // display: `${hideTags ? 'none' : 'block'}` - }} +
{ + setSelectedTag({ key, index }) + setFocusElement({ ...item, focusElementIndx: index }) + } + } + key={index} + // onPointerDown={(e) => handleTagMouseDown(e, key, index)} + className="absolute rounded dropped-item text-sm" + // onClick={() => handleTagClick(key, index)} + style={{ + left: `${item.dimensions.left}px`, + top: `${item.dimensions.top}px`, + width: `${item.dimensions.width}px`, + height: `${item.dimensions.height}px`, + border: `${((!hideTags && focusElement) && !transparentTags && focusElement.documentId === item.documentId && focusElement.focusElementIndx === index) ? '2px dashed #1c398e' : 'none'}`, + // display: `${hideTags ? 'none' : 'block'}` + }} + > + {provideTags && !transparentTags && !hideTags &&
handleTagMouseDown(e, key, index)} + // className="absolute top-[-15px] left-[-15px] w-4 h-4 bg-blue-600 rounded-tr cursor-move z-30" + title="Drag" > - {provideTags && !transparentTags && !hideTags &&
handleTagMouseDown(e, key, index)} - // className="absolute top-[-15px] left-[-15px] w-4 h-4 bg-blue-600 rounded-tr cursor-move z-30" - title="Drag" - > - -
} + +
} - <> - {selectedTag?.key && selectedTag.key === key && selectedTag.index === index && -
-
-

-

- {/*

+ {selectedTag?.key && selectedTag.key === key && selectedTag.index === index && +

+
+

+

+ {/*

{IconComponent}

*/} -

{item.label}

- { - console.log("Handle Remove Tag Called"); +

{item.label}

+ { - e.stopPropagation(); - handleRemoveTag(key, index) - }} className='cursor-pointer' /> -
-
} - + e.stopPropagation(); + handleRemoveTag(key, index) + }} className='cursor-pointer' /> +
+
} + - {/* TEXT FIELD - START */} - { - item.type === "TEXT" && -
+ {/* TEXT FIELD - START */} + { + item.type === "TEXT" && +
- {/* */} - { - !item.multiLine && !item.maskType &&

{ - console.log("Text Input Event Triggered"); - const val = e.currentTarget.textContent; - handleTagUpdate(index, val as string); - }} - onKeyDown={(e) => { - if (e.key === "Enter") e.preventDefault(); - }} - contentEditable={true} - className="outline-none whitespace-nowrap w-full max-h-max" - >{item.value ?? ""}

- } - { - item.multiLine && !item.maskType &&

{ - const val = e.currentTarget.textContent; - handleTagUpdate(index, val as string); - }} - contentEditable={true} - className="w-full outline-none max-h-max" - >{item.value ?? ""}

- } - { - "maskType" in item && "maskCharacter" in item && item.maskType &&

{ - // const val = e.currentTarget.textContent; - // handleTagUpdate(index, val as string); - // }} - onKeyDown={(e) => { - if (e.key === "Enter") e.preventDefault(); - }} - // onFocus={() => { - // }} - onBlur={(e) => { - let val = e.target.textContent; - handleTagUpdate(index, val as string); - if (typeof item.maskType === "string" && typeof val === "string" && item.maskCharacter) { - val = val.replace(/ /g, ""); - e.target.textContent = maskUtils(item.maskType, val, item.maskCharacter) - } - }} - contentEditable={true} - className="outline-none whitespace-nowrap w-full max-h-max" - >

- } -
- } - {/* TEXT FIELD - END */} + { + !item.multiLine && !item.maskType &&

{ + const val = e.currentTarget.textContent; + handleTagUpdate(index, val as string); + }} + onKeyDown={(e) => { + if (e.key === "Enter") e.preventDefault(); + }} + contentEditable={true} + className="outline-none whitespace-nowrap w-full max-h-max" + >{item.value ?? ""}

+ } + { + item.multiLine && !item.maskType &&

{ + const val = e.currentTarget.textContent; + handleTagUpdate(index, val as string); + }} + contentEditable={true} + className="w-full outline-none max-h-max" + >{item.value ?? ""}

+ } + { + "maskType" in item && "maskCharacter" in item && item.maskType &&

{ + // const val = e.currentTarget.textContent; + // handleTagUpdate(index, val as string); + // }} + onKeyDown={(e) => { + if (e.key === "Enter") e.preventDefault(); + }} + // onFocus={() => { + // }} + onBlur={(e) => { + let val = e.target.textContent; + handleTagUpdate(index, val as string); + if (typeof item.maskType === "string" && typeof val === "string" && item.maskCharacter) { + val = val.replace(/ /g, ""); + e.target.textContent = maskUtils(item.maskType, val, item.maskCharacter) + } + }} + contentEditable={true} + className="outline-none whitespace-nowrap w-full max-h-max" + >

+ } +
+ } + {/* TEXT FIELD - END */} - {/* EMAIL FIELD - START */} - { - item.type === "EMAIL" && -
- { -

{ - const val = e.currentTarget.textContent; - handleTagUpdate(index, val as string); - }} - onKeyDown={(e) => { - if (e.key === "Enter") { - const val = e.currentTarget.textContent?.trim() || ""; - const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/; - - if (val && !emailRegex.test(val)) { - alert("Please enter a valid email address"); - handleTagUpdate(index, "" as string) - e.currentTarget.textContent = ""; - e.currentTarget.focus(); // Optional: return focus if invalid - } - e.preventDefault() - }; - }} - - onBlur={(e) => { + {/* EMAIL FIELD - START */} + { + item.type === "EMAIL" && +

+ { +

{ + const val = e.currentTarget.textContent; + handleTagUpdate(index, val as string); + }} + onKeyDown={(e) => { + if (e.key === "Enter") { const val = e.currentTarget.textContent?.trim() || ""; const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/; @@ -1275,366 +1249,379 @@ const SignDocument = () => { e.currentTarget.textContent = ""; e.currentTarget.focus(); // Optional: return focus if invalid } - }} - // contentEditable={true} - className="outline-none whitespace-nowrap w-full max-h-max" - > - {item.value ?? ""} -

- } -
- } - {/* EMAIL FIELD - END */} + e.preventDefault() + }; + }} + + onBlur={(e) => { + const val = e.currentTarget.textContent?.trim() || ""; + const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/; + + if (val && !emailRegex.test(val)) { + alert("Please enter a valid email address"); + handleTagUpdate(index, "" as string) + e.currentTarget.textContent = ""; + e.currentTarget.focus(); // Optional: return focus if invalid + } + }} + // contentEditable={true} + className="outline-none whitespace-nowrap w-full max-h-max" + > + {item.value ?? ""} +

+ } +
+ } + {/* EMAIL FIELD - END */} - {/* NAME FIELD - START */} - { - item.type === "NAME" && -
- { -

{ - const val = e.currentTarget.textContent; - handleTagUpdate(index, val as string); - }} - onKeyDown={(e) => { - if (e.key === "Enter") { - e.preventDefault() - }; - }} - - onBlur={(e) => { - - }} - // contentEditable={true} - className="outline-none whitespace-nowrap w-full max-h-max" - > - {item.value ?? ""} -

- } -
- } - {/* NAME FIELD - END */} - - - {/* NUMBER FIELD - START */} - { - item.type === "NUMBER" && -
- { - { - const val = e.currentTarget.value; - handleTagUpdate(index, val as string); - }} - type="number" - className="outline-none h-full max-w-max" - /> - } -
- } - {/* NUMBER FIELD - END */} - - - - {/* COMPANY FIELD - START */} - { - item.type === "COMPANY" && -
- { -

{ - const val = e.currentTarget.textContent; - handleTagUpdate(index, val as string); - }} - onKeyDown={(e) => { - if (e.key === "Enter") { - e.preventDefault() - }; - }} - - onBlur={(e) => { - - }} - contentEditable={true} - className="outline-none whitespace-nowrap w-full max-h-max" - >

- } -
- } - {/* COMPANY FIELD - END */} - - - {/* CHECKBOX FIELD - START */} - { - item.type === "CHECKBOX" && -
- + { +

-

- } - {/* CHECKBOX FIELD - END */} + onInput={(e) => { + const val = e.currentTarget.textContent; + handleTagUpdate(index, val as string); + }} + onKeyDown={(e) => { + if (e.key === "Enter") { + e.preventDefault() + }; + }} + + onBlur={(e) => { + + }} + // contentEditable={true} + className="outline-none whitespace-nowrap w-full max-h-max" + > + {item.value ?? ""} +

+ } +
+ } + {/* NAME FIELD - END */} - {/* SIGNATURE FIELD - START */} - { - item.type === "SIGNATURE" && -
handleSignClick(index, item.id)} - className={`flex justify-center items-center h-full w-full rounded cursor-pointer ${transparentTags || hideTags ? "pointer-events-none bg-transparent" : "bg-slate-200 shadow-sm border-slate-100 opacity-80"}`} - // style={{ height: item.dimensions.height + "px" }} - > - {/* */} - { - (!transparentTags && !hideTags && !(saved.save && (index in signConfObj && signConfObj[index].accepted))) ? - <> - - - : - - src={`data:image/png;base64,${saved.signature}`} - /> - } -
- } - {/* SIGNATURE FIELD - END */} + {/* NUMBER FIELD - START */} + { + item.type === "NUMBER" && +
+ { + { + const val = e.currentTarget.value; + handleTagUpdate(index, val as string); + }} + type="number" + className="outline-none h-full max-w-max" + /> + } +
+ } + {/* NUMBER FIELD - END */} - {/* INITIALS FIELD - START */} - { - item.type === "INITIALS" && -
handleSignClick(index, item.id)} - className={`flex justify-center items-center h-full w-full rounded cursor-pointer ${transparentTags || hideTags ? "pointer-events-none" : "bg-slate-200 shadow-sm border-slate-100 opacity-80"}`} - // style={{ height: item.dimensions.height + "px" }} - > - {((!transparentTags && !hideTags) && !(saved.save && (index in signConfObj) && signConfObj[index].accepted)) ? - + + {/* COMPANY FIELD - START */} + { + item.type === "COMPANY" && +
+ { +

{ + const val = e.currentTarget.textContent; + handleTagUpdate(index, val as string); + }} + onKeyDown={(e) => { + if (e.key === "Enter") { + e.preventDefault() + }; + }} + + onBlur={(e) => { + + }} + contentEditable={true} + className="outline-none whitespace-nowrap w-full max-h-max" + >

+ } +
+ } + {/* COMPANY FIELD - END */} + + + {/* CHECKBOX FIELD - START */} + { + item.type === "CHECKBOX" && +
+ +
+ } + {/* CHECKBOX FIELD - END */} + + + {/* SIGNATURE FIELD - START */} + { + item.type === "SIGNATURE" && +
handleSignClick(index, item.id)} + className={`flex justify-center items-center h-full w-full rounded cursor-pointer ${transparentTags || hideTags ? "pointer-events-none bg-transparent" : "bg-slate-200 shadow-sm border-slate-100 opacity-80"}`} + // style={{ height: item.dimensions.height + "px" }} + > + {/* */} + { + (!transparentTags && !hideTags && !(saved.save && (index in signConfObj && signConfObj[index].accepted))) ? + <> + + : + src={`data:image/png;base64,${saved.signature}`} /> - } -
- } - {/* INITIALS FIELD - END */} + } +
+ } + {/* SIGNATURE FIELD - END */} - {/* STAMP FIELD - START */} - { - item.type === "STAMP" && -
handleStampClick(index)} - className={`flex justify-center items-center h-full w-full rounded cursor-pointer ${transparentTags || hideTags ? "pointer-events-none" : "bg-slate-200 shadow-sm border-slate-100 opacity-80"}`} - // style={{ height: item.dimensions.height + "px" }} - > - {!transparentTags && !hideTags ? - - : - - } -
- } - {/* STAMP FIELD - END */} - - {/* IMAGE FIELD - START */} - { - item.type === "FILE" && -
handleSignClick(index)} - className={`flex justify-center items-center h-full w-full rounded cursor-pointer ${transparentTags || hideTags ? "pointer-events-none" : "bg-slate-200 shadow-sm border-slate-100 opacity-80"}`} - // style={{ height: item.dimensions.height + "px" }} - > - {!transparentTags && !hideTags ? - - : - - } -
- } - {/* IMAGE FIELD - END */} - - - {/* SELECT FIELD - START */} - { - item.type === "SELECT" && -
- -
- } - {/* SELECT FIELD - END */} - - - - - {/* TEMPORAL FIELD - START */} - - { - item.type === "TEMPORAL" && -
-

- {(item.id && item.id in dateValues) ? dateValues[item.id] : item.value ? item.value : item.dateFormat?.toLowerCase()} -

- { - e.target.showPicker?.() - if (item.id) setIsDateOpen(item.id) - }} - onBlur={(e) => { - let val = e.target.value; - - // Adding dummy time in case of time as it giving Invalid date without that - if (item.dateFormat?.toLowerCase() === "time") val = "09/02/2025 " + val - - if (!item.id) return; - setIsDateOpen(null); - setDateValues({ - ...dateValues, - [item.id as string]: dayjs(val).format(item.format) - }) - }} - onInput={(e) => { - const val = e.currentTarget.value; - handleTagUpdate(index, val as string); - }} - style={{ opacity: `${item.id === isDateOpen ? "100" : "0"}` }} - className="w-full px-2 outline-none absolute" - onClick={() => { - - }} - type={`${item.dateFormat?.toLowerCase() === "date" ? "date" : (item.dateFormat?.toLowerCase() === "time" ? "time" : "datetime-local")}`} + className="w-[100%] h-full" + // src={saved.initial as string} + src={`data:image/png;base64,${saved.initial}`} /> - -
- } - - {/* TEMPORAL FIELD - END */} + } +
+ } + {/* INITIALS FIELD - END */} - {/* Attachment Field - START */} - { - item.type.toLowerCase() === TagsTypes.ATTACHMENT && -
handleStampClick(index)} - className={`flex justify-center items-center h-full w-full rounded cursor-pointer ${transparentTags || hideTags ? "pointer-events-none" : "bg-slate-200 shadow-sm border-slate-100 opacity-80"}`} - // style={{ height: item.dimensions.height + "px" }} + {/* STAMP FIELD - START */} + { + item.type === "STAMP" && +
handleStampClick(index)} + className={`flex justify-center items-center h-full w-full rounded cursor-pointer ${transparentTags || hideTags ? "pointer-events-none" : "bg-slate-200 shadow-sm border-slate-100 opacity-80"}`} + // style={{ height: item.dimensions.height + "px" }} + > + {!transparentTags && !hideTags ? + + : + + } +
+ } + {/* STAMP FIELD - END */} + + {/* IMAGE FIELD - START */} + { + item.type === "FILE" && +
handleSignClick(index)} + className={`flex justify-center items-center h-full w-full rounded cursor-pointer ${transparentTags || hideTags ? "pointer-events-none" : "bg-slate-200 shadow-sm border-slate-100 opacity-80"}`} + // style={{ height: item.dimensions.height + "px" }} + > + {!transparentTags && !hideTags ? + + : + + } +
+ } + {/* IMAGE FIELD - END */} + + + {/* SELECT FIELD - START */} + { + item.type === "SELECT" && +
+ +
+ } + {/* SELECT FIELD - END */} - {/* Focus Show Element */} - { - (!transparentTags && !hideTags) && (focusElement && focusElement.documentId === item.documentId && focusElement.focusElementIndx === index) && - <> - {/*
+

+ {(item.id && item.id in dateValues) ? dateValues[item.id] : item.value ? item.value : item.dateFormat?.toLowerCase()} +

+ { + e.target.showPicker?.() + if (item.id) setIsDateOpen(item.id) + }} + onBlur={(e) => { + let val = e.target.value; + + // Adding dummy time in case of time as it giving Invalid date without that + if (item.dateFormat?.toLowerCase() === "time") val = "09/02/2025 " + val + + if (!item.id) return; + setIsDateOpen(null); + setDateValues({ + ...dateValues, + [item.id as string]: dayjs(val).format(item.format) + }) + }} + onInput={(e) => { + const val = e.currentTarget.value; + handleTagUpdate(index, val as string); + }} + style={{ opacity: `${item.id === isDateOpen ? "100" : "0"}` }} + className="w-full px-2 outline-none absolute" + onClick={() => { + + }} + type={`${item.dateFormat?.toLowerCase() === "date" ? "date" : (item.dateFormat?.toLowerCase() === "time" ? "time" : "datetime-local")}`} + /> + +
+ } + + {/* TEMPORAL FIELD - END */} + + + {/* Attachment Field - START */} + { + item.type.toLowerCase() === TagsTypes.ATTACHMENT && +
handleStampClick(index)} + className={`flex justify-center items-center h-full w-full rounded cursor-pointer ${transparentTags || hideTags ? "pointer-events-none" : "bg-slate-200 shadow-sm border-slate-100 opacity-80"}`} + // style={{ height: item.dimensions.height + "px" }} + > + {!transparentTags && !hideTags ? + ( +

+ {typeToIconMap.ATTACHMENT} +

+ ) + : + ( +

+ {typeToIconMap.ATTACHMENT} +

+ ) + } +
+ } + {/* Attachment Field - END */} + + + + {/* Focus Show Element */} + { + (!transparentTags && !hideTags) && (focusElement && focusElement.documentId === item.documentId && focusElement.focusElementIndx === index) && + <> + {/*

{focusElement.label}

*/} -
- {/* +
+ {/* */} - -
- - } -
- + +
+ + } +
) }) } @@ -1683,15 +1670,14 @@ const SignDocument = () => {
- {/* */} + dropDownTogglePage={dropDownTogglePage} />} - - {provideTags && selectedTag && selectedTag !== null && "key" in selectedTag && "index" in selectedTag && + {/* {provideTags && selectedTag && selectedTag !== null && "key" in selectedTag && "index" in selectedTag && { selTagKey={selectedTag.key} selTagIndx={selectedTag.index} signClient={true} - />} + />} */} diff --git a/src/components/client/handlePrefill.tsx b/src/components/client/handlePrefill.tsx deleted file mode 100644 index d28823e..0000000 --- a/src/components/client/handlePrefill.tsx +++ /dev/null @@ -1,25 +0,0 @@ -const prefilledTags = ["NAME", "EMAIL", "TEXT", "COMPANY", "TEMPORAL"] - - -const handlePrefillValues = () => { - for(const droppedItem of droppedItems) { - if (prefilledTags.includes(droppedItem.type) && "value" in droppedItem && droppedItem.value.length > 0) { - handleTagUpdate(droppedItem.index, droppedItem.value); - } - } -} - -const handleTagUpdate = (updateIndx: number, updateValue: string) => { - if (droppedItems && droppedItems.length) { - const updatedTag = droppedItems.map((val, indx) => { - if (indx === updateIndx) { - return { - ...val, - value: updateValue - } - } - return val; - }) - setDroppedItems(updatedTag); - } -} diff --git a/src/components/contacts/Contacts.tsx b/src/components/contacts/Contacts.tsx index e1d5d8e..356f14c 100644 --- a/src/components/contacts/Contacts.tsx +++ b/src/components/contacts/Contacts.tsx @@ -25,7 +25,6 @@ const Contacts = () => { const [showModal, setShowModal] = useState(false) const [editJsonData, setEditJsonData] = useState({}) const [actionStatus, setActionStatus] = useState("") - console.log("editJsonData", editJsonData) const fetchContacts = async () => { setLoading(true) @@ -46,7 +45,6 @@ const Contacts = () => { }, [activeAccountId]); const handleEdit = (contactId) => { - console.log('Edit contact:', contactId); let jsonEditData = contacts.find((prev) => prev.id === contactId) setEditJsonData(jsonEditData) setActionStatus("Edit") @@ -55,7 +53,6 @@ const Contacts = () => { }; const handleDelete = async (contactId) => { - console.log('Delete contact:', contactId); try { let res = await api.delete(`/api/accounts/${activeAccountId}/contacts/${contactId}`) diff --git a/src/components/contacts/ContactsFormModal.tsx b/src/components/contacts/ContactsFormModal.tsx index 0e44ffa..05e7c78 100644 --- a/src/components/contacts/ContactsFormModal.tsx +++ b/src/components/contacts/ContactsFormModal.tsx @@ -55,7 +55,6 @@ const ContactFormModal = ({ }, [actionStatus, editJsonData]); const handleChange = (field: keyof ContactData, value: string) => { - console.log(field, value); setFormData((prev) => ({ ...prev, [field]: value })); if (errors[field]) { setErrors((prev) => ({ ...prev, [field]: "" })); @@ -136,7 +135,6 @@ const ContactFormModal = ({ const validationErrors = validate(); let type = "Add"; let payload = formData; - console.log(payload); if (Object.keys(validationErrors).length > 0) { setErrors(validationErrors); diff --git a/src/components/dashboard/Dashboard.tsx b/src/components/dashboard/Dashboard.tsx index 4464eca..d9ccf92 100644 --- a/src/components/dashboard/Dashboard.tsx +++ b/src/components/dashboard/Dashboard.tsx @@ -47,7 +47,7 @@ function Dashboard() { // Clear all if transaction success if (transactionStatus === TRANSACTION_STATUS_ENUMS.TRANSACTION_SEND_SUCCESS || transactionStatus === TRANSACTION_STATUS_ENUMS.TRANSACTION_INITIATED || transactionStatus === TRANSACTION_STATUS_ENUMS.TRANSACTION_SEND_FAILURE) { - console.log("IN MIC CHECK"); + dispatch(resetSelDoc()) dispatch(resetSelRecipient()) dispatch(clearTransaction()) @@ -86,13 +86,11 @@ function Dashboard() { if (documentSignType && transactionStatus === TRANSACTION_STATUS_ENUMS.TRANSACTION_NOT_INITIATED) { if (documentSignType === 'self-sign') { - console.log('Self Sign'); setTimeout(() => { navigate('/process-step-one'); }, 1000) return } else if (documentSignType === 'multiple-sign') { - console.log('multiple-sign'); setTimeout(() => { navigate('/process-step-one'); }, 1000) diff --git a/src/components/dashboard/NavLink.tsx b/src/components/dashboard/NavLink.tsx index 77e033a..3638471 100644 --- a/src/components/dashboard/NavLink.tsx +++ b/src/components/dashboard/NavLink.tsx @@ -25,7 +25,6 @@ const NavLink: React.FC = ({ to, icon, label, showSideBar, menuPat const location = useLocation(); const isActive = menuPathMap[location.pathname] === label; - console.log('Line 26' , to, icon, label, showSideBar, menuPathMap , "Check" , menuPathMap[location.pathname] === label) // const [transactionFilter, setTransationFilter] = useState(TransactionFilterEnum.ALL) diff --git a/src/components/home/Home.tsx b/src/components/home/Home.tsx index 817cfcf..9d960b3 100644 --- a/src/components/home/Home.tsx +++ b/src/components/home/Home.tsx @@ -72,9 +72,6 @@ const Home = () => { const userData = useSelector((state: RootState) => state.user); - console.log("activeAccountId", activeAccountId); - console.log("cards", cards); - const getDashboardData = async () => { if (!activeAccountId) return; @@ -86,7 +83,7 @@ const Home = () => { try { const res = await api.get(`/api/accounts/${userData.account.id}/dashboard`, { params: payload }); setDashboardData(res.data); - console.log("Dashboard Data:", res.data); + const cardDataArray = mapApiDataToCards(res.data); setCards(cardDataArray); } catch (error) { diff --git a/src/components/home/ShowDocs.tsx b/src/components/home/ShowDocs.tsx index 2f38676..9bca9cf 100644 --- a/src/components/home/ShowDocs.tsx +++ b/src/components/home/ShowDocs.tsx @@ -28,13 +28,9 @@ const ShowDocs = () => { ); }; - console.log(selectedDocs, "selectedDocsselectedDocs") - console.log(selectedDocs.length, "LENGTHselectedDocs") - // Handle button click to update Redux state const handleUpdateSelectedDocs = () => { const selectedDocuments = documents.filter((doc) => selectedDocs.includes(doc.id)); - console.log(selectedDocuments, "selected Document Line 34 ShowDocs.tsx") dispatch(updateSelectedDocuments({ documents: selectedDocuments })); }; diff --git a/src/components/home/UploadDoc.tsx b/src/components/home/UploadDoc.tsx index da71933..9eb80c8 100644 --- a/src/components/home/UploadDoc.tsx +++ b/src/components/home/UploadDoc.tsx @@ -37,7 +37,6 @@ const UploadDoc: React.FC = () => { dispatch(uploadDocuments(formData)) .unwrap() .then((res) => { - console.log("Documents uploaded", res); // toast.dismiss(); // toast.info("📄 Documents uploaded!", { // position: "bottom-right", diff --git a/src/components/process/CompletionScreen/DocumentCompletionScreen.tsx b/src/components/process/CompletionScreen/DocumentCompletionScreen.tsx index 496b4e4..f9eeafb 100644 --- a/src/components/process/CompletionScreen/DocumentCompletionScreen.tsx +++ b/src/components/process/CompletionScreen/DocumentCompletionScreen.tsx @@ -201,7 +201,6 @@ const SigningOrderDiagram: React.FC<{ signers: Signer[] }> = ({ signers }) => { const DocumentSubmissionOptions = () => { const location = useLocation(); const [status, setStatus] = useState(null); - console.log("location.pathname", location.pathname, status) const { accountId, transactionId } = useParams<{ accountId: string, transactionId: string }>(); const [showConfetti, setShowConfetti] = React.useState(true) if (!accountId || !transactionId) { @@ -216,7 +215,6 @@ const DocumentSubmissionOptions = () => { const selectedRecipients = useSelector((state: RootState) => state.selectedRecipients.recipients); // const selectedDocuments = useSelector((state: RootState) => state.selectedDocuments.selectedDocuments) const selectedDocuments = useSelector((state: RootState) => state.documents.documents) - console.log('Line 218', selectedDocuments) const [transactionData, setTransactionData] = useState({}) @@ -267,10 +265,6 @@ const DocumentSubmissionOptions = () => { } }, [showConfetti]); - - console.log("History length:", window.history.length); - - // Step 1: Fetch transaction status useEffect(() => { const fetchTransaction = async () => { diff --git a/src/components/process/processStepOne/DocumentCard.tsx b/src/components/process/processStepOne/DocumentCard.tsx index 394eb5f..b79f52c 100644 --- a/src/components/process/processStepOne/DocumentCard.tsx +++ b/src/components/process/processStepOne/DocumentCard.tsx @@ -43,7 +43,6 @@ const DocumentCard: React.FC = ({ id, name, isCompleted , tra docProgSSE.addEventListener('progress', (event) => { const jsonData = JSON.parse(event.data); - console.log(jsonData, "Kaboom"); if (jsonData.isComplete) { isCompleted = true; @@ -87,8 +86,6 @@ const DocumentCard: React.FC = ({ id, name, isCompleted , tra }; }, [id]); - console.log(isCompleted, "line 118") - const radius = 28 const circumference = 2 * Math.PI * radius const offset = circumference - (progress / 100) * circumference @@ -103,7 +100,6 @@ const DocumentCard: React.FC = ({ id, name, isCompleted , tra if (res.status === 202) { dispatch(deleteDocument(docId)); setDocumentDel({ docId: null, isDel: false }); - console.log("Document deleted successfully"); } } diff --git a/src/components/process/processStepOne/ProcessStepOne.tsx b/src/components/process/processStepOne/ProcessStepOne.tsx index 858464e..eba3c0f 100644 --- a/src/components/process/processStepOne/ProcessStepOne.tsx +++ b/src/components/process/processStepOne/ProcessStepOne.tsx @@ -31,7 +31,7 @@ const ProcessStepOne = () => { const templateId = useParams<{ templateId: string }>().templateId; let { accountId, transactionId } = useParams<{ accountId: string, transactionId: string }>(); const [searchParams] = useSearchParams(); - console.log("searchParams", searchParams.get('useTemplate')) + const isTamplate = searchParams.get('useTemplate') const navigate = useNavigate(); @@ -62,7 +62,6 @@ const ProcessStepOne = () => { const [showSelfSignWarnModal, setShowSelfSignWarnModal] = useState(false) const [editRecipientCurrentEmail, setEditRecipientCurrentEmail] = useState('') - console.log() const userData = useSelector((state: RootState) => state.user) // ProcessStepOne.tsx const topRef = useRef(null); @@ -87,8 +86,6 @@ const ProcessStepOne = () => { const [transactionDetails, setTransactionDetails] = useState([]); - console.log("selectedRecipients", selectedRecipients) - useEffect(() => { // <<<<<<< HEAD // Fetching Transaction Details - START @@ -105,9 +102,7 @@ const ProcessStepOne = () => { { subject: res.data.subject ? res.data.subject : "Documents for Signature", message: res.data.message ? res.data.message : "" } ) - // console.log("setTransactionDetails",res.data) } catch (e) { - console.log("Error - transactions details") } })() // Fetching Transaction Details - END @@ -115,13 +110,11 @@ const ProcessStepOne = () => { // ======= // (async () => { // const res = await api.get(`/api/accounts/${accountId}/${transactionTemplateToggle}/${transactionId}`) - // console.log(res.data); // })() // >>>>>>> origin/main // (async () => { // const res = await api.get(`/api/accounts/${accountId}/${transactionTemplateToggle}/${transactionId}`) - // console.log(res.data); // })() selectedRecipients.length === 0 && dispatch(fetchRecipients({ accountId, transactionId })); @@ -172,7 +165,6 @@ const ProcessStepOne = () => { if (SignTypeEnum.selfSign === signType) formError.recipients = false; if (formError.documents || formError.recipients || formError.subject || formError.recipientEmailAndLastName) { - console.log(selectedDocuments, 'line 193') toast.dismiss(); toast.error(`${formError.documents ? "Add Document" : ""} ${(formError.documents && formError.recipients) ? " | " : ""} @@ -486,7 +478,7 @@ const ProcessStepOne = () => { {/* Message */}
- +