setChoropleth({ ...municipalStyles, lineThickness: 3 }, feature, resolution)
}
@@ -287,7 +257,9 @@ const TaskSubmissionsMap = () => {
collapsed={true}
/>
- {buildingGeojson && }
+ {dataExtractUrl && isValidUrl(dataExtractUrl) && (
+
+ )}
);
diff --git a/src/frontend/src/components/SubmissionMap/SubmissionMap.jsx b/src/frontend/src/components/SubmissionMap/SubmissionMap.jsx
deleted file mode 100644
index 881910627c..0000000000
--- a/src/frontend/src/components/SubmissionMap/SubmissionMap.jsx
+++ /dev/null
@@ -1,64 +0,0 @@
-import React, { useState } from 'react';
-import useOLMap from '@/hooks/useOlMap';
-import { MapContainer as MapComponent } from '@/components/MapComponent/OpenLayersComponent';
-import LayerSwitcherControl from '@/components/MapComponent/OpenLayersComponent/LayerSwitcher/index.js';
-import { VectorLayer } from '@/components/MapComponent/OpenLayersComponent/Layers';
-
-function elastic(t) {
- return Math.pow(2, -10 * t) * Math.sin(((t - 0.075) * (2 * Math.PI)) / 0.3) + 1;
-}
-
-const SubmissionMap = ({ outlineBoundary, featureGeojson }) => {
- const { mapRef, map } = useOLMap({
- // center: fromLonLat([85.3, 27.7]),
- center: [0, 0],
- zoom: 4,
- maxZoom: 25,
- });
-
- return (
-
-
-
- {outlineBoundary?.type && (
-
- )}
- {featureGeojson?.type && }
- {/* )} */}
-
-
- );
-};
-
-SubmissionMap.propTypes = {};
-
-export default SubmissionMap;
diff --git a/src/frontend/src/components/TasksMap/TasksMap.jsx b/src/frontend/src/components/TasksMap/TasksMap.jsx
deleted file mode 100644
index c15b806099..0000000000
--- a/src/frontend/src/components/TasksMap/TasksMap.jsx
+++ /dev/null
@@ -1,67 +0,0 @@
-import React from 'react';
-import useOLMap from '@/hooks/useOlMap';
-import { MapContainer as MapComponent } from '@/components/MapComponent/OpenLayersComponent';
-import LayerSwitcherControl from '@/components/MapComponent/OpenLayersComponent/LayerSwitcher/index.js';
-import { VectorLayer } from '@/components/MapComponent/OpenLayersComponent/Layers';
-
-function elastic(t) {
- return Math.pow(2, -10 * t) * Math.sin(((t - 0.075) * (2 * Math.PI)) / 0.3) + 1;
-}
-const basicGeojsonTemplate = {
- type: 'FeatureCollection',
- features: [],
-};
-const TasksMap = ({ projectTaskBoundries, projectBuildingGeojson }) => {
- // const projectTaskBoundries = CoreModules.useAppSelector((state) => state.project.projectTaskBoundries);
- // const projectBuildingGeojson = CoreModules.useAppSelector((state) => state.project.projectBuildingGeojson);
-
- const { mapRef, map } = useOLMap({
- // center: fromLonLat([85.3, 27.7]),
- center: [0, 0],
- zoom: 4,
- maxZoom: 25,
- });
- console.log(projectTaskBoundries, 'projectTaskBoundries');
-
- return (
-
-
-
- {/*
- */}
-
-
- );
-};
-
-TasksMap.propTypes = {};
-
-export default TasksMap;
diff --git a/src/frontend/src/components/createnewproject/validation/CreateProjectValidation.tsx b/src/frontend/src/components/createnewproject/validation/CreateProjectValidation.tsx
index 9f24902769..8aaa8563c4 100755
--- a/src/frontend/src/components/createnewproject/validation/CreateProjectValidation.tsx
+++ b/src/frontend/src/components/createnewproject/validation/CreateProjectValidation.tsx
@@ -1,3 +1,5 @@
+import { isValidUrl } from '@/utilfunctions/urlChecker';
+
interface ProjectValues {
organisation_id: string;
name: string;
@@ -26,15 +28,6 @@ interface ValidationErrors {
const regexForSymbol = /_/g;
-function isValidUrl(url: string) {
- try {
- new URL(url);
- return true;
- } catch (error) {
- return false;
- }
-}
-
function CreateProjectValidation(values: ProjectValues) {
const errors: ValidationErrors = {};
diff --git a/src/frontend/src/components/organisation/Validation/OrganisationAddValidation.tsx b/src/frontend/src/components/organisation/Validation/OrganisationAddValidation.tsx
index 0d947418f4..bbd4935658 100644
--- a/src/frontend/src/components/organisation/Validation/OrganisationAddValidation.tsx
+++ b/src/frontend/src/components/organisation/Validation/OrganisationAddValidation.tsx
@@ -1,3 +1,5 @@
+import { isValidUrl } from '@/utilfunctions/urlChecker';
+
interface OrganisationValues {
logo: string;
name: string;
@@ -19,15 +21,6 @@ interface ValidationErrors {
odk_central_password?: string;
}
-function isValidUrl(url: string) {
- try {
- new URL(url);
- return true;
- } catch (error) {
- return false;
- }
-}
-
function OrganisationAddValidation(values: OrganisationValues) {
const errors: ValidationErrors = {};
diff --git a/src/frontend/src/store/slices/ProjectSlice.ts b/src/frontend/src/store/slices/ProjectSlice.ts
index 20a82bdf03..352cd1a377 100755
--- a/src/frontend/src/store/slices/ProjectSlice.ts
+++ b/src/frontend/src/store/slices/ProjectSlice.ts
@@ -10,8 +10,7 @@ const ProjectSlice = createSlice({
projectInfo: {},
projectSubmissionLoading: false,
projectSubmission: [],
- projectBuildingGeojsonLoading: false,
- projectBuildingGeojson: [],
+ projectDataExtractLoading: false,
downloadProjectFormLoading: { type: 'form', loading: false },
generateProjectTilesLoading: false,
tilesList: [],
@@ -48,12 +47,6 @@ const ProjectSlice = createSlice({
SetProjectSubmission(state, action) {
state.projectSubmission = action.payload;
},
- GetProjectBuildingGeojsonLoading(state, action) {
- state.projectSubmissionLoading = action.payload;
- },
- SetProjectBuildingGeojson(state, action) {
- state.projectBuildingGeojson = action.payload;
- },
SetDownloadProjectFormLoading(state, action) {
state.downloadProjectFormLoading = action.payload;
},
diff --git a/src/frontend/src/utilfunctions/urlChecker.ts b/src/frontend/src/utilfunctions/urlChecker.ts
new file mode 100644
index 0000000000..ac2c705c9d
--- /dev/null
+++ b/src/frontend/src/utilfunctions/urlChecker.ts
@@ -0,0 +1,8 @@
+export function isValidUrl(url) {
+ try {
+ new URL(url);
+ return true;
+ } catch (error) {
+ return false;
+ }
+}
diff --git a/src/frontend/src/views/NewProjectDetails.jsx b/src/frontend/src/views/NewProjectDetails.jsx
index cffb47b8b6..e027cfdb68 100644
--- a/src/frontend/src/views/NewProjectDetails.jsx
+++ b/src/frontend/src/views/NewProjectDetails.jsx
@@ -7,13 +7,13 @@ import environment from '@/environment';
import { ProjectById } from '@/api/Project';
import { ProjectActions } from '@/store/slices/ProjectSlice';
import CustomizedSnackbar from '@/utilities/CustomizedSnackbar';
+import { Modal } from '@/components/common/Modal';
import OnScroll from '@/hooks/OnScroll';
import { HomeActions } from '@/store/slices/HomeSlice';
import CoreModules from '@/shared/CoreModules';
import AssetModules from '@/shared/AssetModules';
import FmtmLogo from '@/assets/images/hotLog.png';
import GenerateBasemap from '@/components/GenerateBasemap';
-import { ProjectBuildingGeojsonService } from '@/api/SubmissionService';
import TaskSectionPopup from '@/components/ProjectDetails/TaskSectionPopup';
import DialogTaskActions from '@/components/DialogTaskActions';
import QrcodeComponent from '@/components/QrcodeComponent';
@@ -28,7 +28,6 @@ import LayerSwitcherControl from '@/components/MapComponent/OpenLayersComponent/
import MapControlComponent from '@/components/ProjectDetails/MapControlComponent';
import { VectorLayer } from '@/components/MapComponent/OpenLayersComponent/Layers';
import { geojsonObjectModel } from '@/constants/geojsonObjectModal';
-import { basicGeojsonTemplate } from '@/utilities/mapUtils';
import getTaskStatusStyle from '@/utilfunctions/getTaskStatusStyle';
import { defaultStyles } from '@/components/MapComponent/OpenLayersComponent/helpers/styleUtils';
import MapLegends from '@/components/MapLegends';
@@ -38,6 +37,7 @@ import { Icon, Style } from 'ol/style';
import { Motion } from '@capacitor/motion';
import locationArc from '@/assets/images/locationArc.png';
import { CommonActions } from '@/store/slices/CommonSlice';
+import { isValidUrl } from '@/utilfunctions/urlChecker';
const Home = () => {
const dispatch = CoreModules.useAppDispatch();
@@ -49,11 +49,14 @@ const Home = () => {
const [mainView, setView] = useState();
const [featuresLayer, setFeaturesLayer] = useState();
const [toggleGenerateModal, setToggleGenerateModal] = useState(false);
- const [taskBuildingGeojson, setTaskBuildingGeojson] = useState(null);
- const [initialFeaturesLayer, setInitialFeaturesLayer] = useState(null);
+ const [taskBoundariesLayer, setTaskBoundariesLayer] = useState(null);
+ const [dataExtractUrl, setDataExtractUrl] = useState(null);
+ const [dataExtractExtent, setDataExtractExtent] = useState(null);
const [currentCoordinate, setCurrentCoordinate] = useState({ latitude: null, longitude: null });
const [positionGeojson, setPositionGeojson] = useState(null);
const [deviceRotation, setDeviceRotation] = useState(0);
+ const [selectedFeature, setSelectedFeature] = useState(false);
+ const [dataExtractModalOpen, setDataExtractModalOpen] = useState(false);
const encodedId = params.id;
const decodedId = environment.decode(encodedId);
@@ -61,7 +64,6 @@ const Home = () => {
const state = CoreModules.useAppSelector((state) => state.project);
const projectInfo = CoreModules.useAppSelector((state) => state.home.selectedProject);
const stateSnackBar = CoreModules.useAppSelector((state) => state.home.snackbar);
- const projectBuildingGeojson = CoreModules.useAppSelector((state) => state.project.projectBuildingGeojson);
const mobileFooterSelection = CoreModules.useAppSelector((state) => state.project.mobileFooterSelection);
const mapTheme = CoreModules.useAppSelector((state) => state.theme.hotTheme);
const geolocationStatus = CoreModules.useAppSelector((state) => state.project.geolocationStatus);
@@ -80,13 +82,13 @@ const Home = () => {
}),
);
};
+
//Fetch project for the first time
useEffect(() => {
dispatch(ProjectActions.SetNewProjectTrigger());
if (state.projectTaskBoundries.findIndex((project) => project.id == environment.decode(encodedId)) == -1) {
dispatch(ProjectActions.SetProjectTaskBoundries([]));
dispatch(ProjectById(state.projectTaskBoundries, environment.decode(encodedId)));
- // dispatch(ProjectBuildingGeojsonService(`${import.meta.env.VITE_API_URL}/projects/${environment.decode(encodedId)}/features`))
} else {
dispatch(ProjectActions.SetProjectTaskBoundries([]));
dispatch(ProjectById(state.projectTaskBoundries, environment.decode(encodedId)));
@@ -98,9 +100,7 @@ const Home = () => {
dispatch(ProjectActions.SetProjectInfo(projectInfo));
}
}
- return () => {
- dispatch(ProjectActions.SetProjectBuildingGeojson(null));
- };
+ return () => {};
}, [params.id]);
const { mapRef, map } = useOLMap({
@@ -123,39 +123,21 @@ const Home = () => {
},
id: `${feature.id}_${feature.task_status}`,
}));
- const taskBuildingGeojsonFeatureCollection = {
+ const taskBoundariesFeatcol = {
...geojsonObjectModel,
features: features,
};
- setInitialFeaturesLayer(taskBuildingGeojsonFeatureCollection);
+ setTaskBoundariesLayer(taskBoundariesFeatcol);
}, [state.projectTaskBoundries[0]?.taskBoundries?.length]);
- useEffect(() => {
- if (!map) return;
- if (!projectBuildingGeojson) return;
-
- const taskBuildingGeojsonFeatureCollection = {
- ...basicGeojsonTemplate,
- features: [
- ...projectBuildingGeojson?.map((feature) => ({
- ...feature.geometry,
- id: feature.id,
- })),
- ],
- };
-
- setTaskBuildingGeojson(taskBuildingGeojsonFeatureCollection);
- }, [map, projectBuildingGeojson]);
-
// TasksLayer(map, mainView, featuresLayer);
const projectClickOnMap = (properties, feature) => {
setFeaturesLayer(feature, 'feature');
- let extent = properties.geometry.getExtent();
- dispatch(
- ProjectBuildingGeojsonService(
- `${import.meta.env.VITE_API_URL}/projects/${decodedId}/features?task_id=${properties.uid}`,
- ),
- );
+ const extent = properties.geometry.getExtent();
+
+ setDataExtractExtent(properties.geometry);
+ setDataExtractUrl(state.projectInfo.data_extract_url);
+
mapRef.current?.scrollIntoView({
block: 'center',
behavior: 'smooth',
@@ -173,6 +155,11 @@ const Home = () => {
}
};
+ const displayDataExtractValues = (properties) => {
+ setSelectedFeature(properties);
+ setDataExtractModalOpen(true);
+ };
+
const buildingStyle = {
...defaultStyles,
lineColor: '#FF0000',
@@ -282,6 +269,23 @@ const Home = () => {
/>
+
+
+ {Object.entries(selectedFeature).map(([key, value]) => (
+ {`${key}: ${value}`}
+ ))}
+
+ }
+ open={dataExtractModalOpen}
+ onOpenChange={(value) => {
+ setDataExtractModalOpen(value);
+ }}
+ />
+
+
{/* Top project details heading medium dimension*/}
{windowSize.width >= 640 && (
@@ -367,7 +371,6 @@ const Home = () => {
)}
- {/* */}
{params?.id && (
{
>
- {initialFeaturesLayer && initialFeaturesLayer?.features?.length > 0 && (
+ {taskBoundariesLayer && taskBoundariesLayer?.features?.length > 0 && (
{
getTaskStatusStyle={(feature) => getTaskStatusStyle(feature, mapTheme)}
/>
)}
- {taskBuildingGeojson && taskBuildingGeojson?.features?.length > 0 && (
+ {dataExtractUrl && isValidUrl(dataExtractUrl) && (
{
constrainResolution: true,
duration: 2000,
}}
+ mapOnClick={displayDataExtractValues}
zoomToLayer
- zIndex={5}
+ zIndex={10}
/>
)}
{geolocationStatus && currentCoordinate?.latitude && currentCoordinate?.longitude && (
@@ -422,7 +427,7 @@ const Home = () => {
constrainResolution: true,
duration: 2000,
}}
- zIndex={5}
+ zIndex={15}
rotation={deviceRotation}
/>
)}
diff --git a/src/frontend/src/views/ProjectDetails.jsx b/src/frontend/src/views/ProjectDetails.jsx
index 080e7dd062..518b7b5462 100755
--- a/src/frontend/src/views/ProjectDetails.jsx
+++ b/src/frontend/src/views/ProjectDetails.jsx
@@ -1,3 +1,5 @@
+// TODO should this be deleted??
+
import React, { useEffect, useRef, useState } from 'react';
import '../styles/home.scss';
import WindowDimension from '@/hooks/WindowDimension';
@@ -24,7 +26,6 @@ import GeoJSON from 'ol/format/GeoJSON';
import FmtmLogo from '@/assets/images/hotLog.png';
import GenerateBasemap from '@/components/GenerateBasemap';
-import { ProjectBuildingGeojsonService } from '@/api/SubmissionService';
import { get } from 'ol/proj';
import { buildingStyle, basicGeojsonTemplate } from '@/utilities/mapUtils';
import MapLegends from '@/components/MapLegends';
@@ -82,12 +83,11 @@ const Home = () => {
//Fetch project for the first time
useEffect(() => {
+ console.log('HERE');
dispatch(ProjectActions.SetNewProjectTrigger());
if (state.projectTaskBoundries.findIndex((project) => project.id == environment.decode(encodedId)) == -1) {
dispatch(ProjectActions.SetProjectTaskBoundries([]));
dispatch(ProjectById(state.projectTaskBoundries, environment.decode(encodedId)));
-
- // dispatch(ProjectBuildingGeojsonService(`${import.meta.env.VITE_API_URL}/projects/${environment.decode(encodedId)}/features`))
} else {
dispatch(ProjectActions.SetProjectTaskBoundries([]));
dispatch(ProjectById(state.projectTaskBoundries, environment.decode(encodedId)));
@@ -100,7 +100,7 @@ const Home = () => {
}
}
return () => {
- dispatch(ProjectActions.SetProjectBuildingGeojson(null));
+ dispatch(ProjectActions.SetProjectDataExtract(null));
};
}, [params.id]);
@@ -180,13 +180,13 @@ const Home = () => {
document.querySelector('#project-details-map').scrollIntoView({
behavior: 'smooth',
});
- dispatch(
- ProjectBuildingGeojsonService(
- `${import.meta.env.VITE_API_URL}/projects/${decodedId}/features?task_id=${
- feature?.getId()?.split('_')?.[0]
- }`,
- ),
- );
+ // dispatch(
+ // ProjectDataExtractService(
+ // `${import.meta.env.VITE_API_URL}/projects/${decodedId}/features?task_id=${
+ // feature?.getId()?.split('_')?.[0]
+ // }`,
+ // ),
+ // );
}
});
});
@@ -366,7 +366,6 @@ const Home = () => {
)}
- {/* */}
{params?.id && (
{
const dispatch = CoreModules.useAppDispatch();
@@ -53,8 +53,9 @@ const Home = () => {
const [mainView, setView] = useState();
const [featuresLayer, setFeaturesLayer] = useState();
const [toggleGenerateModal, setToggleGenerateModal] = useState(false);
- const [taskBuildingGeojson, setTaskBuildingGeojson] = useState(null);
- const [initialFeaturesLayer, setInitialFeaturesLayer] = useState(null);
+ const [dataExtractUrl, setDataExtractUrl] = useState(null);
+ const [dataExtractExtent, setDataExtractExtent] = useState(null);
+ const [taskBoundariesLayer, setTaskBoundariesLayer] = useState(null);
const [currentCoordinate, setCurrentCoordinate] = useState({ latitude: null, longitude: null });
const [positionGeojson, setPositionGeojson] = useState(null);
const [deviceRotation, setDeviceRotation] = useState(0);
@@ -65,7 +66,6 @@ const Home = () => {
const state = CoreModules.useAppSelector((state) => state.project);
const projectInfo = CoreModules.useAppSelector((state) => state.home.selectedProject);
const stateSnackBar = CoreModules.useAppSelector((state) => state.home.snackbar);
- const projectBuildingGeojson = CoreModules.useAppSelector((state) => state.project.projectBuildingGeojson);
const mobileFooterSelection = CoreModules.useAppSelector((state) => state.project.mobileFooterSelection);
const mapTheme = CoreModules.useAppSelector((state) => state.theme.hotTheme);
const geolocationStatus = CoreModules.useAppSelector((state) => state.project.geolocationStatus);
@@ -102,9 +102,7 @@ const Home = () => {
dispatch(ProjectActions.SetProjectInfo(projectInfo));
}
}
- return () => {
- dispatch(ProjectActions.SetProjectBuildingGeojson(null));
- };
+ return () => {};
}, [params.id]);
const { mapRef, map } = useOLMap({
@@ -126,30 +124,13 @@ const Home = () => {
},
id: `${feature.id}_${feature.task_status}`,
}));
- const taskBuildingGeojsonFeatureCollection = {
+ const taskBoundariesFeatcol = {
...geojsonObjectModel,
features: features,
};
- setInitialFeaturesLayer(taskBuildingGeojsonFeatureCollection);
+ setTaskBoundariesLayer(taskBoundariesFeatcol);
}, [state.projectTaskBoundries[0]?.taskBoundries?.length]);
- useEffect(() => {
- if (!map) return;
- if (!projectBuildingGeojson) return;
-
- const taskBuildingGeojsonFeatureCollection = {
- ...basicGeojsonTemplate,
- features: [
- ...projectBuildingGeojson?.map((feature) => ({
- ...feature.geometry,
- id: feature.id,
- })),
- ],
- };
-
- setTaskBuildingGeojson(taskBuildingGeojsonFeatureCollection);
- }, [map, projectBuildingGeojson]);
-
useEffect(() => {
dispatch(GetProjectDashboard(`${import.meta.env.VITE_API_URL}/projects/project_dashboard/${decodedId}`));
}, []);
@@ -158,11 +139,10 @@ const Home = () => {
const projectClickOnMap = (properties, feature) => {
setFeaturesLayer(feature, 'feature');
let extent = properties.geometry.getExtent();
- dispatch(
- ProjectBuildingGeojsonService(
- `${import.meta.env.VITE_API_URL}/projects/${decodedId}/features?task_id=${properties.uid}`,
- ),
- );
+
+ setDataExtractExtent(properties.geometry);
+ setDataExtractUrl(state.projectInfo.data_extract_url);
+
mapRef.current?.scrollIntoView({
block: 'center',
behavior: 'smooth',
@@ -392,9 +372,9 @@ const Home = () => {
>
- {initialFeaturesLayer && initialFeaturesLayer?.features?.length > 0 && (
+ {taskBoundariesLayer && taskBoundariesLayer?.features?.length > 0 && (
{
getTaskStatusStyle={(feature) => getTaskStatusStyle(feature, mapTheme)}
/>
)}
- {taskBuildingGeojson && taskBuildingGeojson?.features?.length > 0 && (
+ {dataExtractUrl && isValidUrl(dataExtractUrl) && (
{
if (state.projectTaskBoundries.findIndex((project) => project.id == environment.decode(encodedId)) == -1) {
dispatch(ProjectActions.SetProjectTaskBoundries([]));
dispatch(ProjectById(state.projectTaskBoundries, environment.decode(encodedId)));
-
- // dispatch(ProjectBuildingGeojsonService(`${import.meta.env.VITE_API_URL}/projects/${environment.decode(encodedId)}/features`))
} else {
dispatch(ProjectActions.SetProjectTaskBoundries([]));
dispatch(ProjectById(state.projectTaskBoundries, environment.decode(encodedId)));
@@ -91,21 +91,6 @@ const ProjectInfo = () => {
);
};
- // useEffect(() => {
- // const fetchData = () => {
- // dispatch(fetchInfoTask(`${environment.baseApiUrl}/tasks/tasks-features/?project_id=${decodedId}`));
- // };
- // fetchData();
- // let interval;
- // if (isMonitoring) {
- // interval = setInterval(fetchData, 3000);
- // } else {
- // clearInterval(interval);
- // }
-
- // return () => clearInterval(interval);
- // }, [dispatch, isMonitoring]);
-
useEffect(() => {
const fetchData = () => {
dispatch(fetchInfoTask(`${import.meta.env.VITE_API_URL}/tasks/tasks-features/?project_id=${decodedId}`));
diff --git a/src/frontend/src/views/Submissions.tsx b/src/frontend/src/views/Submissions.tsx
index 6b69859902..a12f4a8301 100755
--- a/src/frontend/src/views/Submissions.tsx
+++ b/src/frontend/src/views/Submissions.tsx
@@ -1,3 +1,5 @@
+// TODO should this be deleted??
+
import React, { useEffect } from 'react';
// import '../styles/home.css'
import CoreModules from '@/shared/CoreModules';
@@ -5,7 +7,6 @@ import CoreModules from '@/shared/CoreModules';
import Avatar from '@/assets/images/avatar.png';
import SubmissionMap from '@/components/SubmissionMap/SubmissionMap';
import environment from '@/environment';
-import { ProjectBuildingGeojsonService, ProjectSubmissionService } from '@/api/SubmissionService';
import { ProjectActions } from '@/store/slices/ProjectSlice';
import { ProjectById } from '@/api/Project';
@@ -23,7 +24,7 @@ const Submissions = () => {
// const theme = CoreModules.useAppSelector(state => state.theme.hotTheme)
useEffect(() => {
dispatch(ProjectSubmissionService(`${import.meta.env.VITE_API_URL}/submission/?project_id=${decodedId}`));
- dispatch(ProjectBuildingGeojsonService(`${import.meta.env.VITE_API_URL}/projects/${decodedId}/features`));
+ // dispatch(ProjectDataExtractService(`${import.meta.env.VITE_API_URL}/projects/${decodedId}/features`));
//creating a manual thunk that will make an API call then autamatically perform state mutation whenever we navigate to home page
}, []);
diff --git a/src/frontend/src/views/Tasks.tsx b/src/frontend/src/views/Tasks.tsx
index 96dd72ca10..deb90306af 100644
--- a/src/frontend/src/views/Tasks.tsx
+++ b/src/frontend/src/views/Tasks.tsx
@@ -1,3 +1,5 @@
+// TODO should this be deleted??
+
import React, { useEffect, useState } from 'react';
// import '../styles/home.css'
import CoreModules from '@/shared/CoreModules';
@@ -6,9 +8,8 @@ import AssetModules from '@/shared/AssetModules';
// import { styled, alpha } from '@mui/material';
import Avatar from '@/assets/images/avatar.png';
-import SubmissionMap from '@/components/SubmissionMap/SubmissionMap';
import environment from '@/environment';
-import { ProjectBuildingGeojsonService, ProjectSubmissionService } from '@/api/SubmissionService';
+import { ProjectSubmissionService } from '@/api/SubmissionService';
import { ProjectActions } from '@/store/slices/ProjectSlice';
import { ProjectById } from '@/api/Project';
import { getDownloadProjectSubmission } from '@/api/task';
@@ -37,22 +38,22 @@ const TasksSubmission = () => {
`${import.meta.env.VITE_API_URL}/submission/?project_id=${decodedProjectId}&task_id=${decodedTaskId}`,
),
);
- dispatch(
- ProjectBuildingGeojsonService(
- `${import.meta.env.VITE_API_URL}/projects/${decodedProjectId}/features?task_id=${decodedTaskId}`,
- ),
- );
+ // dispatch(
+ // ProjectDataExtractService(
+ // `${import.meta.env.VITE_API_URL}/projects/${decodedProjectId}/features?task_id=${decodedTaskId}`,
+ // ),
+ // );
//creating a manual thunk that will make an API call then autamatically perform state mutation whenever we navigate to home page
}, []);
//Fetch project for the first time
useEffect(() => {
if (state.projectTaskBoundries.findIndex((project) => project.id == environment.decode(encodedProjectId)) == -1) {
dispatch(ProjectById(state.projectTaskBoundries, environment.decode(encodedProjectId)));
- dispatch(
- ProjectBuildingGeojsonService(
- `${import.meta.env.VITE_API_URL}/projects/${environment.decode(encodedProjectId)}/features`,
- ),
- );
+ // dispatch(
+ // ProjectDataExtractService(
+ // `${import.meta.env.VITE_API_URL}/projects/${environment.decode(encodedProjectId)}/features`,
+ // ),
+ // );
} else {
dispatch(ProjectActions.SetProjectTaskBoundries([]));
dispatch(ProjectById(state.projectTaskBoundries, environment.decode(encodedProjectId)));