Skip to content

Commit

Permalink
Fix svg imports following VesselSidebar move
Browse files Browse the repository at this point in the history
  • Loading branch information
ivangabriele committed Sep 9, 2024
1 parent 6e83a6f commit a9a514c
Show file tree
Hide file tree
Showing 24 changed files with 106 additions and 105 deletions.
1 change: 1 addition & 0 deletions frontend/src/constants/constants.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/** @deprecated Use `monitor-ui` colors. */
export const COLORS = {
// TODO Remove this color.
blue: '#0A18DF',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ import { COLORS } from '../../../../../constants/constants'
import { getNumberOfInfractions } from '../../../../../domain/entities/controls'
import { useMainAppDispatch } from '../../../../../hooks/useMainAppDispatch'
import { getDate } from '../../../../../utils'
import GyroRedSVG from '../../../../icons/Gyrophare_controles_rouge.svg?react'
import GyroGreenSVG from '../../../../icons/Gyrophare_controles_vert.svg?react'
import { MissionAction } from '../../../../Mission/missionAction.types'
import { editMission } from '../../../../Mission/useCases/editMission'
import GyroRedSVG from '../../icons/Gyrophare_controles_rouge.svg?react'
import GyroGreenSVG from '../../icons/Gyrophare_controles_vert.svg?react'

type ControlProps = Readonly<{
control: MissionAction.MissionAction
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { Icon } from '@mtes-mct/monitor-ui'
import styled from 'styled-components'
import { theme } from 'ui/theme'

import { InfractionsSummary } from './InfractionsSummary'
import { LastControl } from './LastControl'
import { LawReminders } from './LawReminders'
import { theme } from '../../../../../ui/theme'
// TODO Add the icon to https://github.com/MTES-MCT/monitor-ui
import CautionSVG from '../../icons/Attention_controles.svg?react'
import SeaSVG from '../../icons/Avarie_statut_navire_en_mer.svg?react'
import CautionSVG from '../../../../icons/Attention_controles.svg?react'
import SeaSVG from '../../../../icons/Avarie_statut_navire_en_mer.svg?react'
import { Header, Zone } from '../common_styles/common.style'

import type { MissionAction } from '../../../../Mission/missionAction.types'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { COLORS } from '@constants/constants'
import { useMainAppDispatch } from '@hooks/useMainAppDispatch'
import { useMainAppSelector } from '@hooks/useMainAppSelector'
import { getFirstVesselStatus } from 'domain/entities/beaconMalfunction'
import { EquipmentTab } from 'domain/entities/beaconMalfunction/constants'
import { setBeaconMalfunctionsTab } from 'domain/shared_slices/BeaconMalfunction'
import styled from 'styled-components'
import { getDateTime } from 'utils'

import { COLORS } from '../../../../../../constants/constants'
import { getFirstVesselStatus } from '../../../../../../domain/entities/beaconMalfunction'
import { EquipmentTab } from '../../../../../../domain/entities/beaconMalfunction/constants'
import { setBeaconMalfunctionsTab } from '../../../../../../domain/shared_slices/BeaconMalfunction'
import { useMainAppDispatch } from '../../../../../../hooks/useMainAppDispatch'
import { useMainAppSelector } from '../../../../../../hooks/useMainAppSelector'
import { getDateTime } from '../../../../../../utils'
import ArrowSVG from '../../../../../icons/Picto_fleche-pleine-droite.svg?react'
import { BeaconMalfunctionDetailsFollowUp } from '../../../../../SideWindow/BeaconMalfunctionBoard/BeaconMalfunctionDetailsFollowUp'
import ArrowSVG from '../../../icons/Picto_fleche-pleine-droite.svg?react'
import { BeaconMalfunctionBody } from '../resume/BeaconMalfunctionBody'
import { CurrentBeaconMalfunctionBody } from '../resume/CurrentBeaconMalfunctionBody'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import {
import { setOpenedBeaconMalfunction } from '../../../../../../domain/shared_slices/BeaconMalfunction'
import { useMainAppDispatch } from '../../../../../../hooks/useMainAppDispatch'
import { getDateTime } from '../../../../../../utils'
import AtSeaSVG from '../../../icons/Icone_avarie_mer.svg?react'
import AtPortSVG from '../../../icons/Icone_avarie_quai.svg?react'
import AtSeaSVG from '../../../../../icons/Icone_avarie_mer.svg?react'
import AtPortSVG from '../../../../../icons/Icone_avarie_quai.svg?react'

import type { BeaconMalfunctionResumeAndDetails } from '../../../../../../domain/entities/beaconMalfunction/types'
import type { HTMLProps } from 'react'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { COLORS } from '@constants/constants'
import { useMainAppDispatch } from '@hooks/useMainAppDispatch'
import { setOpenedBeaconMalfunction } from 'domain/shared_slices/BeaconMalfunction'
import styled from 'styled-components'

import { CurrentBeaconMalfunctionBody } from './CurrentBeaconMalfunctionBody'
import { COLORS } from '../../../../../../constants/constants'
import { setOpenedBeaconMalfunction } from '../../../../../../domain/shared_slices/BeaconMalfunction'
import { useMainAppDispatch } from '../../../../../../hooks/useMainAppDispatch'
import ArrowSVG from '../../../icons/Picto_fleche-pleine-droite.svg?react'
import ArrowSVG from '../../../../../icons/Picto_fleche-pleine-droite.svg?react'
import { Header, Zone } from '../../common_styles/common.style'

import type { BeaconMalfunctionResumeAndDetails } from '../../../../../../domain/entities/beaconMalfunction/types'
import type { BeaconMalfunctionResumeAndDetails } from 'domain/entities/beaconMalfunction/types'
import type { Promisable } from 'type-fest'

type CurrentBeaconMalfunctionProps = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import { getMalfunctionStartDateText } from '../../../../../../domain/entities/b
import { VESSEL_STATUS } from '../../../../../../domain/entities/beaconMalfunction/constants'
import updateBeaconMalfunctionFromKanban from '../../../../../../domain/use_cases/beaconMalfunction/updateBeaconMalfunctionFromKanban'
import { useMainAppDispatch } from '../../../../../../hooks/useMainAppDispatch'
import TimeAgoSVG from '../../../../../icons/Label_horaire_VMS.svg?react'
import { VesselStatusSelectValue } from '../../../../../SideWindow/BeaconMalfunctionBoard/VesselStatusSelectValue'
import TimeAgoSVG from '../../../icons/Label_horaire_VMS.svg?react'

import type { BeaconMalfunctionResumeAndDetails } from '../../../../../../domain/entities/beaconMalfunction/types'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import { COLORS } from '@constants/constants'
import { useMainAppDispatch } from '@hooks/useMainAppDispatch'
import { useMainAppSelector } from '@hooks/useMainAppSelector'
import { useIsSuperUser } from 'auth/hooks/useIsSuperUser'
import { getCoordinates } from 'coordinates'
import { WSG84_PROJECTION } from 'domain/entities/map/constants'
import { showVessel } from 'domain/use_cases/vessel/showVessel'
import { useEffect, useState } from 'react'
import { FingerprintSpinner } from 'react-epic-spinners'
import styled from 'styled-components'
import * as timeago from 'timeago.js'
import { getDateTime, timeagoFrenchLocale } from 'utils'

import { RiskFactorResume } from './risk_factor/RiskFactorResume'
import { useIsSuperUser } from '../../../../auth/hooks/useIsSuperUser'
import { COLORS } from '../../../../constants/constants'
import { getCoordinates } from '../../../../coordinates'
import { WSG84_PROJECTION } from '../../../../domain/entities/map/constants'
import { showVessel } from '../../../../domain/use_cases/vessel/showVessel'
import { getDateTime, timeagoFrenchLocale } from '../../../../utils'
import InfoSVG from '../../icons/Information.svg?react'
import NoVesselSVG from '../../icons/Picto_photo_navire_manquante.svg?react'
import InfoSVG from '../../../icons/Information.svg?react'
import NoVesselSVG from '../../../icons/Picto_photo_navire_manquante.svg?react'

// @ts-ignore
timeago.register('fr', timeagoFrenchLocale)
Expand Down
28 changes: 14 additions & 14 deletions frontend/src/features/Vessel/components/VesselSidebar/Tabs.tsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
import { COLORS } from '@constants/constants'
import { useMainAppDispatch } from '@hooks/useMainAppDispatch'
import { useMainAppSelector } from '@hooks/useMainAppSelector'
import { DisplayedErrorKey } from '@libs/DisplayedError/constants'
import { useIsSuperUser } from 'auth/hooks/useIsSuperUser'
import { forbiddenVesselSidebarPaths } from 'domain/entities/authorization/constants'
import { VesselSidebarTab } from 'domain/entities/vessel/vessel'
import { displayedErrorActions } from 'domain/shared_slices/DisplayedError'
import { showVesselSidebarTab } from 'domain/shared_slices/Vessel'
import { useEffect } from 'react'
import styled from 'styled-components'

import { useIsSuperUser } from '../../../../auth/hooks/useIsSuperUser'
import { COLORS } from '../../../../constants/constants'
import { forbiddenVesselSidebarPaths } from '../../../../domain/entities/authorization/constants'
import { VesselSidebarTab } from '../../../../domain/entities/vessel/vessel'
import { displayedErrorActions } from '../../../../domain/shared_slices/DisplayedError'
import { showVesselSidebarTab } from '../../../../domain/shared_slices/Vessel'
import { useMainAppDispatch } from '../../../../hooks/useMainAppDispatch'
import { useMainAppSelector } from '../../../../hooks/useMainAppSelector'
import ReportingSVG from '../icons/Icone_onglet_signalement.svg?react'
import VMSSVG from '../icons/Icone_VMS_fiche_navire.svg?react'
import ControlsSVG from '../icons/Picto_controles.svg?react'
import VesselIDSVG from '../icons/Picto_identite.svg?react'
import FisheriesSVG from '../icons/Picto_peche.svg?react'
import SummarySVG from '../icons/Picto_resume.svg?react'
import ReportingSVG from '../../../icons/Icone_onglet_signalement.svg?react'
import VMSSVG from '../../../icons/Icone_VMS_fiche_navire.svg?react'
import ControlsSVG from '../../../icons/Picto_controles.svg?react'
import VesselIDSVG from '../../../icons/Picto_identite.svg?react'
import FisheriesSVG from '../../../icons/Picto_peche.svg?react'
import SummarySVG from '../../../icons/Picto_resume.svg?react'

// TODO Move the icons in Monitor UI : https://github.com/MTES-MCT/monitorfish/issues/1736
export function Tabs() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { COLORS } from '@constants/constants'
import { useMainAppDispatch } from '@hooks/useMainAppDispatch'
import { useMainAppSelector } from '@hooks/useMainAppSelector'
import { getVesselCompositeIdentifier } from 'domain/entities/vessel/vessel'
import { addVesselToFavorites, removeVesselFromFavorites } from 'domain/shared_slices/FavoriteVessel'
import { unselectVessel } from 'domain/use_cases/vessel/unselectVessel'
import countries from 'i18n-iso-countries'
import { useCallback, useMemo } from 'react'
import styled from 'styled-components'

import { COLORS } from '../../../../../constants/constants'
import { getVesselCompositeIdentifier } from '../../../../../domain/entities/vessel/vessel'
import { addVesselToFavorites, removeVesselFromFavorites } from '../../../../../domain/shared_slices/FavoriteVessel'
import { unselectVessel } from '../../../../../domain/use_cases/vessel/unselectVessel'
import { useMainAppDispatch } from '../../../../../hooks/useMainAppDispatch'
import { useMainAppSelector } from '../../../../../hooks/useMainAppSelector'
import CloseIconSVG from '../../icons/Croix_grise.svg?react'
import FavoriteSVG from '../../icons/Etoile_navire_suivi.svg?react'
import CloseIconSVG from '../../../../icons/Croix_grise.svg?react'
import FavoriteSVG from '../../../../icons/Etoile_navire_suivi.svg?react'

export function VesselName({ focusOnVesselSearchInput }) {
const dispatch = useMainAppDispatch()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import { MapButton } from '@features/MainWindow/components/MapButtons/MapButton'
import { useMainAppDispatch } from '@hooks/useMainAppDispatch'
import { useMainAppSelector } from '@hooks/useMainAppSelector'
import { vesselsAreEquals } from 'domain/entities/vessel/vessel'
import { expandRightMenu } from 'domain/shared_slices/Global'
import { setIsFocusedOnVesselSearch } from 'domain/shared_slices/Vessel'
import { showVessel } from 'domain/use_cases/vessel/showVessel'
import { useCallback } from 'react'
import styled from 'styled-components'

import { VesselName } from './VesselName'
import { vesselsAreEquals } from '../../../../../domain/entities/vessel/vessel'
import { expandRightMenu } from '../../../../../domain/shared_slices/Global'
import { setIsFocusedOnVesselSearch } from '../../../../../domain/shared_slices/Vessel'
import { showVessel } from '../../../../../domain/use_cases/vessel/showVessel'
import { MapComponent } from '../../../../commonStyles/MapComponent'
import { MapButton } from '../../../../MainWindow/components/MapButtons/MapButton'
import SearchIconSVG from '../../../../icons/Loupe.svg?react'
import { VesselSearch } from '../../../../VesselSearch'
import SearchIconSVG from '../../icons/Loupe.svg?react'

import type { VesselIdentity } from '../../../../../domain/entities/vessel/types'
import type { VesselIdentity } from 'domain/entities/vessel/types'

export function VesselSidebarHeader() {
const dispatch = useMainAppDispatch()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import { useMainAppSelector } from '@hooks/useMainAppSelector'
import { downloadAsCsv } from '@utils/downloadAsCsv'
import { getCoordinates } from 'coordinates'
import dayjs from 'dayjs'
import { WSG84_PROJECTION } from 'domain/entities/map/constants'
import { NetworkType } from 'domain/entities/vessel/types'
import countries from 'i18n-iso-countries'
import { useCallback, useMemo } from 'react'
import styled from 'styled-components'
import { getDate } from 'utils'

import { getCoordinates } from '../../../../../../coordinates'
import { WSG84_PROJECTION } from '../../../../../../domain/entities/map/constants'
import { NetworkType } from '../../../../../../domain/entities/vessel/types'
import { useMainAppSelector } from '../../../../../../hooks/useMainAppSelector'
import { getDate } from '../../../../../../utils'
import { downloadAsCsv } from '../../../../../../utils/downloadAsCsv'
import { PrimaryButton } from '../../../../../commonStyles/Buttons.style'
import ExportSVG from '../../../icons/Bouton_exporter_piste_navire.svg?react'
import ExportSVG from '../../../../../icons/Bouton_exporter_piste_navire.svg?react'

import type { VesselPosition } from '../../../../../../domain/entities/vessel/types'
import type { DownloadAsCsvMap } from '../../../../../../utils/downloadAsCsv'
import type { DownloadAsCsvMap } from '@utils/downloadAsCsv'
import type { VesselPosition } from 'domain/entities/vessel/types'

type VesselPositionWithId = VesselPosition & {
id: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { getCoordinates } from '../../../../../../coordinates'
import { OPENLAYERS_PROJECTION, WSG84_PROJECTION } from '../../../../../../domain/entities/map/constants'
import { animateToCoordinates } from '../../../../../../domain/shared_slices/Map'
import { highlightVesselTrackPosition } from '../../../../../../domain/shared_slices/Vessel'
import ManualPositionSVG from '../../../icons/Pastille_position_manuelle.svg?react'
import ManualPositionSVG from '../../../../../icons/Pastille_position_manuelle.svg?react'

import type { VesselPosition } from '../../../../../../domain/entities/vessel/types'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
import { useMainAppDispatch } from '@hooks/useMainAppDispatch'
import { useMainAppSelector } from '@hooks/useMainAppSelector'
import { DateRangePicker, THEME } from '@mtes-mct/monitor-ui'
import { getTrackRequestFromTrackDepth, VesselTrackDepth } from 'domain/entities/vesselTrackDepth'
import { updateSelectedVesselTrackRequest } from 'domain/use_cases/vessel/updateSelectedVesselTrackRequest'
import { useCallback, useMemo, useState } from 'react'
import styled from 'styled-components'

import { ExportTrack } from './ExportTrack'
import { PositionsTable } from './PositionsTable'
import { TrackDepthSelection } from './TrackDepthSelection'
import { getTrackRequestFromTrackDepth, VesselTrackDepth } from '../../../../../../domain/entities/vesselTrackDepth'
import { updateSelectedVesselTrackRequest } from '../../../../../../domain/use_cases/vessel/updateSelectedVesselTrackRequest'
import { MapComponent } from '../../../../../commonStyles/MapComponent'
import VesselSVG from '../../../icons/Icone_navire.svg?react'
import VesselSVG from '../../../../../icons/Icone_navire.svg?react'
import { VesselSidebarActionButton } from '../VesselSidebarActionButton'

import type { TrackRequestCustom, TrackRequestPredefined } from '../../../../../../domain/entities/vessel/types'
import type { SelectableVesselTrackDepth } from '@features/Vessel/components/VesselSidebar/actions/TrackRequest/types'
import type { DateRange } from '@mtes-mct/monitor-ui'
import type { TrackRequestCustom, TrackRequestPredefined } from 'domain/entities/vessel/types'

type TrackRequestProps = {
isSidebarOpen: boolean
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { useMainAppDispatch } from '@hooks/useMainAppDispatch'
import { useMainAppSelector } from '@hooks/useMainAppSelector'
import { animateToExtent } from 'domain/shared_slices/Map'
import styled from 'styled-components'

import { animateToExtent } from '../../../../../../domain/shared_slices/Map'
import { useMainAppDispatch } from '../../../../../../hooks/useMainAppDispatch'
import { useMainAppSelector } from '../../../../../../hooks/useMainAppSelector'
import ShowTrackSVG from '../../../icons/Bouton_afficher_toute_la_piste.svg?react'
import ShowTrackSVG from '../../../../../icons/Bouton_afficher_toute_la_piste.svg?react'
import { VesselSidebarActionButton } from '../VesselSidebarActionButton'

export function AnimateToTrack({ isSidebarOpen }) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { useMainAppDispatch } from '@hooks/useMainAppDispatch'
import { useMainAppSelector } from '@hooks/useMainAppSelector'
import { THEME } from '@mtes-mct/monitor-ui'
import { setHideNonSelectedVessels } from 'domain/shared_slices/Vessel'
import styled from 'styled-components'

import { setHideNonSelectedVessels } from '../../../../../../domain/shared_slices/Vessel'
import { useMainAppDispatch } from '../../../../../../hooks/useMainAppDispatch'
import { useMainAppSelector } from '../../../../../../hooks/useMainAppSelector'
import HidingOtherTracksSVG from '../../../icons/Bouton_masquer_pistes_actif.svg?react'
import ShowingOtherTracksSVG from '../../../icons/Bouton_masquer_pistes_inactif.svg?react'
import HidingOtherTracksSVG from '../../../../../icons/Bouton_masquer_pistes_actif.svg?react'
import ShowingOtherTracksSVG from '../../../../../icons/Bouton_masquer_pistes_inactif.svg?react'
import { VesselSidebarActionButton } from '../VesselSidebarActionButton'

export function HideNonSelectedVessels({ isSidebarOpen }) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { useMainAppDispatch } from '@hooks/useMainAppDispatch'
import { useMainAppSelector } from '@hooks/useMainAppSelector'
import { THEME } from '@mtes-mct/monitor-ui'
import { useCallback, useEffect, useMemo } from 'react'
import styled from 'styled-components'

import { useMainAppDispatch } from '../../../../../../hooks/useMainAppDispatch'
import { useMainAppSelector } from '../../../../../../hooks/useMainAppSelector'
import ShowFishingActivitiesSVG from '../../../../../icons/Bouton_afficher_messages_JPE_sur_piste.svg?react'
import { useGetLogbookUseCase } from '../../../../../Logbook/hooks/useGetLogbookUseCase'
import { logbookActions } from '../../../../../Logbook/slice'
import ShowFishingActivitiesSVG from '../../../icons/Bouton_afficher_messages_JPE_sur_piste.svg?react'
import { VesselSidebarActionButton } from '../VesselSidebarActionButton'

export function ShowFishingActivitiesOnMap({ isSidebarOpen }) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { COLORS } from '@constants/constants'
import styled from 'styled-components'

import { COLORS } from '../../../../../constants/constants'
import ChevronIconSVG from '../../icons/Chevron_simple_gris.svg?react'
import ChevronIconSVG from '../../../../icons/Chevron_simple_gris.svg?react'

import type { HTMLProps } from 'react'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import {
} from '../../../../../domain/entities/vessel/riskFactor'
import { StyledModalHeader } from '../../../../commonComponents/StyledModalHeader'
import { basePrimaryButton, SecondaryButton } from '../../../../commonStyles/Buttons.style'
import RiskFactorControlSVG from '../../icons/Note_de_controle_gyrophare.svg?react'
import RiskFactorImpactSVG from '../../icons/Note_impact_poisson.svg?react'
import RiskFactorInfractionsSVG from '../../icons/Note_infraction_stop.svg?react'
import RiskFactorControlSVG from '../../../../icons/Note_de_controle_gyrophare.svg?react'
import RiskFactorImpactSVG from '../../../../icons/Note_impact_poisson.svg?react'
import RiskFactorInfractionsSVG from '../../../../icons/Note_infraction_stop.svg?react'

import type { Promisable } from 'type-fest'

Expand Down
Loading

0 comments on commit a9a514c

Please sign in to comment.