Skip to content

Commit

Permalink
[Tech] update imports
Browse files Browse the repository at this point in the history
  • Loading branch information
claire2212 committed Dec 11, 2024
1 parent 3be691f commit b55e972
Show file tree
Hide file tree
Showing 33 changed files with 82 additions and 98 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import org.springframework.data.repository.CrudRepository
interface IDBDepartmentAreaRepository : CrudRepository<DepartmentAreaModel, Int> {
@Query(
value =
"""
"""
SELECT *
FROM departments_areas
WHERE insee_dep = :inseeCode
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ interface IDBReportingRepository : JpaRepository<ReportingModel, Int> {
@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
Expand All @@ -30,7 +30,7 @@ interface IDBReportingRepository : JpaRepository<ReportingModel, Int> {
@Modifying(clearAutomatically = true, flushAutomatically = true)
@Query(
value =
"""
"""
UPDATE reportings
SET is_archived = TRUE
WHERE id in (:ids)
Expand All @@ -42,7 +42,7 @@ interface IDBReportingRepository : JpaRepository<ReportingModel, Int> {
@Modifying(clearAutomatically = true, flushAutomatically = true)
@Query(
value =
"""
"""
UPDATE reportings
SET
mission_id = :missionId,
Expand All @@ -60,7 +60,7 @@ interface IDBReportingRepository : JpaRepository<ReportingModel, Int> {
@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
Expand All @@ -75,7 +75,7 @@ interface IDBReportingRepository : JpaRepository<ReportingModel, Int> {
@Modifying(clearAutomatically = true, flushAutomatically = true)
@Query(
value =
"""
"""
UPDATE reportings
SET is_deleted = TRUE
WHERE id = :id
Expand All @@ -87,7 +87,7 @@ interface IDBReportingRepository : JpaRepository<ReportingModel, Int> {
@Modifying(clearAutomatically = true, flushAutomatically = true)
@Query(
value =
"""
"""
UPDATE reportings
SET is_deleted = TRUE
WHERE id in (:ids)
Expand All @@ -99,7 +99,7 @@ interface IDBReportingRepository : JpaRepository<ReportingModel, Int> {
@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))
Expand Down Expand Up @@ -176,7 +176,7 @@ interface IDBReportingRepository : JpaRepository<ReportingModel, Int> {
@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
Expand All @@ -187,7 +187,7 @@ interface IDBReportingRepository : JpaRepository<ReportingModel, Int> {

@Query(
value =
"""
"""
SELECT reporting
FROM ReportingModelJpa reporting
WHERE reporting.mission.id = :missionId
Expand All @@ -197,7 +197,7 @@ interface IDBReportingRepository : JpaRepository<ReportingModel, Int> {

@Query(
value =
"""
"""
SELECT r.id FROM ReportingModel r
WHERE ST_INTERSECTS(st_setsrid(r.geom, 4326), st_buffer(st_setsrid(:geometry, 4326), 0))
""",
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/api/administrativeLayersAPI.ts
Original file line number Diff line number Diff line change
@@ -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

Expand Down
3 changes: 2 additions & 1 deletion frontend/src/domain/entities/layers/index.ts
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
3 changes: 0 additions & 3 deletions frontend/src/domain/entities/map/constants.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
export const WSG84_PROJECTION = 'EPSG:4326'
export const OPENLAYERS_PROJECTION = 'EPSG:3857'

export enum InteractionType {
CIRCLE = 'CIRCLE',
POINT = 'POINT',
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/domain/types/map.ts
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
Original file line number Diff line number Diff line change
@@ -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'
Expand All @@ -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'

Expand Down
3 changes: 2 additions & 1 deletion frontend/src/domain/use_cases/measurement/saveMeasurement.ts
Original file line number Diff line number Diff line change
@@ -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) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,14 @@ 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'
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'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
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'
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'
Expand Down
3 changes: 1 addition & 2 deletions frontend/src/features/LocateOnMap/index.tsx
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
Original file line number Diff line number Diff line change
@@ -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'

Expand Down
Original file line number Diff line number Diff line change
@@ -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) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
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'
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'
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/features/coordinates/DMDCoordinatesInput.tsx
Original file line number Diff line number Diff line change
@@ -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'

Expand Down
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,14 @@ 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'
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'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
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'
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,
Expand Down
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
3 changes: 1 addition & 2 deletions frontend/src/features/layersSelector/utils/MyLayerZone.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,14 @@ 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'

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'

Expand Down
4 changes: 2 additions & 2 deletions frontend/src/features/map/BaseMap.tsx
Original file line number Diff line number Diff line change
@@ -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,
Expand Down Expand Up @@ -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'
Expand Down
Loading

0 comments on commit b55e972

Please sign in to comment.