Skip to content

Commit

Permalink
fix(createNewProject): save current form step state on previous btn c…
Browse files Browse the repository at this point in the history
…lick (#1643)
  • Loading branch information
NSUWAL123 authored Jul 11, 2024
1 parent fd11d08 commit b97b3bd
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
5 changes: 4 additions & 1 deletion src/frontend/src/components/createnewproject/SelectForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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"
/>
<Button btnText="NEXT" btnType="primary" type="submit" className="fmtm-font-bold" />
Expand Down
5 changes: 4 additions & 1 deletion src/frontend/src/components/createnewproject/SplitTasks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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"
/>
<Button
Expand Down
5 changes: 4 additions & 1 deletion src/frontend/src/components/createnewproject/UploadArea.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,10 @@ const UploadArea = ({ flag, geojsonFile, setGeojsonFile, setCustomDataExtractUpl
btnText="PREVIOUS"
btnType="secondary"
type="button"
onClick={() => toggleStep(1, '/create-project')}
onClick={() => {
dispatch(CreateProjectActions.SetIndividualProjectDetailsData(formValues));
toggleStep(1, '/create-project');
}}
className="fmtm-font-bold"
/>
<Button btnText="NEXT" btnType="primary" type="submit" className="fmtm-font-bold" />
Expand Down

0 comments on commit b97b3bd

Please sign in to comment.