template
This commit is contained in:
parent
8ec313e6d8
commit
5b1d804ec3
|
|
@ -26,6 +26,7 @@ import Account from "./components/accounts/Account";
|
||||||
import TransactionView from "./components/transactions/TransactionView";
|
import TransactionView from "./components/transactions/TransactionView";
|
||||||
import AccountTransactionWrapper from "./components/AccountTransactionWrapper";
|
import AccountTransactionWrapper from "./components/AccountTransactionWrapper";
|
||||||
import SigningOrderDiagram from "./SigningOrderDiagram ";
|
import SigningOrderDiagram from "./SigningOrderDiagram ";
|
||||||
|
import Templates from "./components/templates/Templates";
|
||||||
|
|
||||||
const App = () => {
|
const App = () => {
|
||||||
return (
|
return (
|
||||||
|
|
@ -41,7 +42,7 @@ const App = () => {
|
||||||
</ProtectedRoute>
|
</ProtectedRoute>
|
||||||
}>
|
}>
|
||||||
<Route path="/" element={<Home />} />
|
<Route path="/" element={<Home />} />
|
||||||
<Route path="/templates" element={<Home />} />
|
<Route path="/templates" element={<Templates />} />
|
||||||
{/* <Route path="/s/settings" element={<Setting />} /> */}
|
{/* <Route path="/s/settings" element={<Setting />} /> */}
|
||||||
|
|
||||||
<Route element={<AccountTransactionWrapper />}>
|
<Route element={<AccountTransactionWrapper />}>
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ const RecipientAddCard = () => {
|
||||||
const handleRecipientAdd = (e: React.FormEvent<HTMLFormElement>) => {
|
const handleRecipientAdd = (e: React.FormEvent<HTMLFormElement>) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
if (recipient.firstName === "" || recipient.lastName === "" || recipient.email === "" || !recipient.type) return;
|
if (recipient.lastName === "" || recipient.email === "" || !recipient.type) return;
|
||||||
|
|
||||||
// Validate Email Format
|
// Validate Email Format
|
||||||
const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
||||||
|
|
@ -106,7 +106,7 @@ const RecipientAddCard = () => {
|
||||||
{/* Name Inputs */}
|
{/* Name Inputs */}
|
||||||
<div className="grid grid-cols-1 sm:grid-cols-2 gap-4">
|
<div className="grid grid-cols-1 sm:grid-cols-2 gap-4">
|
||||||
<input
|
<input
|
||||||
required
|
// required
|
||||||
type="text"
|
type="text"
|
||||||
onFocus={() => setOpenContactModal(true)}
|
onFocus={() => setOpenContactModal(true)}
|
||||||
onBlur={handleContactModalBlur}
|
onBlur={handleContactModalBlur}
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@ import { fetchRecipients } from '../../../store/slices/selectedRecipientsSlice';
|
||||||
import { fetchDocuments } from '../../../store/slices/documentSlice';
|
import { fetchDocuments } from '../../../store/slices/documentSlice';
|
||||||
import { FaQuestionCircle } from 'react-icons/fa';
|
import { FaQuestionCircle } from 'react-icons/fa';
|
||||||
import typeToIconMap from '../../../helper/iconMap';
|
import typeToIconMap from '../../../helper/iconMap';
|
||||||
|
import { IoAdd } from 'react-icons/io5';
|
||||||
|
|
||||||
export interface DroppedItemsObj {
|
export interface DroppedItemsObj {
|
||||||
[key: string]: DroppedItem[]
|
[key: string]: DroppedItem[]
|
||||||
|
|
@ -210,12 +211,12 @@ const DocumentContainer: React.FC<DocumentContainerProps> = ({ isSend }) => {
|
||||||
"dimensions": dropTag.dimensions,
|
"dimensions": dropTag.dimensions,
|
||||||
"type": dropTag.type.toUpperCase(),
|
"type": dropTag.type.toUpperCase(),
|
||||||
// "subType": (dropTag.subType ? dropTag.subType.toUpperCase() : null),
|
// "subType": (dropTag.subType ? dropTag.subType.toUpperCase() : null),
|
||||||
validation: {
|
// validation: {
|
||||||
"minLength": 0,
|
"minLength": 0,
|
||||||
"maxLength": 0,
|
"maxLength": 0,
|
||||||
"error": ("error" in dropTag && dropTag.error) ? `${dropTag.error}`.toUpperCase() : "error",
|
"error": ("error" in dropTag && dropTag.error) ? `${dropTag.error}`.toUpperCase() : "error",
|
||||||
"regex": "regex" in dropTag ? dropTag.regex : []
|
"regex": "regex" in dropTag ? dropTag.regex : [],
|
||||||
},
|
// },
|
||||||
"documentId": dropTag.documentId,
|
"documentId": dropTag.documentId,
|
||||||
"options": ("options" in dropTag) ? dropTag.options : [],
|
"options": ("options" in dropTag) ? dropTag.options : [],
|
||||||
"pageIndex": dropTag.pageIndex,
|
"pageIndex": dropTag.pageIndex,
|
||||||
|
|
@ -275,10 +276,10 @@ const DocumentContainer: React.FC<DocumentContainerProps> = ({ isSend }) => {
|
||||||
tagsData = groupByRecipientId(tagsData);
|
tagsData = groupByRecipientId(tagsData);
|
||||||
sendTagsToRecipients(tagsData, accountId, transactionId);
|
sendTagsToRecipients(tagsData, accountId, transactionId);
|
||||||
|
|
||||||
// (async () => {
|
(async () => {
|
||||||
// const res = await api.put(`/api/accounts/${accountId}/transactions/${transactionId}`, {status: "SENT"})
|
const res = await api.put(`/api/accounts/${accountId}/transactions/${transactionId}`, {status: "SENT"})
|
||||||
// console.log(res, "Check123")
|
console.log(res, "Check123")
|
||||||
// })()
|
})()
|
||||||
}, [isSend])
|
}, [isSend])
|
||||||
// Save Tags - END
|
// Save Tags - END
|
||||||
|
|
||||||
|
|
@ -519,6 +520,11 @@ const DocumentContainer: React.FC<DocumentContainerProps> = ({ isSend }) => {
|
||||||
})()
|
})()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const handleAddRadioClick = (key:string) => {
|
||||||
|
console.log("Handle Radio Clicled", key)
|
||||||
|
console.log(droppedItems, "line 525")
|
||||||
|
}
|
||||||
|
|
||||||
// const handleAddRadio = (e: React.MouseEvent<HTMLElement>, key: string, index: number) => {
|
// const handleAddRadio = (e: React.MouseEvent<HTMLElement>, key: string, index: number) => {
|
||||||
// // const dataToSet: DroppedItemsObj = {
|
// // const dataToSet: DroppedItemsObj = {
|
||||||
// // ...droppedItems,
|
// // ...droppedItems,
|
||||||
|
|
@ -698,21 +704,53 @@ const DocumentContainer: React.FC<DocumentContainerProps> = ({ isSend }) => {
|
||||||
{/* Expand Circle - ENDS */}
|
{/* Expand Circle - ENDS */}
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
item.type !== "radio" ?
|
||||||
|
<div
|
||||||
|
onPointerDown={(e) => handleTagMouseDown(e, key, index)}
|
||||||
|
// style={{ width: `${item.width}px !important` }}
|
||||||
|
className='p-2 rounded-sm h-full shadow opacity-40 cursor-grab w-full'
|
||||||
|
style={{ background: selectedRecipient[0]?.color }}
|
||||||
|
>
|
||||||
|
<p
|
||||||
|
className={`flex justify-center items-center w-full text-xl text-white h-full`}
|
||||||
|
// style={{ color: selectedRecipients[item.recipientIndx]?.color }}
|
||||||
|
>
|
||||||
|
{IconComponent}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
:
|
||||||
|
<>
|
||||||
|
<div>
|
||||||
|
{/* Radio - Container - START */}
|
||||||
|
<div>
|
||||||
|
|
||||||
<div
|
{/* Radio- Item - START */}
|
||||||
onPointerDown={(e) => handleTagMouseDown(e, key, index)}
|
<div
|
||||||
// style={{ width: `${item.width}px !important` }}
|
onPointerDown={(e) => handleTagMouseDown(e, key, index)}
|
||||||
className='p-2 rounded-sm h-full shadow opacity-40 cursor-grab w-full'
|
// style={{ width: `${item.width}px !important` }}
|
||||||
style={{ background: selectedRecipient[0]?.color }}
|
className='p-2 rounded-sm h-full shadow opacity-40 cursor-grab w-full'
|
||||||
>
|
style={{ background: selectedRecipient[0]?.color }}
|
||||||
<p
|
>
|
||||||
className={`flex justify-center items-center w-full text-xl text-white h-full`}
|
<p
|
||||||
// style={{ color: selectedRecipients[item.recipientIndx]?.color }}
|
className={`flex justify-center items-center w-full text-xl text-white h-full`}
|
||||||
>
|
// style={{ color: selectedRecipients[item.recipientIndx]?.color }}
|
||||||
{IconComponent}
|
>
|
||||||
</p>
|
{IconComponent}
|
||||||
</div>
|
</p>
|
||||||
|
</div>
|
||||||
|
{/* Radio- Item - END */}
|
||||||
|
|
||||||
|
</div>
|
||||||
|
{/* Radio - Container - END */}
|
||||||
|
|
||||||
|
|
||||||
|
<IoAdd onClick={() => handleAddRadioClick(key)} className='ml-[50%] translate-x-[-50%] cursor-pointer' />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</>
|
||||||
|
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,9 @@
|
||||||
|
import React from 'react'
|
||||||
|
|
||||||
|
const Templates = () => {
|
||||||
|
return (
|
||||||
|
<div>Templates</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default Templates
|
||||||
|
|
@ -29,7 +29,7 @@ api.interceptors.response.use(
|
||||||
const originalRequest = error.config;
|
const originalRequest = error.config;
|
||||||
// Prevent multiple refresh attempts
|
// Prevent multiple refresh attempts
|
||||||
// if (error.response?.status === 401 || error.response?.status === 500) {
|
// if (error.response?.status === 401 || error.response?.status === 500) {
|
||||||
if (error.response?.status === 401) {
|
if (error.response?.status === 401 || error.response?.status === 500) {
|
||||||
originalRequest._retry = true;
|
originalRequest._retry = true;
|
||||||
try {
|
try {
|
||||||
if (!isRefreshing) {
|
if (!isRefreshing) {
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,8 @@ export default defineConfig({
|
||||||
'quality-friendly-goldfish.ngrok-free.app',
|
'quality-friendly-goldfish.ngrok-free.app',
|
||||||
'officially-powerful-goat.ngrok-free.app',
|
'officially-powerful-goat.ngrok-free.app',
|
||||||
'89f0-49-36-189-120.ngrok-free.app',
|
'89f0-49-36-189-120.ngrok-free.app',
|
||||||
'c8ee-49-36-191-130.ngrok-free.app'
|
'c8ee-49-36-191-130.ngrok-free.app',
|
||||||
|
'c76f1251c173.ngrok-free.app'
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
build: {
|
build: {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue