diff --git a/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/database/repositories/interfaces/IDBDepartmentAreaRepository.kt b/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/database/repositories/interfaces/IDBDepartmentAreaRepository.kt index ef3feddf93..0c6b062a01 100644 --- a/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/database/repositories/interfaces/IDBDepartmentAreaRepository.kt +++ b/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/database/repositories/interfaces/IDBDepartmentAreaRepository.kt @@ -8,7 +8,7 @@ import org.springframework.data.repository.CrudRepository interface IDBDepartmentAreaRepository : CrudRepository { @Query( value = - """ + """ SELECT * FROM departments_areas WHERE insee_dep = :inseeCode diff --git a/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/database/repositories/interfaces/IDBReportingRepository.kt b/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/database/repositories/interfaces/IDBReportingRepository.kt index 45922d4a8b..fb2179df28 100644 --- a/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/database/repositories/interfaces/IDBReportingRepository.kt +++ b/backend/src/main/kotlin/fr/gouv/cacem/monitorenv/infrastructure/database/repositories/interfaces/IDBReportingRepository.kt @@ -18,7 +18,7 @@ interface IDBReportingRepository : JpaRepository { @Modifying(clearAutomatically = true, flushAutomatically = true) @Query( value = - """ + """ UPDATE reportings SET is_archived = TRUE WHERE (created_at + make_interval(hours => validity_time)) < NOW() AND is_archived IS FALSE @@ -30,7 +30,7 @@ interface IDBReportingRepository : JpaRepository { @Modifying(clearAutomatically = true, flushAutomatically = true) @Query( value = - """ + """ UPDATE reportings SET is_archived = TRUE WHERE id in (:ids) @@ -42,7 +42,7 @@ interface IDBReportingRepository : JpaRepository { @Modifying(clearAutomatically = true, flushAutomatically = true) @Query( value = - """ + """ UPDATE reportings SET mission_id = :missionId, @@ -60,7 +60,7 @@ interface IDBReportingRepository : JpaRepository { @Modifying(clearAutomatically = true, flushAutomatically = true) @Query( value = - """ + """ UPDATE reportings SET attached_env_action_id = CASE WHEN id in (:reportingIds) THEN :envActionId ELSE NULL END WHERE id in (:reportingIds) or attached_env_action_id = :envActionId @@ -75,7 +75,7 @@ interface IDBReportingRepository : JpaRepository { @Modifying(clearAutomatically = true, flushAutomatically = true) @Query( value = - """ + """ UPDATE reportings SET is_deleted = TRUE WHERE id = :id @@ -87,7 +87,7 @@ interface IDBReportingRepository : JpaRepository { @Modifying(clearAutomatically = true, flushAutomatically = true) @Query( value = - """ + """ UPDATE reportings SET is_deleted = TRUE WHERE id in (:ids) @@ -99,7 +99,7 @@ interface IDBReportingRepository : JpaRepository { @Modifying(clearAutomatically = true, flushAutomatically = true) @Query( value = - """ + """ UPDATE reportings SET attached_env_action_id = NULL WHERE mission_id = :missionId AND (:envActionIds IS NULL OR attached_env_action_id NOT IN (:envActionIds)) @@ -176,7 +176,7 @@ interface IDBReportingRepository : JpaRepository { @EntityGraph(value = "ReportingModel.fullLoad", type = EntityGraph.EntityGraphType.LOAD) @Query( value = - """ + """ SELECT reporting FROM ReportingModelJpa reporting INNER JOIN ReportingSourceModel rs ON reporting.id = rs.reporting.id @@ -187,7 +187,7 @@ interface IDBReportingRepository : JpaRepository { @Query( value = - """ + """ SELECT reporting FROM ReportingModelJpa reporting WHERE reporting.mission.id = :missionId @@ -197,7 +197,7 @@ interface IDBReportingRepository : JpaRepository { @Query( value = - """ + """ SELECT r.id FROM ReportingModel r WHERE ST_INTERSECTS(st_setsrid(r.geom, 4326), st_buffer(st_setsrid(:geometry, 4326), 0)) """, diff --git a/frontend/src/api/administrativeLayersAPI.ts b/frontend/src/api/administrativeLayersAPI.ts index defc86021e..214026d32e 100644 --- a/frontend/src/api/administrativeLayersAPI.ts +++ b/frontend/src/api/administrativeLayersAPI.ts @@ -1,4 +1,4 @@ -import { OPENLAYERS_PROJECTION, WSG84_PROJECTION } from '../domain/entities/map/constants' +import { OPENLAYERS_PROJECTION, WSG84_PROJECTION } from '@mtes-mct/monitor-ui' const OK = 200 diff --git a/frontend/src/domain/entities/layers/index.ts b/frontend/src/domain/entities/layers/index.ts index 22dc75454b..3f78e64b0a 100644 --- a/frontend/src/domain/entities/layers/index.ts +++ b/frontend/src/domain/entities/layers/index.ts @@ -1,6 +1,7 @@ +import { OPENLAYERS_PROJECTION, WSG84_PROJECTION } from '@mtes-mct/monitor-ui' import { GeoJSON } from 'ol/format' -import { OLGeometryType, OPENLAYERS_PROJECTION, WSG84_PROJECTION } from '../map/constants' +import { OLGeometryType } from '../map/constants' import type { GeoJSON as GeoJSONType } from '../../types/GeoJSON' import type { MultiPoint, Point, MultiPolygon, Polygon } from 'ol/geom' diff --git a/frontend/src/domain/entities/map/constants.ts b/frontend/src/domain/entities/map/constants.ts index 9880141280..cdd424d02d 100644 --- a/frontend/src/domain/entities/map/constants.ts +++ b/frontend/src/domain/entities/map/constants.ts @@ -1,6 +1,3 @@ -export const WSG84_PROJECTION = 'EPSG:4326' -export const OPENLAYERS_PROJECTION = 'EPSG:3857' - export enum InteractionType { CIRCLE = 'CIRCLE', POINT = 'POINT', diff --git a/frontend/src/domain/types/map.ts b/frontend/src/domain/types/map.ts index e907221dbd..d677787a63 100644 --- a/frontend/src/domain/types/map.ts +++ b/frontend/src/domain/types/map.ts @@ -1,7 +1,8 @@ +import { OPENLAYERS_PROJECTION } from '@mtes-mct/monitor-ui' import Feature, { type FeatureLike } from 'ol/Feature' import { GeoJSON } from 'ol/format' -import { OPENLAYERS_PROJECTION, type InteractionListener, type InteractionType } from '../entities/map/constants' +import { type InteractionListener, type InteractionType } from '../entities/map/constants' import type { Coordinate } from 'ol/coordinate' import type { Geometry } from 'ol/geom' diff --git a/frontend/src/domain/use_cases/administrative/showAdministrativeLayer.ts b/frontend/src/domain/use_cases/administrative/showAdministrativeLayer.ts index 4ede4f4243..86aa8b38d8 100644 --- a/frontend/src/domain/use_cases/administrative/showAdministrativeLayer.ts +++ b/frontend/src/domain/use_cases/administrative/showAdministrativeLayer.ts @@ -1,3 +1,4 @@ +import { OPENLAYERS_PROJECTION, WSG84_PROJECTION } from '@mtes-mct/monitor-ui' import _ from 'lodash' import GeoJSON from 'ol/format/GeoJSON' import VectorImageLayer from 'ol/layer/VectorImage' @@ -8,7 +9,6 @@ import { getAdministrativeZoneFromAPI } from '../../../api/administrativeLayersA import { getAdministrativeLayersStyle } from '../../../features/map/layers/styles/administrativeAndRegulatoryLayers.style' import { administrativeLayers } from '../../entities/administrativeLayers' import { LayerType } from '../../entities/layers/constants' -import { OPENLAYERS_PROJECTION, WSG84_PROJECTION } from '../../entities/map/constants' const IRRETRIEVABLE_FEATURES_EVENT = 'IRRETRIEVABLE_FEATURES' diff --git a/frontend/src/domain/use_cases/measurement/saveMeasurement.ts b/frontend/src/domain/use_cases/measurement/saveMeasurement.ts index e052f8a39c..0c6c6772b5 100644 --- a/frontend/src/domain/use_cases/measurement/saveMeasurement.ts +++ b/frontend/src/domain/use_cases/measurement/saveMeasurement.ts @@ -1,9 +1,10 @@ +import { OPENLAYERS_PROJECTION } from '@mtes-mct/monitor-ui' import GeoJSON from 'ol/format/GeoJSON' import Circle from 'ol/geom/Circle' import { fromCircle } from 'ol/geom/Polygon' import { batch } from 'react-redux' -import { DistanceUnit, OPENLAYERS_PROJECTION } from '../../entities/map/constants' +import { DistanceUnit } from '../../entities/map/constants' import { addMeasurementDrawed, resetCircleMeasurementInDrawing } from '../../shared_slices/Measurement' export const saveMeasurement = (feature, measurement) => (dispatch, getState) => { diff --git a/frontend/src/features/Dashboard/components/DashboardForm/RegulatoryAreas/Layer.tsx b/frontend/src/features/Dashboard/components/DashboardForm/RegulatoryAreas/Layer.tsx index 18c87473fe..26035a92ec 100644 --- a/frontend/src/features/Dashboard/components/DashboardForm/RegulatoryAreas/Layer.tsx +++ b/frontend/src/features/Dashboard/components/DashboardForm/RegulatoryAreas/Layer.tsx @@ -3,7 +3,7 @@ import { Dashboard } from '@features/Dashboard/types' import { LayerLegend } from '@features/layersSelector/utils/LayerLegend.style' import { LayerSelector } from '@features/layersSelector/utils/LayerSelector.style' import { useAppSelector } from '@hooks/useAppSelector' -import { Accent, Icon, IconButton, THEME, WSG84_PROJECTION } from '@mtes-mct/monitor-ui' +import { Accent, Icon, IconButton, THEME, WSG84_PROJECTION, OPENLAYERS_PROJECTION } from '@mtes-mct/monitor-ui' import { transformExtent } from 'ol/proj' import Projection from 'ol/proj/Projection' import { createRef } from 'react' @@ -11,7 +11,6 @@ import styled from 'styled-components' import { useGetRegulatoryLayersQuery } from '../../../../../api/regulatoryLayersAPI' import { MonitorEnvLayers } from '../../../../../domain/entities/layers/constants' -import { OPENLAYERS_PROJECTION } from '../../../../../domain/entities/map/constants' import { setFitToExtent } from '../../../../../domain/shared_slices/Map' import { useAppDispatch } from '../../../../../hooks/useAppDispatch' diff --git a/frontend/src/features/InterestPoint/components/EditInterestPoint.tsx b/frontend/src/features/InterestPoint/components/EditInterestPoint.tsx index 7a5d7959a1..31b18d3c53 100644 --- a/frontend/src/features/InterestPoint/components/EditInterestPoint.tsx +++ b/frontend/src/features/InterestPoint/components/EditInterestPoint.tsx @@ -9,11 +9,11 @@ import { Icon, MapMenuDialog, OPENLAYERS_PROJECTION, + WSG84_PROJECTION, TextInput, Textarea, getCoordinates } from '@mtes-mct/monitor-ui' -import { WSG84_PROJECTION } from 'domain/entities/map/constants' import { setDisplayedItems } from 'domain/shared_slices/Global' import { setFitToExtent } from 'domain/shared_slices/Map' import { boundingExtent } from 'ol/extent' diff --git a/frontend/src/features/InterestPoint/components/InterestPointOverlay.tsx b/frontend/src/features/InterestPoint/components/InterestPointOverlay.tsx index a5450d0905..40a846893c 100644 --- a/frontend/src/features/InterestPoint/components/InterestPointOverlay.tsx +++ b/frontend/src/features/InterestPoint/components/InterestPointOverlay.tsx @@ -1,6 +1,6 @@ import { VigilanceAreaFormTypeOpen } from '@features/VigilanceArea/slice' import { useHasMapInteraction } from '@hooks/useHasMapInteraction' -import { Accent, Icon, IconButton, Size, usePrevious } from '@mtes-mct/monitor-ui' +import { Accent, Icon, IconButton, Size, usePrevious, OPENLAYERS_PROJECTION } from '@mtes-mct/monitor-ui' import { noop } from 'lodash/fp' import LineString from 'ol/geom/LineString' import Overlay from 'ol/Overlay' @@ -8,7 +8,6 @@ import { getLength } from 'ol/sphere' import { createRef, useCallback, useEffect, useRef, useState } from 'react' import styled from 'styled-components' -import { OPENLAYERS_PROJECTION } from '../../../domain/entities/map/constants' import { useAppSelector } from '../../../hooks/useAppSelector' import { useMoveOverlayWhenDragging } from '../../../hooks/useMoveOverlayWhenDragging' import { getCoordinates } from '../../../utils/coordinates' diff --git a/frontend/src/features/LocateOnMap/index.tsx b/frontend/src/features/LocateOnMap/index.tsx index 936d337ef2..71019b6bdc 100644 --- a/frontend/src/features/LocateOnMap/index.tsx +++ b/frontend/src/features/LocateOnMap/index.tsx @@ -1,11 +1,10 @@ -import { Accent, Icon, IconButton, Search, Size } from '@mtes-mct/monitor-ui' +import { Accent, Icon, IconButton, Search, Size, OPENLAYERS_PROJECTION, WSG84_PROJECTION } from '@mtes-mct/monitor-ui' import { getColorWithAlpha } from '@utils/utils' import { transformExtent } from 'ol/proj' import { useState } from 'react' import styled from 'styled-components' import { getPlaceCoordinates, useGooglePlacesAPI } from '../../api/googlePlacesAPI/googlePlacesAPI' -import { OPENLAYERS_PROJECTION, WSG84_PROJECTION } from '../../domain/entities/map/constants' import { setFitToExtent } from '../../domain/shared_slices/Map' import { useAppDispatch } from '../../hooks/useAppDispatch' import { useAppSelector } from '../../hooks/useAppSelector' diff --git a/frontend/src/features/Reportings/components/ReportingForm/FormComponents/Position/PointPicker.tsx b/frontend/src/features/Reportings/components/ReportingForm/FormComponents/Position/PointPicker.tsx index 5a37032302..377fd25fa5 100644 --- a/frontend/src/features/Reportings/components/ReportingForm/FormComponents/Position/PointPicker.tsx +++ b/frontend/src/features/Reportings/components/ReportingForm/FormComponents/Position/PointPicker.tsx @@ -1,14 +1,9 @@ import { useAppDispatch } from '@hooks/useAppDispatch' import { useAppSelector } from '@hooks/useAppSelector' import { useListenForDrawedGeometry } from '@hooks/useListenForDrawing' -import { Accent, Icon, IconButton } from '@mtes-mct/monitor-ui' +import { Accent, Icon, IconButton, OPENLAYERS_PROJECTION, WSG84_PROJECTION } from '@mtes-mct/monitor-ui' import { formatCoordinates } from '@utils/coordinates' -import { - InteractionListener, - OLGeometryType, - OPENLAYERS_PROJECTION, - WSG84_PROJECTION -} from 'domain/entities/map/constants' +import { InteractionListener, OLGeometryType } from 'domain/entities/map/constants' import { setFitToExtent } from 'domain/shared_slices/Map' import { drawPoint } from 'domain/use_cases/draw/drawGeometry' import { useField } from 'formik' diff --git a/frontend/src/features/Reportings/components/ReportingForm/FormComponents/Position/ZonePicker.tsx b/frontend/src/features/Reportings/components/ReportingForm/FormComponents/Position/ZonePicker.tsx index b3835d1a16..f4561060cc 100644 --- a/frontend/src/features/Reportings/components/ReportingForm/FormComponents/Position/ZonePicker.tsx +++ b/frontend/src/features/Reportings/components/ReportingForm/FormComponents/Position/ZonePicker.tsx @@ -1,13 +1,8 @@ import { useAppDispatch } from '@hooks/useAppDispatch' import { useAppSelector } from '@hooks/useAppSelector' import { useListenForDrawedGeometry } from '@hooks/useListenForDrawing' -import { Accent, Icon, IconButton } from '@mtes-mct/monitor-ui' -import { - InteractionListener, - OLGeometryType, - OPENLAYERS_PROJECTION, - WSG84_PROJECTION -} from 'domain/entities/map/constants' +import { Accent, Icon, IconButton, OPENLAYERS_PROJECTION, WSG84_PROJECTION } from '@mtes-mct/monitor-ui' +import { InteractionListener, OLGeometryType } from 'domain/entities/map/constants' import { setFitToExtent } from 'domain/shared_slices/Map' import { drawPolygon } from 'domain/use_cases/draw/drawGeometry' import { useField } from 'formik' diff --git a/frontend/src/features/Reportings/components/ReportingLayer/Reporting/reportingsGeometryHelpers.ts b/frontend/src/features/Reportings/components/ReportingLayer/Reporting/reportingsGeometryHelpers.ts index 9f026016c1..37b9639f08 100644 --- a/frontend/src/features/Reportings/components/ReportingLayer/Reporting/reportingsGeometryHelpers.ts +++ b/frontend/src/features/Reportings/components/ReportingLayer/Reporting/reportingsGeometryHelpers.ts @@ -1,8 +1,7 @@ +import { OPENLAYERS_PROJECTION, WSG84_PROJECTION } from '@mtes-mct/monitor-ui' import { Feature } from 'ol' import { GeoJSON } from 'ol/format' -import { OPENLAYERS_PROJECTION, WSG84_PROJECTION } from '../../../../../domain/entities/map/constants' - import type { AtLeast } from '../../../../../types' import type { Reporting } from 'domain/entities/reporting' diff --git a/frontend/src/features/Semaphore/components/Layer/semaphoresGeometryHelpers.ts b/frontend/src/features/Semaphore/components/Layer/semaphoresGeometryHelpers.ts index 17ac0ff332..dbcacbffd1 100644 --- a/frontend/src/features/Semaphore/components/Layer/semaphoresGeometryHelpers.ts +++ b/frontend/src/features/Semaphore/components/Layer/semaphoresGeometryHelpers.ts @@ -1,8 +1,7 @@ +import { OPENLAYERS_PROJECTION, WSG84_PROJECTION } from '@mtes-mct/monitor-ui' import { Feature } from 'ol' import { GeoJSON } from 'ol/format' -import { OPENLAYERS_PROJECTION, WSG84_PROJECTION } from '../../../../domain/entities/map/constants' - import type { Semaphore } from '../../../../domain/entities/semaphore' export const getSemaphoreZoneFeature = (semaphore: Semaphore, layername: string) => { diff --git a/frontend/src/features/Station/components/StationLayer/utils.ts b/frontend/src/features/Station/components/StationLayer/utils.ts index 798e4369a8..9b1479bfa0 100644 --- a/frontend/src/features/Station/components/StationLayer/utils.ts +++ b/frontend/src/features/Station/components/StationLayer/utils.ts @@ -1,5 +1,5 @@ import { overlayStroke } from '@features/map/overlays/style' -import { THEME } from '@mtes-mct/monitor-ui' +import { OPENLAYERS_PROJECTION, THEME, WSG84_PROJECTION } from '@mtes-mct/monitor-ui' import { uniq } from 'lodash/fp' import { Feature } from 'ol' import { GeoJSON } from 'ol/format' @@ -7,7 +7,6 @@ import { Fill, Icon, Style, Text } from 'ol/style' import CircleStyle from 'ol/style/Circle' import { Layers } from '../../../../domain/entities/layers/constants' -import { OPENLAYERS_PROJECTION, WSG84_PROJECTION } from '../../../../domain/entities/map/constants' import type { Station } from '../../../../domain/entities/station' import type { StyleFunction } from 'ol/style/Style' diff --git a/frontend/src/features/coordinates/DMDCoordinatesInput.tsx b/frontend/src/features/coordinates/DMDCoordinatesInput.tsx index eee7399861..6a4a6238bd 100644 --- a/frontend/src/features/coordinates/DMDCoordinatesInput.tsx +++ b/frontend/src/features/coordinates/DMDCoordinatesInput.tsx @@ -1,9 +1,10 @@ +import { WSG84_PROJECTION } from '@mtes-mct/monitor-ui' import { useEffect, useState } from 'react' import { dmsToDecimal } from 'react-coordinate-input' import { IMaskInput } from 'react-imask' import styled from 'styled-components' -import { CoordinatesFormat, WSG84_PROJECTION } from '../../domain/entities/map/constants' +import { CoordinatesFormat } from '../../domain/entities/map/constants' import { getCoordinates } from '../../utils/coordinates' import { isNumeric } from '../../utils/isNumeric' diff --git a/frontend/src/features/layersSelector/myVigilanceAreas/MyVigilanceAreaLayerZone.tsx b/frontend/src/features/layersSelector/myVigilanceAreas/MyVigilanceAreaLayerZone.tsx index 042e7a7b13..b6d0e251b4 100644 --- a/frontend/src/features/layersSelector/myVigilanceAreas/MyVigilanceAreaLayerZone.tsx +++ b/frontend/src/features/layersSelector/myVigilanceAreas/MyVigilanceAreaLayerZone.tsx @@ -1,13 +1,12 @@ import { useGetVigilanceAreasQuery } from '@api/vigilanceAreasAPI' import { vigilanceAreaActions } from '@features/VigilanceArea/slice' import { useAppSelector } from '@hooks/useAppSelector' -import { IconButton, Accent, Size, Icon, THEME } from '@mtes-mct/monitor-ui' +import { IconButton, Accent, Size, Icon, THEME, WSG84_PROJECTION, OPENLAYERS_PROJECTION } from '@mtes-mct/monitor-ui' import { transformExtent } from 'ol/proj' import Projection from 'ol/proj/Projection' import styled from 'styled-components' import { MonitorEnvLayers } from '../../../domain/entities/layers/constants' -import { OPENLAYERS_PROJECTION, WSG84_PROJECTION } from '../../../domain/entities/map/constants' import { setFitToExtent } from '../../../domain/shared_slices/Map' import { useAppDispatch } from '../../../hooks/useAppDispatch' import { LayerLegend } from '../utils/LayerLegend.style' diff --git a/frontend/src/features/layersSelector/search/ResultsList/AMPLayerGroup/AMPLayer.tsx b/frontend/src/features/layersSelector/search/ResultsList/AMPLayerGroup/AMPLayer.tsx index 94270044c9..8fe3c925b7 100644 --- a/frontend/src/features/layersSelector/search/ResultsList/AMPLayerGroup/AMPLayer.tsx +++ b/frontend/src/features/layersSelector/search/ResultsList/AMPLayerGroup/AMPLayer.tsx @@ -5,7 +5,7 @@ import { openAMPMetadataPanel } from '@features/layersSelector/metadataPanel/slice' import { getIsLinkingAMPToVigilanceArea, vigilanceAreaActions } from '@features/VigilanceArea/slice' -import { Accent, Icon, IconButton, THEME } from '@mtes-mct/monitor-ui' +import { Accent, Icon, IconButton, THEME, OPENLAYERS_PROJECTION, WSG84_PROJECTION } from '@mtes-mct/monitor-ui' import { transformExtent } from 'ol/proj' import Projection from 'ol/proj/Projection' import { createRef, useEffect } from 'react' @@ -13,7 +13,6 @@ import Highlighter from 'react-highlight-words' import { useGetAMPsQuery } from '../../../../../api/ampsAPI' import { MonitorEnvLayers } from '../../../../../domain/entities/layers/constants' -import { OPENLAYERS_PROJECTION, WSG84_PROJECTION } from '../../../../../domain/entities/map/constants' import { addAmpZonesToMyLayers, removeAmpZonesFromMyLayers } from '../../../../../domain/shared_slices/Amp' import { setFitToExtent } from '../../../../../domain/shared_slices/Map' import { useAppDispatch } from '../../../../../hooks/useAppDispatch' diff --git a/frontend/src/features/layersSelector/search/ResultsList/RegulatoryLayerGroup/RegulatoryLayer.tsx b/frontend/src/features/layersSelector/search/ResultsList/RegulatoryLayerGroup/RegulatoryLayer.tsx index dedac337df..9f1e448bce 100644 --- a/frontend/src/features/layersSelector/search/ResultsList/RegulatoryLayerGroup/RegulatoryLayer.tsx +++ b/frontend/src/features/layersSelector/search/ResultsList/RegulatoryLayerGroup/RegulatoryLayer.tsx @@ -1,5 +1,5 @@ import { getIsLinkingRegulatoryToVigilanceArea, vigilanceAreaActions } from '@features/VigilanceArea/slice' -import { Accent, Icon, IconButton, THEME } from '@mtes-mct/monitor-ui' +import { Accent, Icon, IconButton, THEME, OPENLAYERS_PROJECTION, WSG84_PROJECTION } from '@mtes-mct/monitor-ui' import { transformExtent } from 'ol/proj' import Projection from 'ol/proj/Projection' import { createRef, useEffect } from 'react' @@ -7,7 +7,6 @@ import Highlighter from 'react-highlight-words' import { useGetRegulatoryLayersQuery } from '../../../../../api/regulatoryLayersAPI' import { MonitorEnvLayers } from '../../../../../domain/entities/layers/constants' -import { OPENLAYERS_PROJECTION, WSG84_PROJECTION } from '../../../../../domain/entities/map/constants' import { setFitToExtent } from '../../../../../domain/shared_slices/Map' import { addRegulatoryZonesToMyLayers, diff --git a/frontend/src/features/layersSelector/search/ResultsList/VigilanceAreaLayer/index.tsx b/frontend/src/features/layersSelector/search/ResultsList/VigilanceAreaLayer/index.tsx index 02196af961..9d161e18f5 100644 --- a/frontend/src/features/layersSelector/search/ResultsList/VigilanceAreaLayer/index.tsx +++ b/frontend/src/features/layersSelector/search/ResultsList/VigilanceAreaLayer/index.tsx @@ -1,13 +1,12 @@ import { useGetVigilanceAreasQuery } from '@api/vigilanceAreasAPI' import { vigilanceAreaActions } from '@features/VigilanceArea/slice' -import { Accent, Icon, IconButton, THEME } from '@mtes-mct/monitor-ui' +import { Accent, Icon, IconButton, THEME, OPENLAYERS_PROJECTION, WSG84_PROJECTION } from '@mtes-mct/monitor-ui' import { transformExtent } from 'ol/proj' import Projection from 'ol/proj/Projection' import { createRef, useEffect } from 'react' import Highlighter from 'react-highlight-words' import { MonitorEnvLayers } from '../../../../../domain/entities/layers/constants' -import { OPENLAYERS_PROJECTION, WSG84_PROJECTION } from '../../../../../domain/entities/map/constants' import { setFitToExtent } from '../../../../../domain/shared_slices/Map' import { useAppDispatch } from '../../../../../hooks/useAppDispatch' import { useAppSelector } from '../../../../../hooks/useAppSelector' diff --git a/frontend/src/features/layersSelector/utils/MyLayerZone.tsx b/frontend/src/features/layersSelector/utils/MyLayerZone.tsx index b786f24edd..32761210ac 100644 --- a/frontend/src/features/layersSelector/utils/MyLayerZone.tsx +++ b/frontend/src/features/layersSelector/utils/MyLayerZone.tsx @@ -4,7 +4,7 @@ import { vigilanceAreaActions } from '@features/VigilanceArea/slice' import { useAppSelector } from '@hooks/useAppSelector' -import { IconButton, Accent, Size, Icon, THEME } from '@mtes-mct/monitor-ui' +import { IconButton, Accent, Size, Icon, THEME, OPENLAYERS_PROJECTION, WSG84_PROJECTION } from '@mtes-mct/monitor-ui' import { transformExtent } from 'ol/proj' import Projection from 'ol/proj/Projection' import styled from 'styled-components' @@ -12,7 +12,6 @@ import styled from 'styled-components' import { LayerLegend } from './LayerLegend.style' import { LayerSelector } from './LayerSelector.style' import { MonitorEnvLayers } from '../../../domain/entities/layers/constants' -import { OPENLAYERS_PROJECTION, WSG84_PROJECTION } from '../../../domain/entities/map/constants' import { setFitToExtent } from '../../../domain/shared_slices/Map' import { useAppDispatch } from '../../../hooks/useAppDispatch' diff --git a/frontend/src/features/map/BaseMap.tsx b/frontend/src/features/map/BaseMap.tsx index ac19a1c533..f79dfd5a64 100644 --- a/frontend/src/features/map/BaseMap.tsx +++ b/frontend/src/features/map/BaseMap.tsx @@ -1,4 +1,4 @@ -import { MultiRadio } from '@mtes-mct/monitor-ui' +import { MultiRadio, OPENLAYERS_PROJECTION, WSG84_PROJECTION } from '@mtes-mct/monitor-ui' import { getGeoJSONFromFeature, getGeoJSONFromFeatureList, @@ -33,7 +33,7 @@ import { SelectableLayers0To7, SelectableLayers7To26 } from '../../domain/entities/layers/constants' -import { DistanceUnit, OPENLAYERS_PROJECTION, WSG84_PROJECTION } from '../../domain/entities/map/constants' +import { DistanceUnit } from '../../domain/entities/map/constants' import { setDistanceUnit } from '../../domain/shared_slices/Map' import { updateMeasurementsWithNewDistanceUnit } from '../../domain/use_cases/map/updateMeasurementsWithNewDistanceUnit' import { useAppDispatch } from '../../hooks/useAppDispatch' diff --git a/frontend/src/features/map/controls/MapCoordinatesBox.tsx b/frontend/src/features/map/controls/MapCoordinatesBox.tsx index 3192b6dd12..0bb0f568ce 100644 --- a/frontend/src/features/map/controls/MapCoordinatesBox.tsx +++ b/frontend/src/features/map/controls/MapCoordinatesBox.tsx @@ -1,12 +1,8 @@ -import { MultiRadio, getOptionsFromLabelledEnum } from '@mtes-mct/monitor-ui' +import { MultiRadio, getOptionsFromLabelledEnum, OPENLAYERS_PROJECTION } from '@mtes-mct/monitor-ui' import { useEffect, useRef, useState } from 'react' import styled from 'styled-components' -import { - CoordinatesFormat, - CoordinatesFormatLabel, - OPENLAYERS_PROJECTION -} from '../../../domain/entities/map/constants' +import { CoordinatesFormat, CoordinatesFormatLabel } from '../../../domain/entities/map/constants' import { setCoordinatesFormat } from '../../../domain/shared_slices/Map' import { useAppDispatch } from '../../../hooks/useAppDispatch' import { useAppSelector } from '../../../hooks/useAppSelector' diff --git a/frontend/src/features/map/draw/DrawModal.tsx b/frontend/src/features/map/draw/DrawModal.tsx index 0ef2fdea01..4e4784c74d 100644 --- a/frontend/src/features/map/draw/DrawModal.tsx +++ b/frontend/src/features/map/draw/DrawModal.tsx @@ -1,4 +1,12 @@ -import { type Coordinates, CoordinatesInput, Icon, IconButton, usePrevious } from '@mtes-mct/monitor-ui' +import { + type Coordinates, + CoordinatesInput, + Icon, + IconButton, + usePrevious, + OPENLAYERS_PROJECTION, + WSG84_PROJECTION +} from '@mtes-mct/monitor-ui' import { getFeature } from '@utils/getFeature' import Feature from 'ol/Feature' import Point from 'ol/geom/Point' @@ -6,13 +14,7 @@ import { transform } from 'ol/proj' import { useCallback, useEffect, useMemo, useRef } from 'react' import styled from 'styled-components' -import { - InteractionListener, - InteractionType, - OLGeometryType, - OPENLAYERS_PROJECTION, - WSG84_PROJECTION -} from '../../../domain/entities/map/constants' +import { InteractionListener, InteractionType, OLGeometryType } from '../../../domain/entities/map/constants' import { setGeometry, setInteractionType } from '../../../domain/shared_slices/Draw' import { VisibilityState } from '../../../domain/shared_slices/Global' import { setFitToExtent } from '../../../domain/shared_slices/Map' diff --git a/frontend/src/features/map/layers/MeasurementLayer.tsx b/frontend/src/features/map/layers/MeasurementLayer.tsx index 42ead14cc2..26c11a5273 100644 --- a/frontend/src/features/map/layers/MeasurementLayer.tsx +++ b/frontend/src/features/map/layers/MeasurementLayer.tsx @@ -1,3 +1,4 @@ +import { OPENLAYERS_PROJECTION, WSG84_PROJECTION } from '@mtes-mct/monitor-ui' import { getFeature } from '@utils/getFeature' import { getCenter } from 'ol/extent' import Feature from 'ol/Feature' @@ -15,7 +16,7 @@ import { useCallback, useEffect, useRef } from 'react' import { measurementStyle, measurementStyleWithCenter } from './styles/measurement.style' import { Layers } from '../../../domain/entities/layers/constants' -import { DistanceUnit, OPENLAYERS_PROJECTION, WSG84_PROJECTION } from '../../../domain/entities/map/constants' +import { DistanceUnit } from '../../../domain/entities/map/constants' import { removeMeasurementDrawed, resetMeasurementTypeToAdd, diff --git a/frontend/src/features/map/tools/measurements/CustomCircleRange.tsx b/frontend/src/features/map/tools/measurements/CustomCircleRange.tsx index 9a738ee7d1..8ec2ca1766 100644 --- a/frontend/src/features/map/tools/measurements/CustomCircleRange.tsx +++ b/frontend/src/features/map/tools/measurements/CustomCircleRange.tsx @@ -1,15 +1,10 @@ +import { OPENLAYERS_PROJECTION, WSG84_PROJECTION } from '@mtes-mct/monitor-ui' import { boundingExtent } from 'ol/extent' import { transform, transformExtent } from 'ol/proj' import { useCallback, useMemo } from 'react' import styled from 'styled-components' -import { - CoordinatesFormat, - DistanceUnit, - MeasurementType, - OPENLAYERS_PROJECTION, - WSG84_PROJECTION -} from '../../../../domain/entities/map/constants' +import { CoordinatesFormat, DistanceUnit, MeasurementType } from '../../../../domain/entities/map/constants' import { setIsMapToolVisible } from '../../../../domain/shared_slices/Global' import { setFitToExtent } from '../../../../domain/shared_slices/Map' import { diff --git a/frontend/src/features/missions/Layers/missionGeometryHelpers.ts b/frontend/src/features/missions/Layers/missionGeometryHelpers.ts index b7d6e010b3..3493b0fe2f 100644 --- a/frontend/src/features/missions/Layers/missionGeometryHelpers.ts +++ b/frontend/src/features/missions/Layers/missionGeometryHelpers.ts @@ -1,10 +1,10 @@ +import { OPENLAYERS_PROJECTION, WSG84_PROJECTION } from '@mtes-mct/monitor-ui' import Feature from 'ol/Feature' import GeoJSON from 'ol/format/GeoJSON' import { type Geometry } from 'ol/geom' import { selectedMissionControlStyle, selectedMissionSurveillanceStyle } from './missions.style' import { Layers } from '../../../domain/entities/layers/constants' -import { OPENLAYERS_PROJECTION, WSG84_PROJECTION } from '../../../domain/entities/map/constants' import { ActionTypeEnum, type EnvActionControl, diff --git a/frontend/src/features/missions/MissionForm/ActionForm/ControlForm/MultiPointPicker.tsx b/frontend/src/features/missions/MissionForm/ActionForm/ControlForm/MultiPointPicker.tsx index 422d9c48d2..69124b5bda 100644 --- a/frontend/src/features/missions/MissionForm/ActionForm/ControlForm/MultiPointPicker.tsx +++ b/frontend/src/features/missions/MissionForm/ActionForm/ControlForm/MultiPointPicker.tsx @@ -1,4 +1,13 @@ -import { Accent, Button, Icon, IconButton, Label, Message } from '@mtes-mct/monitor-ui' +import { + Accent, + Button, + Icon, + IconButton, + Label, + Message, + OPENLAYERS_PROJECTION, + WSG84_PROJECTION +} from '@mtes-mct/monitor-ui' import { useField } from 'formik' import { isEqual } from 'lodash' import { boundingExtent } from 'ol/extent' @@ -7,12 +16,7 @@ import { remove } from 'ramda' import { useCallback, useEffect, useMemo } from 'react' import styled from 'styled-components' -import { - InteractionListener, - OLGeometryType, - OPENLAYERS_PROJECTION, - WSG84_PROJECTION -} from '../../../../../domain/entities/map/constants' +import { InteractionListener, OLGeometryType } from '../../../../../domain/entities/map/constants' import { setFitToExtent } from '../../../../../domain/shared_slices/Map' import { drawPoint } from '../../../../../domain/use_cases/draw/drawGeometry' import { useAppDispatch } from '../../../../../hooks/useAppDispatch' diff --git a/frontend/src/features/missions/MissionForm/MissionZonePicker.tsx b/frontend/src/features/missions/MissionForm/MissionZonePicker.tsx index 0f38397c71..4786693ae7 100644 --- a/frontend/src/features/missions/MissionForm/MissionZonePicker.tsx +++ b/frontend/src/features/missions/MissionForm/MissionZonePicker.tsx @@ -1,4 +1,13 @@ -import { Accent, Button, Icon, IconButton, Label, THEME } from '@mtes-mct/monitor-ui' +import { + Accent, + Button, + Icon, + IconButton, + Label, + THEME, + OPENLAYERS_PROJECTION, + WSG84_PROJECTION +} from '@mtes-mct/monitor-ui' import { useField, useFormikContext } from 'formik' import _ from 'lodash' import { boundingExtent } from 'ol/extent' @@ -7,12 +16,7 @@ import { remove } from 'ramda' import { useCallback, useEffect, useMemo } from 'react' import styled from 'styled-components' -import { - InteractionListener, - OLGeometryType, - OPENLAYERS_PROJECTION, - WSG84_PROJECTION -} from '../../../domain/entities/map/constants' +import { InteractionListener, OLGeometryType } from '../../../domain/entities/map/constants' import { setFitToExtent } from '../../../domain/shared_slices/Map' import { drawPolygon } from '../../../domain/use_cases/draw/drawGeometry' import { useAppDispatch } from '../../../hooks/useAppDispatch' diff --git a/frontend/src/utils/coordinates.test.ts b/frontend/src/utils/coordinates.test.ts index fe4c3201ea..89466aeced 100644 --- a/frontend/src/utils/coordinates.test.ts +++ b/frontend/src/utils/coordinates.test.ts @@ -1,7 +1,8 @@ import { describe, expect, it } from '@jest/globals' +import { OPENLAYERS_PROJECTION, WSG84_PROJECTION } from '@mtes-mct/monitor-ui' import { getCoordinates } from './coordinates' -import { CoordinatesFormat, OPENLAYERS_PROJECTION, WSG84_PROJECTION } from '../domain/entities/map/constants' +import { CoordinatesFormat } from '../domain/entities/map/constants' describe('coordinates', () => { it('getCoordinates Should get DMS coordinates for a dummy lon/lat', async () => { diff --git a/frontend/src/utils/coordinates.ts b/frontend/src/utils/coordinates.ts index 2c464ec3d1..3c2a689978 100644 --- a/frontend/src/utils/coordinates.ts +++ b/frontend/src/utils/coordinates.ts @@ -1,7 +1,8 @@ +import { WSG84_PROJECTION } from '@mtes-mct/monitor-ui' import { transform } from 'ol/proj' import { isNumeric } from './isNumeric' -import { CoordinatesFormat, WSG84_PROJECTION } from '../domain/entities/map/constants' +import { CoordinatesFormat } from '../domain/entities/map/constants' import type { Coordinate } from 'ol/coordinate'