diff --git a/package.json b/package.json index 141e5f8..0023519 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "build:skip-check": "tsc --noEmit && vite build", "lint": "eslint .", "preview": "vite preview", - "deploy": "npm run build:skip-check && scp -i private\\SME-Web.pem -r dist root@52.10.89.255:/var/www/sme" + "deploy": "npm run build:skip-check && scp -i private\\SME-Web.pem -r dist root@100.22.185.166:/var/www/sme" }, "dependencies": { "@dnd-kit/core": "^6.3.1", diff --git a/src/components/process/processStepOne/ProcessStepOne.tsx b/src/components/process/processStepOne/ProcessStepOne.tsx index cd4c6b8..3d95445 100644 --- a/src/components/process/processStepOne/ProcessStepOne.tsx +++ b/src/components/process/processStepOne/ProcessStepOne.tsx @@ -87,6 +87,7 @@ const ProcessStepOne = () => { const [templateName, setTemplateName] = useState('Untitled'); const [isTyping, setIsTyping] = useState(false); + const [signingOrder, setSigningOrder] = useState(false) // Optional: use a timer to detect pause in typing let typingTimeout = null; @@ -512,6 +513,24 @@ const ProcessStepOne = () => { */} + + + + + {/* HERE WE AREEEEEEEE */} +
+ setSigningOrder(!signingOrder)} + id="default-checkbox" type="checkbox" value="" className="w-4 h-4 checked:bg-[var(--mainPrimaryBtn)] bg-gray-100 border-gray-300 rounded-sm outline-none" + /> + +
+ {/* HERE WE AREEEEEEEE */} + + } @@ -526,6 +545,7 @@ const ProcessStepOne = () => { // setEditRecipientsModal={setEditRecipientsModal} submitError={submitError} isModal={false} + signingOrder={signingOrder} /> } diff --git a/src/components/process/processStepOne/RecipientCards.tsx b/src/components/process/processStepOne/RecipientCards.tsx index 3e537db..91cde3f 100644 --- a/src/components/process/processStepOne/RecipientCards.tsx +++ b/src/components/process/processStepOne/RecipientCards.tsx @@ -53,6 +53,7 @@ type CardsData = { transactionTemplateToggle: string; editRecipientCurrentEmail: string; setEditRecipientCurrentEmail: (email: string) => void; + signingOrder: boolean; }; const RecipientCards = ({ @@ -62,6 +63,7 @@ const RecipientCards = ({ editRecipient, editRecipientCurrentEmail, setEditRecipientCurrentEmail, + signingOrder // signing order - Routing order }: CardsData) => { const templateId = useParams<{ templateId: string }>().templateId; let { accountId, transactionId } = useParams<{ accountId: string; transactionId: string }>(); @@ -389,230 +391,239 @@ const RecipientCards = ({ >
- {/* Main Content Section */} -
- {/* Order Number */} - {recipients.length > 1 ? ( -
- { - const value = e.target.value; - if (/^\d*$/.test(value)) { - const num = Number(value); - handleOrderChange(recipient.id || recipient.uuid, num); - } - }} - onKeyDown={(e) => { - if (!/[0-9]/.test(e.key) && e.key != "Backspace" && e.key != "Tab") { - e.preventDefault(); - } - }} - className="w-8 sm:w-10 h-6 text-center rounded text-sm text-gray-600 focus:outline-none focus:ring-[var(--primary)] border border-dashed border-gray-400" - /> - {idx == 0 && recipients.length > 1 &&

- - {/* Tooltip */} - - Signing order: Recipients receive emails one after another. - Same order means they all receive at once. - -

} -
- ) : ( - - handleOrderChange( - recipient.id || recipient.uuid, - Number(e.target.value) - ) - } - className="w-6 sm:w-8 text-center rounded text-sm text-gray-700 border-none focus:outline-none focus:ring-[var(--primary)] flex-shrink-0" - /> - )} + <> + {/* Main Content Section */} +
+ {/* Order Number */} + {recipients.length > 1 && signingOrder ? ( +
+ { + const value = e.target.value; + if (/^\d*$/.test(value)) { + const num = Number(value); + handleOrderChange(recipient.id || recipient.uuid, num); + } + }} + onKeyDown={(e) => { + if (!/[0-9]/.test(e.key) && e.key != "Backspace" && e.key != "Tab") { + e.preventDefault(); + } + }} + className="w-8 sm:w-10 h-6 text-center rounded text-sm text-gray-600 focus:outline-none focus:ring-[var(--primary)] border border-dashed border-gray-400" + /> + {idx == 0 && recipients.length > 1 &&

+ - {/* Avatar */} - {/*

+ {/* Tooltip */} + + Signing order: Recipients receive emails one after another. + Same order means they all receive at once. + +

} +
+ ) : ( + + <>{signingOrder && + + handleOrderChange( + recipient.id || recipient.uuid, + Number(e.target.value) + ) + } + className="w-6 sm:w-8 text-center rounded text-sm text-gray-700 border-none focus:outline-none focus:ring-[var(--primary)] flex-shrink-0" + />} + + )} + + {/* Avatar */} + {/*
{getInitials(`${recipient.firstName} ${recipient.lastName || ""}`)}
*/} - {/* Form Fields Section */} -
- {/* Role Name and Permissions Row */} -
- {
- {transactionTemplateToggle == TRANSACTION_TEMPLATE_TOGGLE.TEMPLATES ? -
- {renderEditableField(recipient, "roleName", "Role name")} -
- : -
- {recipient.roleName} -
- } -
} - - {/* Permissions - Mobile: Below role, Desktop: Right side */} -
- {transactionTemplateToggle == TRANSACTION_TEMPLATE_TOGGLE.TEMPLATES && ( -
- - - -
- )} -
-
- - {/* Name and Email Fields */} -
- {/* Mobile: Stack vertically, Tablet+: Side by side */} -
-
-
+ {/* Form Fields Section */} +
+ {/* Role Name and Permissions Row */} +
+ {
+ {transactionTemplateToggle == TRANSACTION_TEMPLATE_TOGGLE.TEMPLATES ?
- {renderEditableField(recipient, "firstName", "First Name")} + {renderEditableField(recipient, "roleName", "Role name")}
-
-
-
- {renderEditableField(recipient, "lastName", "Last Name")} + : +
+ {recipient.roleName}
-
-
-
-
- {renderEditableField(recipient, "email", "Recipient Email", "", "email")} -
+ } +
} + + {/* Permissions - Mobile: Below role, Desktop: Right side */} +
+ {transactionTemplateToggle == TRANSACTION_TEMPLATE_TOGGLE.TEMPLATES && ( +
+ + + +
+ )}
-
- {/* Host Fields (for In-Person Signers) */} - {recipient.type == recipientType.INPERSONSIGNER && ( -
+ {/* Name and Email Fields */} +
+ {/* Mobile: Stack vertically, Tablet+: Side by side */}
-
-
- {renderEditableField(recipient, "hostName", "Host Name")} +
+
+
+ {renderEditableField(recipient, "firstName", "First Name")} +
+
+
+
+ {renderEditableField(recipient, "lastName", "Last Name")} +
-
+
- {renderEditableField(recipient, "hostEmail", "Host Email", "", "email")} + {renderEditableField(recipient, "email", "Recipient Email", "", "email")}
- )} - {/* Recipient Type Radio Buttons */} -
- - - + {/* Host Fields (for In-Person Signers) */} + {recipient.type == recipientType.INPERSONSIGNER && ( +
+
+
+
+ {renderEditableField(recipient, "hostName", "Host Name")} +
+
+
+
+ {renderEditableField(recipient, "hostEmail", "Host Email", "", "email")} +
+
+
+
+ )} + + {/* Recipient Type Radio Buttons */} +
+ + + +
-
- {/* Action Buttons */} - {signType != "self-sign" && ( -
- -
- )} + {/* Action Buttons */} + {signType != "self-sign" && ( +
+ +
+ )} + + + +
diff --git a/src/components/process/processStepOne/RecipientsCon.tsx b/src/components/process/processStepOne/RecipientsCon.tsx index 6bb3226..ee1ed6c 100644 --- a/src/components/process/processStepOne/RecipientsCon.tsx +++ b/src/components/process/processStepOne/RecipientsCon.tsx @@ -19,10 +19,11 @@ interface RecipientsConIntProps { userData: UserState; isModal: boolean; submitError?: FormSubmitInt; - setEditRecipientsModal?: React.Dispatch + setEditRecipientsModal?: React.Dispatch; + signingOrder?: boolean; } -const RecipientsCon: React.FC = ({ transactionTemplateToggle, accountId, transactionId, userData, submitError, isModal = true, setEditRecipientsModal }) => { +const RecipientsCon: React.FC = ({ transactionTemplateToggle, accountId, transactionId, userData, submitError, isModal = true, setEditRecipientsModal, signingOrder }) => { const dispatch = useDispatch() const topRef = useRef(null); @@ -144,6 +145,7 @@ const RecipientsCon: React.FC = ({ transactionTemplateTog editRecipient={editRecipient} setEditRecipientCurrentEmail={setEditRecipientCurrentEmail} editRecipientCurrentEmail={editRecipientCurrentEmail} + signingOrder={signingOrder} /> {submitError && submitError.showError &&

diff --git a/vite.config.ts b/vite.config.ts index 010e543..d651257 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -7,6 +7,7 @@ export default defineConfig({ base: '/', plugins: [react(), tailwindcss()], server: { + port: 5174, allowedHosts: [ 'quality-friendly-goldfish.ngrok-free.app', 'officially-powerful-goat.ngrok-free.app',