From 11ebd9e1fb72090ef6fb336567ba3b16f9461570 Mon Sep 17 00:00:00 2001 From: = <=> Date: Fri, 27 Jun 2025 16:09:44 +0530 Subject: [PATCH] SME Web - 27-06-2025 --- .env | 3 + .gitignore | 24 + README.md | 50 + constants_api.json | 20 + eslint.config.js | 28 + index.html | 13 + package-lock.json | 4910 +++++++++++++++++ package.json | 55 + public/vite.svg | 1 + src/App.css | 0 src/App.tsx | 87 + src/SigningOrderDiagram .tsx | 140 + src/assets/react.svg | 1 + src/components/AccountTransactionWrapper.tsx | 16 + src/components/accounts/Account.tsx | 109 + src/components/accounts/AccountNav.tsx | 110 + src/components/accounts/Accounts.tsx | 118 + src/components/auth/LoginForm.tsx | 219 + src/components/auth/OAuthGoogle.tsx | 67 + src/components/auth/RegisterForm.tsx | 185 + src/components/auth/UsertAuthUI.tsx | 87 + src/components/client/SignDocument.tsx | 1011 ++++ src/components/client/TermsModal.tsx | 88 + src/components/dashboard/Dashboard.tsx | 190 + src/components/dashboard/Loader.tsx | 30 + src/components/dashboard/NavLink.tsx | 140 + src/components/dashboard/SendForSign.tsx | 91 + src/components/dashboard/SideBar.tsx | 131 + src/components/home/Cards.tsx | 97 + src/components/home/FilterSort.tsx | 27 + src/components/home/Home.tsx | 22 + src/components/home/HomeTopNav.tsx | 61 + src/components/home/ShowDocs.tsx | 155 + src/components/home/StartSection.tsx | 118 + src/components/home/UploadDoc.tsx | 107 + src/components/login/Login.tsx | 13 + src/components/modal/ProcessStepModal.tsx | 43 + src/components/modal/SignModal.tsx | 65 + src/components/process/ProcessTopNav.tsx | 9 + src/components/process/RecipientAddCard.tsx | 69 + .../process/processStepOne/ContactModal.tsx | 75 + .../process/processStepOne/DocumentCard.tsx | 201 + .../process/processStepOne/ProcessStepOne.tsx | 255 + .../processStepOne/RecipientAddCard.tsx | 214 + .../process/processStepOne/RecipientCards.tsx | 173 + .../processStepOne/SelectedDocuments.tsx | 179 + .../processStepTwo/DocumentContainer.tsx | 735 +++ .../process/processStepTwo/FieldList.tsx | 115 + .../process/processStepTwo/LeftSideBar.tsx | 182 + .../process/processStepTwo/NavTwo.tsx | 271 + .../process/processStepTwo/ProcessStepTwo.tsx | 62 + .../process/processStepTwo/RightSideBar.tsx | 653 +++ src/components/register/Register.tsx | 13 + src/components/routes_helper/PageGuard.tsx | 19 + .../routes_helper/ProtectedRoute.tsx | 15 + src/components/setting/Setting.tsx | 69 + src/components/setting/SettingNav.tsx | 62 + src/components/signature/Draw.tsx | 226 + src/components/signature/SignCon.tsx | 107 + src/components/signature/SignUpload.tsx | 173 + src/components/signature/TypedSign.tsx | 104 + src/components/signature_pad/InitialCon.tsx | 45 + src/components/signature_pad/InitialPad.tsx | 165 + src/components/signature_pad/SignatureCon.tsx | 63 + src/components/signature_pad/SignaturePad.tsx | 165 + src/components/stamp/StampUpload.tsx | 169 + src/components/styles/style.css | 360 ++ src/components/svgs/Svg.tsx | 56 + .../transactions/TransactionTopNav.tsx | 28 + .../transactions/TransactionView.tsx | 155 + src/components/transactions/Transactions.tsx | 124 + src/components/view/DocView.tsx | 146 + src/components/view/DocViewCon.tsx | 9 + src/config/api.tsx | 59 + src/config/axiosInstance.tsx | 33 + src/config/useAxios.tsx | 22 + src/helper/fetchAPIs.tsx | 42 + src/helper/fieldsListData.tsx | 24 + src/helper/genUniqueColor.tsx | 61 + src/helper/iconMap.tsx | 31 + src/index.css | 76 + src/main.tsx | 21 + src/store/slices/documentSlice.ts | 162 + src/store/slices/droppedItemsSlice.tsx | 109 + src/store/slices/json.json | 24 + src/store/slices/loaderSlice.ts | 29 + src/store/slices/modalSlice.ts | 29 + src/store/slices/selectedDocsSlice.ts | 123 + src/store/slices/selectedRecipientsSlice.tsx | 236 + src/store/slices/selectedTagSlice.tsx | 29 + src/store/slices/signatureSlice.ts | 51 + src/store/slices/tagsSlice.ts | 80 + src/store/slices/transactionSlice.tsx | 43 + src/store/slices/userSlice.ts | 194 + src/store/store.ts | 99 + src/utlity/colorsArr.ts | 24 + src/utlity/dateTimeUtils.ts | 56 + src/utlity/maskUtils.ts | 59 + src/utlity/types.tsx | 81 + src/utlity/useDebounce.ts | 23 + src/vite-env.d.ts | 1 + test.html | 13 + tsconfig.app.json | 26 + tsconfig.json | 7 + tsconfig.node.json | 24 + vite.config.ts | 20 + 106 files changed, 16009 insertions(+) create mode 100644 .env create mode 100644 .gitignore create mode 100644 README.md create mode 100644 constants_api.json create mode 100644 eslint.config.js create mode 100644 index.html create mode 100644 package-lock.json create mode 100644 package.json create mode 100644 public/vite.svg create mode 100644 src/App.css create mode 100644 src/App.tsx create mode 100644 src/SigningOrderDiagram .tsx create mode 100644 src/assets/react.svg create mode 100644 src/components/AccountTransactionWrapper.tsx create mode 100644 src/components/accounts/Account.tsx create mode 100644 src/components/accounts/AccountNav.tsx create mode 100644 src/components/accounts/Accounts.tsx create mode 100644 src/components/auth/LoginForm.tsx create mode 100644 src/components/auth/OAuthGoogle.tsx create mode 100644 src/components/auth/RegisterForm.tsx create mode 100644 src/components/auth/UsertAuthUI.tsx create mode 100644 src/components/client/SignDocument.tsx create mode 100644 src/components/client/TermsModal.tsx create mode 100644 src/components/dashboard/Dashboard.tsx create mode 100644 src/components/dashboard/Loader.tsx create mode 100644 src/components/dashboard/NavLink.tsx create mode 100644 src/components/dashboard/SendForSign.tsx create mode 100644 src/components/dashboard/SideBar.tsx create mode 100644 src/components/home/Cards.tsx create mode 100644 src/components/home/FilterSort.tsx create mode 100644 src/components/home/Home.tsx create mode 100644 src/components/home/HomeTopNav.tsx create mode 100644 src/components/home/ShowDocs.tsx create mode 100644 src/components/home/StartSection.tsx create mode 100644 src/components/home/UploadDoc.tsx create mode 100644 src/components/login/Login.tsx create mode 100644 src/components/modal/ProcessStepModal.tsx create mode 100644 src/components/modal/SignModal.tsx create mode 100644 src/components/process/ProcessTopNav.tsx create mode 100644 src/components/process/RecipientAddCard.tsx create mode 100644 src/components/process/processStepOne/ContactModal.tsx create mode 100644 src/components/process/processStepOne/DocumentCard.tsx create mode 100644 src/components/process/processStepOne/ProcessStepOne.tsx create mode 100644 src/components/process/processStepOne/RecipientAddCard.tsx create mode 100644 src/components/process/processStepOne/RecipientCards.tsx create mode 100644 src/components/process/processStepOne/SelectedDocuments.tsx create mode 100644 src/components/process/processStepTwo/DocumentContainer.tsx create mode 100644 src/components/process/processStepTwo/FieldList.tsx create mode 100644 src/components/process/processStepTwo/LeftSideBar.tsx create mode 100644 src/components/process/processStepTwo/NavTwo.tsx create mode 100644 src/components/process/processStepTwo/ProcessStepTwo.tsx create mode 100644 src/components/process/processStepTwo/RightSideBar.tsx create mode 100644 src/components/register/Register.tsx create mode 100644 src/components/routes_helper/PageGuard.tsx create mode 100644 src/components/routes_helper/ProtectedRoute.tsx create mode 100644 src/components/setting/Setting.tsx create mode 100644 src/components/setting/SettingNav.tsx create mode 100644 src/components/signature/Draw.tsx create mode 100644 src/components/signature/SignCon.tsx create mode 100644 src/components/signature/SignUpload.tsx create mode 100644 src/components/signature/TypedSign.tsx create mode 100644 src/components/signature_pad/InitialCon.tsx create mode 100644 src/components/signature_pad/InitialPad.tsx create mode 100644 src/components/signature_pad/SignatureCon.tsx create mode 100644 src/components/signature_pad/SignaturePad.tsx create mode 100644 src/components/stamp/StampUpload.tsx create mode 100644 src/components/styles/style.css create mode 100644 src/components/svgs/Svg.tsx create mode 100644 src/components/transactions/TransactionTopNav.tsx create mode 100644 src/components/transactions/TransactionView.tsx create mode 100644 src/components/transactions/Transactions.tsx create mode 100644 src/components/view/DocView.tsx create mode 100644 src/components/view/DocViewCon.tsx create mode 100644 src/config/api.tsx create mode 100644 src/config/axiosInstance.tsx create mode 100644 src/config/useAxios.tsx create mode 100644 src/helper/fetchAPIs.tsx create mode 100644 src/helper/fieldsListData.tsx create mode 100644 src/helper/genUniqueColor.tsx create mode 100644 src/helper/iconMap.tsx create mode 100644 src/index.css create mode 100644 src/main.tsx create mode 100644 src/store/slices/documentSlice.ts create mode 100644 src/store/slices/droppedItemsSlice.tsx create mode 100644 src/store/slices/json.json create mode 100644 src/store/slices/loaderSlice.ts create mode 100644 src/store/slices/modalSlice.ts create mode 100644 src/store/slices/selectedDocsSlice.ts create mode 100644 src/store/slices/selectedRecipientsSlice.tsx create mode 100644 src/store/slices/selectedTagSlice.tsx create mode 100644 src/store/slices/signatureSlice.ts create mode 100644 src/store/slices/tagsSlice.ts create mode 100644 src/store/slices/transactionSlice.tsx create mode 100644 src/store/slices/userSlice.ts create mode 100644 src/store/store.ts create mode 100644 src/utlity/colorsArr.ts create mode 100644 src/utlity/dateTimeUtils.ts create mode 100644 src/utlity/maskUtils.ts create mode 100644 src/utlity/types.tsx create mode 100644 src/utlity/useDebounce.ts create mode 100644 src/vite-env.d.ts create mode 100644 test.html create mode 100644 tsconfig.app.json create mode 100644 tsconfig.json create mode 100644 tsconfig.node.json create mode 100644 vite.config.ts diff --git a/.env b/.env new file mode 100644 index 0000000..23bf83b --- /dev/null +++ b/.env @@ -0,0 +1,3 @@ +# VITE_BASE_URI="https://officially-powerful-goat.ngrok-free.app" +# VITE_BASE_URI="https://python-amused-adder.ngrok-free.app" +VITE_BASE_URI="https://concrete-gladly-mullet.ngrok-free.app" \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a547bf3 --- /dev/null +++ b/.gitignore @@ -0,0 +1,24 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* +lerna-debug.log* + +node_modules +dist +dist-ssr +*.local + +# Editor directories and files +.vscode/* +!.vscode/extensions.json +.idea +.DS_Store +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? diff --git a/README.md b/README.md new file mode 100644 index 0000000..74872fd --- /dev/null +++ b/README.md @@ -0,0 +1,50 @@ +# React + TypeScript + Vite + +This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules. + +Currently, two official plugins are available: + +- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh +- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh + +## Expanding the ESLint configuration + +If you are developing a production application, we recommend updating the configuration to enable type aware lint rules: + +- Configure the top-level `parserOptions` property like this: + +```js +export default tseslint.config({ + languageOptions: { + // other options... + parserOptions: { + project: ['./tsconfig.node.json', './tsconfig.app.json'], + tsconfigRootDir: import.meta.dirname, + }, + }, +}) +``` + +- Replace `tseslint.configs.recommended` to `tseslint.configs.recommendedTypeChecked` or `tseslint.configs.strictTypeChecked` +- Optionally add `...tseslint.configs.stylisticTypeChecked` +- Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and update the config: + +```js +// eslint.config.js +import react from 'eslint-plugin-react' + +export default tseslint.config({ + // Set the react version + settings: { react: { version: '18.3' } }, + plugins: { + // Add the react plugin + react, + }, + rules: { + // other rules... + // Enable its recommended rules + ...react.configs.recommended.rules, + ...react.configs['jsx-runtime'].rules, + }, +}) +``` diff --git a/constants_api.json b/constants_api.json new file mode 100644 index 0000000..cee7a5d --- /dev/null +++ b/constants_api.json @@ -0,0 +1,20 @@ +{ + "LOGIN": { + "path": "/api/auth/login", + "method": "POST", + "expecte_success_status_code": 200, + "expected_error_status_code": 401, + "default_error_message": "Internal server error" + }, + "AUTH": { + "path": "/api/auth", + "sub": { + "LOGIN":{ + "path": "/login" + } + } + }, + "CREATE_TRANSACTION": { + "path": "/api/account/${var1}/transactions/${var2}" + } +} \ No newline at end of file diff --git a/eslint.config.js b/eslint.config.js new file mode 100644 index 0000000..092408a --- /dev/null +++ b/eslint.config.js @@ -0,0 +1,28 @@ +import js from '@eslint/js' +import globals from 'globals' +import reactHooks from 'eslint-plugin-react-hooks' +import reactRefresh from 'eslint-plugin-react-refresh' +import tseslint from 'typescript-eslint' + +export default tseslint.config( + { ignores: ['dist'] }, + { + extends: [js.configs.recommended, ...tseslint.configs.recommended], + files: ['**/*.{ts,tsx}'], + languageOptions: { + ecmaVersion: 2020, + globals: globals.browser, + }, + plugins: { + 'react-hooks': reactHooks, + 'react-refresh': reactRefresh, + }, + rules: { + ...reactHooks.configs.recommended.rules, + 'react-refresh/only-export-components': [ + 'warn', + { allowConstantExport: true }, + ], + }, + }, +) diff --git a/index.html b/index.html new file mode 100644 index 0000000..e4b78ea --- /dev/null +++ b/index.html @@ -0,0 +1,13 @@ + + +
+ + + +Transaction Sent
*/} +{signer.name.split(" ")[0]}
+| + | Name | +Status | +Active | +Last Change | +Expire After (days) | ++ |
|---|---|---|---|---|---|---|
|
+
+ {selectedTransactions.includes(tx.id) && (
+
+ |
+ + {tx.subject || "Untitled"} + | ++ + {tx.status} + + | ++ {tx.active ? "Yes" : "No"} + | + ++ {formatDate(tx.lastModifiedAt)} + | ++ {tx.expireAfter ?? "-"} + | +
+ |
+
| */} + | Account Name | +Account ID | +Role | +Status | ++ |
|---|---|---|---|---|---|
|
+
+ {selectedAccounts.includes(account.accountId) && (
+
+ | */}
+
+
+
+ |
+ {account.accountId} | ++ + {account.role} + + | ++ + {status.text} + + | +
+ |
+
or login with social platforms
+ +Create an Account. Register
+Already! have an Account. Login
+Don't have an account?
+ +Already have an account?
+ +Welcome to Sign Made Easy! These Terms & Conditions govern your use of our application.
+By accessing our services, you agree to comply with and be bound by the following terms.
+Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam varius placerat tellus, sed sodales odio cursus nec. Sed lacinia...
+Etiam in diam efficitur, congue lorem sed, malesuada orci. Aliquam bibendum purus nec velit fermentum laoreet. Integer finibus...
+We reserve the right to modify these terms at any time without prior notice. Continued use constitutes your acceptance of those changes.
+Thanks for choosing us to make signing easy, secure, and smooth. 🙌
+Your transaction has been created and saved successfully.
++ {loaderData.message != undefined ? `${loaderData.message}` : 'Loading ...'} +
+{label}
} + + + > + ); +}; + +export default NavLink; + + +// {label === "Transactions" ?{label}
} +// + +//All
} +// {transactionFilter === TransactionFilterEnum.ALL &&Draft
} +// {transactionFilter === TransactionFilterEnum.DRAFT &&Sent
} +// {transactionFilter === TransactionFilterEnum.SENT &&Completed
} +// {transactionFilter === TransactionFilterEnum.COMPLETE &&Declined
} +// {transactionFilter === TransactionFilterEnum.DECLINED &&Discarded
} +// {transactionFilter === TransactionFilterEnum.DISCARDED &&Canceled
} +// {transactionFilter === TransactionFilterEnum.CANCELED &&Expired
} +// {transactionFilter === TransactionFilterEnum.EXPIRED &&Send for signature
+ : +
+
Self Sign
+You're the only signer.
+Send for Sign
+You and other need to sign.
+Are you sure you want to log out?
+{card.title}
+{card.count}
+Filter
+Sort
+.{doc.extension}
++ {doc.original ? "Original" : "Signed"} +
+| + | Name | +Type | +Status | ++ |
|---|---|---|---|---|
|
+ {/* handleSelect(doc.id)}
+ className="form-checkbox text-blue-600"
+ /> */}
+
+
+ {selectedDocs.includes(doc.id) &&
+ |
+ + + | ++ {doc.extension} + | ++ + {doc.original ? "Original" : "Signed"} + + | + {/*
+ | */}
+
{card.description}
+Upload or drag & drop files
+PDF, DOCX, JPG, PNG, TXT (max 10MB)
+Discard Changes
+All changes you have made to this form will be discarded
+Document Uploaded {modalState.message && `( ${modalState.message} )`}
+Self Signature
+You're the only signer.
+Send for Signature
+You and other need to sign.
+Add Recipient Details
++ {recipient.firstName} +
++ {recipient.lastName} +
++ {recipient.email} +
++// {val.firstName} +//
+export default ContactModal \ No newline at end of file diff --git a/src/components/process/processStepOne/DocumentCard.tsx b/src/components/process/processStepOne/DocumentCard.tsx new file mode 100644 index 0000000..9ee982d --- /dev/null +++ b/src/components/process/processStepOne/DocumentCard.tsx @@ -0,0 +1,201 @@ +import React, { useEffect, useState } from 'react' +import { FaFileAlt, FaCheckCircle, FaUpload } from 'react-icons/fa' +import { MdFileUpload } from 'react-icons/md' +import { RiDraggable } from 'react-icons/ri' +import { deleteDocument, setDocProgComplete } from '../../../store/slices/documentSlice' +import { useDispatch } from 'react-redux' +import { AppDispatch } from '../../../store/store' +import { IoMdClose } from 'react-icons/io' +import api from '../../../config/api' +import { useParams } from 'react-router-dom' + +interface DocumentCardProps { + id: string; + name: string; + isCompleted: boolean; +} + +const DocumentCard: React.FCAre you sure you want to delete?
+Add Recipient and Message
++ {recipient.firstName} {recipient.lastName || ""} +
++ {recipient.email} | {recipient.type} +
+Signing Order
+Upload Document
+Drag & drop files here or
+ + +{activeTab} integration coming soon...
+{doc.name}
+{IconComponent} +
+{item.label}
++ {IconComponent} +
++ page {indx + 1} of {doc.images && doc.images.length} +
+ {/*+ Document {indxDoc + 1} {doc.name} +
*/} + {/* Side details of documents Pages and document Name - END */} + + ++ {field.type.toLowerCase()} +
+{selectedRecipient.firstName} {selectedRecipient.lastName}
+{recipient.firstName} {recipient.lastName}
+{document.name}
+{indx + 1}
+ + ))} +Fields
+Pages
+Reset
+Fit
+Fit
+{val.label}
+ {selFitIndx === indx &&{transactionSaving ? `Saving ${dots}` : "Save"}
+{selectedDocuments.length} Documents
+{document.name}
+{selectedRecipients.length} Recipients
+{recipient.firstName} {recipient.lastName} segfsdtzgszrdtgrs serdgvsrdgs dtrgv
+Send
+Setup your Document
+ +Prepare
+ +Hooray !
+ +Properties
+{selectedTag?.subType ? (selectedTag.subType === "date_time" ? "Date Time" : selectedTag.subType) : selectedType[Object.keys(selectedType)[0] as keyof typeof selectedType]}
+{(selectedTag.maskType && selectedTag.maskType.replace("_", " ")) ? selectedTag.maskType : MASKTYPE.ALL}
+
+ {selectedTag?.maskCharacter
+ ?
+ selectedTag.maskCharacter === MASKCHARACTER.ASTERISK &&
+ {selectedTag.format ? selectedTag.format : dateTimeFormatMap['date'][0].format} + {/* {(selectedTag.subType !== TEMPORAL.DATE && selectedTag.subType !== TEMPORAL.TIME) ? (is24Hrs ? " " + timeFormats[0].format : " " + timeFormats[1].format) : ""} */} +
++ Example +
*/} +{dayjs().format(selectedTag.format)}
+{val}
+{index === 0 ? "Signature" : "Initial"}
+Draw
+Type
+Upload
++ {signatureFile ? 'Signature Uploaded' : 'Drop Signature Here or Click to Upload'} +
+ {signatureFile && ( ++ {initialFile ? 'Initials Uploaded' : 'Drop Initials Here or Click to Upload'} +
+ {initialFile && ( ++ {typedSign ? typedSign : "Signature"} +
++ {typedInitial ? typedInitial : "Initial"} +
+Click or drag image here
+(Only image files)
+ +From Shanu.R
+Last Change on 12/02/25
+Sent on 11/02/25
+Draft
+ + {/* Buttons */} +
+
{recipient.id}
+{recipient.name}
+{recipient.email}
+ {recipient.hostEmail !== null &&Host: {recipient.hostEmail}
} +{recipient.status}
+on {recipient.completedAt}
} + {/* + View signed location + */} +No Message Found
+abc.pdf
+1 of 10
+| Name | +Created At | +Status | +Documents | +Recipients | +
|---|---|---|---|---|
| + {tx.name?.trim() || 'N/A'} + | ++ {new Date(tx.createAt).toLocaleString()} + | ++ + {tx.status} + + | +
+
|
+
+ {tx.recipients.map((rec) => (
+
+
+ ))}
+
+ {rec.firstName} {rec.lastName}
+
+ Status: {rec.status}
+ {rec.signedDateTime && (
+
+ Signed: {new Date(rec.signedDateTime).toLocaleString()}
+
+ )}
+ |
+
No Data Found
+Fields
+Pages
+Reset
+Fit
+{val.label}
+ {selFitIndx === indx &&