Skip to content

Commit

Permalink
fix: console log errors during project creation
Browse files Browse the repository at this point in the history
  • Loading branch information
spwoodcock committed Feb 23, 2024
1 parent 708dfbc commit ffa1b59
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 12 deletions.
20 changes: 13 additions & 7 deletions src/frontend/src/components/createnewproject/SplitTasks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,9 @@ const SplitTasks = ({ flag, geojsonFile, setGeojsonFile, customLineUpload, custo
/>
</div>
{errors.dimension && (
<p className="fmtm-form-error fmtm-text-red-600 fmtm-text-sm fmtm-py-1">{errors.dimension}</p>
<div>
<p className="fmtm-form-error fmtm-text-red-600 fmtm-text-sm fmtm-py-1">{errors.dimension}</p>
</div>
)}
</>
)}
Expand All @@ -356,9 +358,11 @@ const SplitTasks = ({ flag, geojsonFile, setGeojsonFile, customLineUpload, custo
/>
</div>
{errors.average_buildings_per_task && (
<p className="fmtm-form-error fmtm-text-red-600 fmtm-text-sm fmtm-py-1">
{errors.average_buildings_per_task}
</p>
<div>
<p className="fmtm-form-error fmtm-text-red-600 fmtm-text-sm fmtm-py-1">
{errors.average_buildings_per_task}
</p>
</div>
)}
</>
)}
Expand Down Expand Up @@ -395,9 +399,11 @@ const SplitTasks = ({ flag, geojsonFile, setGeojsonFile, customLineUpload, custo
{(splitTasksSelection === task_split_type['divide_on_square'] ||
splitTasksSelection === task_split_type['task_splitting_algorithm'] ||
splitTasksSelection === task_split_type['choose_area_as_task']) && (
<p className="fmtm-text-gray-500 fmtm-mt-5">
Total number of task: <span className="fmtm-font-bold">{totalSteps}</span>
</p>
<div>
<p className="fmtm-text-gray-500 fmtm-mt-5">
Total number of task: <span className="fmtm-font-bold">{totalSteps}</span>
</p>
</div>
)}
</div>
<div className="fmtm-flex fmtm-gap-5 fmtm-mx-auto fmtm-mt-10 fmtm-my-5">
Expand Down
9 changes: 6 additions & 3 deletions src/frontend/src/components/createnewproject/UploadArea.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import FileInputComponent from '@/components/common/FileInputComponent';
import NewDefineAreaMap from '@/views/NewDefineAreaMap';
import { checkWGS84Projection } from '@/utilfunctions/checkWGS84Projection.js';
import { valid } from 'geojson-validation';
import { DivideSquareIcon } from 'lucide-react';

const uploadAreaOptions = [
{
Expand Down Expand Up @@ -187,14 +188,14 @@ const UploadArea = ({ flag, geojsonFile, setGeojsonFile, setCustomLineUpload, se
<div className="fmtm-flex fmtm-gap-7 fmtm-flex-col lg:fmtm-flex-row">
<div className="fmtm-bg-white lg:fmtm-w-[20%] xl:fmtm-w-[17%] fmtm-px-5 fmtm-py-6">
<h6 className="fmtm-text-xl fmtm-font-[600] fmtm-pb-2 lg:fmtm-pb-6">Upload Area</h6>
<p className="fmtm-text-gray-500 lg:fmtm-flex lg:fmtm-flex-col lg:fmtm-gap-3">
<div className="fmtm-text-gray-500 lg:fmtm-flex lg:fmtm-flex-col lg:fmtm-gap-3">
<span>You can choose to upload the AOI. Note: The file upload only supports .geojson format. </span>
<div>
<p>You may also draw a freehand polygon on map interface.</p>{' '}
<p>Click on the reset button to redraw the AOI.</p>
</div>
<span>The total area of the AOI is also calculated and displayed on the screen.</span>
</p>
</div>
</div>
<div className="lg:fmtm-w-[80%] xl:fmtm-w-[83%] lg:fmtm-h-[60vh] xl:fmtm-h-[58vh] fmtm-bg-white fmtm-px-5 lg:fmtm-px-11 fmtm-py-6 lg:fmtm-overflow-y-scroll lg:scrollbar">
<div className="fmtm-w-full fmtm-flex fmtm-gap-6 md:fmtm-gap-14 fmtm-flex-col md:fmtm-flex-row fmtm-h-full">
Expand Down Expand Up @@ -241,7 +242,9 @@ const UploadArea = ({ flag, geojsonFile, setGeojsonFile, setCustomLineUpload, se
Total Area: <span className="fmtm-font-bold">{totalAreaSelection}</span>
</p>
{errors.drawnGeojson && (
<p className="fmtm-form-error fmtm-text-red-600 fmtm-text-sm fmtm-py-1">{errors.drawnGeojson}</p>
<div>
<p className="fmtm-form-error fmtm-text-red-600 fmtm-text-sm fmtm-py-1">{errors.drawnGeojson}</p>
</div>
)}
</div>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ function SelectFormValidation(values: ProjectValues) {
errors.customFormUpload = 'Form needs to be Uploaded.';
}

console.log(errors);
return errors;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ function UploadAreaValidation(values: ProjectValues) {
errors.uploadedAreaFile = 'Uploaded Area File is Required.';
}

console.log(errors);
return errors;
}

Expand Down

0 comments on commit ffa1b59

Please sign in to comment.