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) => {
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)

View File

@ -49,7 +49,6 @@ const CommonNav: React.FC<AccountNavProps> = ({
}) => {
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<AccountNavProps> = ({
},
});
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<AccountNavProps> = ({
};
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<AccountNavProps> = ({
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<AccountNavProps> = ({
},
};
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<AccountNavProps> = ({
// 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);

View File

@ -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<Transaction[]>([]);
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 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<AccountNavProps> = ({ 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<AccountNavProps> = ({ 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<AccountNavProps> = ({ 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<AccountNavProps> = ({ 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");
}

View File

@ -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",

View File

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

View File

@ -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() {
<p>or login with social platforms</p>
<div className="social-icons">
<OAuthGoogle />
<OAuthGoogle isLogin={true} />
</div>
<div>

View File

@ -19,16 +19,14 @@ interface OAuthGoogleProps {
isLogin: boolean
}
const OAuthGoogle: React.FC<OAuthGoogleProps> = ({isLogin}) => {
const OAuthGoogle: React.FC<OAuthGoogleProps> = ({ isLogin }) => {
const dispatch = useDispatch<AppDispatch>();
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<OAuthGoogleProps> = ({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<OAuthGoogleProps> = ({isLogin}) => {
const decoded = jwtDecode(token);
console.log(decoded, 'decoded');
};
// Define the error handler type (error can be of any type)

View File

@ -22,14 +22,12 @@ interface FormDataState {
function RegisterForm() {
console.log("RegisterForm Component Rendered");
const [formData, setForm] = useState<FormDataState>({ email: "", password: "", confirmPassword: "", firstName: "", lastName: "" });
const dispatch = useDispatch<AppDispatch>();
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",

View File

@ -1,13 +1,18 @@
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<React.SetStateAction<string>>;
dropDownTogglePage: string;
}
const DocumentPages = ({ selectedDocuments, setDropDownTogglePage, dropDownTogglePage }: DocumentPagesInterface) => {
const [currentPage, setCurrentPage] = useState(0);
return (
<div className='bg-white h-full p-4 overflow-y-auto'>
@ -20,7 +25,10 @@ const DocumentPages = ({ selectedDocuments, setDropDownTogglePage, dropDownToggl
// onBlur={() => setDropDownTogglePage('')}
>
<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`}>
{
document.pages != undefined && <img
@ -40,15 +48,53 @@ const DocumentPages = ({ selectedDocuments, setDropDownTogglePage, dropDownToggl
{
dropDownTogglePage === 'pageDropDown' + indx &&
<div className='my-1 flex justify-center items-center gap-1 flex-wrap'>
{document.pages != undefined && document.pages.map((img, indx) => (
<div className="my-1 flex justify-center items-center gap-2 flex-wrap">
{/* Prev Button */}
<a
href={"#" + document.documentId + indx}
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'
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 === 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>
{/* 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>
}

View File

@ -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<StampTypeObj>({ 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<boolean>(true);
@ -1106,12 +1099,9 @@ const SignDocument = () => {
{!hideTags && <>
{currDocTags.map((item, index) => {
if (item.pageIndex !== page.index || item.documentId != doc.documentId) return <></>;
return (
<>
<div
tabIndex={1}
onFocus={() => {
@ -1119,7 +1109,7 @@ const SignDocument = () => {
setFocusElement({ ...item, focusElementIndx: index })
}
}
key={item.id}
key={index}
// onPointerDown={(e) => handleTagMouseDown(e, key, index)}
className="absolute rounded dropped-item text-sm"
// onClick={() => handleTagClick(key, index)}
@ -1155,7 +1145,6 @@ const SignDocument = () => {
</p> */}
<p className='capitalize text-ellipsis whitespace-nowrap'>{item.label}</p>
<IoMdClose onClick={(e) => {
console.log("Handle Remove Tag Called");
e.stopPropagation();
handleRemoveTag(key, index)
@ -1185,7 +1174,6 @@ const SignDocument = () => {
// name={item.id}
// style={{ height: item.dimensions.height + "px" }}
onBlur={(e) => {
console.log("Text Input Event Triggered");
const val = e.currentTarget.textContent;
handleTagUpdate(index, val as string);
}}
@ -1633,8 +1621,7 @@ const SignDocument = () => {
</div>
</>
}
</div >
</>
</div>
)
})
}
@ -1683,15 +1670,14 @@ const SignDocument = () => {
</div>
<div className={`col-span-2 ${provideTags ? "" : "order-first"} overflow-y-auto`}>
{/* <DocumentPages
{selectedDocuments !== null && <DocumentPages
selectedDocuments={selectedDocuments}
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
droppedItems={droppedItems}
selectedTag={droppedItems[selectedTag.index]}
@ -1699,7 +1685,7 @@ const SignDocument = () => {
selTagKey={selectedTag.key}
selTagIndx={selectedTag.index}
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 [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}`)

View File

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

View File

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

View File

@ -25,7 +25,6 @@ const NavLink: React.FC<NavLinkProps> = ({ 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>(TransactionFilterEnum.ALL)

View File

@ -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) {

View File

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

View File

@ -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",

View File

@ -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 () => {

View File

@ -43,7 +43,6 @@ const DocumentCard: React.FC<DocumentCardProps> = ({ 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<DocumentCardProps> = ({ 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<DocumentCardProps> = ({ id, name, isCompleted , tra
if (res.status === 202) {
dispatch(deleteDocument(docId));
setDocumentDel({ docId: null, isDel: false });
console.log("Document deleted successfully");
}
}

View File

@ -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<HTMLDivElement | null>(null);
@ -87,8 +86,6 @@ const ProcessStepOne = () => {
const [transactionDetails, setTransactionDetails] = useState<any>([]);
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 */}
<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
rows={4}
value={emailDtls.message}

View File

@ -32,7 +32,6 @@ const RecipientAddCard = ({ transactionTemplateToggle, editRecipient, editCase,
);
const recipients = useSelector((state: RootState) => state.selectedRecipients.recipients);
console.log("recipients.length in AddCase", recipients)
const [contactData, setContactData] = useState<ContactTypeObj>({ type: "", contacts: [] });
const [openContactModal, setOpenContactModal] = useState(false);
@ -59,10 +58,6 @@ const RecipientAddCard = ({ transactionTemplateToggle, editRecipient, editCase,
type: false,
});
console.log(recipient)
useEffect(() => {
if (openContactModal) {
if (topRef?.current) {
@ -82,9 +77,9 @@ const RecipientAddCard = ({ transactionTemplateToggle, editRecipient, editCase,
(r.email && r.email === editRecipient?.email)
);
});
console.log("Line 83", exists)
if (editCase === "Edit" && editRecipient) {
console.log("editRecipientAdd", editRecipient)
if (!exists) {
// Recipient was deleted -> reset
setEditCase('');
@ -296,7 +291,6 @@ const RecipientAddCard = ({ transactionTemplateToggle, editRecipient, editCase,
useDebouncedEffect(() => {
console.log("useDebouncedEffect")
if (!activeField || !manualFocusTriggered) return;
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 { 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 { fetchDocuments } from '../../../store/slices/documentSlice';
import { GrFormPrevious } from 'react-icons/gr';
interface LeftSideBarProps {
isFields: boolean;
@ -36,6 +37,8 @@ const LeftSideBar: React.FC<LeftSideBarProps> = ({ isFields, selectedRecipientIn
const selectedRecipients = useSelector((state: RootState) => state.selectedRecipients.recipients)
const selectedDocuments = useSelector((state: RootState) => state.documents.documents)
const [currentPage, setCurrentPage] = useState(0);
useEffect(() => {
if (selectedRecipients.length === 0) {
dispatch(fetchRecipients({ accountId, transactionId }));
@ -166,18 +169,57 @@ const LeftSideBar: React.FC<LeftSideBarProps> = ({ isFields, selectedRecipientIn
{
dropDownTogglePage === 'pageDropDown' + indx &&
<div className='my-1 flex justify-center items-center gap-1 flex-wrap'>
{document.pages != undefined && document.pages.map((img, indx) => (
<div className="my-1 flex justify-center items-center gap-2 flex-wrap">
{/* Prev Button */}
<a
href={"#" + document.id + indx}
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'
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 === 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>
{/* 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>
)
})}

View File

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

View File

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

View File

@ -25,8 +25,6 @@ interface TemporalDateAttrInt {
const TemporalDateAttr: React.FC<TemporalDateAttrInt> = ({ dateFormat, format, selectedTag, dropDownToggle, setDropDownToggle, handlePropertyChange }) => {
console.log(dateFormat, format, "dateFormat Line 26", selectedTag)
let is24HourFormat = true
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 allowedPages = ["settings", "contacts"]
console.log("Allowed Pages: ", allowedPages)
const {page1} = useParams<{page1: string}>()
if (page1 && !allowedPages.includes(page1)) {
return <div>Access Denied</div>

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -88,7 +88,7 @@ const TemplateTable = () => {
templateId: item.id,
};
let res = await api.post(`/api/accounts/${activeAccountId}/transactions`, payload)
console.log("handleUseClick", res.data)
// /process-step-one/:accountId/:transactionId
navigate(`/process-step-one/${activeAccountId}/${res?.data?.id}?useTemplate=true`);
} catch (error) {
@ -220,7 +220,6 @@ const TemplateTable = () => {
<button
onMouseDown={() => {
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"
>

View File

@ -31,7 +31,6 @@ const Templates = () => {
const handleAddTemplate = async () => {
console.log("handleAddTemplate called");
try {
const res = await api.post(`/api/accounts/${activeAccountId}/templates`);
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" />,
'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" />;
};

View File

@ -77,8 +77,6 @@ const TransactionView = () => {
setIsModalOpen(false); // update state immediately
};
console.log(transactionDetails, "line 37");
const fetchData = async () => {
try {
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) {
console.log("calling zoom function", percentage, contentClass);
const content = document.querySelector(`.${contentClass}`);
const scale = percentage // 100;
if(content) {
console.log("calling zoom function Printing Content", content);
content.style.transform = `scale(${scale})`;
}
}
useEffect(() => {
console.log("Calling useEffect for zoom", fitObj[selFitIndx].value);
let indx = fitObj[selFitIndx].value
if (indx === "FIT") {
indx = "100";
@ -62,8 +58,6 @@ const DocView = () => {
zoom(Number(indx), 'zoom-con')
}, [selFitIndx])
console.log(isFitDd);
return (
<>

View File

@ -19,8 +19,6 @@ export const createAxiosInstance = () => {
const user = JSON.parse(parsedRoot.user);
const accessToken = user.accessToken;
console.log(accessToken, "accessToken");
return axios.create({
baseURL: import.meta.env.VITE_BASE_URI,
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 { toast, Bounce } from 'react-toastify';
import api from '../../config/api';
@ -244,8 +81,6 @@ export const uploadDocuments = createAsyncThunk<
};
const toggle = state.selectedRecipients.transactionTemplateToggle;
console.log(`/api/accounts/${accountId}/${toggle}/${transactionId}/documents`)
const response = await api.post(
`/api/accounts/${accountId}/${toggle}/${transactionId}/documents`,
formData,
@ -255,7 +90,6 @@ export const uploadDocuments = createAsyncThunk<
},
}
);
console.log("// await sleep(5000);", response.data)
// await sleep(5000);
dispatch(hideLoader());
return [response.data];

View File

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

View File

@ -405,8 +405,6 @@ export const addRecipientAsync = createAsyncThunk<
const updateRecipientsData = 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 resUpdate = updateRecipientsData.length
@ -437,7 +435,6 @@ export const removeRecipientAsync = createAsyncThunk<
const basePath = `/api/accounts/${accountId}/${toggle}/${transactionId}/recipients`;
console.log(`Line 440 : ${basePath}/${recipientId}`)
// return
if (recipientId) {
await api.delete(`${basePath}/${recipientId}`);

View File

@ -23,7 +23,6 @@ const transactionSlice = createSlice({
reducers: {
setTransactionId: (state, action: PayloadAction<string>) => {
const transactionId = action.payload;
console.log("Mic Check 2", transactionId)
state.transactionId = transactionId;
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 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) {
borderTop.style.width = (dimension.maxLeft - dimension.minLeft) + "px";
borderTop.style.height = "1px";