Removed consoles

This commit is contained in:
=bhagwanSingh 2025-08-22 18:49:17 +05:30
parent 2e623931e7
commit 645bf0cb8d
47 changed files with 602 additions and 890 deletions

View File

@ -58,15 +58,11 @@ const getInitials = (name: string) => {
const SigningOrderDiagram : React.FC<Signer[]> = (signers) => { const SigningOrderDiagram : React.FC<Signer[]> = (signers) => {
console.log(signers, "Line 59")
const grouped = groupByRoutingOrder(signers.signers); const grouped = groupByRoutingOrder(signers.signers);
const sortedOrders = Object.keys(grouped) const sortedOrders = Object.keys(grouped)
.map(Number) .map(Number)
.sort((a, b) => a - b); .sort((a, b) => a - b);
console.log("sortedOrders",sortedOrders,grouped)
const currentProcessingOrder = const currentProcessingOrder =
sortedOrders.find((order) => sortedOrders.find((order) =>
grouped[order].some((signer) => !signer.completed) grouped[order].some((signer) => !signer.completed)

View File

@ -49,7 +49,6 @@ const CommonNav: React.FC<AccountNavProps> = ({
}) => { }) => {
const activeAccountId = JSON.parse(sessionStorage.getItem('activeAccountId') || 'null'); const activeAccountId = JSON.parse(sessionStorage.getItem('activeAccountId') || 'null');
const userDetails = JSON.parse(sessionStorage.getItem('userDetails') || '{}'); const userDetails = JSON.parse(sessionStorage.getItem('userDetails') || '{}');
console.log("activeAccountId", activeAccountId);
const [open, setOpen] = useState(false); const [open, setOpen] = useState(false);
const [accountsOpen, setAccountsOpen] = useState(false); const [accountsOpen, setAccountsOpen] = useState(false);
@ -70,12 +69,10 @@ const CommonNav: React.FC<AccountNavProps> = ({
}, },
}); });
console.log("user", user)
const getAccountDetails = async () => { const getAccountDetails = async () => {
try { try {
let res = await api.get('/api/user/accounts'); let res = await api.get('/api/user/accounts');
let items = res?.data; let items = res?.data;
console.log('items', items);
const cleanedData: AccountDataArray[] = items.map((item: any) => ({ const cleanedData: AccountDataArray[] = items.map((item: any) => ({
userId: item.userId, userId: item.userId,
@ -109,7 +106,6 @@ const CommonNav: React.FC<AccountNavProps> = ({
}; };
const handleAccountSwitch = (account: any) => { const handleAccountSwitch = (account: any) => {
console.log("handleAccountSwitch", account);
// Update sessionStorage // Update sessionStorage
sessionStorage.setItem('activeAccountId', JSON.stringify(account.accountId)); sessionStorage.setItem('activeAccountId', JSON.stringify(account.accountId));
@ -151,7 +147,7 @@ const CommonNav: React.FC<AccountNavProps> = ({
const getUserDetails = async () => { const getUserDetails = async () => {
try { try {
let res = await api.get(`/api/user/details`); let res = await api.get(`/api/user/details`);
console.log("getuser", res);
const item = res?.data; const item = res?.data;
if (item) { if (item) {
const userData = { const userData = {
@ -166,8 +162,6 @@ const CommonNav: React.FC<AccountNavProps> = ({
}, },
}; };
console.log("userData", userData)
setUser(userData); setUser(userData);
sessionStorage.setItem('userDetails', JSON.stringify(userData)); sessionStorage.setItem('userDetails', JSON.stringify(userData));
sessionStorage.setItem('activeAccountId', JSON.stringify(userData.account.id)); sessionStorage.setItem('activeAccountId', JSON.stringify(userData.account.id));
@ -175,7 +169,6 @@ const CommonNav: React.FC<AccountNavProps> = ({
// Dispatch event for initial load // Dispatch event for initial load
dispatchSessionStorageChange('activeAccountId', userData.account.id); dispatchSessionStorageChange('activeAccountId', userData.account.id);
console.log("Data is saved in sessionStorage");
} }
} catch (error) { } catch (error) {
console.error("Error fetching user details:", error); console.error("Error fetching user details:", error);

View File

@ -108,7 +108,6 @@ const Account = () => {
JSON.parse(sessionStorage.getItem('activeAccountId') || 'null') JSON.parse(sessionStorage.getItem('activeAccountId') || 'null')
); );
console.log("activeAccountId Trans.", activeAccountId)
// const { accountId } = useParams<{ accountId: string }>(); // const { accountId } = useParams<{ accountId: string }>();
const [transactions, setTransactions] = useState<Transaction[]>([]); const [transactions, setTransactions] = useState<Transaction[]>([]);
const [accountsData, setAccountsData] = useState([]) const [accountsData, setAccountsData] = useState([])

View File

@ -42,7 +42,6 @@ const dispatchSessionStorageChange = (key: string, newValue: any) => {
const AccountNav: React.FC<AccountNavProps> = ({ accountName = null, transactionName = null }) => { const AccountNav: React.FC<AccountNavProps> = ({ accountName = null, transactionName = null }) => {
const activeAccountId = JSON.parse(sessionStorage.getItem('activeAccountId') || 'null'); const activeAccountId = JSON.parse(sessionStorage.getItem('activeAccountId') || 'null');
const userDetails = JSON.parse(sessionStorage.getItem('userDetails') || '{}'); const userDetails = JSON.parse(sessionStorage.getItem('userDetails') || '{}');
console.log("activeAccountId", activeAccountId);
const [open, setOpen] = useState(false); const [open, setOpen] = useState(false);
const [accountsOpen, setAccountsOpen] = useState(false); const [accountsOpen, setAccountsOpen] = useState(false);
@ -63,12 +62,10 @@ const AccountNav: React.FC<AccountNavProps> = ({ accountName = null, transaction
}, },
}); });
console.log("user", user)
const getAccountDetails = async () => { const getAccountDetails = async () => {
try { try {
let res = await api.get('/api/user/accounts'); let res = await api.get('/api/user/accounts');
let items = res?.data; let items = res?.data;
console.log('items', items);
const cleanedData: AccountDataArray[] = items.map((item: any) => ({ const cleanedData: AccountDataArray[] = items.map((item: any) => ({
userId: item.userId, userId: item.userId,
@ -102,7 +99,6 @@ const AccountNav: React.FC<AccountNavProps> = ({ accountName = null, transaction
}; };
const handleAccountSwitch = (account: any) => { const handleAccountSwitch = (account: any) => {
console.log("handleAccountSwitch", account);
// Update sessionStorage // Update sessionStorage
sessionStorage.setItem('activeAccountId', JSON.stringify(account.accountId)); sessionStorage.setItem('activeAccountId', JSON.stringify(account.accountId));
@ -146,7 +142,7 @@ const AccountNav: React.FC<AccountNavProps> = ({ accountName = null, transaction
const getUserDetails = async () => { const getUserDetails = async () => {
try { try {
let res = await api.get(`/api/user/details`); let res = await api.get(`/api/user/details`);
console.log("getuser", res);
const item = res?.data; const item = res?.data;
if (item) { if (item) {
const userData = { const userData = {
@ -161,16 +157,12 @@ const AccountNav: React.FC<AccountNavProps> = ({ accountName = null, transaction
}, },
}; };
console.log("userData",userData)
setUser(userData); setUser(userData);
sessionStorage.setItem('userDetails', JSON.stringify(userData)); sessionStorage.setItem('userDetails', JSON.stringify(userData));
sessionStorage.setItem('activeAccountId', JSON.stringify(userData.account.id)); sessionStorage.setItem('activeAccountId', JSON.stringify(userData.account.id));
// Dispatch event for initial load // Dispatch event for initial load
dispatchSessionStorageChange('activeAccountId', userData.account.id); dispatchSessionStorageChange('activeAccountId', userData.account.id);
console.log("Data is saved in sessionStorage");
} }

View File

@ -99,7 +99,6 @@ const Accounts = () => {
const handleAction = async (accountId: string, action: 'accept' | 'reject') => { const handleAction = async (accountId: string, action: 'accept' | 'reject') => {
try { try {
let response = await api.post(`/api/accounts/${accountId}/accept/invite`) let response = await api.post(`/api/accounts/${accountId}/accept/invite`)
console.log(response)
if (response.data.status === 202) { if (response.data.status === 202) {
toast.success("Login Successful", { toast.success("Login Successful", {
position: "top-center", position: "top-center",

View File

@ -25,7 +25,6 @@ const statusColorMap = {
const TransactionDataTable = ({activeAccountId}) => { const TransactionDataTable = ({activeAccountId}) => {
const navigate = useNavigate() const navigate = useNavigate()
const loaction = useLocation() const loaction = useLocation()
console.log("loaction", loaction.pathname);
const [currentEmailId, setCurrentEmailId] = useState<string | null>('null'); const [currentEmailId, setCurrentEmailId] = useState<string | null>('null');
const [selectedTransactions, setSelectedTransactions] = useState<number[]>([]); const [selectedTransactions, setSelectedTransactions] = useState<number[]>([]);

View File

@ -6,7 +6,6 @@ import { Link, useNavigate } from "react-router-dom";
import OAuthGoogle from "./OAuthGoogle"; import OAuthGoogle from "./OAuthGoogle";
import { Bounce, toast } from "react-toastify"; import { Bounce, toast } from "react-toastify";
// import Cookies from "js-cookie"; // import Cookies from "js-cookie";
import { updateUser } from "../../store/slices/userSlice";
import { useDispatch } from "react-redux"; import { useDispatch } from "react-redux";
import { AppDispatch } from "../../store/store"; import { AppDispatch } from "../../store/store";
// import api from "../../config/api"; // import api from "../../config/api";
@ -27,18 +26,15 @@ function LoginForm() {
const handleNextClick = () => { const handleNextClick = () => {
console.log('Next Button Clicked');
// Validation Starts // Validation Starts
if (formData.email === "") { if (formData.email === "") {
console.log('All Fields are Required');
return; return;
} }
// Validate Email Format // Validate Email Format
const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/; const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
if (!emailRegex.test(formData.email)) { if (!emailRegex.test(formData.email)) {
console.log("Invalid email format");
return; return;
} }
// Validation Ends // 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" } }) axios.get(`${import.meta.env.VITE_BASE_URI}/api/auth/user?email=${formData.email}`, { headers: { "ngrok-skip-browser-warning": "69420" } })
.then((res) => { .then((res) => {
console.log(res, "Cache Key res", formData.email)
console.log(res.data, "Cache Key res 2", formData.email)
if (res.status === 200) { if (res.status === 200) {
toast.dismiss(); toast.dismiss();
console.log('User Exists');
setCacheKey(res.data); setCacheKey(res.data);
setNextClick(true); setNextClick(true);
} }
}) })
.catch((err) => { .catch((err) => {
console.log('User Does Not Exists');
toast.dismiss(); toast.dismiss();
toast.error("User Does Not Exists", { toast.error("User Does Not Exists", {
position: "top-center", position: "top-center",
@ -76,25 +68,20 @@ function LoginForm() {
} }
const handleFormLoginClick = () => { const handleFormLoginClick = () => {
console.log('Login Function Called Line 7 LoginForm.tsx');
// Validation Starts // Validation Starts
if (formData.email === "" || formData.password === "") { if (formData.email === "" || formData.password === "") {
console.log('All Fields are Required');
return; return;
} }
// Validate Email Format // Validate Email Format
const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/; const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
if (!emailRegex.test(formData.email)) { if (!emailRegex.test(formData.email)) {
console.log("Invalid email format");
return; return;
} }
// Validation Ends // Validation Ends
// Login API Call // 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`, axios.post(`${import.meta.env.VITE_BASE_URI}/api/auth/login`,
{ cacheKey: cacheKey, password: formData.password }, { cacheKey: cacheKey, password: formData.password },
{ {
@ -106,11 +93,9 @@ function LoginForm() {
} }
) )
.then((res) => { .then((res) => {
console.log(res.status, "Response Status Line 42 LoginForm.tsx", res);
if (res.status === 200) { if (res.status === 200) {
toast.dismiss(); toast.dismiss();
// console.log('User Logined Successfully Line 45 LoginForm.tsx headerCookie:', res.headers.authorization);
// Cookies.set("authorization", res.headers.authorization, { // Cookies.set("authorization", res.headers.authorization, {
// path: "/", // path: "/",
// secure: true, // Required for HTTPS // secure: true, // Required for HTTPS
@ -133,9 +118,7 @@ function LoginForm() {
} }
}) })
.catch((err) => { .catch((err) => {
console.log(err, "ERROR")
if (err.status === 401) { if (err.status === 401) {
console.log('Unauthorized');
toast.dismiss(); toast.dismiss();
toast.error("Credentials Not Match", { toast.error("Credentials Not Match", {
position: "top-center", position: "top-center",
@ -149,7 +132,6 @@ function LoginForm() {
transition: Bounce, transition: Bounce,
}); });
} else { } else {
console.log('Some Error Occurred');
toast.dismiss(); toast.dismiss();
toast.error("Some Error Occurred", { toast.error("Some Error Occurred", {
position: "top-center", position: "top-center",
@ -207,7 +189,7 @@ function LoginForm() {
<p>or login with social platforms</p> <p>or login with social platforms</p>
<div className="social-icons"> <div className="social-icons">
<OAuthGoogle /> <OAuthGoogle isLogin={true} />
</div> </div>
<div> <div>

View File

@ -19,16 +19,14 @@ interface OAuthGoogleProps {
isLogin: boolean isLogin: boolean
} }
const OAuthGoogle: React.FC<OAuthGoogleProps> = ({isLogin}) => { const OAuthGoogle: React.FC<OAuthGoogleProps> = ({ isLogin }) => {
const dispatch = useDispatch<AppDispatch>(); const dispatch = useDispatch<AppDispatch>();
const navigate = useNavigate(); const navigate = useNavigate();
// Define the success handler type (based on the Google login response) // Define the success handler type (based on the Google login response)
const responseMessage = (response: GoogleResponse) => { const responseMessage = (response: GoogleResponse) => {
console.log(response, "OAuthGoogle .tsx Line 23 Response from Google");
const token = response.credential; const token = response.credential;
console.log(token, 'token');
axios.get(`${import.meta.env.VITE_BASE_URI}/api/oauth2/authorization/google?token=${token}`, { axios.get(`${import.meta.env.VITE_BASE_URI}/api/oauth2/authorization/google?token=${token}`, {
headers: { headers: {
@ -38,7 +36,6 @@ const OAuthGoogle: React.FC<OAuthGoogleProps> = ({isLogin}) => {
.then((res) => { .then((res) => {
if (res.status === 200 || res.status === 201) { if (res.status === 200 || res.status === 201) {
toast.dismiss(); 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 })); dispatch(updateUser({ ...res.data, authorized: true, accessToken: res.headers.authorization }));
@ -52,8 +49,6 @@ const OAuthGoogle: React.FC<OAuthGoogleProps> = ({isLogin}) => {
const decoded = jwtDecode(token); const decoded = jwtDecode(token);
console.log(decoded, 'decoded');
}; };
// Define the error handler type (error can be of any type) // Define the error handler type (error can be of any type)

View File

@ -22,14 +22,12 @@ interface FormDataState {
function RegisterForm() { function RegisterForm() {
console.log("RegisterForm Component Rendered");
const [formData, setForm] = useState<FormDataState>({ email: "", password: "", confirmPassword: "", firstName: "", lastName: "" }); const [formData, setForm] = useState<FormDataState>({ email: "", password: "", confirmPassword: "", firstName: "", lastName: "" });
const dispatch = useDispatch<AppDispatch>(); const dispatch = useDispatch<AppDispatch>();
const navigate = useNavigate(); const navigate = useNavigate();
const handleFormRegisterClick = () => { const handleFormRegisterClick = () => {
console.log('Register Function Called Line 7 RegisterForm.tsx');
formData.firstName = formData.firstName.trim(); formData.firstName = formData.firstName.trim();
formData.lastName = formData.lastName.trim(); formData.lastName = formData.lastName.trim();
// Validation Starts // Validation Starts
@ -48,7 +46,6 @@ function RegisterForm() {
// Register API Call // Register API Call
console.log('Register API Call');
console.dir(formData); 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 }, { 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) => { .then((res) => {
console.log(res.status, "Response Status Line 42 RegisterForm.tsx");
if (res.status === 201) { if (res.status === 201) {
console.log(res, "line 58");
toast.dismiss(); toast.dismiss();
// dispatch(updateUser({ ...res.data, authorized: true, accessToken: res.headers.authorization })); // dispatch(updateUser({ ...res.data, authorized: true, accessToken: res.headers.authorization }));
// dispatch(updateUser({ ...res.data, authorized: true })); // dispatch(updateUser({ ...res.data, authorized: true }));
@ -71,7 +66,6 @@ function RegisterForm() {
}) })
.catch((err) => { .catch((err) => {
if (err.status === 409) { if (err.status === 409) {
console.log('User Already Exists');
toast.dismiss(); toast.dismiss();
toast.error("User Already Exists", { toast.error("User Already Exists", {
position: "top-center", position: "top-center",
@ -85,7 +79,6 @@ function RegisterForm() {
transition: Bounce, transition: Bounce,
}); });
} else { } else {
console.log('Some Error Occurred');
toast.dismiss(); toast.dismiss();
toast.error("Some Error Occurred", { toast.error("Some Error Occurred", {
position: "top-center", position: "top-center",

View File

@ -1,13 +1,18 @@
import React from 'react' import React, { useState } from 'react'
import { MdKeyboardArrowDown } from 'react-icons/md'; import { MdKeyboardArrowDown, MdOutlineNavigateNext } from 'react-icons/md';
import { DocumentType } from './SignDocument';
import { GrFormPrevious } from 'react-icons/gr';
interface DocumentPagesInterface { interface DocumentPagesInterface {
selectedDocuments: DocumentType[]; selectedDocuments: DocumentType[] | null;
setDropDownTogglePage: React.Dispatch<React.SetStateAction<string>>; setDropDownTogglePage: React.Dispatch<React.SetStateAction<string>>;
dropDownTogglePage: string; dropDownTogglePage: string;
} }
const DocumentPages = ({ selectedDocuments, setDropDownTogglePage, dropDownTogglePage }: DocumentPagesInterface) => { const DocumentPages = ({ selectedDocuments, setDropDownTogglePage, dropDownTogglePage }: DocumentPagesInterface) => {
const [currentPage, setCurrentPage] = useState(0);
return ( return (
<div className='bg-white h-full p-4 overflow-y-auto'> <div className='bg-white h-full p-4 overflow-y-auto'>
@ -20,7 +25,10 @@ const DocumentPages = ({ selectedDocuments, setDropDownTogglePage, dropDownToggl
// onBlur={() => setDropDownTogglePage('')} // onBlur={() => setDropDownTogglePage('')}
> >
<div <div
onClick={() => (`${(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`}> 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 && <img document.pages != undefined && <img
@ -40,15 +48,53 @@ const DocumentPages = ({ selectedDocuments, setDropDownTogglePage, dropDownToggl
{ {
dropDownTogglePage === 'pageDropDown' + indx && dropDownTogglePage === 'pageDropDown' + indx &&
<div className='my-1 flex justify-center items-center gap-1 flex-wrap'> <div className="my-1 flex justify-center items-center gap-2 flex-wrap">
{document.pages != undefined && document.pages.map((img, indx) => ( {/* Prev Button */}
<a <a
href={"#" + document.documentId + indx} href={"#" + document.documentId + (currentPage - 1)}
className='max-w-max px-4 py-2 shadow cursor-pointer border-1 rounded-sm border-slate-200 hover:border-[var(--primary)] transition-all duration-300 bg-slate-300' className={`cursor-pointer px-2 py-1 shadow rounded-sm text-sm bg-slate-200 hover:border-[var(--primary)] transition-all duration-300 ${currentPage === 0 ? "pointer-events-none opacity-50" : ""
}`}
onClick={(e) => {
if (currentPage === 0) e.preventDefault();
else setCurrentPage(currentPage - 1);
}}
> >
<p className='text-center text-xs text-slate-600'>{indx + 1}</p> <GrFormPrevious />
</a> </a>
{/* Page Selector */}
<select
className="w-[58px] py-1 text-xs text-slate-400 outline-none"
value={currentPage}
onChange={(e) => {
const newPage = Number(e.target.value);
setCurrentPage(newPage);
window.location.hash = document.documentId + "" + newPage;
}}
>
{document.pages != undefined && document.pages.map((_, pageIndex) => (
<option key={pageIndex} value={pageIndex}>
{pageIndex + 1}
</option>
))} ))}
</select>
<span className="text-xs text-slate-600">
/ {document.pages?.length}
</span>
{/* Next Button */}
<a
href={"#" + document.documentId + (currentPage + 1)}
className={`cursor-pointer px-2 py-1 shadow rounded-sm text-sm bg-slate-200 hover:border-[var(--primary)] transition-all duration-300 ${currentPage === document.pages?.length - 1 ? "pointer-events-none opacity-50" : ""
}`}
onClick={(e) => {
if (currentPage === document.pages?.length - 1) e.preventDefault();
else setCurrentPage(currentPage + 1);
}}
>
<MdOutlineNavigateNext />
</a>
</div> </div>
} }

View File

@ -59,7 +59,7 @@ interface pagesType {
height: number; height: number;
width: number; width: number;
} }
interface DocumentType { export interface DocumentType {
documentId: string; documentId: string;
pages: pagesType[]; pages: pagesType[];
name: string; name: string;
@ -157,7 +157,6 @@ const SignDocument = () => {
const [stamp, setStamp] = useState<StampTypeObj>({ open: false, blob: "" }); const [stamp, setStamp] = useState<StampTypeObj>({ open: false, blob: "" });
console.log(recSignStatus, "recSignStatus")
// Handling Date Opacity // Handling Date Opacity
const [dateValues, setDateValues] = useState<{ [key: string]: string }>({}); const [dateValues, setDateValues] = useState<{ [key: string]: string }>({});
@ -414,7 +413,6 @@ const SignDocument = () => {
return; return;
} }
console.log(droppedItems, "Line 417")
for (const tag of droppedItems) { 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)))) { 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`) handleToastError(`${tag.label} is required`)
@ -442,7 +440,6 @@ const SignDocument = () => {
} }
} }
console.log(submitData, "submitData Line 491");
// return; // return;
dispatch(showLoader("Signing ...")); dispatch(showLoader("Signing ..."));
@ -543,7 +540,6 @@ const SignDocument = () => {
const handleTagUpdate = (updateIndx: number, updateValue: string) => { const handleTagUpdate = (updateIndx: number, updateValue: string) => {
console.log(updateIndx, updateValue, "LINEE636")
if (droppedItems && droppedItems.length) { if (droppedItems && droppedItems.length) {
const updatedTag = droppedItems.map((val, indx) => { const updatedTag = droppedItems.map((val, indx) => {
if (indx === updateIndx) { if (indx === updateIndx) {
@ -611,11 +607,9 @@ const SignDocument = () => {
setDroppedItems(updatedItems); setDroppedItems(updatedItems);
} }
console.log(droppedItems, "droppedItems Line 652")
useEffect(() => { useEffect(() => {
if (droppedItems.length > 0) { if (droppedItems.length > 0) {
console.log("Dropped Items handlePrefillValues:")
handlePrefillValues(); handlePrefillValues();
} }
}, [droppedItems.length]) }, [droppedItems.length])
@ -943,7 +937,6 @@ const SignDocument = () => {
})() })()
}; };
console.log(droppedItems, "droppedItems Line 934")
// const [showTerms, setShowTerms] = useState<boolean>(true); // const [showTerms, setShowTerms] = useState<boolean>(true);
@ -1106,12 +1099,9 @@ const SignDocument = () => {
{!hideTags && <> {!hideTags && <>
{currDocTags.map((item, index) => { {currDocTags.map((item, index) => {
if (item.pageIndex !== page.index || item.documentId != doc.documentId) return <></>; if (item.pageIndex !== page.index || item.documentId != doc.documentId) return <></>;
return ( return (
<>
<div <div
tabIndex={1} tabIndex={1}
onFocus={() => { onFocus={() => {
@ -1119,7 +1109,7 @@ const SignDocument = () => {
setFocusElement({ ...item, focusElementIndx: index }) setFocusElement({ ...item, focusElementIndx: index })
} }
} }
key={item.id} key={index}
// onPointerDown={(e) => handleTagMouseDown(e, key, index)} // onPointerDown={(e) => handleTagMouseDown(e, key, index)}
className="absolute rounded dropped-item text-sm" className="absolute rounded dropped-item text-sm"
// onClick={() => handleTagClick(key, index)} // onClick={() => handleTagClick(key, index)}
@ -1155,7 +1145,6 @@ const SignDocument = () => {
</p> */} </p> */}
<p className='capitalize text-ellipsis whitespace-nowrap'>{item.label}</p> <p className='capitalize text-ellipsis whitespace-nowrap'>{item.label}</p>
<IoMdClose onClick={(e) => { <IoMdClose onClick={(e) => {
console.log("Handle Remove Tag Called");
e.stopPropagation(); e.stopPropagation();
handleRemoveTag(key, index) handleRemoveTag(key, index)
@ -1185,7 +1174,6 @@ const SignDocument = () => {
// name={item.id} // name={item.id}
// style={{ height: item.dimensions.height + "px" }} // style={{ height: item.dimensions.height + "px" }}
onBlur={(e) => { onBlur={(e) => {
console.log("Text Input Event Triggered");
const val = e.currentTarget.textContent; const val = e.currentTarget.textContent;
handleTagUpdate(index, val as string); handleTagUpdate(index, val as string);
}} }}
@ -1633,8 +1621,7 @@ const SignDocument = () => {
</div> </div>
</> </>
} }
</div > </div>
</>
) )
}) })
} }
@ -1683,15 +1670,14 @@ const SignDocument = () => {
</div> </div>
<div className={`col-span-2 ${provideTags ? "" : "order-first"} overflow-y-auto`}> <div className={`col-span-2 ${provideTags ? "" : "order-first"} overflow-y-auto`}>
{/* <DocumentPages {selectedDocuments !== null && <DocumentPages
selectedDocuments={selectedDocuments} selectedDocuments={selectedDocuments}
setDropDownTogglePage={setDropDownTogglePage} setDropDownTogglePage={setDropDownTogglePage}
dropDownTogglePage={dropDownTogglePage} /> */} dropDownTogglePage={dropDownTogglePage} />}
{/* {provideTags && selectedTag && selectedTag !== null && "key" in selectedTag && "index" in selectedTag &&
{provideTags && selectedTag && selectedTag !== null && "key" in selectedTag && "index" in selectedTag &&
<RightSideBar <RightSideBar
droppedItems={droppedItems} droppedItems={droppedItems}
selectedTag={droppedItems[selectedTag.index]} selectedTag={droppedItems[selectedTag.index]}
@ -1699,7 +1685,7 @@ const SignDocument = () => {
selTagKey={selectedTag.key} selTagKey={selectedTag.key}
selTagIndx={selectedTag.index} selTagIndx={selectedTag.index}
signClient={true} signClient={true}
/>} />} */}

View File

@ -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);
}
}

View File

@ -25,7 +25,6 @@ const Contacts = () => {
const [showModal, setShowModal] = useState(false) const [showModal, setShowModal] = useState(false)
const [editJsonData, setEditJsonData] = useState({}) const [editJsonData, setEditJsonData] = useState({})
const [actionStatus, setActionStatus] = useState("") const [actionStatus, setActionStatus] = useState("")
console.log("editJsonData", editJsonData)
const fetchContacts = async () => { const fetchContacts = async () => {
setLoading(true) setLoading(true)
@ -46,7 +45,6 @@ const Contacts = () => {
}, [activeAccountId]); }, [activeAccountId]);
const handleEdit = (contactId) => { const handleEdit = (contactId) => {
console.log('Edit contact:', contactId);
let jsonEditData = contacts.find((prev) => prev.id === contactId) let jsonEditData = contacts.find((prev) => prev.id === contactId)
setEditJsonData(jsonEditData) setEditJsonData(jsonEditData)
setActionStatus("Edit") setActionStatus("Edit")
@ -55,7 +53,6 @@ const Contacts = () => {
}; };
const handleDelete = async (contactId) => { const handleDelete = async (contactId) => {
console.log('Delete contact:', contactId);
try { try {
let res = await api.delete(`/api/accounts/${activeAccountId}/contacts/${contactId}`) let res = await api.delete(`/api/accounts/${activeAccountId}/contacts/${contactId}`)

View File

@ -55,7 +55,6 @@ const ContactFormModal = ({
}, [actionStatus, editJsonData]); }, [actionStatus, editJsonData]);
const handleChange = (field: keyof ContactData, value: string) => { const handleChange = (field: keyof ContactData, value: string) => {
console.log(field, value);
setFormData((prev) => ({ ...prev, [field]: value })); setFormData((prev) => ({ ...prev, [field]: value }));
if (errors[field]) { if (errors[field]) {
setErrors((prev) => ({ ...prev, [field]: "" })); setErrors((prev) => ({ ...prev, [field]: "" }));
@ -136,7 +135,6 @@ const ContactFormModal = ({
const validationErrors = validate(); const validationErrors = validate();
let type = "Add"; let type = "Add";
let payload = formData; let payload = formData;
console.log(payload);
if (Object.keys(validationErrors).length > 0) { if (Object.keys(validationErrors).length > 0) {
setErrors(validationErrors); setErrors(validationErrors);

View File

@ -47,7 +47,7 @@ function Dashboard() {
// Clear all if transaction success // 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) { 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(resetSelDoc())
dispatch(resetSelRecipient()) dispatch(resetSelRecipient())
dispatch(clearTransaction()) dispatch(clearTransaction())
@ -86,13 +86,11 @@ function Dashboard() {
if (documentSignType && transactionStatus === TRANSACTION_STATUS_ENUMS.TRANSACTION_NOT_INITIATED) { if (documentSignType && transactionStatus === TRANSACTION_STATUS_ENUMS.TRANSACTION_NOT_INITIATED) {
if (documentSignType === 'self-sign') { if (documentSignType === 'self-sign') {
console.log('Self Sign');
setTimeout(() => { setTimeout(() => {
navigate('/process-step-one'); navigate('/process-step-one');
}, 1000) }, 1000)
return return
} else if (documentSignType === 'multiple-sign') { } else if (documentSignType === 'multiple-sign') {
console.log('multiple-sign');
setTimeout(() => { setTimeout(() => {
navigate('/process-step-one'); navigate('/process-step-one');
}, 1000) }, 1000)

View File

@ -25,7 +25,6 @@ const NavLink: React.FC<NavLinkProps> = ({ to, icon, label, showSideBar, menuPat
const location = useLocation(); const location = useLocation();
const isActive = menuPathMap[location.pathname] === label; 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>(TransactionFilterEnum.ALL) // const [transactionFilter, setTransationFilter] = useState<TransactionFilterEnum>(TransactionFilterEnum.ALL)

View File

@ -72,9 +72,6 @@ const Home = () => {
const userData = useSelector((state: RootState) => state.user); const userData = useSelector((state: RootState) => state.user);
console.log("activeAccountId", activeAccountId);
console.log("cards", cards);
const getDashboardData = async () => { const getDashboardData = async () => {
if (!activeAccountId) return; if (!activeAccountId) return;
@ -86,7 +83,7 @@ const Home = () => {
try { try {
const res = await api.get(`/api/accounts/${userData.account.id}/dashboard`, { params: payload }); const res = await api.get(`/api/accounts/${userData.account.id}/dashboard`, { params: payload });
setDashboardData(res.data); setDashboardData(res.data);
console.log("Dashboard Data:", res.data);
const cardDataArray = mapApiDataToCards(res.data); const cardDataArray = mapApiDataToCards(res.data);
setCards(cardDataArray); setCards(cardDataArray);
} catch (error) { } catch (error) {

View File

@ -28,13 +28,9 @@ const ShowDocs = () => {
); );
}; };
console.log(selectedDocs, "selectedDocsselectedDocs")
console.log(selectedDocs.length, "LENGTHselectedDocs")
// Handle button click to update Redux state // Handle button click to update Redux state
const handleUpdateSelectedDocs = () => { const handleUpdateSelectedDocs = () => {
const selectedDocuments = documents.filter((doc) => selectedDocs.includes(doc.id)); const selectedDocuments = documents.filter((doc) => selectedDocs.includes(doc.id));
console.log(selectedDocuments, "selected Document Line 34 ShowDocs.tsx")
dispatch(updateSelectedDocuments({ documents: selectedDocuments })); dispatch(updateSelectedDocuments({ documents: selectedDocuments }));
}; };

View File

@ -37,7 +37,6 @@ const UploadDoc: React.FC = () => {
dispatch(uploadDocuments(formData)) dispatch(uploadDocuments(formData))
.unwrap() .unwrap()
.then((res) => { .then((res) => {
console.log("Documents uploaded", res);
// toast.dismiss(); // toast.dismiss();
// toast.info("📄 Documents uploaded!", { // toast.info("📄 Documents uploaded!", {
// position: "bottom-right", // position: "bottom-right",

View File

@ -201,7 +201,6 @@ const SigningOrderDiagram: React.FC<{ signers: Signer[] }> = ({ signers }) => {
const DocumentSubmissionOptions = () => { const DocumentSubmissionOptions = () => {
const location = useLocation(); const location = useLocation();
const [status, setStatus] = useState(null); const [status, setStatus] = useState(null);
console.log("location.pathname", location.pathname, status)
const { accountId, transactionId } = useParams<{ accountId: string, transactionId: string }>(); const { accountId, transactionId } = useParams<{ accountId: string, transactionId: string }>();
const [showConfetti, setShowConfetti] = React.useState(true) const [showConfetti, setShowConfetti] = React.useState(true)
if (!accountId || !transactionId) { if (!accountId || !transactionId) {
@ -216,7 +215,6 @@ const DocumentSubmissionOptions = () => {
const selectedRecipients = useSelector((state: RootState) => state.selectedRecipients.recipients); const selectedRecipients = useSelector((state: RootState) => state.selectedRecipients.recipients);
// const selectedDocuments = useSelector((state: RootState) => state.selectedDocuments.selectedDocuments) // const selectedDocuments = useSelector((state: RootState) => state.selectedDocuments.selectedDocuments)
const selectedDocuments = useSelector((state: RootState) => state.documents.documents) const selectedDocuments = useSelector((state: RootState) => state.documents.documents)
console.log('Line 218', selectedDocuments)
const [transactionData, setTransactionData] = useState({}) const [transactionData, setTransactionData] = useState({})
@ -267,10 +265,6 @@ const DocumentSubmissionOptions = () => {
} }
}, [showConfetti]); }, [showConfetti]);
console.log("History length:", window.history.length);
// Step 1: Fetch transaction status // Step 1: Fetch transaction status
useEffect(() => { useEffect(() => {
const fetchTransaction = async () => { const fetchTransaction = async () => {

View File

@ -43,7 +43,6 @@ const DocumentCard: React.FC<DocumentCardProps> = ({ id, name, isCompleted , tra
docProgSSE.addEventListener('progress', (event) => { docProgSSE.addEventListener('progress', (event) => {
const jsonData = JSON.parse(event.data); const jsonData = JSON.parse(event.data);
console.log(jsonData, "Kaboom");
if (jsonData.isComplete) { if (jsonData.isComplete) {
isCompleted = true; isCompleted = true;
@ -87,8 +86,6 @@ const DocumentCard: React.FC<DocumentCardProps> = ({ id, name, isCompleted , tra
}; };
}, [id]); }, [id]);
console.log(isCompleted, "line 118")
const radius = 28 const radius = 28
const circumference = 2 * Math.PI * radius const circumference = 2 * Math.PI * radius
const offset = circumference - (progress / 100) * circumference const offset = circumference - (progress / 100) * circumference
@ -103,7 +100,6 @@ const DocumentCard: React.FC<DocumentCardProps> = ({ id, name, isCompleted , tra
if (res.status === 202) { if (res.status === 202) {
dispatch(deleteDocument(docId)); dispatch(deleteDocument(docId));
setDocumentDel({ docId: null, isDel: false }); setDocumentDel({ docId: null, isDel: false });
console.log("Document deleted successfully");
} }
} }

View File

@ -31,7 +31,7 @@ const ProcessStepOne = () => {
const templateId = useParams<{ templateId: string }>().templateId; const templateId = useParams<{ templateId: string }>().templateId;
let { accountId, transactionId } = useParams<{ accountId: string, transactionId: string }>(); let { accountId, transactionId } = useParams<{ accountId: string, transactionId: string }>();
const [searchParams] = useSearchParams(); const [searchParams] = useSearchParams();
console.log("searchParams", searchParams.get('useTemplate'))
const isTamplate = searchParams.get('useTemplate') const isTamplate = searchParams.get('useTemplate')
const navigate = useNavigate(); const navigate = useNavigate();
@ -62,7 +62,6 @@ const ProcessStepOne = () => {
const [showSelfSignWarnModal, setShowSelfSignWarnModal] = useState(false) const [showSelfSignWarnModal, setShowSelfSignWarnModal] = useState(false)
const [editRecipientCurrentEmail, setEditRecipientCurrentEmail] = useState('') const [editRecipientCurrentEmail, setEditRecipientCurrentEmail] = useState('')
console.log()
const userData = useSelector((state: RootState) => state.user) const userData = useSelector((state: RootState) => state.user)
// ProcessStepOne.tsx // ProcessStepOne.tsx
const topRef = useRef<HTMLDivElement | null>(null); const topRef = useRef<HTMLDivElement | null>(null);
@ -87,8 +86,6 @@ const ProcessStepOne = () => {
const [transactionDetails, setTransactionDetails] = useState<any>([]); const [transactionDetails, setTransactionDetails] = useState<any>([]);
console.log("selectedRecipients", selectedRecipients)
useEffect(() => { useEffect(() => {
// <<<<<<< HEAD // <<<<<<< HEAD
// Fetching Transaction Details - START // 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 : "" } { subject: res.data.subject ? res.data.subject : "Documents for Signature", message: res.data.message ? res.data.message : "" }
) )
// console.log("setTransactionDetails",res.data)
} catch (e) { } catch (e) {
console.log("Error - transactions details")
} }
})() })()
// Fetching Transaction Details - END // Fetching Transaction Details - END
@ -115,13 +110,11 @@ const ProcessStepOne = () => {
// ======= // =======
// (async () => { // (async () => {
// const res = await api.get(`/api/accounts/${accountId}/${transactionTemplateToggle}/${transactionId}`) // const res = await api.get(`/api/accounts/${accountId}/${transactionTemplateToggle}/${transactionId}`)
// console.log(res.data);
// })() // })()
// >>>>>>> origin/main // >>>>>>> origin/main
// (async () => { // (async () => {
// const res = await api.get(`/api/accounts/${accountId}/${transactionTemplateToggle}/${transactionId}`) // const res = await api.get(`/api/accounts/${accountId}/${transactionTemplateToggle}/${transactionId}`)
// console.log(res.data);
// })() // })()
selectedRecipients.length === 0 && dispatch(fetchRecipients({ accountId, transactionId })); selectedRecipients.length === 0 && dispatch(fetchRecipients({ accountId, transactionId }));
@ -172,7 +165,6 @@ const ProcessStepOne = () => {
if (SignTypeEnum.selfSign === signType) formError.recipients = false; if (SignTypeEnum.selfSign === signType) formError.recipients = false;
if (formError.documents || formError.recipients || formError.subject || formError.recipientEmailAndLastName) { if (formError.documents || formError.recipients || formError.subject || formError.recipientEmailAndLastName) {
console.log(selectedDocuments, 'line 193')
toast.dismiss(); toast.dismiss();
toast.error(`${formError.documents ? "Add Document" : ""} toast.error(`${formError.documents ? "Add Document" : ""}
${(formError.documents && formError.recipients) ? " | " : ""} ${(formError.documents && formError.recipients) ? " | " : ""}
@ -486,7 +478,7 @@ const ProcessStepOne = () => {
{/* Message */} {/* Message */}
<div className='flex flex-col'> <div className='flex flex-col'>
<label className='text-sm font-medium text-[var(--greyTextCol)] mb-1'>Message for Signers</label> <label className='text-sm font-medium text-[var(--greyTextCol)] mb-1'>Message</label>
<textarea <textarea
rows={4} rows={4}
value={emailDtls.message} value={emailDtls.message}

View File

@ -32,7 +32,6 @@ const RecipientAddCard = ({ transactionTemplateToggle, editRecipient, editCase,
); );
const recipients = useSelector((state: RootState) => state.selectedRecipients.recipients); const recipients = useSelector((state: RootState) => state.selectedRecipients.recipients);
console.log("recipients.length in AddCase", recipients)
const [contactData, setContactData] = useState<ContactTypeObj>({ type: "", contacts: [] }); const [contactData, setContactData] = useState<ContactTypeObj>({ type: "", contacts: [] });
const [openContactModal, setOpenContactModal] = useState(false); const [openContactModal, setOpenContactModal] = useState(false);
@ -59,10 +58,6 @@ const RecipientAddCard = ({ transactionTemplateToggle, editRecipient, editCase,
type: false, type: false,
}); });
console.log(recipient)
useEffect(() => { useEffect(() => {
if (openContactModal) { if (openContactModal) {
if (topRef?.current) { if (topRef?.current) {
@ -82,9 +77,9 @@ const RecipientAddCard = ({ transactionTemplateToggle, editRecipient, editCase,
(r.email && r.email === editRecipient?.email) (r.email && r.email === editRecipient?.email)
); );
}); });
console.log("Line 83", exists)
if (editCase === "Edit" && editRecipient) { if (editCase === "Edit" && editRecipient) {
console.log("editRecipientAdd", editRecipient)
if (!exists) { if (!exists) {
// Recipient was deleted -> reset // Recipient was deleted -> reset
setEditCase(''); setEditCase('');
@ -296,7 +291,6 @@ const RecipientAddCard = ({ transactionTemplateToggle, editRecipient, editCase,
useDebouncedEffect(() => { useDebouncedEffect(() => {
console.log("useDebouncedEffect")
if (!activeField || !manualFocusTriggered) return; if (!activeField || !manualFocusTriggered) return;
const inputValue = recipient[activeField].trim().toLowerCase(); const inputValue = recipient[activeField].trim().toLowerCase();

View File

@ -6,9 +6,10 @@ import FieldList from './FieldList';
import { addColorsToRecipient, fetchRecipients, recipientType, toggleToTemplates, TRANSACTION_TEMPLATE_TOGGLE } from '../../../store/slices/selectedRecipientsSlice'; import { addColorsToRecipient, fetchRecipients, recipientType, toggleToTemplates, TRANSACTION_TEMPLATE_TOGGLE } from '../../../store/slices/selectedRecipientsSlice';
import { IoCheckmark } from 'react-icons/io5' import { IoCheckmark } from 'react-icons/io5'
import { MdKeyboardArrowDown } from 'react-icons/md' import { MdKeyboardArrowDown, MdOutlineNavigateNext } from 'react-icons/md'
import { useParams } from 'react-router-dom'; import { useParams } from 'react-router-dom';
import { fetchDocuments } from '../../../store/slices/documentSlice'; import { fetchDocuments } from '../../../store/slices/documentSlice';
import { GrFormPrevious } from 'react-icons/gr';
interface LeftSideBarProps { interface LeftSideBarProps {
isFields: boolean; isFields: boolean;
@ -36,6 +37,8 @@ const LeftSideBar: React.FC<LeftSideBarProps> = ({ isFields, selectedRecipientIn
const selectedRecipients = useSelector((state: RootState) => state.selectedRecipients.recipients) const selectedRecipients = useSelector((state: RootState) => state.selectedRecipients.recipients)
const selectedDocuments = useSelector((state: RootState) => state.documents.documents) const selectedDocuments = useSelector((state: RootState) => state.documents.documents)
const [currentPage, setCurrentPage] = useState(0);
useEffect(() => { useEffect(() => {
if (selectedRecipients.length === 0) { if (selectedRecipients.length === 0) {
dispatch(fetchRecipients({ accountId, transactionId })); dispatch(fetchRecipients({ accountId, transactionId }));
@ -166,18 +169,57 @@ const LeftSideBar: React.FC<LeftSideBarProps> = ({ isFields, selectedRecipientIn
{ {
dropDownTogglePage === 'pageDropDown' + indx && dropDownTogglePage === 'pageDropDown' + indx &&
<div className='my-1 flex justify-center items-center gap-1 flex-wrap'> <div className="my-1 flex justify-center items-center gap-2 flex-wrap">
{document.pages != undefined && document.pages.map((img, indx) => ( {/* Prev Button */}
<a <a
href={"#" + document.id + indx} href={"#" + document.id + (currentPage - 1)}
className='max-w-max px-4 py-2 shadow cursor-pointer border-1 rounded-sm border-slate-200 hover:border-[var(--primary)] transition-all duration-300 bg-slate-300' className={`cursor-pointer px-2 py-1 shadow rounded-sm text-sm bg-slate-200 hover:border-[var(--primary)] transition-all duration-300 ${currentPage === 0 ? "pointer-events-none opacity-50" : ""
}`}
onClick={(e) => {
if (currentPage === 0) e.preventDefault();
else setCurrentPage(currentPage - 1);
}}
> >
<p className='text-center text-xs text-slate-600'>{indx + 1}</p> <GrFormPrevious />
</a> </a>
{/* Page Selector */}
<select
className="w-[58px] py-1 text-xs text-slate-400 outline-none"
value={currentPage}
onChange={(e) => {
const newPage = Number(e.target.value);
setCurrentPage(newPage);
window.location.hash = document.id +""+ newPage;
}}
>
{document.pages != undefined && document.pages.map((_, pageIndex) => (
<option key={pageIndex} value={pageIndex}>
{pageIndex + 1}
</option>
))} ))}
</select>
<span className="text-xs text-slate-600">
/ {document.pages?.length}
</span>
{/* Next Button */}
<a
href={"#" + document.id + (currentPage + 1)}
className={`cursor-pointer px-2 py-1 shadow rounded-sm text-sm bg-slate-200 hover:border-[var(--primary)] transition-all duration-300 ${currentPage === document.pages?.length - 1 ? "pointer-events-none opacity-50" : ""
}`}
onClick={(e) => {
if (currentPage === document.pages?.length - 1) e.preventDefault();
else setCurrentPage(currentPage + 1);
}}
>
<MdOutlineNavigateNext />
</a>
</div> </div>
} }
</div> </div>
) )
})} })}

View File

@ -19,8 +19,6 @@ const CommonAttrDropDown: React.FC<CommonAttrDropDownInt> = ({ selectedType, sel
let subType = ""; let subType = "";
let subTypeKey = "" let subTypeKey = ""
console.log(selectedType, selectedTag, "line 20");
switch (selectedTag.type.toLowerCase()) { switch (selectedTag.type.toLowerCase()) {
case "number": case "number":
if (selectedTag.decimalPlace === undefined) { if (selectedTag.decimalPlace === undefined) {
@ -38,7 +36,6 @@ const CommonAttrDropDown: React.FC<CommonAttrDropDownInt> = ({ selectedType, sel
} }
break; break;
case "text": case "text":
console.log("Line 444", selectedTag);
if (selectedTag.multiLine === undefined) { if (selectedTag.multiLine === undefined) {
subType = TEXT.PARAGRAPH subType = TEXT.PARAGRAPH
} else if (selectedTag.multiLine) { } else if (selectedTag.multiLine) {
@ -75,8 +72,6 @@ const CommonAttrDropDown: React.FC<CommonAttrDropDownInt> = ({ selectedType, sel
break; break;
} }
console.log(selectedTag, "line 63");
return ( return (
<div className="flex flex-col"> <div className="flex flex-col">
<label htmlFor="" className="">Type</label> <label htmlFor="" className="">Type</label>
@ -92,9 +87,6 @@ const CommonAttrDropDown: React.FC<CommonAttrDropDownInt> = ({ selectedType, sel
<div className="shadow bg-slate-100 mt-1 border-[1px] border-slate-100 rounded"> <div className="shadow bg-slate-100 mt-1 border-[1px] border-slate-100 rounded">
{Object.keys(selectedType).map((val, indx) => { {Object.keys(selectedType).map((val, indx) => {
console.log(selectedType, val, "Line 90")
let value = val.toLowerCase() as keyof typeof selectedType | number | boolean; let value = val.toLowerCase() as keyof typeof selectedType | number | boolean;
let isCurrency = false; let isCurrency = false;
let isPassword = false; let isPassword = false;
@ -135,8 +127,6 @@ const CommonAttrDropDown: React.FC<CommonAttrDropDownInt> = ({ selectedType, sel
} }
// Handling TEXT - END // Handling TEXT - END
console.log(subTypeKey, subType, value, "line 1223");
return ( return (
<div <div
key={indx} key={indx}
@ -181,7 +171,7 @@ const CommonAttrDropDown: React.FC<CommonAttrDropDownInt> = ({ selectedType, sel
default: default:
format = dateFormats[0].format; format = dateFormats[0].format;
} }
console.log(format, "line 184");
handlePropertyChange("format", format as string); handlePropertyChange("format", format as string);
} }
} else { } else {

View File

@ -116,7 +116,6 @@ const RightSideBar: React.FC<DroppedItemProps> = ({ droppedItems, selectedTag, s
const [styleOpen, setStyleOpen] = useState(false); const [styleOpen, setStyleOpen] = useState(false);
const handlePropertyChange = (changeTo: string, changeWith: string | boolean | number | StylesInterface, is24Hrs = null) => { const handlePropertyChange = (changeTo: string, changeWith: string | boolean | number | StylesInterface, is24Hrs = null) => {
console.log("changeTo", changeTo, "changeWith", changeWith)
if (changeTo === '') return if (changeTo === '') return
// if (changeTo === "subType" && typeof changeWith === "string" && changeWith.toLowerCase() === "password") { // if (changeTo === "subType" && typeof changeWith === "string" && changeWith.toLowerCase() === "password") {
@ -256,7 +255,6 @@ const RightSideBar: React.FC<DroppedItemProps> = ({ droppedItems, selectedTag, s
// }) // })
setDroppedItems((prev) => { setDroppedItems((prev) => {
return (prev.map((item, idx) => { return (prev.map((item, idx) => {
console.log(prev, "Prev lIne 258")
if (idx === selTagIndx) { if (idx === selTagIndx) {
return { ...item, [changeTo]: changeWith, update: true } return { ...item, [changeTo]: changeWith, update: true }
} }
@ -470,11 +468,6 @@ const RightSideBar: React.FC<DroppedItemProps> = ({ droppedItems, selectedTag, s
className: '' className: ''
} }
console.log(selectedType, "line 434");
return ( return (
<> <>
{/* Right Side Bar Start */} {/* Right Side Bar Start */}

View File

@ -52,7 +52,6 @@ const SelectTagAttr: React.FC<SelectTagAttrInt> = ({ options, selTagKey, selTagI
}; };
} }
console.log("New droppedItems state:", newState);
return newState; return newState;
}); });
} }

View File

@ -25,8 +25,6 @@ interface TemporalDateAttrInt {
const TemporalDateAttr: React.FC<TemporalDateAttrInt> = ({ dateFormat, format, selectedTag, dropDownToggle, setDropDownToggle, handlePropertyChange }) => { const TemporalDateAttr: React.FC<TemporalDateAttrInt> = ({ dateFormat, format, selectedTag, dropDownToggle, setDropDownToggle, handlePropertyChange }) => {
console.log(dateFormat, format, "dateFormat Line 26", selectedTag)
let is24HourFormat = true let is24HourFormat = true
if (selectedTag.format && selectedTag.format.split(/hh|mm/).length > 0) { if (selectedTag.format && selectedTag.format.split(/hh|mm/).length > 0) {

View File

@ -4,8 +4,6 @@ import { useParams } from 'react-router-dom'
const PageGuard = () => { const PageGuard = () => {
const allowedPages = ["settings", "contacts"] const allowedPages = ["settings", "contacts"]
console.log("Allowed Pages: ", allowedPages)
const {page1} = useParams<{page1: string}>() const {page1} = useParams<{page1: string}>()
if (page1 && !allowedPages.includes(page1)) { if (page1 && !allowedPages.includes(page1)) {
return <div>Access Denied</div> return <div>Access Denied</div>

View File

@ -43,9 +43,7 @@ interface AccountOption {
const Setting = () => { const Setting = () => {
const { page1 } = useParams<{ page1: string }>(); const { page1 } = useParams<{ page1: string }>();
console.log("page1", page1)
const location = useLocation(); const location = useLocation();
console.log("location", location)
const navigate = useNavigate(); const navigate = useNavigate();
const [activeAccountId, setActiveAccountId] = useState<string | null>( const [activeAccountId, setActiveAccountId] = useState<string | null>(
@ -310,7 +308,6 @@ const Setting = () => {
// Set initial subsection when component mounts or activeTab changes // Set initial subsection when component mounts or activeTab changes
useEffect(() => { useEffect(() => {
const subSections = getSubSections(activeTab); const subSections = getSubSections(activeTab);
console.log("subSections", subSections)
const hash = location.hash.replace('#', ''); const hash = location.hash.replace('#', '');
if (subSections.length > 0) { if (subSections.length > 0) {
@ -345,23 +342,19 @@ const Setting = () => {
let res; let res;
let toastMesaage; let toastMesaage;
if (action === 'create') { if (action === 'create') {
console.log('Creating account:', data);
const payloadAccount = { const payloadAccount = {
name: data.accountName name: data.accountName
} }
res = await api.post(`/api/user/accounts`, payloadAccount) res = await api.post(`/api/user/accounts`, payloadAccount)
console.log("resAccountName", res)
if (res.status === 201) { if (res.status === 201) {
toastMesaage = `${action.toUpperCase()} Created Successfull...!` toastMesaage = `${action.toUpperCase()} Created Successfull...!`
} }
} else if (action === 'invite') { } else if (action === 'invite') {
console.log('Inviting user:', data);
const payloadInvite = { const payloadInvite = {
email: data.email, email: data.email,
role: data.role role: data.role
} }
res = await api.post(`/api/accounts/${data.i_accountName}/invite`, payloadInvite) res = await api.post(`/api/accounts/${data.i_accountName}/invite`, payloadInvite)
console.log("InviteNAme", res)
toastMesaage = "Invite Successfull...!" toastMesaage = "Invite Successfull...!"
} }

View File

@ -55,7 +55,6 @@ const AddSignatureModal: React.FC<AddSignatureModalProps> = ({
getAllSignatures, getAllSignatures,
editingSignature editingSignature
}) => { }) => {
console.log("editingSignature", editingSignature)
const [activeTab, setActiveTab] = useState<'SELECT' | 'DRAW' | 'UPLOAD'>('SELECT'); const [activeTab, setActiveTab] = useState<'SELECT' | 'DRAW' | 'UPLOAD'>('SELECT');
const [fullName, setFullName] = useState(''); const [fullName, setFullName] = useState('');
const [initials, setInitials] = useState(''); const [initials, setInitials] = useState('');
@ -82,8 +81,6 @@ const AddSignatureModal: React.FC<AddSignatureModalProps> = ({
signatureOptions.length > 0 ? { id: signatureOptions[0].id, style: signatureOptions[0].style } : { id: 0, style: "" } signatureOptions.length > 0 ? { id: signatureOptions[0].id, style: signatureOptions[0].style } : { id: 0, style: "" }
); );
console.log("selectedSignature", selectedSignature)
// Store the actual file // Store the actual file
const [file1, setFile1] = useState<File | null>(null); const [file1, setFile1] = useState<File | null>(null);
const [file2, setFile2] = useState<File | null>(null); const [file2, setFile2] = useState<File | null>(null);
@ -119,7 +116,7 @@ const AddSignatureModal: React.FC<AddSignatureModalProps> = ({
useEffect(() => { useEffect(() => {
if (editingSignature) { if (editingSignature) {
setFullName(`${editingSignature.firstName} ${editingSignature.lastName}`); setFullName(`${editingSignature.firstName} ${editingSignature.lastName}`);
setInitials(`${editingSignature.firstName.slice(0, 1)}${editingSignature.lastName.slice(0, 1)}`); setInitials((`${editingSignature.firstName.slice(0, 1)}${editingSignature.lastName.slice(0, 1)}`).toUpperCase());
setActiveTab(editingSignature.signatureType as 'SELECT' | 'DRAW' | 'UPLOAD'); setActiveTab(editingSignature.signatureType as 'SELECT' | 'DRAW' | 'UPLOAD');
// Set font for SELECT tab // Set font for SELECT tab
@ -230,8 +227,6 @@ const AddSignatureModal: React.FC<AddSignatureModalProps> = ({
payload.initialsBase64 = signatures.initials; payload.initialsBase64 = signatures.initials;
} }
console.log("payload214", payload);
let res; let res;
if (isEditMode && editingSignature) { if (isEditMode && editingSignature) {
// Update existing signature // Update existing signature
@ -240,7 +235,6 @@ const AddSignatureModal: React.FC<AddSignatureModalProps> = ({
signatureId: editingSignature.id signatureId: editingSignature.id
}; };
res = await api.put(`/api/user/signatures`, updatePayload); res = await api.put(`/api/user/signatures`, updatePayload);
console.log("handleUpdate", res);
toast.success("Signature Updated Successfully", { toast.success("Signature Updated Successfully", {
position: "top-center", position: "top-center",
@ -256,7 +250,6 @@ const AddSignatureModal: React.FC<AddSignatureModalProps> = ({
} else { } else {
// Create new signature // Create new signature
res = await api.post(`/api/user/signatures`, payload); res = await api.post(`/api/user/signatures`, payload);
console.log("handleSubmit", res);
toast.success("Signature Created Successfully", { toast.success("Signature Created Successfully", {
position: "top-center", position: "top-center",
@ -451,7 +444,7 @@ const AddSignatureModal: React.FC<AddSignatureModalProps> = ({
const getUserDetails = async () => { const getUserDetails = async () => {
try { try {
let res = await api.get(`/api/user/details`); let res = await api.get(`/api/user/details`);
console.log("getuser", res);
let currUser = res?.data; let currUser = res?.data;
setUser(currUser); setUser(currUser);
@ -564,7 +557,7 @@ const AddSignatureModal: React.FC<AddSignatureModalProps> = ({
> >
{checked && <FiCheck className="text-white text-xs" />} {checked && <FiCheck className="text-white text-xs" />}
</div> </div>
<span>Signature will be used by default</span> <span>Save as default signature</span>
</label> </label>
</div> </div>
@ -686,7 +679,7 @@ const AddSignatureModal: React.FC<AddSignatureModalProps> = ({
> >
{checked && <FiCheck className="text-white text-xs" />} {checked && <FiCheck className="text-white text-xs" />}
</div> </div>
<span>Signature will be used by default</span> <span>Save as default signature</span>
</label> </label>
</div> </div>

View File

@ -43,7 +43,6 @@ const SignatureManager: React.FC = () => {
setLoading(true) setLoading(true)
try { try {
let res = await api.get("/api/user/signatures") let res = await api.get("/api/user/signatures")
console.log("getAllSignatures", res.data)
let signatureData = res?.data let signatureData = res?.data
setSignatures(signatureData) setSignatures(signatureData)
} catch (error) { } catch (error) {
@ -58,9 +57,7 @@ const SignatureManager: React.FC = () => {
}, []) }, [])
const handleEdit = (id: string) => { const handleEdit = (id: string) => {
console.log('Edit signature:', id);
let editSignature = signatures.find((item) => item.id === id); let editSignature = signatures.find((item) => item.id === id);
console.log("editSignature", editSignature);
if (editSignature) { if (editSignature) {
setEditingSignature(editSignature); setEditingSignature(editSignature);
@ -74,7 +71,7 @@ const SignatureManager: React.FC = () => {
setLoading(true) setLoading(true)
try { try {
let res = await api.delete(`/api/user/signatures/${id}`) let res = await api.delete(`/api/user/signatures/${id}`)
console.log(res.data)
toast.success("Signature Delete Successfull", { toast.success("Signature Delete Successfull", {
position: "top-center", position: "top-center",
autoClose: 500, autoClose: 500,
@ -115,8 +112,6 @@ const SignatureManager: React.FC = () => {
const selectedFont = signatureOptions.find(opt => opt.style === font); const selectedFont = signatureOptions.find(opt => opt.style === font);
const fontClass = `${selectedFont?.style || 'print'}`; const fontClass = `${selectedFont?.style || 'print'}`;
console.log("fontClass",fontClass)
if (mode === 'initials') { if (mode === 'initials') {
const initials = `${(firstName?.[0] ?? '')}${(lastName?.[0] ?? '')}`.toUpperCase(); const initials = `${(firstName?.[0] ?? '')}${(lastName?.[0] ?? '')}`.toUpperCase();

View File

@ -87,7 +87,6 @@ const AddSignatureModal: React.FC<AddSignatureModalProps> = ({
signTagId signTagId
}) => { }) => {
console.log("savedModal", recipient)
const [activeTab, setActiveTab] = useState<'TYPED' | 'DRAW' | 'UPLOAD' | 'SAVED'>('TYPED'); const [activeTab, setActiveTab] = useState<'TYPED' | 'DRAW' | 'UPLOAD' | 'SAVED'>('TYPED');
const [fullName, setFullName] = useState(''); const [fullName, setFullName] = useState('');
const [initials, setInitials] = useState(''); const [initials, setInitials] = useState('');
@ -120,8 +119,6 @@ const AddSignatureModal: React.FC<AddSignatureModalProps> = ({
}, },
}); });
console.log("User data", user)
const [selectedSignature, setSelectedSignature] = useState<SelectStyle>( const [selectedSignature, setSelectedSignature] = useState<SelectStyle>(
signatureOptions.length > 0 ? { id: signatureOptions[0].id, style: signatureOptions[0].style } : { id: 0, style: "" } signatureOptions.length > 0 ? { id: signatureOptions[0].id, style: signatureOptions[0].style } : { id: 0, style: "" }
); );
@ -172,7 +169,6 @@ const AddSignatureModal: React.FC<AddSignatureModalProps> = ({
signature: signatureBlob, signature: signatureBlob,
initial: initialsBlob, initial: initialsBlob,
}); });
console.log("saved Called Line 174")
} }
} }
setPreSaveSignatures(preSavedSignatures) setPreSaveSignatures(preSavedSignatures)
@ -223,7 +219,6 @@ const AddSignatureModal: React.FC<AddSignatureModalProps> = ({
const handleSubmit = async () => { const handleSubmit = async () => {
setIsSubmitting(true); setIsSubmitting(true);
console.log("handleSubmit Called")
if (!signatures.fullSignature || !signatures.initials) { if (!signatures.fullSignature || !signatures.initials) {
alert('Please provide both signature and initials'); alert('Please provide both signature and initials');
setIsSubmitting(false); setIsSubmitting(false);
@ -243,7 +238,6 @@ const AddSignatureModal: React.FC<AddSignatureModalProps> = ({
font: selectedSignature.style font: selectedSignature.style
}; };
console.log("payload", payload)
// if (isEditMode && editingSignature) { // if (isEditMode && editingSignature) {
// // Update existing signature // // Update existing signature
// const updatePayload = { // const updatePayload = {
@ -273,7 +267,6 @@ const AddSignatureModal: React.FC<AddSignatureModalProps> = ({
"ngrok-skip-browser-warning": "69420" "ngrok-skip-browser-warning": "69420"
} }
}); });
console.log("handleSubmit", res);
toast.success("Signature Created Successfully", { toast.success("Signature Created Successfully", {
position: "top-center", position: "top-center",
@ -532,7 +525,7 @@ const AddSignatureModal: React.FC<AddSignatureModalProps> = ({
// let currUser = res?.data; // let currUser = res?.data;
setUser(recipient); setUser(recipient);
setFullName(recipient.firstName + " " + recipient.lastName); setFullName(recipient.firstName + " " + recipient.lastName);
setInitials(recipient.firstName.slice(0, 1) + recipient.lastName.slice(0, 1)); setInitials((recipient.firstName.slice(0, 1) + recipient.lastName.slice(0, 1)).toUpperCase());
} catch (error) { } catch (error) {
console.error("Error fetching user details:", error); console.error("Error fetching user details:", error);
} }

View File

@ -13,7 +13,6 @@ interface InitialConProps {
const InitialCon: React.FC<InitialConProps> = ({ openInitial, setOpenInitial, savedInitial, setSavedInitial }) => { const InitialCon: React.FC<InitialConProps> = ({ openInitial, setOpenInitial, savedInitial, setSavedInitial }) => {
const handleSaveInitial = (signatureDataUrl: string) => { const handleSaveInitial = (signatureDataUrl: string) => {
console.log(signatureDataUrl, "savedInitial ------ 123");
setSavedInitial(signatureDataUrl); setSavedInitial(signatureDataUrl);
setOpenInitial(false) setOpenInitial(false)

View File

@ -14,7 +14,6 @@ interface SignatureConProps {
const SignatureCon: React.FC<SignatureConProps> = ({ recipientId, openSign, setOpenSign, savedSignature, setSavedSignature }) => { const SignatureCon: React.FC<SignatureConProps> = ({ recipientId, openSign, setOpenSign, savedSignature, setSavedSignature }) => {
const handleSaveSignature = (signatureDataUrl: string) => { const handleSaveSignature = (signatureDataUrl: string) => {
console.log('Signature saved:', signatureDataUrl);
axios.post(`${import.meta.env.VITE_BASE_URI}/api/sign/signature?recipientId=${recipientId}`, axios.post(`${import.meta.env.VITE_BASE_URI}/api/sign/signature?recipientId=${recipientId}`,
{ {
signature: signatureDataUrl, signature: signatureDataUrl,
@ -23,9 +22,7 @@ const SignatureCon: React.FC<SignatureConProps> = ({ recipientId, openSign, setO
}, },
{ headers: { "ngrok-skip-browser-warning": "69420", } }) { headers: { "ngrok-skip-browser-warning": "69420", } })
.then((res) => { .then((res) => {
console.log(res, "Signature saved response")
if (res.status === 200 || res.status === 201) { if (res.status === 200 || res.status === 201) {
console.log('Signature saved successfully');
setSavedSignature(signatureDataUrl); setSavedSignature(signatureDataUrl);
setOpenSign(false) setOpenSign(false)
} }

View File

@ -9,9 +9,6 @@ interface StampUploadType {
const StampUpload: React.FC<StampUploadType> = ({ stamp, setStamp }) => { const StampUpload: React.FC<StampUploadType> = ({ stamp, setStamp }) => {
console.log(stamp, "stamp upload component");
// const [preview, setStamp] = useState<string | null>(null); // const [preview, setStamp] = useState<string | null>(null);
const fileInputRef = useRef<HTMLInputElement | null>(null); const fileInputRef = useRef<HTMLInputElement | null>(null);
@ -23,7 +20,6 @@ const StampUpload: React.FC<StampUploadType> = ({ stamp, setStamp }) => {
reader.onload = () => { reader.onload = () => {
if (typeof reader.result === 'string') { if (typeof reader.result === 'string') {
console.log(reader.result, "reader result");
setStamp((prev) => { setStamp((prev) => {
return ( return (
{ {

View File

@ -88,7 +88,7 @@ const TemplateTable = () => {
templateId: item.id, templateId: item.id,
}; };
let res = await api.post(`/api/accounts/${activeAccountId}/transactions`, payload) let res = await api.post(`/api/accounts/${activeAccountId}/transactions`, payload)
console.log("handleUseClick", res.data)
// /process-step-one/:accountId/:transactionId // /process-step-one/:accountId/:transactionId
navigate(`/process-step-one/${activeAccountId}/${res?.data?.id}?useTemplate=true`); navigate(`/process-step-one/${activeAccountId}/${res?.data?.id}?useTemplate=true`);
} catch (error) { } catch (error) {
@ -220,7 +220,6 @@ const TemplateTable = () => {
<button <button
onMouseDown={() => { onMouseDown={() => {
setShowMenu(null); setShowMenu(null);
console.log('Delete clicked', item);
}} }}
className="block w-full text-left px-4 py-2 text-sm hover:bg-gray-100 text-red-600" className="block w-full text-left px-4 py-2 text-sm hover:bg-gray-100 text-red-600"
> >

View File

@ -31,7 +31,6 @@ const Templates = () => {
const handleAddTemplate = async () => { const handleAddTemplate = async () => {
console.log("handleAddTemplate called");
try { try {
const res = await api.post(`/api/accounts/${activeAccountId}/templates`); const res = await api.post(`/api/accounts/${activeAccountId}/templates`);
navigate(`/process-step-one/${activeAccountId}/template/${res.data.id}`) navigate(`/process-step-one/${activeAccountId}/template/${res.data.id}`)

View File

@ -149,7 +149,6 @@ const AuditModal: React.FC<AuditModalProps> = ({ closeModal }) => {
'REASSIGNED': <FiUserPlus className="w-4 h-4" />, 'REASSIGNED': <FiUserPlus className="w-4 h-4" />,
'EDITED': <FiEdit className="w-4 h-4" />, 'EDITED': <FiEdit className="w-4 h-4" />,
}; };
console.log("getActionIcons", action || <FiActivity className="w-4 h-4" />)
return icons[action as keyof typeof icons] || <FiActivity className="w-4 h-4" />; return icons[action as keyof typeof icons] || <FiActivity className="w-4 h-4" />;
}; };

View File

@ -77,8 +77,6 @@ const TransactionView = () => {
setIsModalOpen(false); // update state immediately setIsModalOpen(false); // update state immediately
}; };
console.log(transactionDetails, "line 37");
const fetchData = async () => { const fetchData = async () => {
try { try {
const [res1, res2] = await Promise.all([api.get(`/api/accounts/${accountId}/transactions/${transactionId}`), const [res1, res2] = await Promise.all([api.get(`/api/accounts/${accountId}/transactions/${transactionId}`),

View File

@ -43,18 +43,14 @@ const DocView = () => {
function zoom(percentage: number, contentClass: string) { function zoom(percentage: number, contentClass: string) {
console.log("calling zoom function", percentage, contentClass);
const content = document.querySelector(`.${contentClass}`); const content = document.querySelector(`.${contentClass}`);
const scale = percentage // 100; const scale = percentage // 100;
if(content) { if(content) {
console.log("calling zoom function Printing Content", content);
content.style.transform = `scale(${scale})`; content.style.transform = `scale(${scale})`;
} }
} }
useEffect(() => { useEffect(() => {
console.log("Calling useEffect for zoom", fitObj[selFitIndx].value);
let indx = fitObj[selFitIndx].value let indx = fitObj[selFitIndx].value
if (indx === "FIT") { if (indx === "FIT") {
indx = "100"; indx = "100";
@ -62,8 +58,6 @@ const DocView = () => {
zoom(Number(indx), 'zoom-con') zoom(Number(indx), 'zoom-con')
}, [selFitIndx]) }, [selFitIndx])
console.log(isFitDd);
return ( return (
<> <>

View File

@ -19,8 +19,6 @@ export const createAxiosInstance = () => {
const user = JSON.parse(parsedRoot.user); const user = JSON.parse(parsedRoot.user);
const accessToken = user.accessToken; const accessToken = user.accessToken;
console.log(accessToken, "accessToken");
return axios.create({ return axios.create({
baseURL: import.meta.env.VITE_BASE_URI, baseURL: import.meta.env.VITE_BASE_URI,
withCredentials: true, withCredentials: true,

View File

@ -1,166 +1,3 @@
// import { createSlice, createAsyncThunk, PayloadAction } from "@reduxjs/toolkit";
// // import { v4 as uuidv4 } from "uuid";
// import { hideLoader, showLoader } from "./loaderSlice";
// // import { showModal } from "./modalSlice";
// // import { updateSelectedDocuments } from "./selectedDocsSlice";
// import api from "../../config/api";
// import { Bounce, toast } from "react-toastify";
// // import { createAxiosInstance } from "../../config/axiosInstance";
// // const axiosInstance = createAxiosInstance();
// export interface Document {
// id: string;
// name: string;
// extension: string;
// original?: boolean;
// corrupted?: boolean;
// isCompleted: boolean;
// status: string;
// }
// export interface DocumentState {
// documents: Document[];
// loading: boolean;
// error: string | null;
// }
// const initialState: DocumentState = {
// documents: [],
// loading: false,
// error: null,
// };
// interface uploadArgs {
// formData: FormData;
// accountId: string;
// transactionId: string;
// }
// // Fetch documents from API
// export const fetchDocuments = createAsyncThunk<Document[], { accountId: string, transactionId: string }>(
// "documents/fetchDocuments",
// async ({ accountId, transactionId }, { rejectWithValue }) => {
// try {
// const response = await api.get(`/api/accounts/${accountId}/transactions/${transactionId}/documents?include_images=true`);
// return response.data as Document[];
// } catch (error: any) {
// // if(error.status === 401) {}
// return rejectWithValue(error.response?.data || "Failed to fetch documents");
// }
// }
// );
// // Upload multiple documents using FormData (Key: "document")
// export const uploadDocuments = createAsyncThunk<Document[], uploadArgs>(
// "documents/uploadDocuments",
// async ({ formData, accountId, transactionId }, { dispatch, rejectWithValue }) => {
// try {
// dispatch(showLoader("Uploading documents..."));
// console.log("Form Data", formData.getAll("document"))
// const response = await api.post(`/api/accounts/${accountId}/transactions/${transactionId}/documents`, formData, {
// headers: {
// "Content-Type": "multipart/form-data"
// },
// });
// console.log("Form Uploaded Response DocumentSlice Line 185", response.data)
// dispatch(hideLoader());
// return [response.data];
// } catch (error: any) {
// dispatch(hideLoader());
// toast.error("Error Uploading Document", {
// position: "bottom-right",
// autoClose: 3000,
// hideProgressBar: false,
// closeOnClick: false,
// pauseOnHover: false,
// draggable: false,
// progress: undefined,
// theme: "light",
// transition: Bounce,
// });
// console.log("Failed Uploading Documents")
// throw new Error("Failed Uploading Documents")
// // Mock data in case of failure
// // const failedDocuments = formData.getAll("document").map((file: any) => ({
// // id: uuidv4(),
// // name: file.name,
// // extension: file.name.split(".").pop() || "unknown",
// // original: Math.random() < 0.5,
// // corrupted: Math.random() < 0.5,
// // }));
// // dispatch(updateSelectedDocuments({ documents: failedDocuments }));
// // return failedDocuments; // Instead of rejecting, return mock data
// }
// }
// );
// const documentSlice = createSlice({
// name: "documents",
// initialState,
// reducers: {
// setDocuments: (state, action: PayloadAction<Document[]>) => {
// state.documents = action.payload;
// },
// setDocProgComplete: (state, action: PayloadAction<string>) => {
// const docIndex = state.documents.findIndex(doc => doc.id === action.payload);
// if (docIndex !== -1) {
// state.documents[docIndex].isCompleted = true;
// }
// },
// resetDocuments: (state) => {
// state.documents = [];
// },
// deleteDocument: (state, action: PayloadAction<string>) => {
// state.documents = state.documents.filter(doc => doc.id !== action.payload);
// },
// },
// extraReducers: (builder) => {
// builder
// // Fetch documents
// .addCase(fetchDocuments.pending, (state) => {
// state.loading = true;
// state.error = null;
// })
// .addCase(fetchDocuments.fulfilled, (state, action: PayloadAction<Document[]>) => {
// state.loading = false;
// state.documents = action.payload;
// })
// .addCase(fetchDocuments.rejected, (state, action) => {
// state.loading = false;
// state.error = action.payload as string;
// })
// // Upload multiple documents
// .addCase(uploadDocuments.pending, (state) => {
// state.loading = true;
// state.error = null;
// })
// .addCase(uploadDocuments.fulfilled, (state, action: PayloadAction<Document[]>) => {
// state.loading = false;
// state.documents = [...action.payload, ...state.documents];
// })
// .addCase(uploadDocuments.rejected, (state, action) => {
// state.loading = false;
// state.error = action.payload as string;
// });
// },
// });
// export const { resetDocuments, setDocuments, setDocProgComplete, deleteDocument } = documentSlice.actions;
// export default documentSlice.reducer;
import { createSlice, createAsyncThunk, PayloadAction } from '@reduxjs/toolkit'; import { createSlice, createAsyncThunk, PayloadAction } from '@reduxjs/toolkit';
import { toast, Bounce } from 'react-toastify'; import { toast, Bounce } from 'react-toastify';
import api from '../../config/api'; import api from '../../config/api';
@ -244,8 +81,6 @@ export const uploadDocuments = createAsyncThunk<
}; };
const toggle = state.selectedRecipients.transactionTemplateToggle; const toggle = state.selectedRecipients.transactionTemplateToggle;
console.log(`/api/accounts/${accountId}/${toggle}/${transactionId}/documents`)
const response = await api.post( const response = await api.post(
`/api/accounts/${accountId}/${toggle}/${transactionId}/documents`, `/api/accounts/${accountId}/${toggle}/${transactionId}/documents`,
formData, formData,
@ -255,7 +90,6 @@ export const uploadDocuments = createAsyncThunk<
}, },
} }
); );
console.log("// await sleep(5000);", response.data)
// await sleep(5000); // await sleep(5000);
dispatch(hideLoader()); dispatch(hideLoader());
return [response.data]; return [response.data];

View File

@ -55,10 +55,6 @@ export const updateSelectedDocuments = createAsyncThunk<
"selectedDocuments/updateSelectedDocuments", "selectedDocuments/updateSelectedDocuments",
async ({ documents }, { rejectWithValue }) => { async ({ documents }, { rejectWithValue }) => {
try { try {
console.log(documents, "From Selected Documents")
// await axiosInstance.post("/selected-documents", // await axiosInstance.post("/selected-documents",
// { documents } // { documents }
// ); // );

View File

@ -405,8 +405,6 @@ export const addRecipientAsync = createAsyncThunk<
const updateRecipientsData = recipientsData.filter(recipient => recipient.id !== null); const updateRecipientsData = recipientsData.filter(recipient => recipient.id !== null);
const createRecipientsData = recipientsData.filter(recipient => recipient.id == null); const createRecipientsData = recipientsData.filter(recipient => recipient.id == null);
console.log("createRecipientsData", createRecipientsData)
const basePath = `/api/accounts/${accountId}/${toggle}/${transactionId}/recipients`; const basePath = `/api/accounts/${accountId}/${toggle}/${transactionId}/recipients`;
const resUpdate = updateRecipientsData.length const resUpdate = updateRecipientsData.length
@ -437,7 +435,6 @@ export const removeRecipientAsync = createAsyncThunk<
const basePath = `/api/accounts/${accountId}/${toggle}/${transactionId}/recipients`; const basePath = `/api/accounts/${accountId}/${toggle}/${transactionId}/recipients`;
console.log(`Line 440 : ${basePath}/${recipientId}`)
// return // return
if (recipientId) { if (recipientId) {
await api.delete(`${basePath}/${recipientId}`); await api.delete(`${basePath}/${recipientId}`);

View File

@ -23,7 +23,6 @@ const transactionSlice = createSlice({
reducers: { reducers: {
setTransactionId: (state, action: PayloadAction<string>) => { setTransactionId: (state, action: PayloadAction<string>) => {
const transactionId = action.payload; const transactionId = action.payload;
console.log("Mic Check 2", transactionId)
state.transactionId = transactionId; state.transactionId = transactionId;
return state; return state;
}, },

View File

@ -40,8 +40,6 @@ const handleGroupBorderPosition = (groupElements: NodeListOf<HTMLElement>, conta
const borderBottom: HTMLElement | null = document.querySelector("[border-group='" + groupElements[0].getAttribute("group") + "'][border-pos='bottom']"); const borderBottom: HTMLElement | null = document.querySelector("[border-group='" + groupElements[0].getAttribute("group") + "'][border-pos='bottom']");
const borderLeft: HTMLElement | null = document.querySelector("[border-group='" + groupElements[0].getAttribute("group") + "'][border-pos='left']"); const borderLeft: HTMLElement | null = document.querySelector("[border-group='" + groupElements[0].getAttribute("group") + "'][border-pos='left']");
console.log("handleGroupBorderPosition")
if (borderTop !== null && dimension.maxLeft !== null && dimension.minLeft !== null) { if (borderTop !== null && dimension.maxLeft !== null && dimension.minLeft !== null) {
borderTop.style.width = (dimension.maxLeft - dimension.minLeft) + "px"; borderTop.style.width = (dimension.maxLeft - dimension.minLeft) + "px";
borderTop.style.height = "1px"; borderTop.style.height = "1px";