From 74cb4d1917306faa4a3de49b2ec23d3b14ba5a07 Mon Sep 17 00:00:00 2001 From: Varun Date: Thu, 29 Jun 2023 11:40:02 +0545 Subject: [PATCH 1/2] feat: redirected to project specific detail page after project creation --- .../main/src/components/createproject/FormSelection.tsx | 4 +++- src/frontend/main/src/views/CreateProject.tsx | 1 - 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/frontend/main/src/components/createproject/FormSelection.tsx b/src/frontend/main/src/components/createproject/FormSelection.tsx index 18e795755b..b957426a0c 100755 --- a/src/frontend/main/src/components/createproject/FormSelection.tsx +++ b/src/frontend/main/src/components/createproject/FormSelection.tsx @@ -11,6 +11,7 @@ import useForm from '../../hooks/useForm'; import SelectFormValidation from './validation/SelectFormValidation'; import { CommonActions } from '../../store/slices/CommonSlice'; import LoadingBar from './LoadingBar'; +import environment from '../../environment'; // import { SelectPicker } from 'rsuite'; let generateProjectLogIntervalCb = null; @@ -120,7 +121,8 @@ const FormSelection: React.FC = ({ geojsonFile,customFormFile,setCustomFormFile, useEffect(() => { if (generateQrSuccess && generateProjectLog?.status === 'SUCCESS') { clearInterval(generateProjectLogIntervalCb); - navigate('/'); + const encodedProjectId = environment.encode(projectDetailsResponse?.id) + navigate(`/project_details/${encodedProjectId}`); dispatch( CommonActions.SetSnackBar({ open: true, diff --git a/src/frontend/main/src/views/CreateProject.tsx b/src/frontend/main/src/views/CreateProject.tsx index df6e7d5917..21b1bc65f2 100755 --- a/src/frontend/main/src/views/CreateProject.tsx +++ b/src/frontend/main/src/views/CreateProject.tsx @@ -5,7 +5,6 @@ import CoreModules from '../shared/CoreModules'; import UploadArea from '../components/createproject/UploadArea'; import { useLocation, Link } from 'react-router-dom'; import ProjectDetailsForm from '../components/createproject/ProjectDetailsForm'; -import BasemapSelection from '../components/createproject/BasemapSelection'; import FormSelection from '../components/createproject/FormSelection'; import DefineTasks from '../components/createproject/DefineTasks'; import { CreateProjectActions } from '../store/slices/CreateProjectSlice'; From fa0f0dbf64e55c0b1cbfe54c3b79d837f90afbb8 Mon Sep 17 00:00:00 2001 From: Varun Date: Thu, 29 Jun 2023 11:40:33 +0545 Subject: [PATCH 2/2] fix: project detail metadata not showing --- src/frontend/fmtm_openlayer_map/src/api/Project.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/frontend/fmtm_openlayer_map/src/api/Project.js b/src/frontend/fmtm_openlayer_map/src/api/Project.js index a978f02949..4e8fa8714e 100755 --- a/src/frontend/fmtm_openlayer_map/src/api/Project.js +++ b/src/frontend/fmtm_openlayer_map/src/api/Project.js @@ -27,6 +27,19 @@ export const ProjectById = (url, existingProjectList) => { { id: resp.id, taskBoundries: persistingValues }, ]) ); + dispatch( + ProjectActions.SetProjectInfo({id:resp.id, + priority:resp.priority || 2, + priority_str:resp.priority_str || "MEDIUM", + title:resp.project_info?.[0]?.name, + location_str:resp.location_str, + description:resp.description, + num_contributors:resp.num_contributors, + total_tasks:resp.total_tasks, + tasks_mapped:resp.tasks_mapped, + tasks_validated:resp.tasks_validated, + tasks_bad:resp.tasks_bad}) + ); } catch (error) { // console.log('error :', error) }