Skip to content

Commit

Permalink
Merge branch 'development' of github.com:hotosm/fmtm into feat/mapper…
Browse files Browse the repository at this point in the history
…-flow-test
  • Loading branch information
NSUWAL123 committed Sep 5, 2024
2 parents 869cdee + 07ccf9b commit 174d88c
Show file tree
Hide file tree
Showing 10 changed files with 37 additions and 48 deletions.
Binary file removed src/frontend/src/assets/images/no-file.png
Binary file not shown.
Binary file removed src/frontend/src/assets/images/notFound.png
Binary file not shown.
Binary file added src/frontend/src/assets/images/page-not-found.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 0 additions & 13 deletions src/frontend/src/components/createnewproject/DataExtract.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -191,22 +191,9 @@ const DataExtract = ({ flag, customDataExtractUpload, setCustomDataExtractUpload
const geojsonFile = new File([extractFeatCol], 'custom_extract.geojson', { type: 'application/json' });
setDataExtractToState(geojsonFile);
}
const hasGeojsonLineString = checkGeomTypeInGeojson(extractFeatCol, 'LineString');
if (extractFeatCol && extractFeatCol?.features?.length > 0) {
handleCustomChange('customDataExtractUpload', event.target.files[0]);
handleCustomChange('hasGeojsonLineString', hasGeojsonLineString);
handleCustomChange('task_split_type', task_split_type['choose_area_as_task'].toString());
if (!hasGeojsonLineString) {
dispatch(
CommonActions.SetSnackBar({
open: true,
message:
'Features must contain line data (roads, rivers) otherwise the task splitting algorithm will not work.',
variant: 'warning',
duration: 8000,
}),
);
}
// View on map
await dispatch(CreateProjectActions.setDataExtractGeojson(extractFeatCol));
return;
Expand Down
5 changes: 1 addition & 4 deletions src/frontend/src/components/createnewproject/SplitTasks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,7 @@ const SplitTasks = ({ flag, geojsonFile, setGeojsonFile, customDataExtractUpload
name: 'define_tasks',
value: task_split_type['task_splitting_algorithm'].toString(),
label: 'Task Splitting Algorithm',
disabled:
!projectDetails?.hasGeojsonLineString && projectDetails?.dataExtractWays === 'custom_data_extract'
? true
: false,
disabled: false,
},
];

Expand Down
1 change: 0 additions & 1 deletion src/frontend/src/store/slices/CreateProjectSlice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ export const initialState: CreateProjectStateTypes = {
formWays: 'existing_form',
hasCustomTMS: false,
custom_tms_url: '',
hasGeojsonLineString: true,
},
projectDetailsResponse: null,
projectDetailsLoading: false,
Expand Down
1 change: 0 additions & 1 deletion src/frontend/src/store/types/ICreateProject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ export type ProjectDetailsTypes = {
per_task_instructions?: string;
custom_tms_url: string;
hasCustomTMS: boolean;
hasGeojsonLineString: boolean;
};

export type ProjectAreaTypes = {
Expand Down
47 changes: 27 additions & 20 deletions src/frontend/src/views/NotFound404.tsx
Original file line number Diff line number Diff line change
@@ -1,26 +1,33 @@
import React from 'react';
import pageNoFound from '@/assets/images/notFound.png';
import CoreModules from '@/shared/CoreModules';
import NotFound from '@/assets/images/page-not-found.png';
import Button from '@/components/common/Button';
import { useNavigate } from 'react-router-dom';

const NotFoundPage = () => {
const ProjectNotFound = () => {
const navigate = useNavigate();
return (
<CoreModules.Stack
className="notFound"
backgroundColor="white"
display="flex"
flexDirection="column"
alignItems="center"
p={3}
>
<CoreModules.Typography mt={'9%'} style={{ wordWrap: 'break-word' }} variant="subtitle2">
{`The page you were looking for doesn't exist.`}
</CoreModules.Typography>
<CoreModules.Typography style={{ wordWrap: 'break-word' }} variant="h3">
You may have mistyped the address or the page may have moved.
</CoreModules.Typography>
<img src={pageNoFound} style={{ height: '22%' }} />
</CoreModules.Stack>
<div className="md:fmtm-px-[2rem] lg:fmtm-px-[4.5rem] fmtm-h-full fmtm-bg-white">
<div className="fmtm-flex fmtm-flex-col fmtm-items-center fmtm-h-[90%] fmtm-justify-center fmtm-gap-[3rem] sm:fmtm-gap-[3.75rem]">
<div>
<img src={NotFound} alt="Project Not Found Photo" className="fmtm-w-[12rem] lg:fmtm-w-[16.75rem]" />
</div>
<div className="fmtm-flex fmtm-flex-col fmtm-gap-3">
<h2 className="fmtm-text-[1.5rem] md:fmtm-text-[2rem] lg:fmtm-text-[2.5rem] fmtm-text-[#4F4F4F] fmtm-font-barlow fmtm-font-bold fmtm-text-center">
404
</h2>
<p className="fmtm-text-sm sm:fmtm-text-base fmtm-text-center fmtm-text-[#4F4F4F] fmtm-uppercase fmtm-font-semibold">
Page Not Found
</p>
</div>
<Button
btnText="Return Home"
onClick={() => navigate('/')}
btnType="other"
className="fmtm-mx-auto fmtm-rounded-none fmtm-py-2"
/>
</div>
</div>
);
};

export default NotFoundPage;
export default ProjectNotFound;
18 changes: 9 additions & 9 deletions src/frontend/src/views/ProjectNotFound.tsx
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
import React from 'react';
import NoFileImage from '@/assets/images/no-file.png';
import NoFileImage from '@/assets/images/project-not-found.png';
import Button from '@/components/common/Button';
import { useNavigate } from 'react-router-dom';

const ProjectNotFound = () => {
const navigate = useNavigate();
return (
<div className="md:fmtm-px-[2rem] lg:fmtm-px-[4.5rem] fmtm-h-full">
<div className="fmtm-flex fmtm-flex-col fmtm-items-center fmtm-h-[90%] fmtm-justify-center">
<div className="fmtm-mb-[5rem]">
<img src={NoFileImage} alt="Project Not Found Photo" className="fmtm-w-[12rem] lg:fmtm-w-[15.625rem]" />
<div className="fmtm-flex fmtm-flex-col fmtm-items-center fmtm-h-[90%] fmtm-justify-center fmtm-gap-[3rem] sm:fmtm-gap-[5rem]">
<div>
<img src={NoFileImage} alt="Project Not Found Photo" className="lg:fmtm-w-[7.688rem]" />
</div>
<div className="fmtm-flex fmtm-flex-col fmtm-gap-3">
<h2 className="fmtm-text-[1.5rem] md:fmtm-text-[2rem] lg:fmtm-text-[2.5rem] fmtm-text-primaryRed fmtm-font-barlow fmtm-font-bold fmtm-text-center">
<h2 className="fmtm-text-[1.5rem] md:fmtm-text-[2rem] lg:fmtm-text-[2.5rem] fmtm-text-[#4F4F4F] fmtm-font-barlow fmtm-font-bold fmtm-text-center">
PROJECT NOT FOUND
</h2>
<p className="fmtm-text-sm sm:fmtm-text-base fmtm-text-center fmtm-text-[#68707F]">
There is no project to show, please create a project by clicking the button below.{' '}
<p className="fmtm-text-sm sm:fmtm-text-base fmtm-text-center fmtm-text-[#4F4F4F] fmtm-uppercase fmtm-font-semibold">
There is no project to show
</p>
</div>
<Button
btnText="Create Project"
onClick={() => navigate('/create-project')}
btnType="primary"
className="fmtm-mx-auto fmtm-rounded-none fmtm-py-2 fmtm-mt-8"
btnType="other"
className="fmtm-mx-auto fmtm-rounded-none fmtm-py-2"
/>
</div>
</div>
Expand Down

0 comments on commit 174d88c

Please sign in to comment.