From 19abe70a647bec6d09d1ee6ffc89f629b8298b07 Mon Sep 17 00:00:00 2001 From: =bhagwanSingh <=bhagwan.r@hicglobalsolutions.com> Date: Thu, 31 Jul 2025 12:25:44 +0530 Subject: [PATCH] a --- .../DocumentCompletionScreen.tsx | 2 +- .../process/processStepOne/ProcessStepOne.tsx | 42 ++++++++++++------- .../processStepOne/RecipientAddCard.tsx | 40 ++++++++++-------- .../processStepTwo/DocumentContainer.tsx | 7 +--- .../process/processStepTwo/NavTwo.tsx | 22 +++++++++- .../rightSideBar/DirectionalControls.tsx | 16 +++---- src/components/templates/Templates.tsx | 14 +++---- .../transactions/TransactionView.tsx | 2 +- src/store/slices/documentSlice.ts | 8 +++- src/store/slices/selectedRecipientsSlice.tsx | 33 +++++++++------ src/utlity/JoyRideTour.tsx | 6 +++ 11 files changed, 122 insertions(+), 70 deletions(-) diff --git a/src/components/process/CompletionScreen/DocumentCompletionScreen.tsx b/src/components/process/CompletionScreen/DocumentCompletionScreen.tsx index 706c76e..aae9504 100644 --- a/src/components/process/CompletionScreen/DocumentCompletionScreen.tsx +++ b/src/components/process/CompletionScreen/DocumentCompletionScreen.tsx @@ -48,7 +48,7 @@ const SignersList: React.FC<{ signers: Signer[] }> = ({ signers }) => { {signers.map((signer) => (
Send
++ {transactionTemplateToggle === TRANSACTION_TEMPLATE_TOGGLE.TEMPLATES ? "Save" : "Send"} +
{recipient.status}
handleNavigateToSign(recipient.id)}
className='text-white rounded-sm bg-[var(--primary)] px-3 py-1 font-semibold'>
diff --git a/src/store/slices/documentSlice.ts b/src/store/slices/documentSlice.ts
index cd011c3..06bfa79 100644
--- a/src/store/slices/documentSlice.ts
+++ b/src/store/slices/documentSlice.ts
@@ -213,7 +213,13 @@ export const fetchDocuments = createAsyncThunk<
`/api/accounts/${accountId}/${toggle}/${transactionId}/documents?include_images=true`
);
- return response.data as Document[];
+ const data = response.data as Document[];
+
+ if (data.length === 0 && window.location.pathname.includes('/process-step-two')) {
+ window.location.href = window.location.href.replace("process-step-two", "process-step-one") // ✅ navigate using window
+ }
+
+ return data;
} catch (error: any) {
return rejectWithValue(error.response?.data || 'Failed to fetch documents');
}
diff --git a/src/store/slices/selectedRecipientsSlice.tsx b/src/store/slices/selectedRecipientsSlice.tsx
index 217b7d5..f7a3d02 100644
--- a/src/store/slices/selectedRecipientsSlice.tsx
+++ b/src/store/slices/selectedRecipientsSlice.tsx
@@ -463,7 +463,13 @@ export const fetchRecipients = createAsyncThunk<
const basePath = `/api/accounts/${accountId}/${toggle}/${transactionId}/recipients`;
const response = await api.get(basePath);
- return response.data as Recipient[];
+ const data = response.data as Recipient[];
+
+ if (data.length === 0 && window.location.pathname.includes('/process-step-two')) {
+ window.location.href = window.location.href.replace("process-step-two", "process-step-one") // ✅ navigate using window
+ }
+
+ return data as Recipient[];
} catch (err: any) {
return rejectWithValue(err.response?.data || "Failed to fetch recipients");
}
@@ -475,17 +481,20 @@ const selectedRecipientsSlice = createSlice({
initialState,
reducers: {
addRecipient: (state, action: PayloadAction