diff --git a/src/frontend/src/api/Project.ts b/src/frontend/src/api/Project.ts index ac14e5f84f..ab2e46d60e 100755 --- a/src/frontend/src/api/Project.ts +++ b/src/frontend/src/api/Project.ts @@ -48,6 +48,7 @@ export const ProjectById = (projectId: string) => { custom_tms_url: projectResp?.custom_tms_url, organisation_id: projectResp?.organisation_id, organisation_logo: projectResp?.organisation_logo, + organisation_name: projectResp?.organisation_name, created_at: projectResp?.created_at, }), ); diff --git a/src/frontend/src/api/Submission.ts b/src/frontend/src/api/Submission.ts index e1a05122ec..d5d2f1e838 100644 --- a/src/frontend/src/api/Submission.ts +++ b/src/frontend/src/api/Submission.ts @@ -3,6 +3,7 @@ import { SubmissionActions } from '@/store/slices/SubmissionSlice'; export const SubmissionService: Function = (url: string) => { return async (dispatch) => { + dispatch(SubmissionActions.SetSubmissionDetails(null)); dispatch(SubmissionActions.SetSubmissionDetailsLoading(true)); const getSubmissionDetails = async (url: string) => { try { diff --git a/src/frontend/src/components/ProjectDetailsV2/ProjectInfo.tsx b/src/frontend/src/components/ProjectDetailsV2/ProjectInfo.tsx index f55b491c88..bf68787afc 100644 --- a/src/frontend/src/components/ProjectDetailsV2/ProjectInfo.tsx +++ b/src/frontend/src/components/ProjectDetailsV2/ProjectInfo.tsx @@ -106,6 +106,7 @@ const ProjectInfo: React.FC = () => { alt="Organization Photo" /> +

{projectInfo?.organisation_name}

)} diff --git a/src/frontend/src/components/ProjectSubmissions/SubmissionsTable.tsx b/src/frontend/src/components/ProjectSubmissions/SubmissionsTable.tsx index 48b43bce87..52edfe47bb 100644 --- a/src/frontend/src/components/ProjectSubmissions/SubmissionsTable.tsx +++ b/src/frontend/src/components/ProjectSubmissions/SubmissionsTable.tsx @@ -464,7 +464,7 @@ const SubmissionsTable = ({ toggleView }) => { headerClassName="updatedHeader !fmtm-sticky fmtm-right-0 fmtm-shadow-[-10px_0px_20px_0px_rgba(0,0,0,0.1)] fmtm-text-center" rowClassName="updatedRow !fmtm-sticky fmtm-right-0 fmtm-bg-white fmtm-shadow-[-10px_0px_20px_0px_rgba(0,0,0,0.1)]" dataFormat={(row) => { - const taskUid = taskList?.find((task) => task?.id == row?.task_id)?.id; + const taskUid = taskList?.find((task) => task?.index == row?.task_id)?.id; return (
diff --git a/src/frontend/src/components/createnewproject/UploadArea.tsx b/src/frontend/src/components/createnewproject/UploadArea.tsx index 993f201f20..549d2ce263 100644 --- a/src/frontend/src/components/createnewproject/UploadArea.tsx +++ b/src/frontend/src/components/createnewproject/UploadArea.tsx @@ -31,11 +31,11 @@ const uploadAreaOptions = [ }, ]; -const UploadArea = ({ flag, geojsonFile, setGeojsonFile, setCustomDataExtractUpload }) => { +const UploadArea = ({ flag, geojsonFile, setGeojsonFile, setCustomDataExtractUpload, setAdditionalFeature }) => { useDocumentTitle('Create Project: Upload Area'); + const dispatch = useDispatch(); const navigate = useNavigate(); - // const [uploadAreaFile, setUploadAreaFile] = useState(null); const [isGeojsonWGS84, setIsGeojsonWG84] = useState(true); const projectDetails = useAppSelector((state) => state.createproject.projectDetails); @@ -66,13 +66,15 @@ const UploadArea = ({ flag, geojsonFile, setGeojsonFile, setCustomDataExtractUpl navigate('/upload-survey'); dispatch(CreateProjectActions.SetToggleSplittedGeojsonEdit(false)); }; + const { handleSubmit, handleCustomChange, values: formValues, errors, }: any = useForm(projectDetails, submission, UploadAreaValidation); - const toggleStep = (step, url) => { + + const toggleStep = (step: number, url: string) => { dispatch(CommonActions.SetCurrentStepFormStep({ flag: flag, step: step })); navigate(url); dispatch(CreateProjectActions.SetToggleSplittedGeojsonEdit(false)); @@ -168,11 +170,14 @@ const UploadArea = ({ flag, geojsonFile, setGeojsonFile, setCustomDataExtractUpl const resetFile = () => { setGeojsonFile(null); + setCustomDataExtractUpload(null); handleCustomChange('uploadedAreaFile', null); handleCustomChange('drawnGeojson', null); + setAdditionalFeature(null); dispatch(CreateProjectActions.SetDrawnGeojson(null)); dispatch(CreateProjectActions.SetTotalAreaSelection(null)); - dispatch(CreateProjectActions.ClearProjectStepState(formValues)); + dispatch(CreateProjectActions.SetAdditionalFeatureGeojson(null)); + dispatch(CreateProjectActions.ClearProjectStepState({ ...formValues, uploadedAreaFile: null, drawnGeojson: null })); }; useEffect(() => { @@ -279,38 +284,6 @@ const UploadArea = ({ flag, geojsonFile, setGeojsonFile, setCustomDataExtractUpl btnText="Upload a Geojson" errorMsg={errors.uploadedAreaFile} /> - //
- //
- // - //
- // resetFile()} /> - //
- //
- // {geojsonFile && ( - //
- //

{geojsonFile?.name}

- //
- // )} - //

- // *The supported file formats are zipped shapefile, geojson or kml files. - //

- //

- // Total Area: 234 sq.km - //

- //
)}
diff --git a/src/frontend/src/models/project/projectModel.ts b/src/frontend/src/models/project/projectModel.ts index 79518ce134..acdfb21793 100644 --- a/src/frontend/src/models/project/projectModel.ts +++ b/src/frontend/src/models/project/projectModel.ts @@ -51,6 +51,7 @@ export type projectInfoType = { total_tasks: any; organisation_id: number; organisation_logo: string; + organisation_name: string; instructions: string; custom_tms_url: string; created_at: string; diff --git a/src/frontend/src/views/CreateNewProject.tsx b/src/frontend/src/views/CreateNewProject.tsx index 19840c1683..90fa1ecb93 100644 --- a/src/frontend/src/views/CreateNewProject.tsx +++ b/src/frontend/src/views/CreateNewProject.tsx @@ -67,6 +67,7 @@ const CreateNewProject = () => { geojsonFile={geojsonFile} setGeojsonFile={setGeojsonFile} setCustomDataExtractUpload={setCustomDataExtractUpload} + setAdditionalFeature={setAdditionalFeature} /> ); case '/upload-survey':