From 4c12cc3195f73bd820fdb9258028165209002fca Mon Sep 17 00:00:00 2001 From: Sam <78538841+spwoodcock@users.noreply.github.com> Date: Thu, 25 Jan 2024 18:31:55 +0000 Subject: [PATCH] refactor(frontend): use absolute (aliased) imports over relative imports (#1136) * fix: add vite alias @ for src dir * refactor(frontend): replace all relative imports with @ alias * build: add lint command to package.json (eslint) * build: add @ alias to tsconfig for type imports * refactor: fix all linting errors from eslint * fix: browser console errors incorrect React usage * fix: add axios interceptor withCredentials, plus API const * refactor: fix remaining relative imports --- src/frontend/package.json | 3 +- src/frontend/src/App.jsx | 38 ++++++++-- src/frontend/src/api/CreateProjectService.ts | 8 +-- src/frontend/src/api/Files.js | 2 +- src/frontend/src/api/HomeService.ts | 6 +- src/frontend/src/api/OrganisationService.ts | 8 +-- src/frontend/src/api/Project.js | 8 +-- src/frontend/src/api/ProjectTaskStatus.js | 10 +-- src/frontend/src/api/Submission.ts | 2 +- src/frontend/src/api/SubmissionService.ts | 6 +- src/frontend/src/api/index.js | 6 ++ src/frontend/src/api/task.ts | 4 +- src/frontend/src/components/Activities.jsx | 8 +-- .../src/components/ActivitiesPanel.jsx | 10 +-- .../src/components/DialogTaskActions.jsx | 12 ++-- .../src/components/GenerateBasemap.jsx | 8 +-- .../Layers/ClusterLayer.js | 6 +- .../OpenLayersComponent/Layers/VectorLayer.js | 4 +- .../Layers/VectorTileLayer.js | 4 +- .../OpenLayersComponent/Layers/index.js | 6 +- .../MapContainer/index.jsx | 2 + .../MapComponent/OpenLayersComponent/index.js | 4 +- .../components/MapDescriptionComponents.jsx | 4 +- src/frontend/src/components/MapLegends.jsx | 4 +- src/frontend/src/components/OpenLayersMap.jsx | 28 ++++---- .../ProjectDetails/MapControlComponent.tsx | 6 +- .../MobileActivitiesContents.tsx | 4 +- .../ProjectDetails/MobileFooter.tsx | 6 +- .../MobileProjectInfoContent.tsx | 2 +- .../ProjectDetails/ProjectOptions.tsx | 10 +-- .../ProjectDetails/TaskSectionPopup.tsx | 6 +- .../ProjectDetailsV2/ActivitiesPanel.tsx | 12 ++-- .../ProjectDetailsV2/MapControlComponent.tsx | 6 +- .../MobileActivitiesContents.tsx | 4 +- .../ProjectDetailsV2/MobileFooter.tsx | 6 +- .../MobileProjectInfoContent.tsx | 2 +- .../ProjectDetailsV2/ProjectInfo.tsx | 6 +- .../ProjectDetailsV2/ProjectOptions.tsx | 10 +-- .../ProjectDetailsV2/SkeletonLoader.tsx | 2 +- .../ProjectDetailsV2/TaskSectionPopup.tsx | 6 +- .../components/ProjectInfo/ProjectCard.jsx | 6 +- .../ProjectInfo/ProjectInfoCountCard.jsx | 6 +- .../ProjectInfoCountCardSkeleton.jsx | 4 +- .../ProjectInfo/ProjectInfoSidebar.jsx | 8 +-- .../ProjectInfoSidebarSkeleton.jsx | 2 +- .../components/ProjectInfo/ProjectInfomap.jsx | 24 +++---- .../src/components/ProjectMap/ProjectMap.jsx | 8 +-- .../src/components/QrcodeComponent.jsx | 12 ++-- .../SubmissionMap/SubmissionMap.jsx | 8 +-- src/frontend/src/components/TasksLayer.jsx | 8 +-- .../src/components/TasksMap/TasksMap.jsx | 8 +-- .../src/components/common/Accordion.tsx | 2 +- .../src/components/common/BottomSheet.tsx | 2 +- .../components/common/FileInputComponent.tsx | 2 +- src/frontend/src/components/common/Modal.tsx | 2 +- src/frontend/src/components/common/Select.tsx | 2 +- .../src/components/common/StepSwitcher.tsx | 6 +- src/frontend/src/components/common/Switch.tsx | 2 +- .../createnewproject/CreateProjectHeader.tsx | 2 +- .../createnewproject/DataExtract.tsx | 20 +++--- .../createnewproject/MapControlComponent.tsx | 6 +- .../createnewproject/ProjectDetailsForm.tsx | 28 ++++---- .../createnewproject/SelectForm.tsx | 24 +++---- .../createnewproject/SplitTasks.tsx | 31 ++++---- .../createnewproject/UploadArea.tsx | 25 +++---- .../validation/DefineTaskValidation.tsx | 2 +- .../createproject/BasemapSelection.tsx | 2 +- .../components/createproject/DataExtract.tsx | 16 ++--- .../components/createproject/DefineTasks.tsx | 18 ++--- .../createproject/FormSelection.tsx | 21 +++--- .../components/createproject/LoadingBar.tsx | 2 +- .../createproject/ProjectDetailsForm.tsx | 17 +++-- .../components/createproject/UploadArea.tsx | 6 +- .../editproject/EditProjectDetails.tsx | 16 ++--- .../src/components/editproject/UpdateForm.tsx | 8 +-- .../editproject/UpdateProjectArea.tsx | 10 +-- .../components/home/ExploreProjectCard.tsx | 14 ++-- .../src/components/home/HomePageFilters.tsx | 10 +-- .../components/home/ProjectCardSkeleton.tsx | 2 +- .../src/components/home/ProjectListMap.tsx | 20 +++--- .../organisation/OrganisationAddForm.tsx | 15 ++-- src/frontend/src/hooks/MapStyles.js | 4 +- src/frontend/src/hooks/Prompt.tsx | 2 +- src/frontend/src/hooks/useForm.tsx | 2 - src/frontend/src/routes.jsx | 34 ++++----- src/frontend/src/shared/AssetModules.js | 4 +- src/frontend/src/shared/CoreModules.js | 8 +-- src/frontend/src/store/Store.ts | 18 ++--- src/frontend/src/store/slices/CommonSlice.ts | 2 +- .../src/store/slices/CreateProjectSlice.ts | 2 +- src/frontend/src/store/slices/HomeSlice.ts | 2 +- src/frontend/src/store/slices/LoginSlice.ts | 2 +- src/frontend/src/store/slices/ThemeSlice.ts | 2 +- .../src/store/slices/organisationSlice.ts | 2 +- src/frontend/src/types/reduxTypes.ts | 2 +- .../src/utilfunctions/getTaskStatusStyle.js | 4 +- src/frontend/src/utilfunctions/login.ts | 2 +- src/frontend/src/utilfunctions/testUtils.jsx | 2 +- src/frontend/src/utilities/AppLoader.jsx | 2 +- src/frontend/src/utilities/BasicCard.tsx | 2 +- src/frontend/src/utilities/BasicDialog.jsx | 4 +- src/frontend/src/utilities/BasicDialog.tsx | 4 +- src/frontend/src/utilities/BasicTabs.tsx | 4 +- src/frontend/src/utilities/CustomDrawer.jsx | 12 ++-- .../src/utilities/CustomizedImage.jsx | 4 +- .../src/utilities/CustomizedMenus.tsx | 4 +- .../src/utilities/CustomizedModal.tsx | 1 + .../src/utilities/CustomizedProgressBar.tsx | 2 +- .../src/utilities/CustomizedSnackbar.jsx | 2 +- src/frontend/src/utilities/IconButtonCard.jsx | 2 +- src/frontend/src/utilities/MappingHeader.tsx | 4 +- src/frontend/src/utilities/PrimaryAppBar.tsx | 20 +++--- src/frontend/src/utilities/ProtectedRoute.jsx | 6 +- src/frontend/src/views/Authorized.tsx | 4 +- src/frontend/src/views/CreateNewProject.tsx | 22 +++--- src/frontend/src/views/CreateOrganisation.tsx | 12 ++-- src/frontend/src/views/CreateProject.tsx | 14 ++-- src/frontend/src/views/DefineAreaMap.tsx | 12 ++-- src/frontend/src/views/EditProject.tsx | 16 ++--- src/frontend/src/views/EditProjectArea.tsx | 8 +-- src/frontend/src/views/ErrorBoundary.tsx | 6 +- src/frontend/src/views/Home.jsx | 18 ++--- src/frontend/src/views/MainView.jsx | 14 ++-- src/frontend/src/views/NewDefineAreaMap.tsx | 12 ++-- src/frontend/src/views/NewProjectDetails.jsx | 68 +++++++++--------- src/frontend/src/views/NotFound404.jsx | 6 +- src/frontend/src/views/Organisation.tsx | 8 +-- src/frontend/src/views/ProjectDetails.jsx | 52 +++++++------- src/frontend/src/views/ProjectDetailsV2.tsx | 72 +++++++++---------- src/frontend/src/views/ProjectInfo.tsx | 20 +++--- src/frontend/src/views/SubmissionDetails.tsx | 6 +- src/frontend/src/views/Submissions.tsx | 15 ++-- src/frontend/src/views/Tasks.tsx | 19 ++--- src/frontend/src/views/UnderConstruction.tsx | 2 +- src/frontend/tests/App.test.tsx | 6 +- src/frontend/tests/CreateProject.test.tsx | 6 +- src/frontend/tsconfig.json | 5 +- src/frontend/vite.config.ts | 6 ++ 138 files changed, 681 insertions(+), 631 deletions(-) create mode 100644 src/frontend/src/api/index.js diff --git a/src/frontend/package.json b/src/frontend/package.json index 7e50d7887c..b5e7f6cdca 100755 --- a/src/frontend/package.json +++ b/src/frontend/package.json @@ -7,7 +7,8 @@ "build:start": "cd dist && PORT=8080 npx serve", "start": "env-cmd -f .env.dev vite dev", "start:live": "vite dev", - "test": "vitest tests/" + "test": "vitest tests/", + "lint": "eslint --fix --ext .js,.jsx,.ts,.tsx src" }, "license": "GPL-3.0-only", "author": { diff --git a/src/frontend/src/App.jsx b/src/frontend/src/App.jsx index e09fff60a4..9010333731 100755 --- a/src/frontend/src/App.jsx +++ b/src/frontend/src/App.jsx @@ -1,14 +1,17 @@ +import axios from 'axios'; import React, { useEffect } from 'react'; import ReactDOM from 'react-dom'; import { RouterProvider } from 'react-router-dom'; -import { store, persistor } from './store/Store'; import { Provider } from 'react-redux'; -import routes from './routes'; import { PersistGate } from 'redux-persist/integration/react'; -import './index.css'; + +import { store, persistor } from '@/store/Store'; +import routes from '@/routes'; +import environment from '@/environment'; + +import '@/index.css'; import 'ol/ol.css'; import 'react-loading-skeleton/dist/skeleton.css'; -import environment from './environment'; // Added Fix of Console Error of MUI Issue const consoleError = console.error; @@ -26,6 +29,32 @@ console.error = function filterWarnings(msg, ...args) { } }; +const GlobalInit = () => { + useEffect(() => { + axios.interceptors.request.use( + (config) => { + // Do something before request is sent + + // const excludedDomains = ['xxx', 'xxx']; + // const urlIsExcluded = excludedDomains.some((domain) => config.url.includes(domain)); + // if (!urlIsExcluded) { + // config.withCredentials = true; + // } + + config.withCredentials = true; + + return config; + }, + (error) => + // Do something with request error + Promise.reject(error), + ); + return () => {}; + }, []); + + return null; // Renders nothing +}; + const SentryInit = () => { useEffect(() => { if (import.meta.env.MODE === 'development') { @@ -105,6 +134,7 @@ ReactDOM.render( + diff --git a/src/frontend/src/api/CreateProjectService.ts b/src/frontend/src/api/CreateProjectService.ts index 45fdcbaaee..e6b192e517 100755 --- a/src/frontend/src/api/CreateProjectService.ts +++ b/src/frontend/src/api/CreateProjectService.ts @@ -1,13 +1,13 @@ import axios from 'axios'; -import { CreateProjectActions } from '../store/slices/CreateProjectSlice'; +import { CreateProjectActions } from '@/store/slices/CreateProjectSlice'; import { ProjectDetailsModel, FormCategoryListModel, OrganisationListModel, -} from '../models/createproject/createProjectModel'; -import { CommonActions } from '../store/slices/CommonSlice'; +} from '@/models/createproject/createProjectModel'; +import { CommonActions } from '@/store/slices/CommonSlice'; import { ValidateCustomFormResponse } from 'store/types/ICreateProject'; -import { task_split_type } from '../types/enums'; +import { task_split_type } from '@/types/enums'; const CreateProjectService: Function = ( url: string, diff --git a/src/frontend/src/api/Files.js b/src/frontend/src/api/Files.js index 554c8c9c59..bdf97aa805 100755 --- a/src/frontend/src/api/Files.js +++ b/src/frontend/src/api/Files.js @@ -1,5 +1,5 @@ import React, { useEffect, useState } from 'react'; -import CoreModules from '../shared/CoreModules'; +import CoreModules from '@/shared/CoreModules'; export const ProjectFilesById = (url, taskId) => { const [loading, setLoading] = useState(true); diff --git a/src/frontend/src/api/HomeService.ts b/src/frontend/src/api/HomeService.ts index de3ece8b3d..b15a519147 100755 --- a/src/frontend/src/api/HomeService.ts +++ b/src/frontend/src/api/HomeService.ts @@ -1,7 +1,7 @@ import axios from 'axios'; -import { HomeActions } from '../store/slices/HomeSlice'; -import { HomeProjectCardModel } from '../models/home/homeModel'; -import environment from '../environment'; +import { HomeActions } from '@/store/slices/HomeSlice'; +import { HomeProjectCardModel } from '@/models/home/homeModel'; +import environment from '@/environment'; export const HomeSummaryService: Function = (url: string) => { return async (dispatch) => { diff --git a/src/frontend/src/api/OrganisationService.ts b/src/frontend/src/api/OrganisationService.ts index 393156fc76..87e3490faf 100644 --- a/src/frontend/src/api/OrganisationService.ts +++ b/src/frontend/src/api/OrganisationService.ts @@ -1,8 +1,8 @@ import axios from 'axios'; -import { HomeProjectCardModel } from '../models/home/homeModel'; -import { GetOrganisationDataModel, OrganisationModal } from '../models/organisation/organisationModel'; -import { CommonActions } from '../store/slices/CommonSlice'; -import { OrganisationAction } from '../store/slices/organisationSlice'; +import { HomeProjectCardModel } from '@/models/home/homeModel'; +import { GetOrganisationDataModel, OrganisationModal } from '@/models/organisation/organisationModel'; +import { CommonActions } from '@/store/slices/CommonSlice'; +import { OrganisationAction } from '@/store/slices/organisationSlice'; function appendObjectToFormData(formData, object) { for (const [key, value] of Object.entries(object)) { diff --git a/src/frontend/src/api/Project.js b/src/frontend/src/api/Project.js index 7f85f0e333..625d531075 100755 --- a/src/frontend/src/api/Project.js +++ b/src/frontend/src/api/Project.js @@ -1,7 +1,7 @@ -import { ProjectActions } from '../store/slices/ProjectSlice'; -import CoreModules from '../shared/CoreModules'; -import environment from '../environment'; -import { task_priority_str } from '../types/enums'; +import { ProjectActions } from '@/store/slices/ProjectSlice'; +import CoreModules from '@/shared/CoreModules'; +import environment from '@/environment'; +import { task_priority_str } from '@/types/enums'; export const ProjectById = (existingProjectList, projectId) => { return async (dispatch) => { diff --git a/src/frontend/src/api/ProjectTaskStatus.js b/src/frontend/src/api/ProjectTaskStatus.js index 6e88a54b06..5e3dbe6960 100755 --- a/src/frontend/src/api/ProjectTaskStatus.js +++ b/src/frontend/src/api/ProjectTaskStatus.js @@ -1,9 +1,9 @@ -import { ProjectActions } from '../store/slices/ProjectSlice'; +import { ProjectActions } from '@/store/slices/ProjectSlice'; import { easeIn, easeOut } from 'ol/easing'; -import { HomeActions } from '../store/slices/HomeSlice'; -import CoreModules from '../shared/CoreModules'; -import { CommonActions } from '../store/slices/CommonSlice'; -import { task_priority_str } from '../types/enums'; +import { HomeActions } from '@/store/slices/HomeSlice'; +import CoreModules from '@/shared/CoreModules'; +import { CommonActions } from '@/store/slices/CommonSlice'; +import { task_priority_str } from '@/types/enums'; const UpdateTaskStatus = (url, style, existingData, currentProjectId, feature, map, view, taskId, body) => { return async (dispatch) => { diff --git a/src/frontend/src/api/Submission.ts b/src/frontend/src/api/Submission.ts index c282acefe5..fe96f2c484 100644 --- a/src/frontend/src/api/Submission.ts +++ b/src/frontend/src/api/Submission.ts @@ -1,5 +1,5 @@ import axios from 'axios'; -import { SubmissionActions } from '../store/slices/SubmissionSlice'; +import { SubmissionActions } from '@/store/slices/SubmissionSlice'; export const SubmissionService: Function = (url: string) => { return async (dispatch) => { diff --git a/src/frontend/src/api/SubmissionService.ts b/src/frontend/src/api/SubmissionService.ts index 66aedadc34..70d4e2a308 100644 --- a/src/frontend/src/api/SubmissionService.ts +++ b/src/frontend/src/api/SubmissionService.ts @@ -1,6 +1,6 @@ -import CoreModules from '../shared/CoreModules'; -import { ProjectActions } from '../store/slices/ProjectSlice'; -// import { HomeProjectCardModel } from '../models/home/homeModel'; +import CoreModules from '@/shared/CoreModules'; +import { ProjectActions } from '@/store/slices/ProjectSlice'; +// import { HomeProjectCardModel } from '@/models/home/homeModel'; export const ProjectSubmissionService: Function = (url: string) => { return async (dispatch) => { diff --git a/src/frontend/src/api/index.js b/src/frontend/src/api/index.js new file mode 100644 index 0000000000..1c74257b01 --- /dev/null +++ b/src/frontend/src/api/index.js @@ -0,0 +1,6 @@ +import axios from 'axios'; + +export const API = axios.create({ + baseURL: import.meta.env.VITE_API_URL, + withCredentials: true, +}); diff --git a/src/frontend/src/api/task.ts b/src/frontend/src/api/task.ts index 19b5158fe6..629fa90a99 100644 --- a/src/frontend/src/api/task.ts +++ b/src/frontend/src/api/task.ts @@ -1,5 +1,5 @@ -import CoreModules from '../shared/CoreModules'; -import { CommonActions } from '../store/slices/CommonSlice'; +import CoreModules from '@/shared/CoreModules'; +import { CommonActions } from '@/store/slices/CommonSlice'; export const fetchInfoTask: Function = (url: string) => { return async (dispatch) => { diff --git a/src/frontend/src/components/Activities.jsx b/src/frontend/src/components/Activities.jsx index 16c1b863e3..f916003585 100755 --- a/src/frontend/src/components/Activities.jsx +++ b/src/frontend/src/components/Activities.jsx @@ -1,9 +1,9 @@ import React from 'react'; -import IconButtonCard from '../utilities/IconButtonCard'; -import environment from '../environment'; +import IconButtonCard from '@/utilities/IconButtonCard'; +import environment from '@/environment'; import { easeIn, easeOut } from 'ol/easing'; -import CoreModules from '../shared/CoreModules'; -import AssetModules from '../shared/AssetModules'; +import CoreModules from '@/shared/CoreModules'; +import AssetModules from '@/shared/AssetModules'; //Activity Model to be display in Activities panel const Activities = ({ history, defaultTheme, mapDivPostion, map, view, state, params }) => { const index = state.projectTaskBoundries.findIndex((project) => project.id == environment.decode(params.id)); diff --git a/src/frontend/src/components/ActivitiesPanel.jsx b/src/frontend/src/components/ActivitiesPanel.jsx index 2725bad4d8..0c5a0d2976 100755 --- a/src/frontend/src/components/ActivitiesPanel.jsx +++ b/src/frontend/src/components/ActivitiesPanel.jsx @@ -1,9 +1,9 @@ import React, { useEffect, useState } from 'react'; -import BasicCard from '../utilities/BasicCard'; -import Activities from '../components/Activities'; -import environment from '../environment'; -import CoreModules from '../shared/CoreModules'; -import AssetModules from '../shared/AssetModules'; +import BasicCard from '@/utilities/BasicCard'; +import Activities from '@/components/Activities'; +import environment from '@/environment'; +import CoreModules from '@/shared/CoreModules'; +import AssetModules from '@/shared/AssetModules'; const Search = AssetModules.styled('div')(({ theme }) => ({ position: 'relative', diff --git a/src/frontend/src/components/DialogTaskActions.jsx b/src/frontend/src/components/DialogTaskActions.jsx index 5b0a3179c7..cfdcb100ff 100755 --- a/src/frontend/src/components/DialogTaskActions.jsx +++ b/src/frontend/src/components/DialogTaskActions.jsx @@ -1,10 +1,10 @@ import React, { useState, useEffect } from 'react'; -import environment from '../environment'; -import ProjectTaskStatus from '../api/ProjectTaskStatus'; -import MapStyles from '../hooks/MapStyles'; -import CoreModules from '../shared/CoreModules'; -import { CommonActions } from '../store/slices/CommonSlice'; -import { task_priority_str } from '../types/enums'; +import environment from '@/environment'; +import ProjectTaskStatus from '@/api/ProjectTaskStatus'; +import MapStyles from '@/hooks/MapStyles'; +import CoreModules from '@/shared/CoreModules'; +import { CommonActions } from '@/store/slices/CommonSlice'; +import { task_priority_str } from '@/types/enums'; export default function Dialog({ taskId, feature, map, view }) { // const featureStatus = feature.id_ != undefined ? feature.id_.replace("_", ",").split(',')[1] : null; diff --git a/src/frontend/src/components/GenerateBasemap.jsx b/src/frontend/src/components/GenerateBasemap.jsx index bc6c5bfcd9..d00f39664f 100644 --- a/src/frontend/src/components/GenerateBasemap.jsx +++ b/src/frontend/src/components/GenerateBasemap.jsx @@ -1,8 +1,8 @@ import React, { useEffect, useState } from 'react'; -import CoreModules from '../shared/CoreModules'; -import AssetModules from '../shared/AssetModules'; -import environment from '../environment'; -import { DownloadTile, GenerateProjectTiles, GetTilesList } from '../api/Project'; +import CoreModules from '@/shared/CoreModules'; +import AssetModules from '@/shared/AssetModules'; +import environment from '@/environment'; +import { DownloadTile, GenerateProjectTiles, GetTilesList } from '@/api/Project'; const GenerateBasemap = ({ setToggleGenerateModal, toggleGenerateModal, projectInfo }) => { const dispatch = CoreModules.useAppDispatch(); diff --git a/src/frontend/src/components/MapComponent/OpenLayersComponent/Layers/ClusterLayer.js b/src/frontend/src/components/MapComponent/OpenLayersComponent/Layers/ClusterLayer.js index bbe26f93f4..7ebaa41501 100644 --- a/src/frontend/src/components/MapComponent/OpenLayersComponent/Layers/ClusterLayer.js +++ b/src/frontend/src/components/MapComponent/OpenLayersComponent/Layers/ClusterLayer.js @@ -8,9 +8,9 @@ import Fill from 'ol/style/Fill'; import { Cluster, OSM as OSMSource } from 'ol/source'; import { Text, Circle, Icon } from 'ol/style'; import VectorSource from 'ol/source/Vector'; -import { hexToRgba } from '../../../MapComponent/OpenLayersComponent/helpers/styleUtils'; import SelectCluster from 'ol-ext/interaction/SelectCluster'; -import MarkerIcon from '../../../../assets/images/red_marker.png'; +import { hexToRgba } from '@/components/MapComponent/OpenLayersComponent/helpers/styleUtils'; +import MarkerIcon from '@/assets/images/red_marker.png'; function setAsyncStyle(style, feature, getIndividualStyle) { const styleCache = {}; @@ -202,8 +202,8 @@ const ClusterLayer = ({ font: '15px Times New Roman', }), }); - return style; fillColor = '#96bfff'; + return style; } else { return; } diff --git a/src/frontend/src/components/MapComponent/OpenLayersComponent/Layers/VectorLayer.js b/src/frontend/src/components/MapComponent/OpenLayersComponent/Layers/VectorLayer.js index 3ed0cc9a7f..f88a824ef3 100644 --- a/src/frontend/src/components/MapComponent/OpenLayersComponent/Layers/VectorLayer.js +++ b/src/frontend/src/components/MapComponent/OpenLayersComponent/Layers/VectorLayer.js @@ -8,8 +8,8 @@ import { Circle as CircleStyle, Fill, Stroke, Style } from 'ol/style.js'; import GeoJSON from 'ol/format/GeoJSON'; import { Vector as VectorSource } from 'ol/source'; import OLVectorLayer from 'ol/layer/Vector'; -import { defaultStyles, getStyles } from '../helpers/styleUtils'; -import { isExtentValid } from '../helpers/layerUtils'; +import { defaultStyles, getStyles } from '@/components/MapComponent/OpenLayersComponent/helpers/styleUtils'; +import { isExtentValid } from '@/components/MapComponent/OpenLayersComponent/helpers/layerUtils'; import { Draw, Modify, Snap, Select, defaults as defaultInteractions } from 'ol/interaction.js'; import { getArea } from 'ol/sphere'; import { valid } from 'geojson-validation'; diff --git a/src/frontend/src/components/MapComponent/OpenLayersComponent/Layers/VectorTileLayer.js b/src/frontend/src/components/MapComponent/OpenLayersComponent/Layers/VectorTileLayer.js index c7cd0d7f45..3110bbd959 100644 --- a/src/frontend/src/components/MapComponent/OpenLayersComponent/Layers/VectorTileLayer.js +++ b/src/frontend/src/components/MapComponent/OpenLayersComponent/Layers/VectorTileLayer.js @@ -6,8 +6,8 @@ import VectorTileSource from 'ol/source/VectorTile'; import { transformExtent } from 'ol/proj'; import Stroke from 'ol/style/Stroke'; import Style from 'ol/style/Style'; -import { getStyles, defaultStyles } from '../helpers/styleUtils'; -import { isExtentValid } from '../helpers/layerUtils'; +import { getStyles, defaultStyles } from '@/components/MapComponent/OpenLayersComponent/helpers/styleUtils'; +import { isExtentValid } from '@/components/MapComponent/OpenLayersComponent/helpers/layerUtils'; const selectElement = 'singleselect'; diff --git a/src/frontend/src/components/MapComponent/OpenLayersComponent/Layers/index.js b/src/frontend/src/components/MapComponent/OpenLayersComponent/Layers/index.js index da4c7b0197..6df3d4417f 100644 --- a/src/frontend/src/components/MapComponent/OpenLayersComponent/Layers/index.js +++ b/src/frontend/src/components/MapComponent/OpenLayersComponent/Layers/index.js @@ -1,4 +1,4 @@ -export { default as VectorTileLayer } from './VectorTileLayer'; +export { default as VectorTileLayer } from '@/components/MapComponent/OpenLayersComponent/Layers/VectorTileLayer'; -export { default as VectorLayer } from './VectorLayer'; -export { default as ClusterLayer } from './ClusterLayer'; +export { default as VectorLayer } from '@/components/MapComponent/OpenLayersComponent/Layers/VectorLayer'; +export { default as ClusterLayer } from '@/components/MapComponent/OpenLayersComponent/Layers/ClusterLayer'; diff --git a/src/frontend/src/components/MapComponent/OpenLayersComponent/MapContainer/index.jsx b/src/frontend/src/components/MapComponent/OpenLayersComponent/MapContainer/index.jsx index b7abafa404..b3dc95b82d 100644 --- a/src/frontend/src/components/MapComponent/OpenLayersComponent/MapContainer/index.jsx +++ b/src/frontend/src/components/MapComponent/OpenLayersComponent/MapContainer/index.jsx @@ -34,4 +34,6 @@ MapContainer.propTypes = { mapInstance: PropTypes.oneOfType([PropTypes.object, PropTypes.number]), }; +MapContainer.displayName = 'MapContainer'; + export default MapContainer; diff --git a/src/frontend/src/components/MapComponent/OpenLayersComponent/index.js b/src/frontend/src/components/MapComponent/OpenLayersComponent/index.js index 590d8e71b3..1921fe57f3 100644 --- a/src/frontend/src/components/MapComponent/OpenLayersComponent/index.js +++ b/src/frontend/src/components/MapComponent/OpenLayersComponent/index.js @@ -1,3 +1,3 @@ -export { default as MapContainer } from './MapContainer'; +export { default as MapContainer } from '@/components/MapComponent/OpenLayersComponent/MapContainer'; -export { default as useOLMap } from './useOLMap'; +export { default as useOLMap } from '@/components/MapComponent/OpenLayersComponent/useOLMap'; diff --git a/src/frontend/src/components/MapDescriptionComponents.jsx b/src/frontend/src/components/MapDescriptionComponents.jsx index 3fcd0bf23f..98f738dff2 100755 --- a/src/frontend/src/components/MapDescriptionComponents.jsx +++ b/src/frontend/src/components/MapDescriptionComponents.jsx @@ -1,6 +1,6 @@ import React from 'react'; -import CustomizedMenus from '../utilities/CustomizedMenus'; -import CoreModules from '../shared/CoreModules'; +import CustomizedMenus from '@/utilities/CustomizedMenus'; +import CoreModules from '@/shared/CoreModules'; const MapDescriptionComponents = ({ type, state, defaultTheme }) => { const descriptionData = [ diff --git a/src/frontend/src/components/MapLegends.jsx b/src/frontend/src/components/MapLegends.jsx index 9361c9afa4..c0c31adf4e 100755 --- a/src/frontend/src/components/MapLegends.jsx +++ b/src/frontend/src/components/MapLegends.jsx @@ -1,6 +1,6 @@ import React from 'react'; -import CoreModules from '../shared/CoreModules'; -import AssetModules from '../shared/AssetModules'; +import CoreModules from '@/shared/CoreModules'; +import AssetModules from '@/shared/AssetModules'; const MapLegends = ({ direction, spacing, iconBtnProps, defaultTheme, valueStatus }) => { const MapDetails = [ diff --git a/src/frontend/src/components/OpenLayersMap.jsx b/src/frontend/src/components/OpenLayersMap.jsx index 191c45a2c1..8682c3de80 100755 --- a/src/frontend/src/components/OpenLayersMap.jsx +++ b/src/frontend/src/components/OpenLayersMap.jsx @@ -1,27 +1,27 @@ import React, { useEffect, useState } from 'react'; -import DialogTaskActions from '../components/DialogTaskActions'; +import DialogTaskActions from '@/components/DialogTaskActions'; import '../styles/home.scss'; -import CoreModules from '../shared/CoreModules'; +import CoreModules from '@/shared/CoreModules'; import Control from 'ol/control/Control'; -import locationImg from '../assets/images/location.png'; -import accDownImg from '../assets/images/acc-down.png'; -import accUpImg from '../assets/images/acc-up.png'; -import gridIcon from '../assets/images/grid.png'; -import QrcodeComponent from './QrcodeComponent'; +import locationImg from '@/assets/images/location.png'; +import accDownImg from '@/assets/images/acc-down.png'; +import accUpImg from '@/assets/images/acc-up.png'; +import gridIcon from '@/assets/images/grid.png'; +import QrcodeComponent from '@/components/QrcodeComponent'; import * as ol from 'ol'; import { Point } from 'ol/geom'; import Vector from 'ol/layer/Vector'; import VectorSource from 'ol/source/Vector'; import { transform } from 'ol/proj'; import { Icon, Style } from 'ol/style'; -import LocationImage from '../assets/images/location.png'; -import AssetModules from '../shared/AssetModules'; -import { Modal } from '../components/common/Modal'; -import Button from './common/Button'; -import { ProjectActions } from '../store/slices/ProjectSlice'; -import TaskSectionModal from './ProjectDetails/TaskSectionPopup'; +import LocationImage from '@/assets/images/location.png'; +import AssetModules from '@/shared/AssetModules'; +import { Modal } from '@/components/common/Modal'; +import Button from '@/components/common/Button'; +import { ProjectActions } from '@/store/slices/ProjectSlice'; +import TaskSectionModal from '@/components/ProjectDetails/TaskSectionPopup'; import VectorLayer from 'ol/layer/Vector'; -import WindowDimension from '../hooks/WindowDimension'; +import WindowDimension from '@/hooks/WindowDimension'; let currentLocationLayer = null; const OpenLayersMap = ({ diff --git a/src/frontend/src/components/ProjectDetails/MapControlComponent.tsx b/src/frontend/src/components/ProjectDetails/MapControlComponent.tsx index a0ab6ea5fd..329510978f 100644 --- a/src/frontend/src/components/ProjectDetails/MapControlComponent.tsx +++ b/src/frontend/src/components/ProjectDetails/MapControlComponent.tsx @@ -1,8 +1,8 @@ import React, { useState } from 'react'; -import AssetModules from '../../shared/AssetModules'; +import AssetModules from '@/shared/AssetModules'; import VectorLayer from 'ol/layer/Vector'; -import CoreModules from '../../shared/CoreModules.js'; -import { ProjectActions } from '../../store/slices/ProjectSlice'; +import CoreModules from '@/shared/CoreModules.js'; +import { ProjectActions } from '@/store/slices/ProjectSlice'; const MapControlComponent = ({ map }) => { const btnList = [ diff --git a/src/frontend/src/components/ProjectDetails/MobileActivitiesContents.tsx b/src/frontend/src/components/ProjectDetails/MobileActivitiesContents.tsx index d8cd5e6764..c989785d43 100644 --- a/src/frontend/src/components/ProjectDetails/MobileActivitiesContents.tsx +++ b/src/frontend/src/components/ProjectDetails/MobileActivitiesContents.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import ActivitiesPanel from '../ActivitiesPanel'; -import CoreModules from '../../shared/CoreModules'; +import ActivitiesPanel from '@/components/ActivitiesPanel'; +import CoreModules from '@/shared/CoreModules'; const MobileActivitiesContents = ({ map, mainView, mapDivPostion }) => { const params = CoreModules.useParams(); diff --git a/src/frontend/src/components/ProjectDetails/MobileFooter.tsx b/src/frontend/src/components/ProjectDetails/MobileFooter.tsx index 54233e25a2..63b458d7ab 100644 --- a/src/frontend/src/components/ProjectDetails/MobileFooter.tsx +++ b/src/frontend/src/components/ProjectDetails/MobileFooter.tsx @@ -1,7 +1,7 @@ import React from 'react'; -import AssetModules from '../../shared/AssetModules.js'; -import CoreModules from '../../shared/CoreModules'; -import { ProjectActions } from '../../store/slices/ProjectSlice'; +import AssetModules from '@/shared/AssetModules.js'; +import CoreModules from '@/shared/CoreModules'; +import { ProjectActions } from '@/store/slices/ProjectSlice'; const MobileFooter = () => { const dispatch = CoreModules.useAppDispatch(); diff --git a/src/frontend/src/components/ProjectDetails/MobileProjectInfoContent.tsx b/src/frontend/src/components/ProjectDetails/MobileProjectInfoContent.tsx index ff15c16a12..35757d1d85 100644 --- a/src/frontend/src/components/ProjectDetails/MobileProjectInfoContent.tsx +++ b/src/frontend/src/components/ProjectDetails/MobileProjectInfoContent.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import AssetModules from '../../shared/AssetModules'; +import AssetModules from '@/shared/AssetModules'; const MobileProjectInfoContent = ({ projectInfo }) => { return ( diff --git a/src/frontend/src/components/ProjectDetails/ProjectOptions.tsx b/src/frontend/src/components/ProjectDetails/ProjectOptions.tsx index 440c2d2b1c..3e4fb42119 100644 --- a/src/frontend/src/components/ProjectDetails/ProjectOptions.tsx +++ b/src/frontend/src/components/ProjectDetails/ProjectOptions.tsx @@ -1,9 +1,9 @@ import React, { useState } from 'react'; -import CoreModules from '../../shared/CoreModules'; -import AssetModules from '../../shared/AssetModules'; -import environment from '../../environment'; -import { DownloadDataExtract, DownloadProjectForm } from '../../api/Project'; -import { ProjectActions } from '../../store/slices/ProjectSlice'; +import CoreModules from '@/shared/CoreModules'; +import AssetModules from '@/shared/AssetModules'; +import environment from '@/environment'; +import { DownloadDataExtract, DownloadProjectForm } from '@/api/Project'; +import { ProjectActions } from '@/store/slices/ProjectSlice'; const ProjectOptions = ({ setToggleGenerateModal }) => { const dispatch = CoreModules.useAppDispatch(); diff --git a/src/frontend/src/components/ProjectDetails/TaskSectionPopup.tsx b/src/frontend/src/components/ProjectDetails/TaskSectionPopup.tsx index 2f91da89f9..0a46469b6d 100644 --- a/src/frontend/src/components/ProjectDetails/TaskSectionPopup.tsx +++ b/src/frontend/src/components/ProjectDetails/TaskSectionPopup.tsx @@ -1,7 +1,7 @@ import React from 'react'; -import CoreModules from '../../shared/CoreModules'; -import AssetModules from '../../shared/AssetModules'; -import { ProjectActions } from '../../store/slices/ProjectSlice'; +import CoreModules from '@/shared/CoreModules'; +import AssetModules from '@/shared/AssetModules'; +import { ProjectActions } from '@/store/slices/ProjectSlice'; const TaskSectionPopup = ({ body }) => { const dispatch = CoreModules.useAppDispatch(); diff --git a/src/frontend/src/components/ProjectDetailsV2/ActivitiesPanel.tsx b/src/frontend/src/components/ProjectDetailsV2/ActivitiesPanel.tsx index 9db0fb4f5a..8022e67482 100644 --- a/src/frontend/src/components/ProjectDetailsV2/ActivitiesPanel.tsx +++ b/src/frontend/src/components/ProjectDetailsV2/ActivitiesPanel.tsx @@ -1,13 +1,13 @@ /* eslint-disable react/jsx-key */ import React, { useEffect, useState } from 'react'; -import environment from '../../environment'; -import CoreModules from '../../shared/CoreModules'; -import AssetModules from '../../shared/AssetModules'; -import { CustomSelect } from '../../components/common/Select'; -import profilePic from '../../assets/images/project_icon.png'; +import environment from '@/environment'; +import CoreModules from '@/shared/CoreModules'; +import AssetModules from '@/shared/AssetModules'; +import { CustomSelect } from '@/components/common/Select'; +import profilePic from '@/assets/images/project_icon.png'; import { Feature } from 'ol'; import { Polygon } from 'ol/geom'; -import { ActivitiesCardSkeletonLoader, ShowingCountSkeletonLoader } from './SkeletonLoader'; +import { ActivitiesCardSkeletonLoader, ShowingCountSkeletonLoader } from '@/components/ProjectDetailsV2/SkeletonLoader'; const sortByList = [ { id: 'activities', name: 'Activities' }, diff --git a/src/frontend/src/components/ProjectDetailsV2/MapControlComponent.tsx b/src/frontend/src/components/ProjectDetailsV2/MapControlComponent.tsx index a0ab6ea5fd..329510978f 100644 --- a/src/frontend/src/components/ProjectDetailsV2/MapControlComponent.tsx +++ b/src/frontend/src/components/ProjectDetailsV2/MapControlComponent.tsx @@ -1,8 +1,8 @@ import React, { useState } from 'react'; -import AssetModules from '../../shared/AssetModules'; +import AssetModules from '@/shared/AssetModules'; import VectorLayer from 'ol/layer/Vector'; -import CoreModules from '../../shared/CoreModules.js'; -import { ProjectActions } from '../../store/slices/ProjectSlice'; +import CoreModules from '@/shared/CoreModules.js'; +import { ProjectActions } from '@/store/slices/ProjectSlice'; const MapControlComponent = ({ map }) => { const btnList = [ diff --git a/src/frontend/src/components/ProjectDetailsV2/MobileActivitiesContents.tsx b/src/frontend/src/components/ProjectDetailsV2/MobileActivitiesContents.tsx index 177a28585f..cffe8e4c72 100644 --- a/src/frontend/src/components/ProjectDetailsV2/MobileActivitiesContents.tsx +++ b/src/frontend/src/components/ProjectDetailsV2/MobileActivitiesContents.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import ActivitiesPanel from './ActivitiesPanel'; -import CoreModules from '../../shared/CoreModules'; +import ActivitiesPanel from '@/components/ProjectDetailsV2/ActivitiesPanel'; +import CoreModules from '@/shared/CoreModules'; const MobileActivitiesContents = ({ map, mainView, mapDivPostion }) => { const params = CoreModules.useParams(); diff --git a/src/frontend/src/components/ProjectDetailsV2/MobileFooter.tsx b/src/frontend/src/components/ProjectDetailsV2/MobileFooter.tsx index cab3cc8ca0..0028a127da 100644 --- a/src/frontend/src/components/ProjectDetailsV2/MobileFooter.tsx +++ b/src/frontend/src/components/ProjectDetailsV2/MobileFooter.tsx @@ -1,7 +1,7 @@ import React from 'react'; -import AssetModules from '../../shared/AssetModules.js'; -import CoreModules from '../../shared/CoreModules'; -import { ProjectActions } from '../../store/slices/ProjectSlice'; +import AssetModules from '@/shared/AssetModules.js'; +import CoreModules from '@/shared/CoreModules'; +import { ProjectActions } from '@/store/slices/ProjectSlice'; const MobileFooter = () => { const dispatch = CoreModules.useAppDispatch(); diff --git a/src/frontend/src/components/ProjectDetailsV2/MobileProjectInfoContent.tsx b/src/frontend/src/components/ProjectDetailsV2/MobileProjectInfoContent.tsx index ff15c16a12..35757d1d85 100644 --- a/src/frontend/src/components/ProjectDetailsV2/MobileProjectInfoContent.tsx +++ b/src/frontend/src/components/ProjectDetailsV2/MobileProjectInfoContent.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import AssetModules from '../../shared/AssetModules'; +import AssetModules from '@/shared/AssetModules'; const MobileProjectInfoContent = ({ projectInfo }) => { return ( diff --git a/src/frontend/src/components/ProjectDetailsV2/ProjectInfo.tsx b/src/frontend/src/components/ProjectDetailsV2/ProjectInfo.tsx index 2a42f6ab89..58a3692a36 100644 --- a/src/frontend/src/components/ProjectDetailsV2/ProjectInfo.tsx +++ b/src/frontend/src/components/ProjectDetailsV2/ProjectInfo.tsx @@ -1,7 +1,7 @@ import React, { useEffect, useRef, useState } from 'react'; -import AssetModules from '../../shared/AssetModules.js'; -import ProjectIcon from '../../assets/images/project_icon.png'; -import CoreModules from '../../shared/CoreModules'; +import AssetModules from '@/shared/AssetModules.js'; +import ProjectIcon from '@/assets/images/project_icon.png'; +import CoreModules from '@/shared/CoreModules'; const ProjectInfo = () => { const paraRef = useRef(null); diff --git a/src/frontend/src/components/ProjectDetailsV2/ProjectOptions.tsx b/src/frontend/src/components/ProjectDetailsV2/ProjectOptions.tsx index 66ad5e5074..e89fd5c936 100644 --- a/src/frontend/src/components/ProjectDetailsV2/ProjectOptions.tsx +++ b/src/frontend/src/components/ProjectDetailsV2/ProjectOptions.tsx @@ -1,9 +1,9 @@ import React, { useState } from 'react'; -import CoreModules from '../../shared/CoreModules'; -import AssetModules from '../../shared/AssetModules'; -import environment from '../../environment'; -import { DownloadDataExtract, DownloadProjectForm } from '../../api/Project'; -import { ProjectActions } from '../../store/slices/ProjectSlice'; +import CoreModules from '@/shared/CoreModules'; +import AssetModules from '@/shared/AssetModules'; +import environment from '@/environment'; +import { DownloadDataExtract, DownloadProjectForm } from '@/api/Project'; +import { ProjectActions } from '@/store/slices/ProjectSlice'; const ProjectOptions = ({ setToggleGenerateModal }) => { const dispatch = CoreModules.useAppDispatch(); diff --git a/src/frontend/src/components/ProjectDetailsV2/SkeletonLoader.tsx b/src/frontend/src/components/ProjectDetailsV2/SkeletonLoader.tsx index 629102c5aa..d22843bcf2 100644 --- a/src/frontend/src/components/ProjectDetailsV2/SkeletonLoader.tsx +++ b/src/frontend/src/components/ProjectDetailsV2/SkeletonLoader.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import CoreModules from '../../shared/CoreModules'; +import CoreModules from '@/shared/CoreModules'; export const ActivitiesCardSkeletonLoader = () => { return ( diff --git a/src/frontend/src/components/ProjectDetailsV2/TaskSectionPopup.tsx b/src/frontend/src/components/ProjectDetailsV2/TaskSectionPopup.tsx index 2f91da89f9..0a46469b6d 100644 --- a/src/frontend/src/components/ProjectDetailsV2/TaskSectionPopup.tsx +++ b/src/frontend/src/components/ProjectDetailsV2/TaskSectionPopup.tsx @@ -1,7 +1,7 @@ import React from 'react'; -import CoreModules from '../../shared/CoreModules'; -import AssetModules from '../../shared/AssetModules'; -import { ProjectActions } from '../../store/slices/ProjectSlice'; +import CoreModules from '@/shared/CoreModules'; +import AssetModules from '@/shared/AssetModules'; +import { ProjectActions } from '@/store/slices/ProjectSlice'; const TaskSectionPopup = ({ body }) => { const dispatch = CoreModules.useAppDispatch(); diff --git a/src/frontend/src/components/ProjectInfo/ProjectCard.jsx b/src/frontend/src/components/ProjectInfo/ProjectCard.jsx index d6542004e5..b981c4babb 100644 --- a/src/frontend/src/components/ProjectInfo/ProjectCard.jsx +++ b/src/frontend/src/components/ProjectInfo/ProjectCard.jsx @@ -1,7 +1,7 @@ import React from 'react'; -import CoreModules from '../../shared/CoreModules'; -import IconButtonCard from '../../utilities/IconButtonCard'; -import AssetModules from '../../shared/AssetModules'; +import CoreModules from '@/shared/CoreModules'; +import IconButtonCard from '@/utilities/IconButtonCard'; +import AssetModules from '@/shared/AssetModules'; const ProjectCard = () => { return ( diff --git a/src/frontend/src/components/ProjectInfo/ProjectInfoCountCard.jsx b/src/frontend/src/components/ProjectInfo/ProjectInfoCountCard.jsx index b85d6f9046..fa4da6ec3f 100644 --- a/src/frontend/src/components/ProjectInfo/ProjectInfoCountCard.jsx +++ b/src/frontend/src/components/ProjectInfo/ProjectInfoCountCard.jsx @@ -1,7 +1,7 @@ import React from 'react'; -import AssetModules from '../../shared/AssetModules'; -import CoreModules from '../../shared/CoreModules'; -import ProjectInfoCountSkeleton from './ProjectInfoCountCardSkeleton'; +import AssetModules from '@/shared/AssetModules'; +import CoreModules from '@/shared/CoreModules'; +import ProjectInfoCountSkeleton from '@/components/ProjectInfo/ProjectInfoCountCardSkeleton'; const ProjectInfoCountCard = () => { const taskData = CoreModules.useAppSelector((state) => state.task.taskData); diff --git a/src/frontend/src/components/ProjectInfo/ProjectInfoCountCardSkeleton.jsx b/src/frontend/src/components/ProjectInfo/ProjectInfoCountCardSkeleton.jsx index 631f7225a1..0ec681aab2 100644 --- a/src/frontend/src/components/ProjectInfo/ProjectInfoCountCardSkeleton.jsx +++ b/src/frontend/src/components/ProjectInfo/ProjectInfoCountCardSkeleton.jsx @@ -1,5 +1,5 @@ import React from 'react'; -import CoreModules from '../../shared/CoreModules'; +import CoreModules from '@/shared/CoreModules'; const ProjectInfoCountCardSkeleton = () => { return ( @@ -11,7 +11,7 @@ const ProjectInfoCountCardSkeleton = () => { }} > {Array.from({ length: 3 }).map((i) => ( -
+
))} diff --git a/src/frontend/src/components/ProjectInfo/ProjectInfoSidebar.jsx b/src/frontend/src/components/ProjectInfo/ProjectInfoSidebar.jsx index 27bb104036..5695777307 100644 --- a/src/frontend/src/components/ProjectInfo/ProjectInfoSidebar.jsx +++ b/src/frontend/src/components/ProjectInfo/ProjectInfoSidebar.jsx @@ -1,8 +1,8 @@ import React from 'react'; -import CoreModules from '../../shared/CoreModules'; -import ProjectCard from './ProjectCard'; -import environment from '../../environment'; -import ProjectInfoSidebarSkeleton from './ProjectInfoSidebarSkeleton'; +import CoreModules from '@/shared/CoreModules'; +import ProjectCard from '@/components/ProjectInfo/ProjectCard'; +import environment from '@/environment'; +import ProjectInfoSidebarSkeleton from '@/components/ProjectInfo/ProjectInfoSidebarSkeleton'; const ProjectInfoSidebar = ({ projectId, taskInfo }) => { const dispatch = CoreModules.useAppDispatch(); diff --git a/src/frontend/src/components/ProjectInfo/ProjectInfoSidebarSkeleton.jsx b/src/frontend/src/components/ProjectInfo/ProjectInfoSidebarSkeleton.jsx index 15cb754854..1299f7498f 100644 --- a/src/frontend/src/components/ProjectInfo/ProjectInfoSidebarSkeleton.jsx +++ b/src/frontend/src/components/ProjectInfo/ProjectInfoSidebarSkeleton.jsx @@ -1,5 +1,5 @@ import React from 'react'; -import CoreModules from '../../shared/CoreModules'; +import CoreModules from '@/shared/CoreModules'; const ProjectInfoSidebarSkeleton = () => { return ( diff --git a/src/frontend/src/components/ProjectInfo/ProjectInfomap.jsx b/src/frontend/src/components/ProjectInfo/ProjectInfomap.jsx index fadf775d35..d100b730b5 100644 --- a/src/frontend/src/components/ProjectInfo/ProjectInfomap.jsx +++ b/src/frontend/src/components/ProjectInfo/ProjectInfomap.jsx @@ -1,20 +1,20 @@ import React, { useCallback, useState, useEffect } from 'react'; -import CoreModules from '../../shared/CoreModules'; -import { MapContainer as MapComponent } from '../MapComponent/OpenLayersComponent'; -import { useOLMap } from '../MapComponent/OpenLayersComponent'; -import LayerSwitcherControl from '../MapComponent/OpenLayersComponent/LayerSwitcher'; -import { VectorLayer } from '../MapComponent/OpenLayersComponent/Layers'; +import CoreModules from '@/shared/CoreModules'; +import { MapContainer as MapComponent } from '@/components/MapComponent/OpenLayersComponent'; +import { useOLMap } from '@/components/MapComponent/OpenLayersComponent'; +import LayerSwitcherControl from '@/components/MapComponent/OpenLayersComponent/LayerSwitcher'; +import { VectorLayer } from '@/components/MapComponent/OpenLayersComponent/Layers'; import { Vector as VectorSource } from 'ol/source'; import GeoJSON from 'ol/format/GeoJSON'; import { get } from 'ol/proj'; -import { ProjectBuildingGeojsonService } from '../../api/SubmissionService'; -import environment from '../../environment'; -import { getStyles } from '../MapComponent/OpenLayersComponent/helpers/styleUtils'; -import { ProjectActions } from '../../store/slices/ProjectSlice'; -import { basicGeojsonTemplate } from '../../utilities/mapUtils'; -import ProjectInfoMapLegend from './ProjectInfoMapLegend'; -import Accordion from '../common/Accordion'; +import { ProjectBuildingGeojsonService } from '@/api/SubmissionService'; +import environment from '@/environment'; +import { getStyles } from '@/components/MapComponent/OpenLayersComponent/helpers/styleUtils'; +import { ProjectActions } from '@/store/slices/ProjectSlice'; +import { basicGeojsonTemplate } from '@/utilities/mapUtils'; +import ProjectInfoMapLegend from '@/components/ProjectInfo/ProjectInfoMapLegend'; +import Accordion from '@/components/common/Accordion'; export const defaultStyles = { lineColor: '#000000', diff --git a/src/frontend/src/components/ProjectMap/ProjectMap.jsx b/src/frontend/src/components/ProjectMap/ProjectMap.jsx index cf6ae604b7..84056cf1ec 100644 --- a/src/frontend/src/components/ProjectMap/ProjectMap.jsx +++ b/src/frontend/src/components/ProjectMap/ProjectMap.jsx @@ -1,9 +1,9 @@ import React, { useState } from 'react'; import CoreModules from 'fmtm/CoreModules'; -import { useOLMap } from '../MapComponent/OpenLayersComponent'; -import { MapContainer as MapComponent } from '../MapComponent/OpenLayersComponent'; -import LayerSwitcherControl from '../MapComponent/OpenLayersComponent/LayerSwitcher/index.js'; -import { VectorLayer } from '../MapComponent/OpenLayersComponent/Layers'; +import { useOLMap } from '@/components/MapComponent/OpenLayersComponent'; +import { MapContainer as MapComponent } from '@/components/MapComponent/OpenLayersComponent'; +import LayerSwitcherControl from '@/components/MapComponent/OpenLayersComponent/LayerSwitcher/index.js'; +import { VectorLayer } from '@/components/MapComponent/OpenLayersComponent/Layers'; const basicGeojsonTemplate = { type: 'FeatureCollection', diff --git a/src/frontend/src/components/QrcodeComponent.jsx b/src/frontend/src/components/QrcodeComponent.jsx index ba9ec80c64..3cbc603598 100755 --- a/src/frontend/src/components/QrcodeComponent.jsx +++ b/src/frontend/src/components/QrcodeComponent.jsx @@ -1,11 +1,11 @@ import React, { useState } from 'react'; -import BasicCard from '../utilities/BasicCard'; +import BasicCard from '@/utilities/BasicCard'; // import Activities from "./Activities"; -import environment from '../environment'; -import { ProjectFilesById } from '../api/Files'; -import CoreModules from '../shared/CoreModules'; -import AssetModules from '../shared/AssetModules'; -import { HomeActions } from '../store/slices/HomeSlice'; +import environment from '@/environment'; +import { ProjectFilesById } from '@/api/Files'; +import CoreModules from '@/shared/CoreModules'; +import AssetModules from '@/shared/AssetModules'; +import { HomeActions } from '@/store/slices/HomeSlice'; const TasksComponent = ({ type, task, defaultTheme }) => { const dispatch = CoreModules.useAppDispatch(); diff --git a/src/frontend/src/components/SubmissionMap/SubmissionMap.jsx b/src/frontend/src/components/SubmissionMap/SubmissionMap.jsx index 1fe5f16c05..881910627c 100644 --- a/src/frontend/src/components/SubmissionMap/SubmissionMap.jsx +++ b/src/frontend/src/components/SubmissionMap/SubmissionMap.jsx @@ -1,8 +1,8 @@ import React, { useState } from 'react'; -import useOLMap from '../../hooks/useOlMap'; -import { MapContainer as MapComponent } from '../MapComponent/OpenLayersComponent'; -import LayerSwitcherControl from '../MapComponent/OpenLayersComponent/LayerSwitcher/index.js'; -import { VectorLayer } from '../MapComponent/OpenLayersComponent/Layers'; +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; diff --git a/src/frontend/src/components/TasksLayer.jsx b/src/frontend/src/components/TasksLayer.jsx index 643fdc7b32..7dfab9bf63 100755 --- a/src/frontend/src/components/TasksLayer.jsx +++ b/src/frontend/src/components/TasksLayer.jsx @@ -2,10 +2,10 @@ import React, { useEffect } from 'react'; import { Vector as VectorLayer } from 'ol/layer.js'; import GeoJSON from 'ol/format/GeoJSON'; import { Vector as VectorSource } from 'ol/source.js'; -import { geojsonObjectModel } from '../models/geojsonObjectModel'; -import MapStyles from '../hooks/MapStyles'; -import environment from '../environment'; -import CoreModules from '../shared/CoreModules'; +import { geojsonObjectModel } from '@/models/geojsonObjectModel'; +import MapStyles from '@/hooks/MapStyles'; +import environment from '@/environment'; +import CoreModules from '@/shared/CoreModules'; import { get } from 'ol/proj'; let geojsonObject; const TasksLayer = (map, view, feature) => { diff --git a/src/frontend/src/components/TasksMap/TasksMap.jsx b/src/frontend/src/components/TasksMap/TasksMap.jsx index 78322e2f3b..c15b806099 100644 --- a/src/frontend/src/components/TasksMap/TasksMap.jsx +++ b/src/frontend/src/components/TasksMap/TasksMap.jsx @@ -1,8 +1,8 @@ import React from 'react'; -import useOLMap from '../../hooks/useOlMap'; -import { MapContainer as MapComponent } from '../MapComponent/OpenLayersComponent'; -import LayerSwitcherControl from '../MapComponent/OpenLayersComponent/LayerSwitcher/index.js'; -import { VectorLayer } from '../MapComponent/OpenLayersComponent/Layers'; +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; diff --git a/src/frontend/src/components/common/Accordion.tsx b/src/frontend/src/components/common/Accordion.tsx index 9cbc69296a..bc15e58d17 100644 --- a/src/frontend/src/components/common/Accordion.tsx +++ b/src/frontend/src/components/common/Accordion.tsx @@ -1,5 +1,5 @@ import React, { useEffect, useState } from 'react'; -import AssetModules from '../../shared/AssetModules'; +import AssetModules from '@/shared/AssetModules'; interface IAccordion { collapsed?: boolean; diff --git a/src/frontend/src/components/common/BottomSheet.tsx b/src/frontend/src/components/common/BottomSheet.tsx index 6b0d59cad6..28a2d31695 100644 --- a/src/frontend/src/components/common/BottomSheet.tsx +++ b/src/frontend/src/components/common/BottomSheet.tsx @@ -1,5 +1,5 @@ import React, { useEffect, useRef, useState } from 'react'; -import FmtmLogo from '../../assets/images/hotLog.png'; +import FmtmLogo from '@/assets/images/hotLog.png'; const BottomSheet = ({ body, onClose }) => { const sheetContentRef: any = useRef(null); diff --git a/src/frontend/src/components/common/FileInputComponent.tsx b/src/frontend/src/components/common/FileInputComponent.tsx index 92fd4bd45b..e7865637c4 100644 --- a/src/frontend/src/components/common/FileInputComponent.tsx +++ b/src/frontend/src/components/common/FileInputComponent.tsx @@ -1,5 +1,5 @@ import React, { useRef } from 'react'; -import AssetModules from '../../shared/AssetModules.js'; +import AssetModules from '@/shared/AssetModules.js'; const FileInputComponent = ({ accept = '.geojson, .json', diff --git a/src/frontend/src/components/common/Modal.tsx b/src/frontend/src/components/common/Modal.tsx index 9b7206d3c5..f0b1ee48ed 100644 --- a/src/frontend/src/components/common/Modal.tsx +++ b/src/frontend/src/components/common/Modal.tsx @@ -4,7 +4,7 @@ import * as React from 'react'; import * as DialogPrimitive from '@radix-ui/react-dialog'; import { X } from 'lucide-react'; -import { cn } from '../../utilfunctions/shadcn'; +import { cn } from '@/utilfunctions/shadcn'; const Dialog = DialogPrimitive.Root; diff --git a/src/frontend/src/components/common/Select.tsx b/src/frontend/src/components/common/Select.tsx index 1affd68046..1e12d733b6 100644 --- a/src/frontend/src/components/common/Select.tsx +++ b/src/frontend/src/components/common/Select.tsx @@ -2,7 +2,7 @@ import * as React from 'react'; import * as SelectPrimitive from '@radix-ui/react-select'; import { Check, ChevronDown } from 'lucide-react'; -import { cn } from '../../utilfunctions/shadcn'; +import { cn } from '@/utilfunctions/shadcn'; const Select = SelectPrimitive.Root; diff --git a/src/frontend/src/components/common/StepSwitcher.tsx b/src/frontend/src/components/common/StepSwitcher.tsx index 0eb5b22764..aa6467d4ab 100644 --- a/src/frontend/src/components/common/StepSwitcher.tsx +++ b/src/frontend/src/components/common/StepSwitcher.tsx @@ -1,7 +1,7 @@ import React from 'react'; -import AssetModules from '../../shared/AssetModules.js'; -import { CommonActions } from '../../store/slices/CommonSlice'; -import CoreModules from '../../shared/CoreModules.js'; +import AssetModules from '@/shared/AssetModules.js'; +import { CommonActions } from '@/store/slices/CommonSlice'; +import CoreModules from '@/shared/CoreModules.js'; import { useNavigate } from 'react-router-dom'; const StepSwitcher = ({ data, flag, switchSteps }) => { diff --git a/src/frontend/src/components/common/Switch.tsx b/src/frontend/src/components/common/Switch.tsx index 089f1c9bf5..89c52a7151 100644 --- a/src/frontend/src/components/common/Switch.tsx +++ b/src/frontend/src/components/common/Switch.tsx @@ -1,6 +1,6 @@ import React from 'react'; import * as SwitchPrimitives from '@radix-ui/react-switch'; -import { cn } from '../../utilfunctions/shadcn'; +import { cn } from '@/utilfunctions/shadcn'; const Switch = React.forwardRef< React.ElementRef, diff --git a/src/frontend/src/components/createnewproject/CreateProjectHeader.tsx b/src/frontend/src/components/createnewproject/CreateProjectHeader.tsx index 8349fe3c23..13e59d7577 100644 --- a/src/frontend/src/components/createnewproject/CreateProjectHeader.tsx +++ b/src/frontend/src/components/createnewproject/CreateProjectHeader.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import AssetModules from '../../shared/AssetModules.js'; +import AssetModules from '@/shared/AssetModules.js'; import { useNavigate } from 'react-router-dom'; const CreateProjectHeader = () => { diff --git a/src/frontend/src/components/createnewproject/DataExtract.tsx b/src/frontend/src/components/createnewproject/DataExtract.tsx index fd2dd1553c..99d0d96f8e 100644 --- a/src/frontend/src/components/createnewproject/DataExtract.tsx +++ b/src/frontend/src/components/createnewproject/DataExtract.tsx @@ -1,18 +1,18 @@ import axios from 'axios'; import { geojson as fgbGeojson } from 'flatgeobuf'; import React, { useEffect, useState } from 'react'; -import Button from '../../components/common/Button'; +import Button from '@/components/common/Button'; import { useDispatch } from 'react-redux'; -import { CommonActions } from '../../store/slices/CommonSlice'; -import RadioButton from '../../components/common/RadioButton'; +import { CommonActions } from '@/store/slices/CommonSlice'; +import RadioButton from '@/components/common/RadioButton'; import { useNavigate } from 'react-router-dom'; -import { CreateProjectActions } from '../../store/slices/CreateProjectSlice'; -import useForm from '../../hooks/useForm'; -import { useAppSelector } from '../../types/reduxTypes'; -import { FormCategoryService } from '../../api/CreateProjectService'; -import FileInputComponent from '../../components/common/FileInputComponent'; -import DataExtractValidation from './validation/DataExtractValidation'; -import NewDefineAreaMap from '../../views/NewDefineAreaMap'; +import { CreateProjectActions } from '@/store/slices/CreateProjectSlice'; +import useForm from '@/hooks/useForm'; +import { useAppSelector } from '@/types/reduxTypes'; +import { FormCategoryService } from '@/api/CreateProjectService'; +import FileInputComponent from '@/components/common/FileInputComponent'; +import DataExtractValidation from '@/components/createnewproject/validation/DataExtractValidation'; +import NewDefineAreaMap from '@/views/NewDefineAreaMap'; const dataExtractOptions = [ { name: 'data_extract', value: 'osm_data_extract', label: 'Use OSM data extract' }, diff --git a/src/frontend/src/components/createnewproject/MapControlComponent.tsx b/src/frontend/src/components/createnewproject/MapControlComponent.tsx index 93917ab5a5..f62b9e6da4 100644 --- a/src/frontend/src/components/createnewproject/MapControlComponent.tsx +++ b/src/frontend/src/components/createnewproject/MapControlComponent.tsx @@ -1,8 +1,8 @@ import React, { useState } from 'react'; -import AssetModules from '../../shared/AssetModules'; import VectorLayer from 'ol/layer/Vector'; -import CoreModules from '../../shared/CoreModules.js'; -import { CreateProjectActions } from '../../store/slices/CreateProjectSlice'; +import AssetModules from '@/shared/AssetModules'; +import CoreModules from '@/shared/CoreModules.js'; +import { CreateProjectActions } from '@/store/slices/CreateProjectSlice'; const MapControlComponent = ({ map, hasEditUndo }) => { const dispatch = CoreModules.useAppDispatch(); diff --git a/src/frontend/src/components/createnewproject/ProjectDetailsForm.tsx b/src/frontend/src/components/createnewproject/ProjectDetailsForm.tsx index 1952e93632..42ce617fe7 100644 --- a/src/frontend/src/components/createnewproject/ProjectDetailsForm.tsx +++ b/src/frontend/src/components/createnewproject/ProjectDetailsForm.tsx @@ -1,18 +1,18 @@ -import TextArea from '../../components/common/TextArea'; -import InputTextField from '../../components/common/InputTextField'; +import TextArea from '@/components/common/TextArea'; +import InputTextField from '@/components/common/InputTextField'; import React, { useEffect } from 'react'; -import { CreateProjectActions } from '../../store/slices/CreateProjectSlice'; +import { CreateProjectActions } from '@/store/slices/CreateProjectSlice'; import { useDispatch } from 'react-redux'; import { useNavigate } from 'react-router-dom'; -import { useAppSelector } from '../../types/reduxTypes'; -import useForm from '../../hooks/useForm'; -import CreateProjectValidation from '../../components/createproject/validation/CreateProjectValidation'; -import Button from '../../components/common/Button'; -import { CommonActions } from '../../store/slices/CommonSlice'; -import AssetModules from '../../shared/AssetModules.js'; -import { createPopup } from '../../utilfunctions/createPopup'; -import { CustomSelect } from '../../components/common/Select'; -import { OrganisationService } from '../../api/CreateProjectService'; +import { useAppSelector } from '@/types/reduxTypes'; +import useForm from '@/hooks/useForm'; +import CreateProjectValidation from '@/components/createproject/validation//CreateProjectValidation'; +import Button from '@/components/common/Button'; +import { CommonActions } from '@/store/slices/CommonSlice'; +import AssetModules from '@/shared/AssetModules.js'; +import { createPopup } from '@/utilfunctions/createPopup'; +import { CustomSelect } from '@/components/common/Select'; +import { OrganisationService } from '@/api/CreateProjectService'; const ProjectDetailsForm = ({ flag }) => { const dispatch = useDispatch(); @@ -81,7 +81,7 @@ const ProjectDetailsForm = ({ flag }) => {
Project Details
-

+

Fill in your project basic information such as name, description, hashtag, etc. This captures essential information about your project. @@ -99,7 +99,7 @@ const ProjectDetailsForm = ({ flag }) => { https://docs.getodk.org/central-install-digital-ocean/
-

+
> tags {' '} - that match the selected category in OSM database, if you don't choose to upload custom data extract. + {`that match the selected category in OSM database, if you don't choose to upload custom data extract.`}

import('../../views/DefineAreaMap')); diff --git a/src/frontend/src/components/createnewproject/validation/DefineTaskValidation.tsx b/src/frontend/src/components/createnewproject/validation/DefineTaskValidation.tsx index 37f8191dab..b11b1968e9 100644 --- a/src/frontend/src/components/createnewproject/validation/DefineTaskValidation.tsx +++ b/src/frontend/src/components/createnewproject/validation/DefineTaskValidation.tsx @@ -1,4 +1,4 @@ -import { task_split_type } from '../../../types/enums'; +import { task_split_type } from '@/types/enums'; interface ProjectValues { task_split_type: number; diff --git a/src/frontend/src/components/createproject/BasemapSelection.tsx b/src/frontend/src/components/createproject/BasemapSelection.tsx index 73dc380314..571d58b205 100644 --- a/src/frontend/src/components/createproject/BasemapSelection.tsx +++ b/src/frontend/src/components/createproject/BasemapSelection.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import CoreModules from '../../shared/CoreModules.js'; +import CoreModules from '@/shared/CoreModules.js'; // import { SelectPicker } from 'rsuite'; import { useNavigate } from 'react-router-dom'; diff --git a/src/frontend/src/components/createproject/DataExtract.tsx b/src/frontend/src/components/createproject/DataExtract.tsx index 4fc7355532..15dde7e1a1 100755 --- a/src/frontend/src/components/createproject/DataExtract.tsx +++ b/src/frontend/src/components/createproject/DataExtract.tsx @@ -1,16 +1,16 @@ import React, { useEffect } from 'react'; -import enviroment from '../../environment'; -import CoreModules from '../../shared/CoreModules.js'; +import enviroment from '@/environment'; +import CoreModules from '@/shared/CoreModules.js'; import FormGroup from '@mui/material/FormGroup'; -import { FormCategoryService } from '../../api/CreateProjectService'; +import { FormCategoryService } from '@/api/CreateProjectService'; import { useNavigate, Link } from 'react-router-dom'; -import { CreateProjectActions } from '../../store/slices/CreateProjectSlice'; +import { CreateProjectActions } from '@/store/slices/CreateProjectSlice'; import { Grid, InputLabel, MenuItem, Select } from '@mui/material'; -import useForm from '../../hooks/useForm'; +import useForm from '@/hooks/useForm'; //@ts-ignore -// import DefineAreaMap from './views/DefineAreaMap'; -import DefineAreaMap from '../../views//DefineAreaMap'; -import DataExtractValidation from './validation/DataExtractValidation'; +// import DefineAreaMap from '@/views/DefineAreaMap'; +import DefineAreaMap from '@/views//DefineAreaMap'; +import DataExtractValidation from '@/components/createproject/validation/DataExtractValidation'; // import { SelectPicker } from 'rsuite'; let generateProjectLogIntervalCb: any = null; diff --git a/src/frontend/src/components/createproject/DefineTasks.tsx b/src/frontend/src/components/createproject/DefineTasks.tsx index ed699382a5..33644ac6a9 100755 --- a/src/frontend/src/components/createproject/DefineTasks.tsx +++ b/src/frontend/src/components/createproject/DefineTasks.tsx @@ -1,17 +1,17 @@ import React from 'react'; -import enviroment from '../../environment'; -import CoreModules from '../../shared/CoreModules'; -import AssetModules from '../../shared/AssetModules.js'; +import enviroment from '@/environment'; +import CoreModules from '@/shared/CoreModules'; +import AssetModules from '@/shared/AssetModules.js'; import FormGroup from '@mui/material/FormGroup'; -import { GetDividedTaskFromGeojson, TaskSplittingPreviewService } from '../../api/CreateProjectService'; +import { GetDividedTaskFromGeojson, TaskSplittingPreviewService } from '@/api/CreateProjectService'; import { useNavigate, Link } from 'react-router-dom'; -import { CreateProjectActions } from '../../store/slices/CreateProjectSlice'; +import { CreateProjectActions } from '@/store/slices/CreateProjectSlice'; import { InputLabel, MenuItem, Select } from '@mui/material'; //@ts-ignore -import DefineAreaMap from '../../views/DefineAreaMap'; -import useForm from '../../hooks/useForm'; -import DefineTaskValidation from './validation/DefineTaskValidation'; -import { useAppSelector } from '../../types/reduxTypes'; +import DefineAreaMap from '@/views/DefineAreaMap'; +import useForm from '@/hooks/useForm'; +import DefineTaskValidation from '@/components/createproject/validation/DefineTaskValidation'; +import { useAppSelector } from '@/types/reduxTypes'; const alogrithmList = [ { id: 1, value: 'Divide on Square', label: 'Divide on Square' }, diff --git a/src/frontend/src/components/createproject/FormSelection.tsx b/src/frontend/src/components/createproject/FormSelection.tsx index 0d9f3f5c24..c348b7782c 100755 --- a/src/frontend/src/components/createproject/FormSelection.tsx +++ b/src/frontend/src/components/createproject/FormSelection.tsx @@ -1,23 +1,22 @@ import React, { useEffect, useRef } from 'react'; -import enviroment from '../../environment'; -import CoreModules from '../../shared/CoreModules'; +import CoreModules from '@/shared/CoreModules'; import FormGroup from '@mui/material/FormGroup'; import { CreateProjectService, FormCategoryService, GenerateProjectLog, ValidateCustomForm, -} from '../../api/CreateProjectService'; +} from '@/api/CreateProjectService'; import { useNavigate, Link } from 'react-router-dom'; -import { CreateProjectActions } from '../../store/slices/CreateProjectSlice'; +import { CreateProjectActions } from '@/store/slices/CreateProjectSlice'; import { Grid, InputLabel, MenuItem, Select } from '@mui/material'; -import AssetModules from '../../shared/AssetModules.js'; -import useForm from '../../hooks/useForm'; -import SelectFormValidation from './validation/SelectFormValidation'; -import { CommonActions } from '../../store/slices/CommonSlice'; -import LoadingBar from './LoadingBar'; -import environment from '../../environment'; -import { useAppSelector } from '../../types/reduxTypes'; +import AssetModules from '@/shared/AssetModules.js'; +import useForm from '@/hooks/useForm'; +import SelectFormValidation from '@/components/createproject/validation/SelectFormValidation'; +import { CommonActions } from '@/store/slices/CommonSlice'; +import LoadingBar from '@/components/createproject/LoadingBar'; +import environment from '@/environment'; +import { useAppSelector } from '@/types/reduxTypes'; // import { SelectPicker } from 'rsuite'; let generateProjectLogIntervalCb: any = null; diff --git a/src/frontend/src/components/createproject/LoadingBar.tsx b/src/frontend/src/components/createproject/LoadingBar.tsx index d04c925a8d..c74f426741 100644 --- a/src/frontend/src/components/createproject/LoadingBar.tsx +++ b/src/frontend/src/components/createproject/LoadingBar.tsx @@ -2,7 +2,7 @@ import React from 'react'; import { Box, Tooltip } from '@mui/material'; import { LinearProgress } from '@mui/material'; import { createTheme } from '@mui/material/styles'; -import CoreModules from '../../shared/CoreModules'; +import CoreModules from '@/shared/CoreModules'; const LoadingBar = ({ activeStep, totalSteps, title }) => { const theme = createTheme({ diff --git a/src/frontend/src/components/createproject/ProjectDetailsForm.tsx b/src/frontend/src/components/createproject/ProjectDetailsForm.tsx index fa66118c08..ae01c0296c 100755 --- a/src/frontend/src/components/createproject/ProjectDetailsForm.tsx +++ b/src/frontend/src/components/createproject/ProjectDetailsForm.tsx @@ -1,15 +1,14 @@ import React, { useEffect } from 'react'; -import CoreModules from '../../shared/CoreModules'; -import AssetModules from '../../shared/AssetModules'; +import CoreModules from '@/shared/CoreModules'; +import AssetModules from '@/shared/AssetModules'; import { useNavigate } from 'react-router-dom'; -import useForm from '../../hooks/useForm'; -import CreateProjectValidation from './validation/CreateProjectValidation'; -import { CreateProjectActions } from '../../store/slices/CreateProjectSlice'; -import { OrganisationService } from '../../api/CreateProjectService'; -import environment from '../../environment'; +import useForm from '@/hooks/useForm'; +import CreateProjectValidation from '@/components/createproject/validation/CreateProjectValidation'; +import { CreateProjectActions } from '@/store/slices/CreateProjectSlice'; +import { OrganisationService } from '@/api/CreateProjectService'; import { MenuItem, Select } from '@mui/material'; -import { createPopup } from '../../utilfunctions/createPopup'; -import { useAppSelector } from '../../types/reduxTypes'; +import { createPopup } from '@/utilfunctions/createPopup'; +import { useAppSelector } from '@/types/reduxTypes'; const ProjectDetailsForm: React.FC = () => { const defaultTheme: any = CoreModules.useAppSelector((state) => state.theme.hotTheme); diff --git a/src/frontend/src/components/createproject/UploadArea.tsx b/src/frontend/src/components/createproject/UploadArea.tsx index 9ad74d8eaf..6f51239c5f 100755 --- a/src/frontend/src/components/createproject/UploadArea.tsx +++ b/src/frontend/src/components/createproject/UploadArea.tsx @@ -1,10 +1,10 @@ import React, { useEffect } from 'react'; -import CoreModules from '../../shared/CoreModules'; +import CoreModules from '@/shared/CoreModules'; import FormControl from '@mui/material/FormControl'; import FormGroup from '@mui/material/FormGroup'; import { useNavigate, Link } from 'react-router-dom'; -import { CreateProjectActions } from '../../store/slices/CreateProjectSlice'; -import DrawSvg from '../createproject/DrawSvg'; +import { CreateProjectActions } from '@/store/slices/CreateProjectSlice'; +import DrawSvg from '@/components/createproject/DrawSvg'; // @ts-ignore const DefineAreaMap = React.lazy(() => import('../../views/DefineAreaMap')); diff --git a/src/frontend/src/components/editproject/EditProjectDetails.tsx b/src/frontend/src/components/editproject/EditProjectDetails.tsx index a997c39b47..7f51bcd7d3 100644 --- a/src/frontend/src/components/editproject/EditProjectDetails.tsx +++ b/src/frontend/src/components/editproject/EditProjectDetails.tsx @@ -1,12 +1,12 @@ import React from 'react'; -import CoreModules from '../../shared/CoreModules'; -import AssetModules from '../../shared/AssetModules'; -import useForm from '../../hooks/useForm'; -import EditProjectValidation from './validation/EditProjectDetailsValidation'; -import { diffObject } from '../../utilfunctions/compareUtils'; -import environment from '../../environment'; -import { CreateProjectActions } from '../../store/slices/CreateProjectSlice'; -import { PatchProjectDetails } from '../../api/CreateProjectService'; +import CoreModules from '@/shared/CoreModules'; +import AssetModules from '@/shared/AssetModules'; +import useForm from '@/hooks/useForm'; +import EditProjectValidation from '@/components/editproject/validation/EditProjectDetailsValidation'; +import { diffObject } from '@/utilfunctions/compareUtils'; +import environment from '@/environment'; +import { CreateProjectActions } from '@/store/slices/CreateProjectSlice'; +import { PatchProjectDetails } from '@/api/CreateProjectService'; const EditProjectDetails = ({ projectId }) => { const editProjectDetails: any = CoreModules.useAppSelector((state) => state.createproject.editProjectDetails); // //we use use selector from redux to get all state of projectDetails from createProject slice diff --git a/src/frontend/src/components/editproject/UpdateForm.tsx b/src/frontend/src/components/editproject/UpdateForm.tsx index 3ea351ce64..183876e433 100644 --- a/src/frontend/src/components/editproject/UpdateForm.tsx +++ b/src/frontend/src/components/editproject/UpdateForm.tsx @@ -1,9 +1,9 @@ import React, { useEffect, useState } from 'react'; -import CoreModules from '../../shared/CoreModules'; -import environment from '../../environment'; -import { FormCategoryService, PostFormUpdate } from '../../api/CreateProjectService'; +import CoreModules from '@/shared/CoreModules'; +import environment from '@/environment'; +import { FormCategoryService, PostFormUpdate } from '@/api/CreateProjectService'; import { MenuItem } from '@mui/material'; -import { diffObject } from '../../utilfunctions/compareUtils.js'; +import { diffObject } from '@/utilfunctions/compareUtils.js'; const UpdateForm = ({ projectId }) => { const dispatch = CoreModules.useAppDispatch(); diff --git a/src/frontend/src/components/editproject/UpdateProjectArea.tsx b/src/frontend/src/components/editproject/UpdateProjectArea.tsx index 9c83b6860d..12f0a69c38 100644 --- a/src/frontend/src/components/editproject/UpdateProjectArea.tsx +++ b/src/frontend/src/components/editproject/UpdateProjectArea.tsx @@ -1,9 +1,9 @@ import React, { useEffect, useState } from 'react'; -import CoreModules from '../../shared/CoreModules'; -import AssetModules from '../../shared/AssetModules'; -import EditProjectArea from '../../views/EditProjectArea'; -import enviroment from '../../environment'; -import { EditProjectBoundaryService, GetDividedTaskFromGeojson } from '../../api/CreateProjectService'; +import CoreModules from '@/shared/CoreModules'; +import AssetModules from '@/shared/AssetModules'; +import EditProjectArea from '@/views/EditProjectArea'; +import enviroment from '@/environment'; +import { EditProjectBoundaryService, GetDividedTaskFromGeojson } from '@/api/CreateProjectService'; const UpdateProjectArea = ({ projectId }) => { const dispatch = CoreModules.useAppDispatch(); diff --git a/src/frontend/src/components/home/ExploreProjectCard.tsx b/src/frontend/src/components/home/ExploreProjectCard.tsx index 5803ccccf0..2b22a337aa 100755 --- a/src/frontend/src/components/home/ExploreProjectCard.tsx +++ b/src/frontend/src/components/home/ExploreProjectCard.tsx @@ -1,11 +1,11 @@ import * as React from 'react'; -import CustomizedImage from '../../utilities/CustomizedImage'; -import CustomizedProgressBar from '../../utilities/CustomizedProgressBar'; -import environment from '../../environment'; -import { HomeActions } from '../../store/slices/HomeSlice'; -import { HomeProjectCardModel } from '../../models/home/homeModel'; -import CoreModules from '../../shared/CoreModules'; -import AssetModules from '../../shared/AssetModules'; +import CustomizedImage from '@/utilities/CustomizedImage'; +import CustomizedProgressBar from '@/utilities/CustomizedProgressBar'; +import environment from '@/environment'; +import { HomeActions } from '@/store/slices/HomeSlice'; +import { HomeProjectCardModel } from '@/models/home/homeModel'; +import CoreModules from '@/shared/CoreModules'; +import AssetModules from '@/shared/AssetModules'; //Explore Project Card Model to be renderd in home view export default function ExploreProjectCard({ data }) { diff --git a/src/frontend/src/components/home/HomePageFilters.tsx b/src/frontend/src/components/home/HomePageFilters.tsx index 85fa0fa40b..368afec4ce 100755 --- a/src/frontend/src/components/home/HomePageFilters.tsx +++ b/src/frontend/src/components/home/HomePageFilters.tsx @@ -1,9 +1,9 @@ import React, { useState } from 'react'; -import windowDimention from '../../hooks/WindowDimension'; -import CoreModules from '../../shared/CoreModules'; -import AssetModules from '../../shared/AssetModules'; -import Switch from '../common/Switch'; -import { HomeActions } from '../../store/slices/HomeSlice'; +import windowDimention from '@/hooks/WindowDimension'; +import CoreModules from '@/shared/CoreModules'; +import AssetModules from '@/shared/AssetModules'; +import Switch from '@/components/common/Switch'; +import { HomeActions } from '@/store/slices/HomeSlice'; //Home Filter const HomePageFilters = ({ onSearch, filteredProjectCount, totalProjectCount }) => { diff --git a/src/frontend/src/components/home/ProjectCardSkeleton.tsx b/src/frontend/src/components/home/ProjectCardSkeleton.tsx index ef1d1c0174..c71b4bab43 100755 --- a/src/frontend/src/components/home/ProjectCardSkeleton.tsx +++ b/src/frontend/src/components/home/ProjectCardSkeleton.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import CoreModules from '../../shared/CoreModules'; +import CoreModules from '@/shared/CoreModules'; // Skeleton card main purpose is to perfom loading in case of any delay in retrieving project const ProjectCardSkeleton = ({ cardsPerRow, defaultTheme }) => { return cardsPerRow.map((data, index) => { diff --git a/src/frontend/src/components/home/ProjectListMap.tsx b/src/frontend/src/components/home/ProjectListMap.tsx index 54b3890084..63b86ea52c 100644 --- a/src/frontend/src/components/home/ProjectListMap.tsx +++ b/src/frontend/src/components/home/ProjectListMap.tsx @@ -1,15 +1,15 @@ import React, { useState, useEffect } from 'react'; -import { useOLMap } from '../MapComponent/OpenLayersComponent'; -import { MapContainer as MapComponent } from '../MapComponent/OpenLayersComponent'; -import LayerSwitcherControl from '../MapComponent/OpenLayersComponent/LayerSwitcher/index.js'; -import { VectorLayer } from '../MapComponent/OpenLayersComponent/Layers'; -import { ClusterLayer } from '../MapComponent/OpenLayersComponent/Layers'; -import CoreModules from '../../shared/CoreModules'; -import { geojsonObjectModel } from '../../constants/geojsonObjectModal'; -import { defaultStyles, getStyles } from '../MapComponent/OpenLayersComponent/helpers/styleUtils'; -import MarkerIcon from '../../assets/images/red_marker.png'; +import { useOLMap } from '@/components/MapComponent/OpenLayersComponent'; +import { MapContainer as MapComponent } from '@/components/MapComponent/OpenLayersComponent'; +import LayerSwitcherControl from '@/components/MapComponent/OpenLayersComponent/LayerSwitcher/index.js'; +import { VectorLayer } from '@/components/MapComponent/OpenLayersComponent/Layers'; +import { ClusterLayer } from '@/components/MapComponent/OpenLayersComponent/Layers'; +import CoreModules from '@/shared/CoreModules'; +import { geojsonObjectModel } from '@/constants/geojsonObjectModal'; +import { defaultStyles, getStyles } from '@/components/MapComponent/OpenLayersComponent/helpers/styleUtils'; +import MarkerIcon from '@/assets/images/red_marker.png'; import { useNavigate } from 'react-router-dom'; -import environment from '../../environment'; +import environment from '@/environment'; import { Style, Text, Icon, Fill } from 'ol/style'; type HomeProjectSummaryType = { diff --git a/src/frontend/src/components/organisation/OrganisationAddForm.tsx b/src/frontend/src/components/organisation/OrganisationAddForm.tsx index 1835200b37..398f5cb5ed 100644 --- a/src/frontend/src/components/organisation/OrganisationAddForm.tsx +++ b/src/frontend/src/components/organisation/OrganisationAddForm.tsx @@ -1,10 +1,9 @@ import React from 'react'; -import CoreModules from '../../shared/CoreModules.js'; -import useForm from '../../hooks/useForm.js'; -import OrganisationAddValidation from './Validation/OrganisationAddValidation.js'; +import CoreModules from '@/shared/CoreModules.js'; +import useForm from '@/hooks/useForm.js'; +import OrganisationAddValidation from '@/components/organisation/Validation/OrganisationAddValidation.js'; import { MenuItem, Select } from '@mui/material'; -import { OrganisationService } from '../../api/OrganisationService'; -import environment from '../../environment.js'; +import { OrganisationService } from '@/api/OrganisationService'; const formData = {}; const organisationTypeList = ['FREE', 'DISCOUNTED', 'FULL_FEE']; @@ -168,7 +167,11 @@ const OrganisationAddForm = () => { // dispatch(CreateProjectActions.SetProjectDetails({ key: 'organisation', value: e.target.value })) }} > - {organisationDataList?.map((org) => {org.label})} + {organisationDataList?.map((org) => ( + + {org.label} + + ))} {errors.type && ( diff --git a/src/frontend/src/hooks/MapStyles.js b/src/frontend/src/hooks/MapStyles.js index 57c18fe183..29980a59c5 100755 --- a/src/frontend/src/hooks/MapStyles.js +++ b/src/frontend/src/hooks/MapStyles.js @@ -2,8 +2,8 @@ import Fill from 'ol/style/Fill'; import Stroke from 'ol/style/Stroke'; import { Icon, Style } from 'ol/style'; import React, { useEffect, useState } from 'react'; -import CoreModules from '../shared/CoreModules'; -import AssetModules from '../shared/AssetModules'; +import CoreModules from '@/shared/CoreModules'; +import AssetModules from '@/shared/AssetModules'; import { getCenter } from 'ol/extent'; import Point from 'ol/geom/Point.js'; import { transform } from 'ol/proj'; diff --git a/src/frontend/src/hooks/Prompt.tsx b/src/frontend/src/hooks/Prompt.tsx index b61748154e..88288a7e79 100644 --- a/src/frontend/src/hooks/Prompt.tsx +++ b/src/frontend/src/hooks/Prompt.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import pathNotToBlock from '../constants/blockerUrl'; +import pathNotToBlock from '@/constants/blockerUrl'; import { unstable_useBlocker as useBlocker } from 'react-router-dom'; function Prompt(props) { diff --git a/src/frontend/src/hooks/useForm.tsx b/src/frontend/src/hooks/useForm.tsx index 4000b0b4b0..fc6939435d 100755 --- a/src/frontend/src/hooks/useForm.tsx +++ b/src/frontend/src/hooks/useForm.tsx @@ -59,8 +59,6 @@ const useForm = (initialState, callback, validate) => { useEffect(() => { setValues(initialState); setErrors({}); - - // eslint-disable-next-line react-hooks/exhaustive-deps }, [initialState]); return { diff --git a/src/frontend/src/routes.jsx b/src/frontend/src/routes.jsx index 5818226dee..ceaa0c591c 100755 --- a/src/frontend/src/routes.jsx +++ b/src/frontend/src/routes.jsx @@ -3,23 +3,23 @@ import { createBrowserRouter, // Navigate, } from 'react-router-dom'; -import Home from './views/Home'; -import Tabbed from './views/Tabbed'; -import MainView from './views/MainView'; -import CreateProject from './views/CreateProject'; -import EditProject from './views/EditProject'; -import ProtectedRoute from './utilities/ProtectedRoute'; -import NotFoundPage from './views/NotFound404'; -import Organisation from './views/Organisation'; -import CreateOrganisation from './views/CreateOrganisation'; -import Authorized from './views/Authorized'; -import SubmissionDetails from './views/SubmissionDetails'; -import CreateNewProject from './views/CreateNewProject'; -import ProjectDetails from './views/ProjectDetails'; -import UnderConstruction from './views/UnderConstruction'; -import ErrorBoundary from './views/ErrorBoundary'; -import NewProjectDetails from './views/NewProjectDetails'; -import ProjectDetailsV2 from './views/ProjectDetailsV2'; +import Home from '@/views/Home'; +import Tabbed from '@/views/Tabbed'; +import MainView from '@/views/MainView'; +import CreateProject from '@/views/CreateProject'; +import EditProject from '@/views/EditProject'; +import ProtectedRoute from '@/utilities/ProtectedRoute'; +import NotFoundPage from '@/views/NotFound404'; +import Organisation from '@/views/Organisation'; +import CreateOrganisation from '@/views/CreateOrganisation'; +import Authorized from '@/views/Authorized'; +import SubmissionDetails from '@/views/SubmissionDetails'; +import CreateNewProject from '@/views/CreateNewProject'; +import ProjectDetails from '@/views/ProjectDetails'; +import UnderConstruction from '@/views/UnderConstruction'; +import ErrorBoundary from '@/views/ErrorBoundary'; +import NewProjectDetails from '@/views/NewProjectDetails'; +import ProjectDetailsV2 from '@/views/ProjectDetailsV2'; // const ProjectDetails = React.lazy(() => import('./views/ProjectDetails')); const Submissions = React.lazy(() => import('./views/Submissions')); diff --git a/src/frontend/src/shared/AssetModules.js b/src/frontend/src/shared/AssetModules.js index 4baba51804..58790691ea 100755 --- a/src/frontend/src/shared/AssetModules.js +++ b/src/frontend/src/shared/AssetModules.js @@ -59,8 +59,8 @@ import { Undo as UndoIcon, Timeline as TimelineIcon, } from '@mui/icons-material'; -import LockPng from '../assets/images/lock.png'; -import RedLockPng from '../assets/images/red-lock.png'; +import LockPng from '@/assets/images/lock.png'; +import RedLockPng from '@/assets/images/red-lock.png'; import { styled, alpha } from '@mui/material/styles'; export default { ExitToAppIcon, diff --git a/src/frontend/src/shared/CoreModules.js b/src/frontend/src/shared/CoreModules.js index e773a37f9c..7409e1ca6b 100755 --- a/src/frontend/src/shared/CoreModules.js +++ b/src/frontend/src/shared/CoreModules.js @@ -68,10 +68,10 @@ import { import { Provider } from 'react-redux'; import { createSlice, configureStore, getDefaultMiddleware } from '@reduxjs/toolkit'; import { combineReducers } from 'redux'; -import LoadingBar from '../components/createproject/LoadingBar'; -import { TaskActions } from '../store/slices/TaskSlice'; -import { useAppDispatch, useAppSelector } from '../types/reduxTypes'; -import CustomizedModal from '../utilities/CustomizedModal'; +import LoadingBar from '@/components/createproject/LoadingBar'; +import { TaskActions } from '@/store/slices/TaskSlice'; +import { useAppDispatch, useAppSelector } from '@/types/reduxTypes'; +import CustomizedModal from '@/utilities/CustomizedModal'; export default { Provider, diff --git a/src/frontend/src/store/Store.ts b/src/frontend/src/store/Store.ts index 05058a3470..8a33f6dcfb 100755 --- a/src/frontend/src/store/Store.ts +++ b/src/frontend/src/store/Store.ts @@ -1,14 +1,14 @@ -import HomeSlice from './slices/HomeSlice'; -import ThemeSlice from './slices/ThemeSlice'; +import HomeSlice from '@/store/slices/HomeSlice'; +import ThemeSlice from '@/store/slices/ThemeSlice'; import { persistStore } from 'redux-persist'; import storage from 'redux-persist/lib/storage'; -import ProjectSlice from './slices/ProjectSlice'; -import CreateProjectReducer from './slices/CreateProjectSlice'; -import CommonSlice from './slices/CommonSlice'; -import LoginSlice from './slices/LoginSlice'; -import OrganisationSlice from './slices/organisationSlice'; -import SubmissionSlice from './slices/SubmissionSlice'; -import TaskSlice from './slices/TaskSlice'; +import ProjectSlice from '@/store/slices/ProjectSlice'; +import CreateProjectReducer from '@/store/slices/CreateProjectSlice'; +import CommonSlice from '@/store/slices/CommonSlice'; +import LoginSlice from '@/store/slices/LoginSlice'; +import OrganisationSlice from '@/store/slices/organisationSlice'; +import SubmissionSlice from '@/store/slices/SubmissionSlice'; +import TaskSlice from '@/store/slices/TaskSlice'; import { persistReducer } from 'redux-persist'; import { combineReducers, configureStore, getDefaultMiddleware } from '@reduxjs/toolkit'; diff --git a/src/frontend/src/store/slices/CommonSlice.ts b/src/frontend/src/store/slices/CommonSlice.ts index 9b5db5b957..b3f9ddca23 100755 --- a/src/frontend/src/store/slices/CommonSlice.ts +++ b/src/frontend/src/store/slices/CommonSlice.ts @@ -1,4 +1,4 @@ -import CoreModules from '../../shared/CoreModules'; +import CoreModules from '@/shared/CoreModules'; const CommonSlice = CoreModules.createSlice({ name: 'common', initialState: { diff --git a/src/frontend/src/store/slices/CreateProjectSlice.ts b/src/frontend/src/store/slices/CreateProjectSlice.ts index ecdf7b33b9..af1a2c5790 100755 --- a/src/frontend/src/store/slices/CreateProjectSlice.ts +++ b/src/frontend/src/store/slices/CreateProjectSlice.ts @@ -1,4 +1,4 @@ -import { CreateProjectStateTypes } from '../types/ICreateProject'; +import { CreateProjectStateTypes } from '@/types/ICreateProject'; import { createSlice } from '@reduxjs/toolkit'; export const initialState: CreateProjectStateTypes = { diff --git a/src/frontend/src/store/slices/HomeSlice.ts b/src/frontend/src/store/slices/HomeSlice.ts index 6c2afee6aa..430a7a0f21 100755 --- a/src/frontend/src/store/slices/HomeSlice.ts +++ b/src/frontend/src/store/slices/HomeSlice.ts @@ -1,4 +1,4 @@ -import CoreModules from '../../shared/CoreModules'; +import CoreModules from '@/shared/CoreModules'; const HomeSlice = CoreModules.createSlice({ name: 'home', initialState: { diff --git a/src/frontend/src/store/slices/LoginSlice.ts b/src/frontend/src/store/slices/LoginSlice.ts index 6afdd45ee1..bb7381900b 100755 --- a/src/frontend/src/store/slices/LoginSlice.ts +++ b/src/frontend/src/store/slices/LoginSlice.ts @@ -1,4 +1,4 @@ -import CoreModules from '../../shared/CoreModules'; +import CoreModules from '@/shared/CoreModules'; import storage from 'redux-persist/lib/storage'; const LoginSlice = CoreModules.createSlice({ name: 'login', diff --git a/src/frontend/src/store/slices/ThemeSlice.ts b/src/frontend/src/store/slices/ThemeSlice.ts index 781cdcdb57..70051fcd2f 100755 --- a/src/frontend/src/store/slices/ThemeSlice.ts +++ b/src/frontend/src/store/slices/ThemeSlice.ts @@ -1,4 +1,4 @@ -import CoreModules from '../../shared/CoreModules'; +import CoreModules from '@/shared/CoreModules'; const ThemeSlice = CoreModules.createSlice({ name: 'theme', diff --git a/src/frontend/src/store/slices/organisationSlice.ts b/src/frontend/src/store/slices/organisationSlice.ts index 26069f4821..30af04dbbb 100644 --- a/src/frontend/src/store/slices/organisationSlice.ts +++ b/src/frontend/src/store/slices/organisationSlice.ts @@ -1,4 +1,4 @@ -import CoreModules from '../../shared/CoreModules.js'; +import CoreModules from '@/shared/CoreModules.js'; const OrganisationSlice = CoreModules.createSlice({ name: 'organisation', diff --git a/src/frontend/src/types/reduxTypes.ts b/src/frontend/src/types/reduxTypes.ts index be668677a9..37408bc699 100644 --- a/src/frontend/src/types/reduxTypes.ts +++ b/src/frontend/src/types/reduxTypes.ts @@ -1,6 +1,6 @@ import { useDispatch, useSelector } from 'react-redux'; import type { TypedUseSelectorHook } from 'react-redux'; -import type { RootState, AppDispatch } from '../store/Store'; +import type { RootState, AppDispatch } from '@/store/Store'; // Use throughout your app instead of plain `useDispatch` and `useSelector` export const useAppDispatch: () => AppDispatch = useDispatch; diff --git a/src/frontend/src/utilfunctions/getTaskStatusStyle.js b/src/frontend/src/utilfunctions/getTaskStatusStyle.js index ee572dbc8d..370e91edad 100644 --- a/src/frontend/src/utilfunctions/getTaskStatusStyle.js +++ b/src/frontend/src/utilfunctions/getTaskStatusStyle.js @@ -1,8 +1,8 @@ import { Fill, Icon, Stroke, Style } from 'ol/style'; import { transform } from 'ol/proj'; import { Point } from 'ol/geom'; -import AssetModules from '../shared/AssetModules'; -import { task_priority_str } from '../types/enums'; +import AssetModules from '@/shared/AssetModules'; +import { task_priority_str } from '@/types/enums'; function createPolygonStyle(fillColor, strokeColor) { return new Style({ diff --git a/src/frontend/src/utilfunctions/login.ts b/src/frontend/src/utilfunctions/login.ts index 503dabd1da..a3306379dd 100644 --- a/src/frontend/src/utilfunctions/login.ts +++ b/src/frontend/src/utilfunctions/login.ts @@ -1,4 +1,4 @@ -import { createPopup } from './createPopup'; +import { createPopup } from '@/utilfunctions/createPopup'; export const createLoginWindow = (redirectTo) => { fetch(`${import.meta.env.VITE_API_URL}/auth/osm_login/`) diff --git a/src/frontend/src/utilfunctions/testUtils.jsx b/src/frontend/src/utilfunctions/testUtils.jsx index 3bc4787685..f39bf8d922 100644 --- a/src/frontend/src/utilfunctions/testUtils.jsx +++ b/src/frontend/src/utilfunctions/testUtils.jsx @@ -1,6 +1,6 @@ import React from 'react'; import { Provider } from 'react-redux'; -import { store } from '../store/Store'; +import { store } from '@/store/Store'; import { BrowserRouter } from 'react-router-dom'; import { act, render } from '@testing-library/react'; export const renderWithRouter = (ui, { route = '/' } = {}) => { diff --git a/src/frontend/src/utilities/AppLoader.jsx b/src/frontend/src/utilities/AppLoader.jsx index 8833a0c670..b4da0ebf9f 100644 --- a/src/frontend/src/utilities/AppLoader.jsx +++ b/src/frontend/src/utilities/AppLoader.jsx @@ -11,7 +11,7 @@ import { ScaleLoader, DotLoader, } from 'react-spinners'; -import CoreModules from '../shared/CoreModules'; +import CoreModules from '@/shared/CoreModules'; const override = { display: 'block', diff --git a/src/frontend/src/utilities/BasicCard.tsx b/src/frontend/src/utilities/BasicCard.tsx index fb5eadd501..dda8b0f4ef 100755 --- a/src/frontend/src/utilities/BasicCard.tsx +++ b/src/frontend/src/utilities/BasicCard.tsx @@ -1,5 +1,5 @@ import * as React from 'react'; -import CoreModules from '../shared/CoreModules'; +import CoreModules from '@/shared/CoreModules'; export default function BasicCard({ title, subtitle, content, variant, contentProps, headerStatus }) { return ( diff --git a/src/frontend/src/utilities/BasicDialog.jsx b/src/frontend/src/utilities/BasicDialog.jsx index be97285132..789258f90c 100755 --- a/src/frontend/src/utilities/BasicDialog.jsx +++ b/src/frontend/src/utilities/BasicDialog.jsx @@ -1,6 +1,6 @@ import * as React from 'react'; -import CoreModules from '../shared/CoreModules'; -import AssetModules from '../shared/AssetModules'; +import CoreModules from '@/shared/CoreModules'; +import AssetModules from '@/shared/AssetModules'; export default function BasicDialog({ open, actions, title, onClose, subtitle }) { return ( diff --git a/src/frontend/src/utilities/BasicDialog.tsx b/src/frontend/src/utilities/BasicDialog.tsx index 6533ff11ab..f3d8e9f3a8 100755 --- a/src/frontend/src/utilities/BasicDialog.tsx +++ b/src/frontend/src/utilities/BasicDialog.tsx @@ -1,7 +1,7 @@ import * as React from 'react'; import { TransitionProps } from '@mui/material/transitions'; -import CoreModules from '../shared/CoreModules'; -import AssetModules from '../shared/AssetModules'; +import CoreModules from '@/shared/CoreModules'; +import AssetModules from '@/shared/AssetModules'; const Transition = React.forwardRef(function Transition( props: TransitionProps & { diff --git a/src/frontend/src/utilities/BasicTabs.tsx b/src/frontend/src/utilities/BasicTabs.tsx index 6d7c77e257..8fb08b27f5 100755 --- a/src/frontend/src/utilities/BasicTabs.tsx +++ b/src/frontend/src/utilities/BasicTabs.tsx @@ -1,7 +1,7 @@ import * as React from 'react'; import PropTypes from 'prop-types'; -import windowDimention from '../hooks/WindowDimension'; -import CoreModules from '../shared/CoreModules'; +import windowDimention from '@/hooks/WindowDimension'; +import CoreModules from '@/shared/CoreModules'; function TabPanel(props) { const { children, value, index, ...other } = props; diff --git a/src/frontend/src/utilities/CustomDrawer.jsx b/src/frontend/src/utilities/CustomDrawer.jsx index 688ccf2a20..3996f6f090 100644 --- a/src/frontend/src/utilities/CustomDrawer.jsx +++ b/src/frontend/src/utilities/CustomDrawer.jsx @@ -1,12 +1,12 @@ import * as React from 'react'; import SwipeableDrawer from '@mui/material/SwipeableDrawer'; -import CoreModules from '../shared/CoreModules'; -import AssetModules from '../shared/AssetModules'; +import CoreModules from '@/shared/CoreModules'; +import AssetModules from '@/shared/AssetModules'; import { NavLink } from 'react-router-dom'; -import { createLoginWindow, revokeCookie } from '../utilfunctions/login'; -import { CommonActions } from '../store/slices/CommonSlice'; -import { LoginActions } from '../store/slices/LoginSlice'; -import { ProjectActions } from '../store/slices/ProjectSlice'; +import { createLoginWindow, revokeCookie } from '@/utilfunctions/login'; +import { CommonActions } from '@/store/slices/CommonSlice'; +import { LoginActions } from '@/store/slices/LoginSlice'; +import { ProjectActions } from '@/store/slices/ProjectSlice'; export default function CustomDrawer({ open, placement, size, type, onClose, onSignOut, setOpen }) { const defaultTheme = CoreModules.useAppSelector((state) => state.theme.hotTheme); diff --git a/src/frontend/src/utilities/CustomizedImage.jsx b/src/frontend/src/utilities/CustomizedImage.jsx index bfa2c7c15b..373e9e8e59 100755 --- a/src/frontend/src/utilities/CustomizedImage.jsx +++ b/src/frontend/src/utilities/CustomizedImage.jsx @@ -1,6 +1,6 @@ import React from 'react'; -import cardImg from '../assets/images/project_icon.png'; -import logo from '../assets/images/hotLog.png'; +import cardImg from '@/assets/images/project_icon.png'; +import logo from '@/assets/images/hotLog.png'; import { LazyLoadImage } from 'react-lazy-load-image-component'; const Switcher = ({ status, width, height }) => { switch (status) { diff --git a/src/frontend/src/utilities/CustomizedMenus.tsx b/src/frontend/src/utilities/CustomizedMenus.tsx index 5b36f53097..5c47628c86 100755 --- a/src/frontend/src/utilities/CustomizedMenus.tsx +++ b/src/frontend/src/utilities/CustomizedMenus.tsx @@ -1,7 +1,7 @@ import * as React from 'react'; import { MenuProps } from '@mui/material/Menu'; -import CoreModules from '../shared/CoreModules'; -import AssetModules from '../shared/AssetModules'; +import CoreModules from '@/shared/CoreModules'; +import AssetModules from '@/shared/AssetModules'; const StyledMenu = AssetModules.styled((props: MenuProps) => ( ; }); +Backdrop.displayName = 'ModalBackdrop'; const StyledModal = styled(Modal)` position: fixed; diff --git a/src/frontend/src/utilities/CustomizedProgressBar.tsx b/src/frontend/src/utilities/CustomizedProgressBar.tsx index 797d78ef26..8ccba25342 100755 --- a/src/frontend/src/utilities/CustomizedProgressBar.tsx +++ b/src/frontend/src/utilities/CustomizedProgressBar.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import CoreModules from '../shared/CoreModules'; +import CoreModules from '@/shared/CoreModules'; const CustomizedProgressBar = ({ height, data }) => { const defaultTheme: any = CoreModules.useAppSelector((state) => state.theme.hotTheme); diff --git a/src/frontend/src/utilities/CustomizedSnackbar.jsx b/src/frontend/src/utilities/CustomizedSnackbar.jsx index bb70fbb4fd..6a6c111908 100755 --- a/src/frontend/src/utilities/CustomizedSnackbar.jsx +++ b/src/frontend/src/utilities/CustomizedSnackbar.jsx @@ -1,5 +1,5 @@ import * as React from 'react'; -import CoreModules from '../shared/CoreModules'; +import CoreModules from '@/shared/CoreModules'; const Alert = React.forwardRef(function Alert(props, ref) { return ; }); diff --git a/src/frontend/src/utilities/IconButtonCard.jsx b/src/frontend/src/utilities/IconButtonCard.jsx index 3e421028b9..4c8e33959c 100755 --- a/src/frontend/src/utilities/IconButtonCard.jsx +++ b/src/frontend/src/utilities/IconButtonCard.jsx @@ -1,5 +1,5 @@ import React from 'react'; -import CoreModules from '../shared/CoreModules'; +import CoreModules from '@/shared/CoreModules'; export default function IconButtonCard({ element, style, radius }) { return ( { const onToggleOutline = (e) => { diff --git a/src/frontend/src/utilities/PrimaryAppBar.tsx b/src/frontend/src/utilities/PrimaryAppBar.tsx index 9786e43eb6..49b0c84e39 100755 --- a/src/frontend/src/utilities/PrimaryAppBar.tsx +++ b/src/frontend/src/utilities/PrimaryAppBar.tsx @@ -1,14 +1,14 @@ import * as React from 'react'; -import windowDimention from '../hooks/WindowDimension'; -import DrawerComponent from './CustomDrawer'; -import CustomizedImage from '../utilities/CustomizedImage'; -import { ThemeActions } from '../store/slices/ThemeSlice'; -import CoreModules from '../shared/CoreModules'; -import AssetModules from '../shared/AssetModules'; -import { CommonActions } from '../store/slices/CommonSlice'; -import { LoginActions } from '../store/slices/LoginSlice'; -import { ProjectActions } from '../store/slices/ProjectSlice'; -import { createLoginWindow, revokeCookie } from '../utilfunctions/login'; +import windowDimention from '@/hooks/WindowDimension'; +import DrawerComponent from '@/utilities/CustomDrawer'; +import CustomizedImage from '@/utilities/CustomizedImage'; +import { ThemeActions } from '@/store/slices/ThemeSlice'; +import CoreModules from '@/shared/CoreModules'; +import AssetModules from '@/shared/AssetModules'; +import { CommonActions } from '@/store/slices/CommonSlice'; +import { LoginActions } from '@/store/slices/LoginSlice'; +import { ProjectActions } from '@/store/slices/ProjectSlice'; +import { createLoginWindow, revokeCookie } from '@/utilfunctions/login'; import { useState } from 'react'; export default function PrimaryAppBar() { diff --git a/src/frontend/src/utilities/ProtectedRoute.jsx b/src/frontend/src/utilities/ProtectedRoute.jsx index abfecaea6a..90e1868a9d 100644 --- a/src/frontend/src/utilities/ProtectedRoute.jsx +++ b/src/frontend/src/utilities/ProtectedRoute.jsx @@ -1,8 +1,8 @@ import { Navigate } from 'react-router-dom'; import React from 'react'; -import CoreModules from '../shared/CoreModules'; -import { createLoginWindow } from '../utilfunctions/login'; -import environment from '../environment'; +import CoreModules from '@/shared/CoreModules'; +import { createLoginWindow } from '@/utilfunctions/login'; +import environment from '@/environment'; const ProtectedRoute = ({ children }) => { // Bypass check if NODE_ENV=development (local dev) diff --git a/src/frontend/src/views/Authorized.tsx b/src/frontend/src/views/Authorized.tsx index 29aba80d0a..2204e32314 100644 --- a/src/frontend/src/views/Authorized.tsx +++ b/src/frontend/src/views/Authorized.tsx @@ -1,7 +1,7 @@ import React, { useEffect, useState } from 'react'; import { useNavigate, useLocation } from 'react-router-dom'; -import { LoginActions } from '../store/slices/LoginSlice'; -import CoreModules from '../shared/CoreModules.js'; +import { LoginActions } from '@/store/slices/LoginSlice'; +import CoreModules from '@/shared/CoreModules.js'; function Authorized() { const navigate = useNavigate(); diff --git a/src/frontend/src/views/CreateNewProject.tsx b/src/frontend/src/views/CreateNewProject.tsx index 271d9b4dc1..a16858219b 100644 --- a/src/frontend/src/views/CreateNewProject.tsx +++ b/src/frontend/src/views/CreateNewProject.tsx @@ -1,17 +1,17 @@ -import StepSwitcher from '../components/common/StepSwitcher'; -import CreateProjectHeader from '../components/createnewproject/CreateProjectHeader'; +import StepSwitcher from '@/components/common/StepSwitcher'; +import CreateProjectHeader from '@/components/createnewproject/CreateProjectHeader'; import React, { useEffect, useState } from 'react'; -import { createProjectSteps } from '../constants/StepFormConstants'; -import ProjectDetailsForm from '../components/createnewproject/ProjectDetailsForm'; -import UploadArea from '../components/createnewproject/UploadArea'; -import DataExtract from '../components/createnewproject/DataExtract'; -import SplitTasks from '../components/createnewproject/SplitTasks'; -import SelectForm from '../components/createnewproject/SelectForm'; +import { createProjectSteps } from '@/constants/StepFormConstants'; +import ProjectDetailsForm from '@/components/createnewproject/ProjectDetailsForm'; +import UploadArea from '@/components/createnewproject/UploadArea'; +import DataExtract from '@/components/createnewproject/DataExtract'; +import SplitTasks from '@/components/createnewproject/SplitTasks'; +import SelectForm from '@/components/createnewproject/SelectForm'; import { useLocation, useNavigate } from 'react-router-dom'; import { useDispatch } from 'react-redux'; -import { CommonActions } from '.././store/slices/CommonSlice'; -import { useAppSelector } from '../types/reduxTypes'; -import Prompt from '../hooks/Prompt'; +import { CommonActions } from '@/store/slices/CommonSlice'; +import { useAppSelector } from '@/types/reduxTypes'; +import Prompt from '@/hooks/Prompt'; const CreateNewProject = () => { const location = useLocation(); const dispatch = useDispatch(); diff --git a/src/frontend/src/views/CreateOrganisation.tsx b/src/frontend/src/views/CreateOrganisation.tsx index 3a0dcc165b..16d51dd54e 100644 --- a/src/frontend/src/views/CreateOrganisation.tsx +++ b/src/frontend/src/views/CreateOrganisation.tsx @@ -1,11 +1,11 @@ import React, { useEffect } from 'react'; -import CoreModules from '../shared/CoreModules'; -import environment from '../environment'; -import useForm from '../hooks/useForm'; -import OrganisationAddValidation from '../components/organisation/Validation/OrganisationAddValidation'; -import { PostOrganisationDataService } from '../api/OrganisationService'; +import CoreModules from '@/shared/CoreModules'; +import environment from '@/environment'; +import useForm from '@/hooks/useForm'; +import OrganisationAddValidation from '@/components/organisation/Validation/OrganisationAddValidation'; +import { PostOrganisationDataService } from '@/api/OrganisationService'; import { useNavigate, useSearchParams } from 'react-router-dom'; -import { OrganisationAction } from '../store/slices/organisationSlice'; +import { OrganisationAction } from '@/store/slices/organisationSlice'; const CreateOrganisationForm = () => { const dispatch = CoreModules.useAppDispatch(); diff --git a/src/frontend/src/views/CreateProject.tsx b/src/frontend/src/views/CreateProject.tsx index 7f23205697..692f97a6a1 100755 --- a/src/frontend/src/views/CreateProject.tsx +++ b/src/frontend/src/views/CreateProject.tsx @@ -1,13 +1,13 @@ import React, { useEffect, useState } from 'react'; import '../styles/home.css'; -import CoreModules from '../shared/CoreModules'; -import UploadArea from '../components/createproject/UploadArea'; +import CoreModules from '@/shared/CoreModules'; +import UploadArea from '@/components/createproject/UploadArea'; import { useLocation, Link } from 'react-router-dom'; -import ProjectDetailsForm from '../components/createproject/ProjectDetailsForm'; -import FormSelection from '../components/createproject/FormSelection'; -import DefineTasks from '../components/createproject/DefineTasks'; -import { CreateProjectActions } from '../store/slices/CreateProjectSlice'; -import DataExtract from '../components/createproject/DataExtract'; +import ProjectDetailsForm from '@/components/createproject/ProjectDetailsForm'; +import FormSelection from '@/components/createproject/FormSelection'; +import DefineTasks from '@/components/createproject/DefineTasks'; +import { CreateProjectActions } from '@/store/slices/CreateProjectSlice'; +import DataExtract from '@/components/createproject/DataExtract'; const CreateProject: React.FC = () => { const [geojsonFile, setGeojsonFile] = useState(null); diff --git a/src/frontend/src/views/DefineAreaMap.tsx b/src/frontend/src/views/DefineAreaMap.tsx index 0b193e8229..acf5b12c58 100644 --- a/src/frontend/src/views/DefineAreaMap.tsx +++ b/src/frontend/src/views/DefineAreaMap.tsx @@ -1,10 +1,10 @@ import React, { useEffect, 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'; -import CoreModules from '../shared/CoreModules'; -import { CreateProjectActions } from '../store/slices/CreateProjectSlice'; +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'; +import CoreModules from '@/shared/CoreModules'; +import { CreateProjectActions } from '@/store/slices/CreateProjectSlice'; const DefineAreaMap = ({ uploadedGeojson, diff --git a/src/frontend/src/views/EditProject.tsx b/src/frontend/src/views/EditProject.tsx index 6ec093313a..41ae4f2032 100755 --- a/src/frontend/src/views/EditProject.tsx +++ b/src/frontend/src/views/EditProject.tsx @@ -1,14 +1,14 @@ import React, { useEffect, useState } from 'react'; import '../styles/home.css'; -import CoreModules from '../shared/CoreModules'; -import AssetModules from '../shared/AssetModules'; -import environment from '../environment'; -import { FormCategoryService, GetIndividualProjectDetails, OrganisationService } from '../api/CreateProjectService'; -import EditProjectDetails from '../components/editproject/EditProjectDetails'; -import SidebarContent from '../constants/EditProjectSidebarContent'; +import CoreModules from '@/shared/CoreModules'; +import AssetModules from '@/shared/AssetModules'; +import environment from '@/environment'; +import { FormCategoryService, GetIndividualProjectDetails, OrganisationService } from '@/api/CreateProjectService'; +import EditProjectDetails from '@/components/editproject/EditProjectDetails'; +import SidebarContent from '@/constants/EditProjectSidebarContent'; import { useNavigate } from 'react-router-dom'; -import UpdateForm from '../components/editproject/UpdateForm'; -import UpdateProjectArea from '../components/editproject/UpdateProjectArea'; +import UpdateForm from '@/components/editproject/UpdateForm'; +import UpdateProjectArea from '@/components/editproject/UpdateProjectArea'; const EditProject: React.FC = () => { const dispatch = CoreModules.useAppDispatch(); diff --git a/src/frontend/src/views/EditProjectArea.tsx b/src/frontend/src/views/EditProjectArea.tsx index 898df1fa30..8a86ee96ab 100644 --- a/src/frontend/src/views/EditProjectArea.tsx +++ b/src/frontend/src/views/EditProjectArea.tsx @@ -1,8 +1,8 @@ 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'; +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'; const EditProjectArea = ({ geojson }) => { const { mapRef, map } = useOLMap({ diff --git a/src/frontend/src/views/ErrorBoundary.tsx b/src/frontend/src/views/ErrorBoundary.tsx index e4385658ea..375f969021 100644 --- a/src/frontend/src/views/ErrorBoundary.tsx +++ b/src/frontend/src/views/ErrorBoundary.tsx @@ -1,7 +1,7 @@ import React from 'react'; -import SomethingWentWrongImage from '../assets/images/something_went_wrong.png'; -import Button from '../components/common/Button'; -import AssetModules from '../shared/AssetModules'; +import SomethingWentWrongImage from '@/assets/images/something_went_wrong.png'; +import Button from '@/components/common/Button'; +import AssetModules from '@/shared/AssetModules'; interface ErrorBoundaryProps { showError?: boolean; diff --git a/src/frontend/src/views/Home.jsx b/src/frontend/src/views/Home.jsx index 8622ce89aa..e06b6930d4 100755 --- a/src/frontend/src/views/Home.jsx +++ b/src/frontend/src/views/Home.jsx @@ -1,14 +1,14 @@ import React, { useEffect, useState } from 'react'; import '../styles/home.css'; -import ExploreProjectCard from '../components/home/ExploreProjectCard'; -import windowDimention from '../hooks/WindowDimension'; -import { HomeSummaryService } from '../api/HomeService'; -import enviroment from '../environment'; -import ProjectCardSkeleton from '../components/home/ProjectCardSkeleton'; -import HomePageFilters from '../components/home/HomePageFilters'; -import CoreModules from '../shared/CoreModules'; -import AssetModules from '../shared/AssetModules'; -import ProjectListMap from '../components/home/ProjectListMap'; +import ExploreProjectCard from '@/components/home/ExploreProjectCard'; +import windowDimention from '@/hooks/WindowDimension'; +import { HomeSummaryService } from '@/api/HomeService'; +import enviroment from '@/environment'; +import ProjectCardSkeleton from '@/components/home/ProjectCardSkeleton'; +import HomePageFilters from '@/components/home/HomePageFilters'; +import CoreModules from '@/shared/CoreModules'; +import AssetModules from '@/shared/AssetModules'; +import ProjectListMap from '@/components/home/ProjectListMap'; const Home = () => { const [searchQuery, setSearchQuery] = useState(''); diff --git a/src/frontend/src/views/MainView.jsx b/src/frontend/src/views/MainView.jsx index 88d85ee61d..12f9fcbcf7 100755 --- a/src/frontend/src/views/MainView.jsx +++ b/src/frontend/src/views/MainView.jsx @@ -1,11 +1,11 @@ import React from 'react'; -import windowDimention from '../hooks/WindowDimension'; -import PrimaryAppBar from '../utilities/PrimaryAppBar'; -import CoreModules from '../shared/CoreModules'; -import CustomizedSnackbars from '../utilities/CustomizedSnackbar'; -import { CommonActions } from '../store/slices/CommonSlice'; -import Loader from '../utilities/AppLoader'; -import MappingHeader from '../utilities/MappingHeader'; +import windowDimention from '@/hooks/WindowDimension'; +import PrimaryAppBar from '@/utilities/PrimaryAppBar'; +import CoreModules from '@/shared/CoreModules'; +import CustomizedSnackbars from '@/utilities/CustomizedSnackbar'; +import { CommonActions } from '@/store/slices/CommonSlice'; +import Loader from '@/utilities/AppLoader'; +import MappingHeader from '@/utilities/MappingHeader'; import { useLocation, useSearchParams } from 'react-router-dom'; const MainView = () => { diff --git a/src/frontend/src/views/NewDefineAreaMap.tsx b/src/frontend/src/views/NewDefineAreaMap.tsx index db465efe80..bc9d906e1d 100644 --- a/src/frontend/src/views/NewDefineAreaMap.tsx +++ b/src/frontend/src/views/NewDefineAreaMap.tsx @@ -1,10 +1,10 @@ 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'; -import { GeoJSONFeatureTypes } from '../store/types/ICreateProject'; -import MapControlComponent from '../components/createnewproject/MapControlComponent'; +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'; +import { GeoJSONFeatureTypes } from '@/store/types/ICreateProject'; +import MapControlComponent from '@/components/createnewproject/MapControlComponent'; type NewDefineAreaMapProps = { drawToggle?: boolean; diff --git a/src/frontend/src/views/NewProjectDetails.jsx b/src/frontend/src/views/NewProjectDetails.jsx index 7bcc0af6ba..6249b6cbbf 100644 --- a/src/frontend/src/views/NewProjectDetails.jsx +++ b/src/frontend/src/views/NewProjectDetails.jsx @@ -1,43 +1,43 @@ import React, { useEffect, useState } from 'react'; import '../styles/home.scss'; -import WindowDimension from '../hooks/WindowDimension'; -import MapDescriptionComponents from '../components/MapDescriptionComponents'; -import ActivitiesPanel from '../components/ActivitiesPanel'; -import environment from '../environment'; -import { ProjectById } from '../api/Project'; -import { ProjectActions } from '../store/slices/ProjectSlice'; -import CustomizedSnackbar from '../utilities/CustomizedSnackbar'; -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'; -import MobileFooter from '../components/ProjectDetails/MobileFooter'; -import MobileActivitiesContents from '../components/ProjectDetails/MobileActivitiesContents'; -import BottomSheet from '../components/common/BottomSheet'; -import MobileProjectInfoContent from '../components/ProjectDetails/MobileProjectInfoContent'; +import WindowDimension from '@/hooks/WindowDimension'; +import MapDescriptionComponents from '@/components/MapDescriptionComponents'; +import ActivitiesPanel from '@/components/ActivitiesPanel'; +import environment from '@/environment'; +import { ProjectById } from '@/api/Project'; +import { ProjectActions } from '@/store/slices/ProjectSlice'; +import CustomizedSnackbar from '@/utilities/CustomizedSnackbar'; +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'; +import MobileFooter from '@/components/ProjectDetails/MobileFooter'; +import MobileActivitiesContents from '@/components/ProjectDetails/MobileActivitiesContents'; +import BottomSheet from '@/components/common/BottomSheet'; +import MobileProjectInfoContent from '@/components/ProjectDetails/MobileProjectInfoContent'; import { useNavigate } from 'react-router-dom'; -import ProjectOptions from '../components/ProjectDetails/ProjectOptions'; -import { MapContainer as MapComponent, useOLMap } from '../components/MapComponent/OpenLayersComponent'; -import LayerSwitcherControl from '../components/MapComponent/OpenLayersComponent/LayerSwitcher/index'; -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'; -import Accordion from '../components/common/Accordion'; +import ProjectOptions from '@/components/ProjectDetails/ProjectOptions'; +import { MapContainer as MapComponent, useOLMap } from '@/components/MapComponent/OpenLayersComponent'; +import LayerSwitcherControl from '@/components/MapComponent/OpenLayersComponent/LayerSwitcher/index'; +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'; +import Accordion from '@/components/common/Accordion'; import { Geolocation } from '@capacitor/geolocation'; 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 locationArc from '@/assets/images/locationArc.png'; +import { CommonActions } from '@/store/slices/CommonSlice'; const Home = () => { const dispatch = CoreModules.useAppDispatch(); diff --git a/src/frontend/src/views/NotFound404.jsx b/src/frontend/src/views/NotFound404.jsx index ee8ce79070..e1152480a1 100644 --- a/src/frontend/src/views/NotFound404.jsx +++ b/src/frontend/src/views/NotFound404.jsx @@ -1,6 +1,6 @@ import React from 'react'; -import pageNoFound from '../assets/images/notFound.png'; -import CoreModules from '../shared/CoreModules'; +import pageNoFound from '@/assets/images/notFound.png'; +import CoreModules from '@/shared/CoreModules'; const NotFoundPage = () => { return ( { p={3} > - The page you were looking for doesn't exist. + {`The page you were looking for doesn't exist.`} You may have mistyped the address or the page may have moved. diff --git a/src/frontend/src/views/Organisation.tsx b/src/frontend/src/views/Organisation.tsx index 758daaec97..4507371b22 100644 --- a/src/frontend/src/views/Organisation.tsx +++ b/src/frontend/src/views/Organisation.tsx @@ -1,8 +1,8 @@ import React, { useEffect, useState } from 'react'; -import CoreModules from '../shared/CoreModules'; -import AssetModules from '../shared/AssetModules'; -import environment from '../environment'; -import { OrganisationDataService } from '../api/OrganisationService'; +import CoreModules from '@/shared/CoreModules'; +import AssetModules from '@/shared/AssetModules'; +import environment from '@/environment'; +import { OrganisationDataService } from '@/api/OrganisationService'; const Organisation = () => { const cardStyle = { diff --git a/src/frontend/src/views/ProjectDetails.jsx b/src/frontend/src/views/ProjectDetails.jsx index dde433ab7b..080e7dd062 100755 --- a/src/frontend/src/views/ProjectDetails.jsx +++ b/src/frontend/src/views/ProjectDetails.jsx @@ -1,42 +1,42 @@ import React, { useEffect, useRef, useState } from 'react'; import '../styles/home.scss'; -import WindowDimension from '../hooks/WindowDimension'; -import MapDescriptionComponents from '../components/MapDescriptionComponents'; -import ActivitiesPanel from '../components/ActivitiesPanel'; -import OpenLayersMap from '../components/OpenLayersMap'; -import environment from '../environment'; -import { ProjectById } from '../api/Project'; -import { ProjectActions } from '../store/slices/ProjectSlice'; -import CustomizedSnackbar from '../utilities/CustomizedSnackbar'; +import WindowDimension from '@/hooks/WindowDimension'; +import MapDescriptionComponents from '@/components/MapDescriptionComponents'; +import ActivitiesPanel from '@/components/ActivitiesPanel'; +import OpenLayersMap from '@/components/OpenLayersMap'; +import environment from '@/environment'; +import { ProjectById } from '@/api/Project'; +import { ProjectActions } from '@/store/slices/ProjectSlice'; +import CustomizedSnackbar from '@/utilities/CustomizedSnackbar'; import { defaults } from 'ol/control/defaults'; -import OnScroll from '../hooks/OnScroll'; +import OnScroll from '@/hooks/OnScroll'; import { Tile as TileLayer } from 'ol/layer.js'; import { OSM } from 'ol/source.js'; import VectorLayer from 'ol/layer/Vector'; import VectorSource from 'ol/source/Vector'; -import TasksLayer from '../components/TasksLayer'; +import TasksLayer from '@/components/TasksLayer'; import Map from 'ol/Map'; import View from 'ol/View'; -import { HomeActions } from '../store/slices/HomeSlice'; -import CoreModules from '../shared/CoreModules'; -import AssetModules from '../shared/AssetModules'; +import { HomeActions } from '@/store/slices/HomeSlice'; +import CoreModules from '@/shared/CoreModules'; +import AssetModules from '@/shared/AssetModules'; import GeoJSON from 'ol/format/GeoJSON'; -import FmtmLogo from '../assets/images/hotLog.png'; +import FmtmLogo from '@/assets/images/hotLog.png'; -import GenerateBasemap from '../components/GenerateBasemap'; -import { ProjectBuildingGeojsonService } from '../api/SubmissionService'; +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'; -import TaskSectionPopup from '../components/ProjectDetails/TaskSectionPopup'; -import DialogTaskActions from '../components/DialogTaskActions'; -import QrcodeComponent from '../components/QrcodeComponent'; -import MobileFooter from '../components/ProjectDetails/MobileFooter'; -import MobileActivitiesContents from '../components/ProjectDetails/MobileActivitiesContents'; -import BottomSheet from '../components/common/BottomSheet'; -import MobileProjectInfoContent from '../components/ProjectDetails/MobileProjectInfoContent'; +import { buildingStyle, basicGeojsonTemplate } from '@/utilities/mapUtils'; +import MapLegends from '@/components/MapLegends'; +import TaskSectionPopup from '@/components/ProjectDetails/TaskSectionPopup'; +import DialogTaskActions from '@/components/DialogTaskActions'; +import QrcodeComponent from '@/components/QrcodeComponent'; +import MobileFooter from '@/components/ProjectDetails/MobileFooter'; +import MobileActivitiesContents from '@/components/ProjectDetails/MobileActivitiesContents'; +import BottomSheet from '@/components/common/BottomSheet'; +import MobileProjectInfoContent from '@/components/ProjectDetails/MobileProjectInfoContent'; import { useNavigate } from 'react-router-dom'; -import ProjectOptions from '../components/ProjectDetails/ProjectOptions'; +import ProjectOptions from '@/components/ProjectDetails/ProjectOptions'; const Home = () => { const dispatch = CoreModules.useAppDispatch(); diff --git a/src/frontend/src/views/ProjectDetailsV2.tsx b/src/frontend/src/views/ProjectDetailsV2.tsx index cbb0ffda7c..7e16daafc2 100644 --- a/src/frontend/src/views/ProjectDetailsV2.tsx +++ b/src/frontend/src/views/ProjectDetailsV2.tsx @@ -1,46 +1,46 @@ import React, { useEffect, useState } from 'react'; import '../../node_modules/ol/ol.css'; import '../styles/home.scss'; -import WindowDimension from '../hooks/WindowDimension'; -import MapDescriptionComponents from '../components/MapDescriptionComponents'; -import ActivitiesPanel from '../components/ProjectDetailsV2/ActivitiesPanel'; -import environment from '../environment'; -import { ProjectById, GetProjectDashboard } from '../api/Project'; -import { ProjectActions } from '../store/slices/ProjectSlice'; -import CustomizedSnackbar from '../utilities/CustomizedSnackbar'; -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/ProjectDetailsV2/TaskSectionPopup'; -import DialogTaskActions from '../components/DialogTaskActions'; -import QrcodeComponent from '../components/QrcodeComponent'; -import MobileFooter from '../components/ProjectDetailsV2/MobileFooter'; -import MobileActivitiesContents from '../components/ProjectDetailsV2/MobileActivitiesContents'; -import BottomSheet from '../components/common/BottomSheet'; -import MobileProjectInfoContent from '../components/ProjectDetailsV2/MobileProjectInfoContent'; +import WindowDimension from '@/hooks/WindowDimension'; +import MapDescriptionComponents from '@/components/MapDescriptionComponents'; +import ActivitiesPanel from '@/components/ProjectDetailsV2/ActivitiesPanel'; +import environment from '@/environment'; +import { ProjectById, GetProjectDashboard } from '@/api/Project'; +import { ProjectActions } from '@/store/slices/ProjectSlice'; +import CustomizedSnackbar from '@/utilities/CustomizedSnackbar'; +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/ProjectDetailsV2/TaskSectionPopup'; +import DialogTaskActions from '@/components/DialogTaskActions'; +import QrcodeComponent from '@/components/QrcodeComponent'; +import MobileFooter from '@/components/ProjectDetailsV2/MobileFooter'; +import MobileActivitiesContents from '@/components/ProjectDetailsV2/MobileActivitiesContents'; +import BottomSheet from '@/components/common/BottomSheet'; +import MobileProjectInfoContent from '@/components/ProjectDetailsV2/MobileProjectInfoContent'; import { useNavigate } from 'react-router-dom'; -import ProjectOptions from '../components/ProjectDetails/ProjectOptions'; -import { MapContainer as MapComponent, useOLMap } from '../components/MapComponent/OpenLayersComponent'; -import LayerSwitcherControl from '../components/MapComponent/OpenLayersComponent/LayerSwitcher/index'; -import MapControlComponent from '../components/ProjectDetailsV2/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'; -import Accordion from '../components/common/Accordion'; +import ProjectOptions from '@/components/ProjectDetails/ProjectOptions'; +import { MapContainer as MapComponent, useOLMap } from '@/components/MapComponent/OpenLayersComponent'; +import LayerSwitcherControl from '@/components/MapComponent/OpenLayersComponent/LayerSwitcher/index'; +import MapControlComponent from '@/components/ProjectDetailsV2/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'; +import Accordion from '@/components/common/Accordion'; import { Geolocation } from '@capacitor/geolocation'; 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 Button from '../components/common/Button'; -import ProjectInfo from '../components/ProjectDetailsV2/ProjectInfo'; +import locationArc from '@/assets/images/locationArc.png'; +import { CommonActions } from '@/store/slices/CommonSlice'; +import Button from '@/components/common/Button'; +import ProjectInfo from '@/components/ProjectDetailsV2/ProjectInfo'; const Home = () => { const dispatch = CoreModules.useAppDispatch(); diff --git a/src/frontend/src/views/ProjectInfo.tsx b/src/frontend/src/views/ProjectInfo.tsx index d87ea19d51..63c4174757 100644 --- a/src/frontend/src/views/ProjectInfo.tsx +++ b/src/frontend/src/views/ProjectInfo.tsx @@ -1,9 +1,9 @@ import React, { useEffect, useState } from 'react'; -import CoreModules from '../shared/CoreModules'; -import ProjectInfoSidebar from '../components/ProjectInfo/ProjectInfoSidebar'; -import ProjectInfomap from '../components/ProjectInfo/ProjectInfomap'; -import environment from '../environment'; -import { ProjectActions } from '../store/slices/ProjectSlice'; +import CoreModules from '@/shared/CoreModules'; +import ProjectInfoSidebar from '@/components/ProjectInfo/ProjectInfoSidebar'; +import ProjectInfomap from '@/components/ProjectInfo/ProjectInfomap'; +import environment from '@/environment'; +import { ProjectActions } from '@/store/slices/ProjectSlice'; import { ConvertXMLToJOSM, @@ -11,11 +11,11 @@ import { fetchInfoTask, getDownloadProjectSubmission, getDownloadProjectSubmissionJson, -} from '../api/task'; -import AssetModules from '../shared/AssetModules'; -import { ProjectById } from '../api/Project'; -import ProjectInfoCountCard from '../components/ProjectInfo/ProjectInfoCountCard'; -import { CommonActions } from '../store/slices/CommonSlice'; +} from '@/api/task'; +import AssetModules from '@/shared/AssetModules'; +import { ProjectById } from '@/api/Project'; +import ProjectInfoCountCard from '@/components/ProjectInfo/ProjectInfoCountCard'; +import { CommonActions } from '@/store/slices/CommonSlice'; const boxStyles = { animation: 'blink 1s infinite', diff --git a/src/frontend/src/views/SubmissionDetails.tsx b/src/frontend/src/views/SubmissionDetails.tsx index a6af3890fc..85c82e0cb9 100644 --- a/src/frontend/src/views/SubmissionDetails.tsx +++ b/src/frontend/src/views/SubmissionDetails.tsx @@ -1,7 +1,7 @@ -import CoreModules from '../shared/CoreModules.js'; +import CoreModules from '@/shared/CoreModules.js'; import React, { useEffect } from 'react'; -import environment from '../environment'; -import { SubmissionService } from '../api/Submission'; +import environment from '@/environment'; +import { SubmissionService } from '@/api/Submission'; const SubmissionDetails = () => { const dispatch = CoreModules.useAppDispatch(); diff --git a/src/frontend/src/views/Submissions.tsx b/src/frontend/src/views/Submissions.tsx index 8adb588691..6b69859902 100755 --- a/src/frontend/src/views/Submissions.tsx +++ b/src/frontend/src/views/Submissions.tsx @@ -1,13 +1,13 @@ import React, { useEffect } from 'react'; // import '../styles/home.css' -import CoreModules from '../shared/CoreModules'; +import CoreModules from '@/shared/CoreModules'; // import { useLocation, useNavigate } from 'react-router-dom'; -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'; +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'; const Submissions = () => { const dispatch = CoreModules.useAppDispatch(); @@ -100,6 +100,7 @@ const Submissions = () => { const formattedDate = date.toLocaleDateString('en-US', dateOptions); return ( { const formattedDate = date.toLocaleDateString('en-US', dateOptions); return ( { return ( diff --git a/src/frontend/tests/App.test.tsx b/src/frontend/tests/App.test.tsx index f3c06e18ff..c4a646e076 100644 --- a/src/frontend/tests/App.test.tsx +++ b/src/frontend/tests/App.test.tsx @@ -1,8 +1,8 @@ import React from 'react'; import { screen } from '@testing-library/react'; -import MainView from '../src/views/MainView'; -import { store } from '../src/store/Store'; -import { renderWithRouter } from '../src/utilfunctions/testUtils'; +import MainView from '@/views/MainView'; +import { store } from '@/store/Store'; +import { renderWithRouter } from '@/utilfunctions/testUtils'; import { Provider } from 'react-redux'; import { expect, test, it, describe } from 'vitest'; diff --git a/src/frontend/tests/CreateProject.test.tsx b/src/frontend/tests/CreateProject.test.tsx index 24f928ea9b..92928b3820 100644 --- a/src/frontend/tests/CreateProject.test.tsx +++ b/src/frontend/tests/CreateProject.test.tsx @@ -1,8 +1,8 @@ import React from 'react'; -import MainView from '../src/views/MainView'; +import MainView from '@/views/MainView'; import { Provider } from 'react-redux'; -import { store } from '../src/store/Store'; -import { renderWithRouter } from '../src/utilfunctions/testUtils'; +import { store } from '@/store/Store'; +import { renderWithRouter } from '@/utilfunctions/testUtils'; import { expect, it, describe } from 'vitest'; describe('Frontend Application Running', () => { diff --git a/src/frontend/tsconfig.json b/src/frontend/tsconfig.json index 42eacebc78..66ee59f81c 100644 --- a/src/frontend/tsconfig.json +++ b/src/frontend/tsconfig.json @@ -18,7 +18,10 @@ "noEmit": true, // "jsx": "react-jsx", "jsx": "react", - "baseUrl": "./src", + "baseUrl": ".", + "paths": { + "@/*": ["src/*"] + }, "noImplicitAny": false, //FIXME: Change This "true" to "false" To Integrate Types Instead Of "Any" Types. "strictNullChecks": true, "strictFunctionTypes": true, diff --git a/src/frontend/vite.config.ts b/src/frontend/vite.config.ts index a1322b69dd..3513f2a70f 100644 --- a/src/frontend/vite.config.ts +++ b/src/frontend/vite.config.ts @@ -1,4 +1,5 @@ /// +import path from 'path'; import { defineConfig } from 'vite'; import react from '@vitejs/plugin-react'; import { VitePWA } from 'vite-plugin-pwa'; @@ -13,6 +14,11 @@ export default defineConfig({ usePolling: true, }, }, + resolve: { + alias: { + '@': path.resolve(__dirname, 'src'), + }, + }, test: { environment: 'jsdom', setupFiles: './setupTests.ts',