From b97b3bd10d822e0649186898db2dc1757feb31a8 Mon Sep 17 00:00:00 2001
From: Nishit Suwal <81785002+NSUWAL123@users.noreply.github.com>
Date: Thu, 11 Jul 2024 21:10:33 +0545
Subject: [PATCH] fix(createNewProject): save current form step state on
previous btn click (#1643)
---
src/frontend/src/components/createnewproject/SelectForm.tsx | 5 ++++-
src/frontend/src/components/createnewproject/SplitTasks.tsx | 5 ++++-
src/frontend/src/components/createnewproject/UploadArea.tsx | 5 ++++-
3 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/src/frontend/src/components/createnewproject/SelectForm.tsx b/src/frontend/src/components/createnewproject/SelectForm.tsx
index ce7375c982..42ce85a41f 100644
--- a/src/frontend/src/components/createnewproject/SelectForm.tsx
+++ b/src/frontend/src/components/createnewproject/SelectForm.tsx
@@ -195,7 +195,10 @@ const SelectForm = ({ flag, geojsonFile, customFormFile, setCustomFormFile }) =>
btnText="PREVIOUS"
btnType="secondary"
type="button"
- onClick={() => toggleStep(2, '/upload-area')}
+ onClick={() => {
+ dispatch(CreateProjectActions.SetIndividualProjectDetailsData(formValues));
+ toggleStep(2, '/upload-area');
+ }}
className="fmtm-font-bold"
/>
diff --git a/src/frontend/src/components/createnewproject/SplitTasks.tsx b/src/frontend/src/components/createnewproject/SplitTasks.tsx
index c6d7457dad..913b2e0308 100644
--- a/src/frontend/src/components/createnewproject/SplitTasks.tsx
+++ b/src/frontend/src/components/createnewproject/SplitTasks.tsx
@@ -343,7 +343,10 @@ const SplitTasks = ({ flag, geojsonFile, setGeojsonFile, customDataExtractUpload
btnText="PREVIOUS"
btnType="secondary"
type="button"
- onClick={() => toggleStep(3, '/data-extract')}
+ onClick={() => {
+ dispatch(CreateProjectActions.SetIndividualProjectDetailsData(formValues));
+ toggleStep(3, '/data-extract');
+ }}
className="fmtm-font-bold"
/>