From c543d2ca01f97c0b9df5e3c4dfdf130dde9b6d1e Mon Sep 17 00:00:00 2001 From: Varun Date: Mon, 11 Sep 2023 17:20:35 +0545 Subject: [PATCH 1/4] fix: create project single AOI --- src/frontend/main/src/components/createproject/UploadArea.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/frontend/main/src/components/createproject/UploadArea.tsx b/src/frontend/main/src/components/createproject/UploadArea.tsx index d53cf5ec7f..1e0c952c90 100755 --- a/src/frontend/main/src/components/createproject/UploadArea.tsx +++ b/src/frontend/main/src/components/createproject/UploadArea.tsx @@ -119,7 +119,7 @@ const UploadArea: React.FC = ({ geojsonFile, setGeojsonFile, setInputValue, { - dispatch(CreateProjectActions.SetDrawnGeojson(JSON.parse(geojson))); + dispatch(CreateProjectActions.SetDividedTaskGeojson(JSON.parse(geojson))); }} /> From bd1ecc1de2f5430a38ec82633501ab86e05fd6e6 Mon Sep 17 00:00:00 2001 From: Varun Date: Mon, 11 Sep 2023 17:26:01 +0545 Subject: [PATCH 2/4] fix: commented pagination for future --- src/frontend/main/src/views/Home.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/frontend/main/src/views/Home.jsx b/src/frontend/main/src/views/Home.jsx index f5256ffc1b..13baf652a8 100755 --- a/src/frontend/main/src/views/Home.jsx +++ b/src/frontend/main/src/views/Home.jsx @@ -111,7 +111,7 @@ const Home = () => { */} -
+ {/*
1-5 of 10
{ type="number" className="fmtm-w-10 fmtm-rounded-md fmtm-border-[1px] fmtm-border-[#E7E2E2] fmtm-outline-none" /> -
+
*/} ); }; From cddc460379dda53b9a1d23924ed02f5654bcee10 Mon Sep 17 00:00:00 2001 From: Varun Date: Mon, 11 Sep 2023 17:28:46 +0545 Subject: [PATCH 3/4] fix: edit project symbol changes on regex --- .../EditProjectDetailsValidation.ts | 106 +++++++++--------- 1 file changed, 52 insertions(+), 54 deletions(-) diff --git a/src/frontend/main/src/components/editproject/validation/EditProjectDetailsValidation.ts b/src/frontend/main/src/components/editproject/validation/EditProjectDetailsValidation.ts index b10bbd7812..06a0c6676a 100644 --- a/src/frontend/main/src/components/editproject/validation/EditProjectDetailsValidation.ts +++ b/src/frontend/main/src/components/editproject/validation/EditProjectDetailsValidation.ts @@ -1,58 +1,56 @@ - interface ProjectValues { - organization: string; - name: string; - username: string; - id: string; - short_description: string; - description: string; - // odk_central_url: string; - // odk_central_user: string; - // odk_central_password: string; + organization: string; + name: string; + username: string; + id: string; + short_description: string; + description: string; + // odk_central_url: string; + // odk_central_user: string; + // odk_central_password: string; +} +interface ValidationErrors { + organization?: string; + name?: string; + username?: string; + id?: string; + short_description?: string; + description?: string; + // odk_central_url?: string; + // odk_central_user?: string; + // odk_central_password?: string; +} +const regexForSymbol = /_/g; + +function EditProjectValidation(values: ProjectValues) { + const errors: ValidationErrors = {}; + + // if (!values?.organization) { + // errors.organization = 'Organization is Required.'; + // } + // if (!values?.odk_central_url) { + // errors.odk_central_url = 'ODK Central Url is Required.'; + // } + // if (!values?.odk_central_user) { + // errors.odk_central_user = 'ODK Central User is Required.'; + // } + // if (!values?.odk_central_password) { + // errors.odk_central_password = 'ODK Central Password is Required.'; + // } + if (!values?.name) { + errors.name = 'Project Name is Required.'; } - interface ValidationErrors { - organization?: string; - name?: string; - username?: string; - id?: string; - short_description?: string; - description?: string; - // odk_central_url?: string; - // odk_central_user?: string; - // odk_central_password?: string; + if (values?.name && regexForSymbol.test(values.name)) { + errors.name = 'Project Name should not contain _.'; } - const regexForSymbol = /[-_]/g; - - function EditProjectValidation(values: ProjectValues) { - const errors: ValidationErrors = {}; - - // if (!values?.organization) { - // errors.organization = 'Organization is Required.'; - // } - // if (!values?.odk_central_url) { - // errors.odk_central_url = 'ODK Central Url is Required.'; - // } - // if (!values?.odk_central_user) { - // errors.odk_central_user = 'ODK Central User is Required.'; - // } - // if (!values?.odk_central_password) { - // errors.odk_central_password = 'ODK Central Password is Required.'; - // } - if (!values?.name) { - errors.name = 'Project Name is Required.'; - } - if (values?.name && regexForSymbol.test(values.name)) { - errors.name = 'Project Name should not contain symbols.'; - } - if (!values?.short_description) { - errors.short_description = 'Short Description is Required.'; - } - if (!values?.description) { - errors.description = 'Description is Required.'; - } - - return errors; + if (!values?.short_description) { + errors.short_description = 'Short Description is Required.'; } - - export default EditProjectValidation; - \ No newline at end of file + if (!values?.description) { + errors.description = 'Description is Required.'; + } + + return errors; +} + +export default EditProjectValidation; From 3cba9154bb24aa3fcd0ddeb02c7f64a6d8d72204 Mon Sep 17 00:00:00 2001 From: Varun Date: Mon, 11 Sep 2023 17:55:57 +0545 Subject: [PATCH 4/4] fix: remove data extract on different dropdown selection --- .../fmtm_openlayer_map/src/views/DefineAreaMap.jsx | 6 ++++-- .../main/src/components/createproject/DataExtract.tsx | 8 ++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/frontend/fmtm_openlayer_map/src/views/DefineAreaMap.jsx b/src/frontend/fmtm_openlayer_map/src/views/DefineAreaMap.jsx index f2f4c65162..a76ee1095c 100644 --- a/src/frontend/fmtm_openlayer_map/src/views/DefineAreaMap.jsx +++ b/src/frontend/fmtm_openlayer_map/src/views/DefineAreaMap.jsx @@ -53,6 +53,7 @@ const DefineAreaMap = ({ setDataExtractedGeojson(e.target.result); }; } else { + setDataExtractedGeojson(null); } }, [uploadedDataExtractFile]); useEffect(() => { @@ -63,6 +64,7 @@ const DefineAreaMap = ({ setLineExtractedGeojson(e.target.result); }; } else { + setLineExtractedGeojson(null); } }, [uploadedLineExtractFile]); return ( @@ -128,7 +130,7 @@ const DefineAreaMap = ({ constrainResolution: true, duration: 2000, }} - // zoomToLayer + zoomToLayer /> )} {lineExtractedGeojson && ( @@ -151,7 +153,7 @@ const DefineAreaMap = ({ constrainResolution: true, duration: 2000, }} - // zoomToLayer + zoomToLayer /> )} diff --git a/src/frontend/main/src/components/createproject/DataExtract.tsx b/src/frontend/main/src/components/createproject/DataExtract.tsx index aec6af82ce..b99e47b4ef 100755 --- a/src/frontend/main/src/components/createproject/DataExtract.tsx +++ b/src/frontend/main/src/components/createproject/DataExtract.tsx @@ -76,6 +76,14 @@ const DataExtract: React.FC = ({ submission, DataExtractValidation, ); + useEffect(() => { + if (values.data_extract_options === 'Data Extract Ways') { + setDataExtractFile(null); + setDataExtractFileValue(null); + setLineExtractFile(null); + setLineExtractFileValue(null); + } + }, [values.data_extract_options]); return (