diff --git a/frontend/src/domain/entities/vessel/types.ts b/frontend/src/domain/entities/vessel/types.ts index 62c7f2b1f2..91f69f453b 100644 --- a/frontend/src/domain/entities/vessel/types.ts +++ b/frontend/src/domain/entities/vessel/types.ts @@ -3,8 +3,8 @@ import { ReportingType } from '@features/Reporting/types' import type { VesselTrackDepth } from '../vesselTrackDepth' +import type { SelectableVesselTrackDepth } from '@features/Vessel/components/VesselSidebar/actions/TrackRequest/types' import type { Vessel } from '@features/Vessel/Vessel.types' -import type { SelectableVesselTrackDepth } from '@features/VesselSidebar/actions/TrackRequest/types' import type Feature from 'ol/Feature' import type LineString from 'ol/geom/LineString' import type Point from 'ol/geom/Point' diff --git a/frontend/src/domain/shared_slices/Map.ts b/frontend/src/domain/shared_slices/Map.ts index d40a169918..5c695f551c 100644 --- a/frontend/src/domain/shared_slices/Map.ts +++ b/frontend/src/domain/shared_slices/Map.ts @@ -7,7 +7,7 @@ import { VesselLabel } from '../entities/vessel/label/types' import { VesselTrackDepth } from '../entities/vesselTrackDepth' import type { LastPositionVisibility } from '../types/map' -import type { SelectableVesselTrackDepth } from '@features/VesselSidebar/actions/TrackRequest/types' +import type { SelectableVesselTrackDepth } from '@features/Vessel/components/VesselSidebar/actions/TrackRequest/types' import type { PayloadAction } from '@reduxjs/toolkit' import type { Extent } from 'ol/extent' diff --git a/frontend/src/domain/use_cases/vessel/updateDefaultVesselTrackDepth.ts b/frontend/src/domain/use_cases/vessel/updateDefaultVesselTrackDepth.ts index 8a0af585d9..d0d62c70d7 100644 --- a/frontend/src/domain/use_cases/vessel/updateDefaultVesselTrackDepth.ts +++ b/frontend/src/domain/use_cases/vessel/updateDefaultVesselTrackDepth.ts @@ -1,7 +1,7 @@ import { updateVesselTracks } from './updateVesselTracks' import { setDefaultVesselTrackDepth } from '../../shared_slices/Map' -import type { SelectableVesselTrackDepth } from '@features/VesselSidebar/actions/TrackRequest/types' +import type { SelectableVesselTrackDepth } from '@features/Vessel/components/VesselSidebar/actions/TrackRequest/types' /** * Update the global vessel track Depth and re-render the rendered vessels tracks diff --git a/frontend/src/features/BackOffice/tableCells.jsx b/frontend/src/features/BackOffice/tableCells.jsx index fca4b140ae..e3c1f66c5a 100644 --- a/frontend/src/features/BackOffice/tableCells.jsx +++ b/frontend/src/features/BackOffice/tableCells.jsx @@ -1,41 +1,42 @@ -import { COLORS } from '../../constants/constants' -import { RiskFactorBox } from '../VesselSidebar/risk_factor/RiskFactorBox' -import { getRiskFactorColor } from '../../domain/entities/vessel/riskFactor' +import { Accent, Icon, IconButton, Tag, THEME } from '@mtes-mct/monitor-ui' import { useCallback } from 'react' -import styled from 'styled-components' import { SelectPicker, Table } from 'rsuite' -import { Accent, Icon, IconButton, Tag, THEME } from '@mtes-mct/monitor-ui' +import styled from 'styled-components' + +import { COLORS } from '../../constants/constants' +import { getRiskFactorColor } from '../../domain/entities/vessel/riskFactor' import { theme } from '../../ui/theme' +import { RiskFactorBox } from '../Vessel/components/VesselSidebar/risk_factor/RiskFactorBox' const { Cell } = Table const rowKey = 'id' export const INPUT_TYPE = { - STRING: 'STRING', + DOUBLE: 'DOUBLE', INT: 'INT', - DOUBLE: 'DOUBLE' + STRING: 'STRING' } /** * @param {*} props */ -export const ModifiableCell = ({ dataKey, id, inputType, maxLength, onChange, afterChange, isDisabled, ...props }) => { +export function ModifiableCell({ afterChange, dataKey, id, inputType, isDisabled, maxLength, onChange, ...props }) { const { rowData } = props const dataCy = `row-${rowData[id]}-${dataKey}` return ( - + @@ -53,18 +54,18 @@ const ModifiableCellWrapper = styled.div` } ` -export const FleetSegmentInput = ({ - maxLength, - value, - inputType, - id, - dataKey, - withinCell, - onChange, +export function FleetSegmentInput({ + afterChange, dataCy, + dataKey, + id, + inputType, isDisabled, - afterChange -}) => { + maxLength, + onChange, + value, + withinCell +}) { const onChangeCallback = useCallback( event => { let value = null @@ -95,52 +96,52 @@ export const FleetSegmentInput = ({ return ( onChangeCallback(event)} style={{ fontSize: 13, - marginTop: withinCell ? -8 : 5, + fontWeight: 500, marginBottom: withinCell ? 0 : 20, marginLeft: withinCell ? -7 : 0, marginRight: 0, + marginTop: withinCell ? -8 : 5, paddingLeft: 5, - paddingRight: 10, - fontWeight: 500 + paddingRight: 10 }} type="text" - maxLength={maxLength} - className="rs-input" value={value} - onChange={event => onChangeCallback(event)} /> ) } -export const ControlPriorityCell = ({ dataKey, onChange, ...props }) => { +export function ControlPriorityCell({ dataKey, onChange, ...props }) { const { rowData } = props const dataCy = `row-${rowData.id}-${dataKey}` return ( - + { - const controlPriority = value && !isNaN(parseInt(value)) ? parseInt(value) : '' - onChange && onChange(rowData.id, dataKey, controlPriority) - }} + cleanable={false} + creatable={false} data={[ { label: 1, value: 1 }, { label: 2, value: 2 }, { label: 3, value: 3 }, { label: 4, value: 4 } ]} - style={{ width: 20 }} - creatable={false} - cleanable={false} + data-cy={dataCy} + onChange={value => { + const controlPriority = value && !isNaN(parseInt(value)) ? parseInt(value) : '' + onChange && onChange(rowData.id, dataKey, controlPriority) + }} searchable={false} - size={'xs'} + size="xs" + style={{ width: 20 }} + value={rowData[dataKey]} /> ) @@ -149,60 +150,63 @@ export const ControlPriorityCell = ({ dataKey, onChange, ...props }) => { /** * @param {*} props */ -export const SegmentCellWithTitle = ({ rowData, dataKey, ...props }) => ( - - {rowData[dataKey]} - -) +export function SegmentCellWithTitle({ dataKey, rowData, ...props }) { + return ( + + {rowData[dataKey]} + + ) +} /** * @param {*} props */ -export const ExpandCell = ({ rowData, dataKey, expandedRowKeys, onChange, ...props }) => ( - { - onChange(rowData) - }} - style={{ - cursor: 'pointer', - width: 35, - fontSize: 19, - lineHeight: '13px', - background: COLORS.gainsboro - }} - > - {expandedRowKeys.some(key => key === rowData[rowKey]) ? '-' : '+'} - -) +export function ExpandCell({ dataKey, expandedRowKeys, onChange, rowData, ...props }) { + return ( + { + onChange(rowData) + }} + style={{ + background: COLORS.gainsboro, + cursor: 'pointer', + fontSize: 19, + lineHeight: '13px', + width: 35 + }} + > + {expandedRowKeys.some(key => key === rowData[rowKey]) ? '-' : '+'} + + ) +} /** * @param {*} props */ -export const ImpactRiskFactorCell = ({ rowData, expandedRowKeys, onChange, ...props }) => ( - - - {rowData.impactRiskFactor} - - -) +export function ImpactRiskFactorCell({ expandedRowKeys, onChange, rowData, ...props }) { + return ( + + + {rowData.impactRiskFactor} + + + ) +} -export const TagsCell = ({ dataKey, data, id, ...props }) => { +export function TagsCell({ data, dataKey, id, ...props }) { const { rowData } = props return ( - + {rowData[dataKey]?.map(tag => ( - + {tag} ))} @@ -225,60 +229,58 @@ export function renderTagPickerValue(items) { const TagOnly = styled.div` margin: -3px 0px 0px 0px; - whiteSpace: nowrap; + whitespace: nowrap; text-overflow: ellipsis; overflow: hidden; ` -export const renderRowExpanded = rowData => { - return ( -
- - - - Engins - {rowData.gears?.join(', ') || -} - - - Zones FAO - {rowData.faoAreas?.join(', ') || -} - - - Espèces cibles - {rowData.targetSpecies?.join(', ') || -} - - - Prises accessoires - {rowData.bycatchSpecies?.join(', ') || -} - - - -
- ) -} +export const renderRowExpanded = rowData => ( +
+ + + + Engins + {rowData.gears?.join(', ') || -} + + + Zones FAO + {rowData.faoAreas?.join(', ') || -} + + + Espèces cibles + {rowData.targetSpecies?.join(', ') || -} + + + Prises accessoires + {rowData.bycatchSpecies?.join(', ') || -} + + + +
+) -export const EditAndDeleteCell = ({ dataKey, id, onEdit, onDelete, ...props }) => { +export function EditAndDeleteCell({ dataKey, id, onDelete, onEdit, ...props }) { const { rowData } = props return ( - + onEdit(rowData)} title="Editer la ligne" /> onDelete(rowData[id])} title="Supprimer la ligne" @@ -287,15 +289,15 @@ export const EditAndDeleteCell = ({ dataKey, id, onEdit, onDelete, ...props }) = ) } -export const DeleteCell = ({ dataKey, id, onClick, ...props }) => { +export function DeleteCell({ dataKey, id, onClick, ...props }) { const { rowData } = props return ( onClick(rowData[id], rowData[dataKey])} title="Supprimer la ligne" diff --git a/frontend/src/features/Logbook/components/VesselLogbook/LogbookMessages/messages/PNOMessage.tsx b/frontend/src/features/Logbook/components/VesselLogbook/LogbookMessages/messages/PNOMessage.tsx index 1e35b88b14..98ae0931eb 100644 --- a/frontend/src/features/Logbook/components/VesselLogbook/LogbookMessages/messages/PNOMessage.tsx +++ b/frontend/src/features/Logbook/components/VesselLogbook/LogbookMessages/messages/PNOMessage.tsx @@ -1,6 +1,6 @@ import { useGetGearsQuery } from '@api/gear' import { PriorNotification } from '@features/PriorNotification/PriorNotification.types' -import { FlatKeyValue } from '@features/VesselSidebar/common/FlatKeyValue' +import { FlatKeyValue } from '@features/Vessel/components/VesselSidebar/common/FlatKeyValue' import { uniq } from 'lodash' import { useMemo } from 'react' import styled from 'styled-components' @@ -28,7 +28,7 @@ export function PNOMessage({ isManuallyCreated, message, tripGears }: PNOMessage } return tripGears.map(tripGear => { - const gearName = getGearsApiQuery.data?.find(gear => gear.code === tripGear.gear)?.name || null + const gearName = getGearsApiQuery.data?.find(gear => gear.code === tripGear.gear)?.name ?? null return { ...tripGear, gearName } }) diff --git a/frontend/src/features/MainWindow/components/MapButtons/VesselVisibility/EditVesselVisibility.tsx b/frontend/src/features/MainWindow/components/MapButtons/VesselVisibility/EditVesselVisibility.tsx index b7065cac3d..eccb0a0442 100644 --- a/frontend/src/features/MainWindow/components/MapButtons/VesselVisibility/EditVesselVisibility.tsx +++ b/frontend/src/features/MainWindow/components/MapButtons/VesselVisibility/EditVesselVisibility.tsx @@ -1,4 +1,4 @@ -import { TrackDepthSelection } from '@features/VesselSidebar/actions/TrackRequest/TrackDepthSelection' +import { TrackDepthSelection } from '@features/Vessel/components/VesselSidebar/actions/TrackRequest/TrackDepthSelection' import { useMainAppDispatch } from '@hooks/useMainAppDispatch' import { useMainAppSelector } from '@hooks/useMainAppSelector' import { THEME } from '@mtes-mct/monitor-ui' diff --git a/frontend/src/features/MainWindow/index.tsx b/frontend/src/features/MainWindow/index.tsx index 13948ca319..e520d59dca 100644 --- a/frontend/src/features/MainWindow/index.tsx +++ b/frontend/src/features/MainWindow/index.tsx @@ -19,9 +19,9 @@ import { Map } from '../map/Map' import PreviewFilteredVessels from '../preview_filtered_vessels/PreviewFilteredVessels' import { SideWindowLauncher } from '../SideWindow/SideWindowLauncher' import { VesselLoader } from '../Vessel/components/VesselLoader' +import { VesselSidebar } from '../Vessel/components/VesselSidebar' +import { VesselSidebarHeader } from '../Vessel/components/VesselSidebar/VesselSidebarHeader' import { VesselList } from '../VesselList' -import { VesselSidebar } from '../VesselSidebar' -import { VesselSidebarHeader } from '../VesselSidebar/VesselSidebarHeader' export function MainWindow() { const isControlUnitDialogDisplayed = useMainAppSelector( diff --git a/frontend/src/features/Reporting/components/VesselReportings/Archived/YearReportings.tsx b/frontend/src/features/Reporting/components/VesselReportings/Archived/YearReportings.tsx index ec60259a01..4f7fe951b8 100644 --- a/frontend/src/features/Reporting/components/VesselReportings/Archived/YearReportings.tsx +++ b/frontend/src/features/Reporting/components/VesselReportings/Archived/YearReportings.tsx @@ -4,7 +4,7 @@ import { YearListContent, YearListTitle, YearListTitleText -} from '@features/VesselSidebar/common_styles/YearList.style' +} from '@features/Vessel/components/VesselSidebar/common_styles/YearList.style' import { THEME } from '@mtes-mct/monitor-ui' import { useMemo, useState } from 'react' import styled from 'styled-components' diff --git a/frontend/src/features/Reporting/components/VesselReportings/Archived/index.tsx b/frontend/src/features/Reporting/components/VesselReportings/Archived/index.tsx index 6c61ac2694..71355889cf 100644 --- a/frontend/src/features/Reporting/components/VesselReportings/Archived/index.tsx +++ b/frontend/src/features/Reporting/components/VesselReportings/Archived/index.tsx @@ -1,5 +1,5 @@ import { getVesselReportings } from '@features/Reporting/useCases/getVesselReportings' -import { Header, Zone } from '@features/VesselSidebar/common_styles/common.style' +import { Header, Zone } from '@features/Vessel/components/VesselSidebar/common_styles/common.style' import { useMainAppDispatch } from '@hooks/useMainAppDispatch' import { useMainAppSelector } from '@hooks/useMainAppSelector' import { Accent, THEME, Button } from '@mtes-mct/monitor-ui' diff --git a/frontend/src/features/SideWindow/Alert/AlertListAndReportingList/SilenceAlertMenu.tsx b/frontend/src/features/SideWindow/Alert/AlertListAndReportingList/SilenceAlertMenu.tsx index 7fa34d6581..3a052bb542 100644 --- a/frontend/src/features/SideWindow/Alert/AlertListAndReportingList/SilenceAlertMenu.tsx +++ b/frontend/src/features/SideWindow/Alert/AlertListAndReportingList/SilenceAlertMenu.tsx @@ -8,7 +8,7 @@ import { COLORS } from '../../../../constants/constants' import { SilencedAlertPeriod } from '../../../../domain/entities/alerts/constants' import { useClickOutsideWhenOpenedWithinRef } from '../../../../hooks/useClickOutsideWhenOpenedWithinRef' import { useForceUpdate } from '../../../../hooks/useForceUpdate' -import { DATE_RANGE_PICKER_LOCALE } from '../../../VesselSidebar/actions/TrackRequest/DateRange' +import { DATE_RANGE_PICKER_LOCALE } from '../../../Vessel/components/VesselSidebar/actions/TrackRequest/DateRange' import type { SilencedAlertPeriodRequest } from '../../../../domain/entities/alerts/types' import type { CSSProperties, MutableRefObject } from 'react' diff --git a/frontend/src/features/VesselSidebar/Body.tsx b/frontend/src/features/Vessel/components/VesselSidebar/Body.tsx similarity index 85% rename from frontend/src/features/VesselSidebar/Body.tsx rename to frontend/src/features/Vessel/components/VesselSidebar/Body.tsx index 430b551c31..ac2c8e5020 100644 --- a/frontend/src/features/VesselSidebar/Body.tsx +++ b/frontend/src/features/Vessel/components/VesselSidebar/Body.tsx @@ -9,12 +9,12 @@ import { Identity } from './Identity' import { VesselSummary } from './Summary' import { AlertWarning } from './warnings/AlertWarning' import { BeaconMalfunctionWarning } from './warnings/BeaconMalfunctionWarning' -import { useIsSuperUser } from '../../auth/hooks/useIsSuperUser' -import { VesselSidebarTab } from '../../domain/entities/vessel/vessel' -import { useMainAppDispatch } from '../../hooks/useMainAppDispatch' -import { useMainAppSelector } from '../../hooks/useMainAppSelector' -import { VesselLogbook } from '../Logbook/components/VesselLogbook' -import { VesselReportings } from '../Reporting/components/VesselReportings' +import { useIsSuperUser } from '../../../../auth/hooks/useIsSuperUser' +import { VesselSidebarTab } from '../../../../domain/entities/vessel/vessel' +import { useMainAppDispatch } from '../../../../hooks/useMainAppDispatch' +import { useMainAppSelector } from '../../../../hooks/useMainAppSelector' +import { VesselLogbook } from '../../../Logbook/components/VesselLogbook' +import { VesselReportings } from '../../../Reporting/components/VesselReportings' export function Body() { const isSuperUser = useIsSuperUser() diff --git a/frontend/src/features/VesselSidebar/Controls/Control.tsx b/frontend/src/features/Vessel/components/VesselSidebar/Controls/Control.tsx similarity index 93% rename from frontend/src/features/VesselSidebar/Controls/Control.tsx rename to frontend/src/features/Vessel/components/VesselSidebar/Controls/Control.tsx index 458a94fbc0..7d982d8dce 100644 --- a/frontend/src/features/VesselSidebar/Controls/Control.tsx +++ b/frontend/src/features/Vessel/components/VesselSidebar/Controls/Control.tsx @@ -4,15 +4,15 @@ import styled from 'styled-components' import { GearOnboard } from './GearOnboard' import { Infraction } from './Infraction' -import { useIsSuperUser } from '../../../auth/hooks/useIsSuperUser' -import { COLORS } from '../../../constants/constants' -import { getNumberOfInfractions } from '../../../domain/entities/controls' -import { useMainAppDispatch } from '../../../hooks/useMainAppDispatch' -import { getDate } from '../../../utils' +import { useIsSuperUser } from '../../../../../auth/hooks/useIsSuperUser' +import { COLORS } from '../../../../../constants/constants' +import { getNumberOfInfractions } from '../../../../../domain/entities/controls' +import { useMainAppDispatch } from '../../../../../hooks/useMainAppDispatch' +import { getDate } from '../../../../../utils' +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' -import { MissionAction } from '../../Mission/missionAction.types' -import { editMission } from '../../Mission/useCases/editMission' type ControlProps = Readonly<{ control: MissionAction.MissionAction diff --git a/frontend/src/features/VesselSidebar/Controls/Controls.style.tsx b/frontend/src/features/Vessel/components/VesselSidebar/Controls/Controls.style.tsx similarity index 86% rename from frontend/src/features/VesselSidebar/Controls/Controls.style.tsx rename to frontend/src/features/Vessel/components/VesselSidebar/Controls/Controls.style.tsx index 5a9683b476..75a91f0077 100644 --- a/frontend/src/features/VesselSidebar/Controls/Controls.style.tsx +++ b/frontend/src/features/Vessel/components/VesselSidebar/Controls/Controls.style.tsx @@ -1,6 +1,6 @@ import styled from 'styled-components' -import { COLORS } from '../../../constants/constants' +import { COLORS } from '../../../../../constants/constants' export const Red = styled.span` height: 8px; diff --git a/frontend/src/features/VesselSidebar/Controls/ControlsSummary.tsx b/frontend/src/features/Vessel/components/VesselSidebar/Controls/ControlsSummary.tsx similarity index 95% rename from frontend/src/features/VesselSidebar/Controls/ControlsSummary.tsx rename to frontend/src/features/Vessel/components/VesselSidebar/Controls/ControlsSummary.tsx index 29644261e6..009cff9318 100644 --- a/frontend/src/features/VesselSidebar/Controls/ControlsSummary.tsx +++ b/frontend/src/features/Vessel/components/VesselSidebar/Controls/ControlsSummary.tsx @@ -4,13 +4,13 @@ import styled from 'styled-components' import { InfractionsSummary } from './InfractionsSummary' import { LastControl } from './LastControl' import { LawReminders } from './LawReminders' -import { theme } from '../../../ui/theme' +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 { Header, Zone } from '../common_styles/common.style' -import type { MissionAction } from '../../Mission/missionAction.types' +import type { MissionAction } from '../../../../Mission/missionAction.types' type ControlsResumeZoneProps = { controlsFromDate: Date diff --git a/frontend/src/features/VesselSidebar/Controls/GearOnboard.tsx b/frontend/src/features/Vessel/components/VesselSidebar/Controls/GearOnboard.tsx similarity index 78% rename from frontend/src/features/VesselSidebar/Controls/GearOnboard.tsx rename to frontend/src/features/Vessel/components/VesselSidebar/Controls/GearOnboard.tsx index ae05eecf12..16a1af3ada 100644 --- a/frontend/src/features/VesselSidebar/Controls/GearOnboard.tsx +++ b/frontend/src/features/Vessel/components/VesselSidebar/Controls/GearOnboard.tsx @@ -1,6 +1,6 @@ import styled from 'styled-components' -import type { MissionAction } from '../../Mission/missionAction.types' +import type { MissionAction } from '../../../../Mission/missionAction.types' type GearOnboardProps = { gearOnboard: MissionAction.GearControl @@ -9,7 +9,7 @@ export function GearOnboard({ gearOnboard }: GearOnboardProps) { return ( - {gearOnboard.gearName} ({gearOnboard.gearCode}) – {gearOnboard.gearWasControlled || 'non '}contrôlé + {gearOnboard.gearName} ({gearOnboard.gearCode}) – {!!gearOnboard.gearWasControlled || 'non '}contrôlé Maillage {gearOnboard.declaredMesh ? `déclaré ${gearOnboard.declaredMesh} mm, ` : ''} {gearOnboard.controlledMesh ? `mesuré ${gearOnboard.controlledMesh} mm` : 'non mesuré'} diff --git a/frontend/src/features/VesselSidebar/Controls/Infraction.tsx b/frontend/src/features/Vessel/components/VesselSidebar/Controls/Infraction.tsx similarity index 94% rename from frontend/src/features/VesselSidebar/Controls/Infraction.tsx rename to frontend/src/features/Vessel/components/VesselSidebar/Controls/Infraction.tsx index 1c3fd78903..8eb1e18b2b 100644 --- a/frontend/src/features/VesselSidebar/Controls/Infraction.tsx +++ b/frontend/src/features/Vessel/components/VesselSidebar/Controls/Infraction.tsx @@ -3,8 +3,8 @@ import { find } from 'lodash' import { useMemo } from 'react' import styled from 'styled-components' -import { COLORS } from '../../../constants/constants' -import { MissionAction } from '../../Mission/missionAction.types' +import { COLORS } from '../../../../../constants/constants' +import { MissionAction } from '../../../../Mission/missionAction.types' type InfractionProps = { index: number diff --git a/frontend/src/features/VesselSidebar/Controls/InfractionsSummary.tsx b/frontend/src/features/Vessel/components/VesselSidebar/Controls/InfractionsSummary.tsx similarity index 96% rename from frontend/src/features/VesselSidebar/Controls/InfractionsSummary.tsx rename to frontend/src/features/Vessel/components/VesselSidebar/Controls/InfractionsSummary.tsx index 24aa3527e8..ec37a7cbbb 100644 --- a/frontend/src/features/VesselSidebar/Controls/InfractionsSummary.tsx +++ b/frontend/src/features/Vessel/components/VesselSidebar/Controls/InfractionsSummary.tsx @@ -1,6 +1,6 @@ import styled from 'styled-components' -import { COLORS } from '../../../constants/constants' +import { COLORS } from '../../../../../constants/constants' import { NoValue } from '../common_styles/common.style' type InfractionsSummaryProps = { diff --git a/frontend/src/features/VesselSidebar/Controls/LastControl.tsx b/frontend/src/features/Vessel/components/VesselSidebar/Controls/LastControl.tsx similarity index 85% rename from frontend/src/features/VesselSidebar/Controls/LastControl.tsx rename to frontend/src/features/Vessel/components/VesselSidebar/Controls/LastControl.tsx index 259ba8698b..62e97a1aeb 100644 --- a/frontend/src/features/VesselSidebar/Controls/LastControl.tsx +++ b/frontend/src/features/Vessel/components/VesselSidebar/Controls/LastControl.tsx @@ -2,10 +2,10 @@ import { useMemo } from 'react' import styled from 'styled-components' import { Green, Red } from './Controls.style' -import { getNumberOfInfractions } from '../../../domain/entities/controls' -import { getDate } from '../../../utils' +import { getNumberOfInfractions } from '../../../../../domain/entities/controls' +import { getDate } from '../../../../../utils' -import type { MissionAction } from '../../Mission/missionAction.types' +import type { MissionAction } from '../../../../Mission/missionAction.types' type LastControlProps = { field: MissionAction.ControlAndText @@ -13,7 +13,7 @@ type LastControlProps = { export function LastControl({ field }: LastControlProps) { const { control, text } = field const controlUnits = - control?.controlUnits.map(controlUnit => controlUnit.name.replace('(historique)', '')).join(', ') || + control?.controlUnits.map(controlUnit => controlUnit.name.replace('(historique)', '')).join(', ') ?? 'Unité manquante' const numberOfInfractions = useMemo(() => getNumberOfInfractions(control), [control]) diff --git a/frontend/src/features/VesselSidebar/Controls/LawReminders.tsx b/frontend/src/features/Vessel/components/VesselSidebar/Controls/LawReminders.tsx similarity index 91% rename from frontend/src/features/VesselSidebar/Controls/LawReminders.tsx rename to frontend/src/features/Vessel/components/VesselSidebar/Controls/LawReminders.tsx index 2a792abc61..376c8642cb 100644 --- a/frontend/src/features/VesselSidebar/Controls/LawReminders.tsx +++ b/frontend/src/features/Vessel/components/VesselSidebar/Controls/LawReminders.tsx @@ -4,10 +4,10 @@ import styled from 'styled-components' import { getNumberOfInfractionsWithoutRecord, getNatinfForInfractionsWithoutRecord -} from '../../../domain/entities/controls' -import { pluralize } from '../../../utils/pluralize' +} from '../../../../../domain/entities/controls' +import { pluralize } from '../../../../../utils/pluralize' -import type { MissionAction } from '../../Mission/missionAction.types' +import type { MissionAction } from '../../../../Mission/missionAction.types' type LawRemindersProps = { controls: MissionAction.MissionAction[] diff --git a/frontend/src/features/VesselSidebar/Controls/YearControls.tsx b/frontend/src/features/Vessel/components/VesselSidebar/Controls/YearControls.tsx similarity index 96% rename from frontend/src/features/VesselSidebar/Controls/YearControls.tsx rename to frontend/src/features/Vessel/components/VesselSidebar/Controls/YearControls.tsx index 3b355609ca..a7c4a403fe 100644 --- a/frontend/src/features/VesselSidebar/Controls/YearControls.tsx +++ b/frontend/src/features/Vessel/components/VesselSidebar/Controls/YearControls.tsx @@ -6,11 +6,11 @@ import { getNumberOfInfractions, getNumberOfInfractionsWithoutRecord, getNumberOfInfractionsWithRecord -} from '../../../domain/entities/controls' -import { pluralize } from '../../../utils/pluralize' +} from '../../../../../domain/entities/controls' +import { pluralize } from '../../../../../utils/pluralize' import { YearListChevronIcon, YearListContent, YearListTitle, YearListTitleText } from '../common_styles/YearList.style' -import type { MissionAction } from '../../Mission/missionAction.types' +import type { MissionAction } from '../../../../Mission/missionAction.types' type YearControlsProps = { year: number diff --git a/frontend/src/features/VesselSidebar/Controls/YearsToControlList.tsx b/frontend/src/features/Vessel/components/VesselSidebar/Controls/YearsToControlList.tsx similarity index 88% rename from frontend/src/features/VesselSidebar/Controls/YearsToControlList.tsx rename to frontend/src/features/Vessel/components/VesselSidebar/Controls/YearsToControlList.tsx index 4f0478c0d4..f04e8bd3cd 100644 --- a/frontend/src/features/VesselSidebar/Controls/YearsToControlList.tsx +++ b/frontend/src/features/Vessel/components/VesselSidebar/Controls/YearsToControlList.tsx @@ -2,10 +2,10 @@ import { useMemo } from 'react' import styled from 'styled-components' import { YearControls } from './YearControls' -import { COLORS } from '../../../constants/constants' +import { COLORS } from '../../../../../constants/constants' import { Header, Zone } from '../common_styles/common.style' -import type { MissionAction } from '../../Mission/missionAction.types' +import type { MissionAction } from '../../../../Mission/missionAction.types' type YearsToControlListProps = { controlsFromDate: Date @@ -26,7 +26,7 @@ export function YearsToControlList({ controlsFromDate, yearsToControls }: YearsT {yearsToControls && Object.keys(yearsToControls) && Object.keys(yearsToControls).length ? ( {sortedYears.map(year => ( - + ))} ) : ( diff --git a/frontend/src/features/VesselSidebar/Controls/index.tsx b/frontend/src/features/Vessel/components/VesselSidebar/Controls/index.tsx similarity index 90% rename from frontend/src/features/VesselSidebar/Controls/index.tsx rename to frontend/src/features/Vessel/components/VesselSidebar/Controls/index.tsx index a6cde1fb0e..6ad4ebb22b 100644 --- a/frontend/src/features/VesselSidebar/Controls/index.tsx +++ b/frontend/src/features/Vessel/components/VesselSidebar/Controls/index.tsx @@ -4,12 +4,16 @@ import styled from 'styled-components' import { ControlsSummary } from './ControlsSummary' import { YearsToControlList } from './YearsToControlList' -import { COLORS } from '../../../constants/constants' -import { getLastControls, getYearsToActions, INITIAL_LAST_CONTROLS } from '../../../domain/entities/controls' -import { resetNextControlSummary, setControlFromDate, setControlSummary } from '../../../domain/shared_slices/Control' -import { getVesselControls } from '../../../domain/use_cases/mission/getVesselControls' -import { useMainAppDispatch } from '../../../hooks/useMainAppDispatch' -import { useMainAppSelector } from '../../../hooks/useMainAppSelector' +import { COLORS } from '../../../../../constants/constants' +import { getLastControls, getYearsToActions, INITIAL_LAST_CONTROLS } from '../../../../../domain/entities/controls' +import { + resetNextControlSummary, + setControlFromDate, + setControlSummary +} from '../../../../../domain/shared_slices/Control' +import { getVesselControls } from '../../../../../domain/use_cases/mission/getVesselControls' +import { useMainAppDispatch } from '../../../../../hooks/useMainAppDispatch' +import { useMainAppSelector } from '../../../../../hooks/useMainAppSelector' export function Controls() { const dispatch = useMainAppDispatch() diff --git a/frontend/src/features/VesselSidebar/Equipment/VesselEquipment.tsx b/frontend/src/features/Vessel/components/VesselSidebar/Equipment/VesselEquipment.tsx similarity index 85% rename from frontend/src/features/VesselSidebar/Equipment/VesselEquipment.tsx rename to frontend/src/features/Vessel/components/VesselSidebar/Equipment/VesselEquipment.tsx index e720960d54..b688bba882 100644 --- a/frontend/src/features/VesselSidebar/Equipment/VesselEquipment.tsx +++ b/frontend/src/features/Vessel/components/VesselSidebar/Equipment/VesselEquipment.tsx @@ -5,14 +5,14 @@ import styled from 'styled-components' import { BeaconMalfunctionDetails } from './details/BeaconMalfunctionDetails' import { EquipmentResume } from './resume/EquipmentResume' -import { useIsSuperUser } from '../../../auth/hooks/useIsSuperUser' -import { COLORS } from '../../../constants/constants' -import { EquipmentTab } from '../../../domain/entities/beaconMalfunction/constants' -import { vesselsAreEquals } from '../../../domain/entities/vessel/vessel' -import { setBeaconMalfunctionsTab } from '../../../domain/shared_slices/BeaconMalfunction' -import { getVesselBeaconMalfunctions } from '../../../domain/use_cases/beaconMalfunction/getVesselBeaconMalfunctions' -import { useMainAppDispatch } from '../../../hooks/useMainAppDispatch' -import { useMainAppSelector } from '../../../hooks/useMainAppSelector' +import { useIsSuperUser } from '../../../../../auth/hooks/useIsSuperUser' +import { COLORS } from '../../../../../constants/constants' +import { EquipmentTab } from '../../../../../domain/entities/beaconMalfunction/constants' +import { vesselsAreEquals } from '../../../../../domain/entities/vessel/vessel' +import { setBeaconMalfunctionsTab } from '../../../../../domain/shared_slices/BeaconMalfunction' +import { getVesselBeaconMalfunctions } from '../../../../../domain/use_cases/beaconMalfunction/getVesselBeaconMalfunctions' +import { useMainAppDispatch } from '../../../../../hooks/useMainAppDispatch' +import { useMainAppSelector } from '../../../../../hooks/useMainAppSelector' export function VesselEquipment() { const dispatch = useMainAppDispatch() diff --git a/frontend/src/features/VesselSidebar/Equipment/details/BeaconMalfunctionDetails.tsx b/frontend/src/features/Vessel/components/VesselSidebar/Equipment/details/BeaconMalfunctionDetails.tsx similarity index 79% rename from frontend/src/features/VesselSidebar/Equipment/details/BeaconMalfunctionDetails.tsx rename to frontend/src/features/Vessel/components/VesselSidebar/Equipment/details/BeaconMalfunctionDetails.tsx index b0cc7ec9ea..ae909c1386 100644 --- a/frontend/src/features/VesselSidebar/Equipment/details/BeaconMalfunctionDetails.tsx +++ b/frontend/src/features/Vessel/components/VesselSidebar/Equipment/details/BeaconMalfunctionDetails.tsx @@ -1,14 +1,14 @@ import styled from 'styled-components' -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 { 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 { BeaconMalfunctionDetailsFollowUp } from '../../../../../SideWindow/BeaconMalfunctionBoard/BeaconMalfunctionDetailsFollowUp' import ArrowSVG from '../../../icons/Picto_fleche-pleine-droite.svg?react' -import { BeaconMalfunctionDetailsFollowUp } from '../../../SideWindow/BeaconMalfunctionBoard/BeaconMalfunctionDetailsFollowUp' import { BeaconMalfunctionBody } from '../resume/BeaconMalfunctionBody' import { CurrentBeaconMalfunctionBody } from '../resume/CurrentBeaconMalfunctionBody' diff --git a/frontend/src/features/VesselSidebar/Equipment/resume/BeaconMalfunctionBody.tsx b/frontend/src/features/Vessel/components/VesselSidebar/Equipment/resume/BeaconMalfunctionBody.tsx similarity index 92% rename from frontend/src/features/VesselSidebar/Equipment/resume/BeaconMalfunctionBody.tsx rename to frontend/src/features/Vessel/components/VesselSidebar/Equipment/resume/BeaconMalfunctionBody.tsx index 0d216b83b9..416ec1f842 100644 --- a/frontend/src/features/VesselSidebar/Equipment/resume/BeaconMalfunctionBody.tsx +++ b/frontend/src/features/Vessel/components/VesselSidebar/Equipment/resume/BeaconMalfunctionBody.tsx @@ -1,15 +1,15 @@ import styled from 'styled-components' -import { getFirstVesselStatus } from '../../../../domain/entities/beaconMalfunction' +import { getFirstVesselStatus } from '../../../../../../domain/entities/beaconMalfunction' import { BeaconMalfunctionPropertyName, BeaconMalfunctionVesselStatus, END_OF_MALFUNCTION_REASON_RECORD, VESSEL_STATUS -} from '../../../../domain/entities/beaconMalfunction/constants' -import { getDateTime } from '../../../../utils' +} from '../../../../../../domain/entities/beaconMalfunction/constants' +import { getDateTime } from '../../../../../../utils' -import type { BeaconMalfunctionResumeAndDetails } from '../../../../domain/entities/beaconMalfunction/types' +import type { BeaconMalfunctionResumeAndDetails } from '../../../../../../domain/entities/beaconMalfunction/types' const MS_PER_DAY = 1000 * 60 * 60 * 24 diff --git a/frontend/src/features/VesselSidebar/Equipment/resume/BeaconMalfunctionCard.tsx b/frontend/src/features/Vessel/components/VesselSidebar/Equipment/resume/BeaconMalfunctionCard.tsx similarity index 91% rename from frontend/src/features/VesselSidebar/Equipment/resume/BeaconMalfunctionCard.tsx rename to frontend/src/features/Vessel/components/VesselSidebar/Equipment/resume/BeaconMalfunctionCard.tsx index 707561201b..2bad28e410 100644 --- a/frontend/src/features/VesselSidebar/Equipment/resume/BeaconMalfunctionCard.tsx +++ b/frontend/src/features/Vessel/components/VesselSidebar/Equipment/resume/BeaconMalfunctionCard.tsx @@ -1,19 +1,19 @@ import { useMemo } from 'react' import styled from 'styled-components' -import { getFirstVesselStatus, getMalfunctionStartDateText } from '../../../../domain/entities/beaconMalfunction' +import { getFirstVesselStatus, getMalfunctionStartDateText } from '../../../../../../domain/entities/beaconMalfunction' import { BeaconMalfunctionPropertyName, BeaconMalfunctionVesselStatus, VESSEL_STATUS -} from '../../../../domain/entities/beaconMalfunction/constants' -import { setOpenedBeaconMalfunction } from '../../../../domain/shared_slices/BeaconMalfunction' -import { useMainAppDispatch } from '../../../../hooks/useMainAppDispatch' -import { getDateTime } from '../../../../utils' +} from '../../../../../../domain/entities/beaconMalfunction/constants' +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 type { BeaconMalfunctionResumeAndDetails } from '../../../../domain/entities/beaconMalfunction/types' +import type { BeaconMalfunctionResumeAndDetails } from '../../../../../../domain/entities/beaconMalfunction/types' import type { HTMLProps } from 'react' const MS_PER_DAY = 1000 * 60 * 60 * 24 diff --git a/frontend/src/features/VesselSidebar/Equipment/resume/BeaconMalfunctionsResume.tsx b/frontend/src/features/Vessel/components/VesselSidebar/Equipment/resume/BeaconMalfunctionsResume.tsx similarity index 93% rename from frontend/src/features/VesselSidebar/Equipment/resume/BeaconMalfunctionsResume.tsx rename to frontend/src/features/Vessel/components/VesselSidebar/Equipment/resume/BeaconMalfunctionsResume.tsx index ddf34084b8..f69c41954e 100644 --- a/frontend/src/features/VesselSidebar/Equipment/resume/BeaconMalfunctionsResume.tsx +++ b/frontend/src/features/Vessel/components/VesselSidebar/Equipment/resume/BeaconMalfunctionsResume.tsx @@ -1,10 +1,10 @@ import styled from 'styled-components' -import { VESSEL_STATUS } from '../../../../domain/entities/beaconMalfunction/constants' -import { getDateTime } from '../../../../utils' +import { VESSEL_STATUS } from '../../../../../../domain/entities/beaconMalfunction/constants' +import { getDateTime } from '../../../../../../utils' import { NoValue, Header, Zone } from '../../common_styles/common.style' -import type { VesselBeaconMalfunctionsResume } from '../../../../domain/entities/beaconMalfunction/types' +import type { VesselBeaconMalfunctionsResume } from '../../../../../../domain/entities/beaconMalfunction/types' type VesselBeaconMalfunctionsResumeProps = { vesselBeaconMalfunctionsResume: VesselBeaconMalfunctionsResume | undefined diff --git a/frontend/src/features/VesselSidebar/Equipment/resume/CurrentBeaconMalfunction.tsx b/frontend/src/features/Vessel/components/VesselSidebar/Equipment/resume/CurrentBeaconMalfunction.tsx similarity index 86% rename from frontend/src/features/VesselSidebar/Equipment/resume/CurrentBeaconMalfunction.tsx rename to frontend/src/features/Vessel/components/VesselSidebar/Equipment/resume/CurrentBeaconMalfunction.tsx index 558be5448e..749527c0b2 100644 --- a/frontend/src/features/VesselSidebar/Equipment/resume/CurrentBeaconMalfunction.tsx +++ b/frontend/src/features/Vessel/components/VesselSidebar/Equipment/resume/CurrentBeaconMalfunction.tsx @@ -1,13 +1,13 @@ 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 { 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 { 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 = { diff --git a/frontend/src/features/VesselSidebar/Equipment/resume/CurrentBeaconMalfunctionBody.tsx b/frontend/src/features/Vessel/components/VesselSidebar/Equipment/resume/CurrentBeaconMalfunctionBody.tsx similarity index 85% rename from frontend/src/features/VesselSidebar/Equipment/resume/CurrentBeaconMalfunctionBody.tsx rename to frontend/src/features/Vessel/components/VesselSidebar/Equipment/resume/CurrentBeaconMalfunctionBody.tsx index 206ac97032..b67525dbe0 100644 --- a/frontend/src/features/VesselSidebar/Equipment/resume/CurrentBeaconMalfunctionBody.tsx +++ b/frontend/src/features/Vessel/components/VesselSidebar/Equipment/resume/CurrentBeaconMalfunctionBody.tsx @@ -2,15 +2,15 @@ import { useEffect, useRef } from 'react' import { SelectPicker } from 'rsuite' import styled from 'styled-components' -import { COLORS } from '../../../../constants/constants' -import { getMalfunctionStartDateText } from '../../../../domain/entities/beaconMalfunction' -import { VESSEL_STATUS } from '../../../../domain/entities/beaconMalfunction/constants' -import updateBeaconMalfunctionFromKanban from '../../../../domain/use_cases/beaconMalfunction/updateBeaconMalfunctionFromKanban' -import { useMainAppDispatch } from '../../../../hooks/useMainAppDispatch' +import { COLORS } from '../../../../../../constants/constants' +import { getMalfunctionStartDateText } from '../../../../../../domain/entities/beaconMalfunction' +import { VESSEL_STATUS } from '../../../../../../domain/entities/beaconMalfunction/constants' +import updateBeaconMalfunctionFromKanban from '../../../../../../domain/use_cases/beaconMalfunction/updateBeaconMalfunctionFromKanban' +import { useMainAppDispatch } from '../../../../../../hooks/useMainAppDispatch' +import { VesselStatusSelectValue } from '../../../../../SideWindow/BeaconMalfunctionBoard/VesselStatusSelectValue' import TimeAgoSVG from '../../../icons/Label_horaire_VMS.svg?react' -import { VesselStatusSelectValue } from '../../../SideWindow/BeaconMalfunctionBoard/VesselStatusSelectValue' -import type { BeaconMalfunctionResumeAndDetails } from '../../../../domain/entities/beaconMalfunction/types' +import type { BeaconMalfunctionResumeAndDetails } from '../../../../../../domain/entities/beaconMalfunction/types' type CurrentBeaconMalfunctionBodyProps = { currentBeaconMalfunctionWithDetails: BeaconMalfunctionResumeAndDetails | null | undefined diff --git a/frontend/src/features/VesselSidebar/Equipment/resume/EquipmentResume.tsx b/frontend/src/features/Vessel/components/VesselSidebar/Equipment/resume/EquipmentResume.tsx similarity index 92% rename from frontend/src/features/VesselSidebar/Equipment/resume/EquipmentResume.tsx rename to frontend/src/features/Vessel/components/VesselSidebar/Equipment/resume/EquipmentResume.tsx index 0a1cfa3657..dfd6337022 100644 --- a/frontend/src/features/VesselSidebar/Equipment/resume/EquipmentResume.tsx +++ b/frontend/src/features/Vessel/components/VesselSidebar/Equipment/resume/EquipmentResume.tsx @@ -1,4 +1,4 @@ -import { FlatKeyValue } from '@features/VesselSidebar/common/FlatKeyValue' +import { FlatKeyValue } from '@features/Vessel/components/VesselSidebar/common/FlatKeyValue' import { useMainAppDispatch } from '@hooks/useMainAppDispatch' import { useMainAppSelector } from '@hooks/useMainAppSelector' import { THEME } from '@mtes-mct/monitor-ui' @@ -9,10 +9,10 @@ import styled from 'styled-components' import { BeaconMalfunctionsResume } from './BeaconMalfunctionsResume' import { CurrentBeaconMalfunction } from './CurrentBeaconMalfunction' import { YearsToBeaconMalfunctionList } from './YearsToBeaconMalfunctionList' -import { useIsSuperUser } from '../../../../auth/hooks/useIsSuperUser' -import { getYearsToBeaconMalfunctions } from '../../../../domain/entities/beaconMalfunction' -import { setVesselBeaconMalfunctionsFromDate } from '../../../../domain/shared_slices/BeaconMalfunction' -import { getDateTime } from '../../../../utils' +import { useIsSuperUser } from '../../../../../../auth/hooks/useIsSuperUser' +import { getYearsToBeaconMalfunctions } from '../../../../../../domain/entities/beaconMalfunction' +import { setVesselBeaconMalfunctionsFromDate } from '../../../../../../domain/shared_slices/BeaconMalfunction' +import { getDateTime } from '../../../../../../utils' import type { Promisable } from 'type-fest' @@ -92,7 +92,7 @@ export function EquipmentResume({ setIsCurrentBeaconMalfunctionDetails }: Beacon }, { key: 'Logiciel JPE', - value: selectedVessel?.logbookSoftware || '-' + value: selectedVessel?.logbookSoftware ?? '-' }, { key: 'Équipé e-Sacapt', diff --git a/frontend/src/features/VesselSidebar/Equipment/resume/YearBeaconMalfunctions.tsx b/frontend/src/features/Vessel/components/VesselSidebar/Equipment/resume/YearBeaconMalfunctions.tsx similarity index 95% rename from frontend/src/features/VesselSidebar/Equipment/resume/YearBeaconMalfunctions.tsx rename to frontend/src/features/Vessel/components/VesselSidebar/Equipment/resume/YearBeaconMalfunctions.tsx index 185708aa95..c1212acdcb 100644 --- a/frontend/src/features/VesselSidebar/Equipment/resume/YearBeaconMalfunctions.tsx +++ b/frontend/src/features/Vessel/components/VesselSidebar/Equipment/resume/YearBeaconMalfunctions.tsx @@ -2,8 +2,8 @@ import { useMemo, useState } from 'react' import styled from 'styled-components' import { BeaconMalfunctionCard } from './BeaconMalfunctionCard' -import { COLORS } from '../../../../constants/constants' -import { getNumberOfSeaAndLandBeaconMalfunctions } from '../../../../domain/entities/beaconMalfunction' +import { COLORS } from '../../../../../../constants/constants' +import { getNumberOfSeaAndLandBeaconMalfunctions } from '../../../../../../domain/entities/beaconMalfunction' import { YearListChevronIcon, YearListContent, @@ -11,7 +11,7 @@ import { YearListTitleText } from '../../common_styles/YearList.style' -import type { BeaconMalfunctionResumeAndDetails } from '../../../../domain/entities/beaconMalfunction/types' +import type { BeaconMalfunctionResumeAndDetails } from '../../../../../../domain/entities/beaconMalfunction/types' type YearBeaconMalfunctionsProps = { setIsCurrentBeaconMalfunctionDetails: (boolean) => void diff --git a/frontend/src/features/VesselSidebar/Equipment/resume/YearsToBeaconMalfunctionList.tsx b/frontend/src/features/Vessel/components/VesselSidebar/Equipment/resume/YearsToBeaconMalfunctionList.tsx similarity index 94% rename from frontend/src/features/VesselSidebar/Equipment/resume/YearsToBeaconMalfunctionList.tsx rename to frontend/src/features/Vessel/components/VesselSidebar/Equipment/resume/YearsToBeaconMalfunctionList.tsx index 62623c31d4..e46f6171d2 100644 --- a/frontend/src/features/VesselSidebar/Equipment/resume/YearsToBeaconMalfunctionList.tsx +++ b/frontend/src/features/Vessel/components/VesselSidebar/Equipment/resume/YearsToBeaconMalfunctionList.tsx @@ -2,9 +2,9 @@ import { useMemo } from 'react' import styled from 'styled-components' import { YearBeaconMalfunctions } from './YearBeaconMalfunctions' -import { COLORS } from '../../../../constants/constants' +import { COLORS } from '../../../../../../constants/constants' -import type { BeaconMalfunctionResumeAndDetails } from '../../../../domain/entities/beaconMalfunction/types' +import type { BeaconMalfunctionResumeAndDetails } from '../../../../../../domain/entities/beaconMalfunction/types' type YearsToBeaconMalfunctionListProps = { setIsCurrentBeaconMalfunctionDetails: (boolean) => void @@ -34,7 +34,7 @@ export function YearsToBeaconMalfunctionList({ key={year} setIsCurrentBeaconMalfunctionDetails={setIsCurrentBeaconMalfunctionDetails} year={year} - yearBeaconMalfunctions={yearsToBeaconMalfunctions[year] || []} + yearBeaconMalfunctions={yearsToBeaconMalfunctions[year] ?? []} /> ))} diff --git a/frontend/src/features/VesselSidebar/Identity/index.tsx b/frontend/src/features/Vessel/components/VesselSidebar/Identity.tsx similarity index 97% rename from frontend/src/features/VesselSidebar/Identity/index.tsx rename to frontend/src/features/Vessel/components/VesselSidebar/Identity.tsx index 2b5b80750b..d74ed5bd16 100644 --- a/frontend/src/features/VesselSidebar/Identity/index.tsx +++ b/frontend/src/features/Vessel/components/VesselSidebar/Identity.tsx @@ -1,4 +1,4 @@ -import { FlatTwoColumnKeyValue } from '@features/VesselSidebar/common/FlatTwoColumnKeyValue' +import { FlatTwoColumnKeyValue } from '@features/Vessel/components/VesselSidebar/common/FlatTwoColumnKeyValue' import { useMainAppDispatch } from '@hooks/useMainAppDispatch' import { useMainAppSelector } from '@hooks/useMainAppSelector' import { THEME } from '@mtes-mct/monitor-ui' @@ -7,8 +7,8 @@ import { useEffect, useMemo } from 'react' import { FingerprintSpinner } from 'react-epic-spinners' import styled from 'styled-components' -import { showVessel } from '../../../domain/use_cases/vessel/showVessel' -import { getDate } from '../../../utils' +import { showVessel } from '../../../../domain/use_cases/vessel/showVessel' +import { getDate } from '../../../../utils' export function Identity() { const dispatch = useMainAppDispatch() diff --git a/frontend/src/features/VesselSidebar/Summary/index.tsx b/frontend/src/features/Vessel/components/VesselSidebar/Summary.tsx similarity index 93% rename from frontend/src/features/VesselSidebar/Summary/index.tsx rename to frontend/src/features/Vessel/components/VesselSidebar/Summary.tsx index 8e8b4f99a3..24934e5cff 100644 --- a/frontend/src/features/VesselSidebar/Summary/index.tsx +++ b/frontend/src/features/Vessel/components/VesselSidebar/Summary.tsx @@ -5,15 +5,15 @@ import { FingerprintSpinner } from 'react-epic-spinners' import styled from 'styled-components' import * as timeago from 'timeago.js' -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 { 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 { RiskFactorResume } from '../risk_factor/RiskFactorResume' // @ts-ignore timeago.register('fr', timeagoFrenchLocale) diff --git a/frontend/src/features/VesselSidebar/Tabs.tsx b/frontend/src/features/Vessel/components/VesselSidebar/Tabs.tsx similarity index 88% rename from frontend/src/features/VesselSidebar/Tabs.tsx rename to frontend/src/features/Vessel/components/VesselSidebar/Tabs.tsx index 2f0babfeeb..58059a2af2 100644 --- a/frontend/src/features/VesselSidebar/Tabs.tsx +++ b/frontend/src/features/Vessel/components/VesselSidebar/Tabs.tsx @@ -2,14 +2,14 @@ import { DisplayedErrorKey } from '@libs/DisplayedError/constants' 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 { 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' diff --git a/frontend/src/features/VesselSidebar/VesselSidebarHeader/VesselName.tsx b/frontend/src/features/Vessel/components/VesselSidebar/VesselSidebarHeader/VesselName.tsx similarity index 88% rename from frontend/src/features/VesselSidebar/VesselSidebarHeader/VesselName.tsx rename to frontend/src/features/Vessel/components/VesselSidebar/VesselSidebarHeader/VesselName.tsx index 9baee91266..d33da8ad10 100644 --- a/frontend/src/features/VesselSidebar/VesselSidebarHeader/VesselName.tsx +++ b/frontend/src/features/Vessel/components/VesselSidebar/VesselSidebarHeader/VesselName.tsx @@ -2,12 +2,12 @@ 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 { 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' @@ -66,7 +66,7 @@ export function VesselName({ focusOnVesselSearchInput }) { data-cy="sidebar-add-vessel-to-favorites" onClick={addOrRemoveToFavorites} /> - {getVesselName(selectedVesselIdentity)} + {getVesselName(selectedVesselIdentity)} ) diff --git a/frontend/src/features/VesselSidebar/VesselSidebarHeader/index.tsx b/frontend/src/features/Vessel/components/VesselSidebar/VesselSidebarHeader/index.tsx similarity index 86% rename from frontend/src/features/VesselSidebar/VesselSidebarHeader/index.tsx rename to frontend/src/features/Vessel/components/VesselSidebar/VesselSidebarHeader/index.tsx index ece0a279c5..22cb5ef7c3 100644 --- a/frontend/src/features/VesselSidebar/VesselSidebarHeader/index.tsx +++ b/frontend/src/features/Vessel/components/VesselSidebar/VesselSidebarHeader/index.tsx @@ -4,16 +4,16 @@ 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 { 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 { VesselSearch } from '../../../../VesselSearch' import SearchIconSVG from '../../icons/Loupe.svg?react' -import { MapButton } from '../../MainWindow/components/MapButtons/MapButton' -import { VesselSearch } from '../../VesselSearch' -import type { VesselIdentity } from '../../../domain/entities/vessel/types' +import type { VesselIdentity } from '../../../../../domain/entities/vessel/types' export function VesselSidebarHeader() { const dispatch = useMainAppDispatch() diff --git a/frontend/src/features/VesselSidebar/actions/TrackRequest/DateRange.tsx b/frontend/src/features/Vessel/components/VesselSidebar/actions/TrackRequest/DateRange.tsx similarity index 97% rename from frontend/src/features/VesselSidebar/actions/TrackRequest/DateRange.tsx rename to frontend/src/features/Vessel/components/VesselSidebar/actions/TrackRequest/DateRange.tsx index d43fe56b4a..6b69804555 100644 --- a/frontend/src/features/VesselSidebar/actions/TrackRequest/DateRange.tsx +++ b/frontend/src/features/Vessel/components/VesselSidebar/actions/TrackRequest/DateRange.tsx @@ -5,7 +5,7 @@ import { useCallback, useMemo } from 'react' import { DateRangePicker } from 'rsuite' import styled from 'styled-components' -import { COLORS } from '../../../../constants/constants' +import { COLORS } from '../../../../../../constants/constants' import type { DateRange as RsuiteDateRange } from 'rsuite/esm/DateRangePicker' diff --git a/frontend/src/features/VesselSidebar/actions/TrackRequest/ExportTrack.tsx b/frontend/src/features/Vessel/components/VesselSidebar/actions/TrackRequest/ExportTrack.tsx similarity index 84% rename from frontend/src/features/VesselSidebar/actions/TrackRequest/ExportTrack.tsx rename to frontend/src/features/Vessel/components/VesselSidebar/actions/TrackRequest/ExportTrack.tsx index eaacf8bf62..2975ce04a9 100644 --- a/frontend/src/features/VesselSidebar/actions/TrackRequest/ExportTrack.tsx +++ b/frontend/src/features/Vessel/components/VesselSidebar/actions/TrackRequest/ExportTrack.tsx @@ -3,17 +3,17 @@ import countries from 'i18n-iso-countries' import { useCallback, useMemo } from 'react' import styled from 'styled-components' -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 { 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 type { VesselPosition } from '../../../../domain/entities/vessel/types' -import type { DownloadAsCsvMap } from '../../../../utils/downloadAsCsv' +import type { VesselPosition } from '../../../../../../domain/entities/vessel/types' +import type { DownloadAsCsvMap } from '../../../../../../utils/downloadAsCsv' type VesselPositionWithId = VesselPosition & { id: string diff --git a/frontend/src/features/VesselSidebar/actions/TrackRequest/HighlightPositionCell.tsx b/frontend/src/features/Vessel/components/VesselSidebar/actions/TrackRequest/HighlightPositionCell.tsx similarity index 86% rename from frontend/src/features/VesselSidebar/actions/TrackRequest/HighlightPositionCell.tsx rename to frontend/src/features/Vessel/components/VesselSidebar/actions/TrackRequest/HighlightPositionCell.tsx index 3989260ba2..fc4bc52e1a 100644 --- a/frontend/src/features/VesselSidebar/actions/TrackRequest/HighlightPositionCell.tsx +++ b/frontend/src/features/Vessel/components/VesselSidebar/actions/TrackRequest/HighlightPositionCell.tsx @@ -4,13 +4,13 @@ import { Accent, Icon, Tag } from '@mtes-mct/monitor-ui' import { transform } from 'ol/proj' import styled from 'styled-components' -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 { 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 type { VesselPosition } from '../../../../domain/entities/vessel/types' +import type { VesselPosition } from '../../../../../../domain/entities/vessel/types' type HighlightPositionCellProps = { isAtPortPositionMarkerShowed?: boolean diff --git a/frontend/src/features/VesselSidebar/actions/TrackRequest/PositionsTable.tsx b/frontend/src/features/Vessel/components/VesselSidebar/actions/TrackRequest/PositionsTable.tsx similarity index 86% rename from frontend/src/features/VesselSidebar/actions/TrackRequest/PositionsTable.tsx rename to frontend/src/features/Vessel/components/VesselSidebar/actions/TrackRequest/PositionsTable.tsx index 76380f010f..931d580e4c 100644 --- a/frontend/src/features/VesselSidebar/actions/TrackRequest/PositionsTable.tsx +++ b/frontend/src/features/Vessel/components/VesselSidebar/actions/TrackRequest/PositionsTable.tsx @@ -1,4 +1,4 @@ -import { POSITION_TABLE_COLUMNS } from '@features/VesselSidebar/actions/TrackRequest/constants' +import { POSITION_TABLE_COLUMNS } from '@features/Vessel/components/VesselSidebar/actions/TrackRequest/constants' import { useClickOutsideWhenOpened } from '@hooks/useClickOutsideWhenOpened' import { useMainAppDispatch } from '@hooks/useMainAppDispatch' import { useMainAppSelector } from '@hooks/useMainAppSelector' @@ -6,7 +6,7 @@ import { DataTable } from '@mtes-mct/monitor-ui' import { useEffect, useRef } from 'react' import styled from 'styled-components' -import { highlightVesselTrackPosition } from '../../../../domain/shared_slices/Vessel' +import { highlightVesselTrackPosition } from '../../../../../../domain/shared_slices/Vessel' export function PositionsTable({ openBox }) { const dispatch = useMainAppDispatch() diff --git a/frontend/src/features/VesselSidebar/actions/TrackRequest/TrackDepthSelection.tsx b/frontend/src/features/Vessel/components/VesselSidebar/actions/TrackRequest/TrackDepthSelection.tsx similarity index 86% rename from frontend/src/features/VesselSidebar/actions/TrackRequest/TrackDepthSelection.tsx rename to frontend/src/features/Vessel/components/VesselSidebar/actions/TrackRequest/TrackDepthSelection.tsx index 5f267df183..e1121882bb 100644 --- a/frontend/src/features/VesselSidebar/actions/TrackRequest/TrackDepthSelection.tsx +++ b/frontend/src/features/Vessel/components/VesselSidebar/actions/TrackRequest/TrackDepthSelection.tsx @@ -1,9 +1,9 @@ -import { SELECT_TRACK_DEPTH_OPTIONS } from '@features/VesselSidebar/actions/TrackRequest/constants' +import { SELECT_TRACK_DEPTH_OPTIONS } from '@features/Vessel/components/VesselSidebar/actions/TrackRequest/constants' import { Select } from '@mtes-mct/monitor-ui' import { useMemo } from 'react' import styled from 'styled-components' -import { VesselTrackDepth } from '../../../../domain/entities/vesselTrackDepth' +import { VesselTrackDepth } from '../../../../../../domain/entities/vesselTrackDepth' import type { Promisable } from 'type-fest' diff --git a/frontend/src/features/VesselSidebar/actions/TrackRequest/constants.tsx b/frontend/src/features/Vessel/components/VesselSidebar/actions/TrackRequest/constants.tsx similarity index 87% rename from frontend/src/features/VesselSidebar/actions/TrackRequest/constants.tsx rename to frontend/src/features/Vessel/components/VesselSidebar/actions/TrackRequest/constants.tsx index 323a09bc5b..af00061667 100644 --- a/frontend/src/features/VesselSidebar/actions/TrackRequest/constants.tsx +++ b/frontend/src/features/Vessel/components/VesselSidebar/actions/TrackRequest/constants.tsx @@ -1,10 +1,10 @@ -import { HighlightPositionCell } from '@features/VesselSidebar/actions/TrackRequest/HighlightPositionCell' +import { HighlightPositionCell } from '@features/Vessel/components/VesselSidebar/actions/TrackRequest/HighlightPositionCell' import { getLocalizedDayjs } from '@mtes-mct/monitor-ui' import { isNumeric } from '@utils/isNumeric' -import { VesselTrackDepth } from '../../../../domain/entities/vesselTrackDepth' +import { VesselTrackDepth } from '../../../../../../domain/entities/vesselTrackDepth' -import type { VesselPosition } from '../../../../domain/entities/vessel/types' +import type { VesselPosition } from '../../../../../../domain/entities/vessel/types' import type { Option } from '@mtes-mct/monitor-ui' import type { ColumnDef } from '@tanstack/react-table' diff --git a/frontend/src/features/VesselSidebar/actions/TrackRequest/index.tsx b/frontend/src/features/Vessel/components/VesselSidebar/actions/TrackRequest/index.tsx similarity index 94% rename from frontend/src/features/VesselSidebar/actions/TrackRequest/index.tsx rename to frontend/src/features/Vessel/components/VesselSidebar/actions/TrackRequest/index.tsx index 04a61a8c57..3fdd954b73 100644 --- a/frontend/src/features/VesselSidebar/actions/TrackRequest/index.tsx +++ b/frontend/src/features/Vessel/components/VesselSidebar/actions/TrackRequest/index.tsx @@ -7,14 +7,14 @@ 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 { 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 { VesselSidebarActionButton } from '../VesselSidebarActionButton' -import type { TrackRequestCustom, TrackRequestPredefined } from '../../../../domain/entities/vessel/types' -import type { SelectableVesselTrackDepth } from '@features/VesselSidebar/actions/TrackRequest/types' +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' type TrackRequestProps = { diff --git a/frontend/src/features/VesselSidebar/actions/TrackRequest/types.ts b/frontend/src/features/Vessel/components/VesselSidebar/actions/TrackRequest/types.ts similarity index 51% rename from frontend/src/features/VesselSidebar/actions/TrackRequest/types.ts rename to frontend/src/features/Vessel/components/VesselSidebar/actions/TrackRequest/types.ts index f4762bbf22..e583d18e82 100644 --- a/frontend/src/features/VesselSidebar/actions/TrackRequest/types.ts +++ b/frontend/src/features/Vessel/components/VesselSidebar/actions/TrackRequest/types.ts @@ -1,3 +1,3 @@ -import { VesselTrackDepth } from '../../../../domain/entities/vesselTrackDepth' +import { VesselTrackDepth } from '../../../../../../domain/entities/vesselTrackDepth' export type SelectableVesselTrackDepth = Exclude diff --git a/frontend/src/features/VesselSidebar/actions/TrackRequest/utils.ts b/frontend/src/features/Vessel/components/VesselSidebar/actions/TrackRequest/utils.ts similarity index 100% rename from frontend/src/features/VesselSidebar/actions/TrackRequest/utils.ts rename to frontend/src/features/Vessel/components/VesselSidebar/actions/TrackRequest/utils.ts diff --git a/frontend/src/features/VesselSidebar/actions/VesselSidebarActionButton.tsx b/frontend/src/features/Vessel/components/VesselSidebar/actions/VesselSidebarActionButton.tsx similarity index 89% rename from frontend/src/features/VesselSidebar/actions/VesselSidebarActionButton.tsx rename to frontend/src/features/Vessel/components/VesselSidebar/actions/VesselSidebarActionButton.tsx index d6d8f4612c..1b0c042dc8 100644 --- a/frontend/src/features/VesselSidebar/actions/VesselSidebarActionButton.tsx +++ b/frontend/src/features/Vessel/components/VesselSidebar/actions/VesselSidebarActionButton.tsx @@ -1,6 +1,6 @@ import styled from 'styled-components' -import { MapButton } from '../../MainWindow/components/MapButtons/MapButton' +import { MapButton } from '../../../../MainWindow/components/MapButtons/MapButton' export const VesselSidebarActionButton = styled(MapButton)<{ backgroundColor?: string diff --git a/frontend/src/features/VesselSidebar/actions/animate_to_track/index.tsx b/frontend/src/features/Vessel/components/VesselSidebar/actions/animate_to_track/index.tsx similarity index 79% rename from frontend/src/features/VesselSidebar/actions/animate_to_track/index.tsx rename to frontend/src/features/Vessel/components/VesselSidebar/actions/animate_to_track/index.tsx index f6e65fee36..55fdd85400 100644 --- a/frontend/src/features/VesselSidebar/actions/animate_to_track/index.tsx +++ b/frontend/src/features/Vessel/components/VesselSidebar/actions/animate_to_track/index.tsx @@ -1,8 +1,8 @@ import styled from 'styled-components' -import { animateToExtent } from '../../../../domain/shared_slices/Map' -import { useMainAppDispatch } from '../../../../hooks/useMainAppDispatch' -import { useMainAppSelector } from '../../../../hooks/useMainAppSelector' +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 { VesselSidebarActionButton } from '../VesselSidebarActionButton' diff --git a/frontend/src/features/VesselSidebar/actions/hide_non_selected_vessels/index.tsx b/frontend/src/features/Vessel/components/VesselSidebar/actions/hide_non_selected_vessels/index.tsx similarity index 85% rename from frontend/src/features/VesselSidebar/actions/hide_non_selected_vessels/index.tsx rename to frontend/src/features/Vessel/components/VesselSidebar/actions/hide_non_selected_vessels/index.tsx index 3497614d5f..1ce59f2268 100644 --- a/frontend/src/features/VesselSidebar/actions/hide_non_selected_vessels/index.tsx +++ b/frontend/src/features/Vessel/components/VesselSidebar/actions/hide_non_selected_vessels/index.tsx @@ -1,9 +1,9 @@ import { THEME } from '@mtes-mct/monitor-ui' import styled from 'styled-components' -import { setHideNonSelectedVessels } from '../../../../domain/shared_slices/Vessel' -import { useMainAppDispatch } from '../../../../hooks/useMainAppDispatch' -import { useMainAppSelector } from '../../../../hooks/useMainAppSelector' +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 { VesselSidebarActionButton } from '../VesselSidebarActionButton' diff --git a/frontend/src/features/VesselSidebar/actions/show_fishing_activities/index.tsx b/frontend/src/features/Vessel/components/VesselSidebar/actions/show_fishing_activities/index.tsx similarity index 88% rename from frontend/src/features/VesselSidebar/actions/show_fishing_activities/index.tsx rename to frontend/src/features/Vessel/components/VesselSidebar/actions/show_fishing_activities/index.tsx index 0107d1dd66..076d2feb1c 100644 --- a/frontend/src/features/VesselSidebar/actions/show_fishing_activities/index.tsx +++ b/frontend/src/features/Vessel/components/VesselSidebar/actions/show_fishing_activities/index.tsx @@ -2,11 +2,11 @@ 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 { useMainAppDispatch } from '../../../../../../hooks/useMainAppDispatch' +import { useMainAppSelector } from '../../../../../../hooks/useMainAppSelector' +import { useGetLogbookUseCase } from '../../../../../Logbook/hooks/useGetLogbookUseCase' +import { logbookActions } from '../../../../../Logbook/slice' import ShowFishingActivitiesSVG from '../../../icons/Bouton_afficher_messages_JPE_sur_piste.svg?react' -import { useGetLogbookUseCase } from '../../../Logbook/hooks/useGetLogbookUseCase' -import { logbookActions } from '../../../Logbook/slice' import { VesselSidebarActionButton } from '../VesselSidebarActionButton' export function ShowFishingActivitiesOnMap({ isSidebarOpen }) { diff --git a/frontend/src/features/VesselSidebar/common/FlatKeyValue.tsx b/frontend/src/features/Vessel/components/VesselSidebar/common/FlatKeyValue.tsx similarity index 100% rename from frontend/src/features/VesselSidebar/common/FlatKeyValue.tsx rename to frontend/src/features/Vessel/components/VesselSidebar/common/FlatKeyValue.tsx diff --git a/frontend/src/features/VesselSidebar/common/FlatTwoColumnKeyValue.tsx b/frontend/src/features/Vessel/components/VesselSidebar/common/FlatTwoColumnKeyValue.tsx similarity index 100% rename from frontend/src/features/VesselSidebar/common/FlatTwoColumnKeyValue.tsx rename to frontend/src/features/Vessel/components/VesselSidebar/common/FlatTwoColumnKeyValue.tsx diff --git a/frontend/src/features/VesselSidebar/common_styles/YearList.style.tsx b/frontend/src/features/Vessel/components/VesselSidebar/common_styles/YearList.style.tsx similarity index 94% rename from frontend/src/features/VesselSidebar/common_styles/YearList.style.tsx rename to frontend/src/features/Vessel/components/VesselSidebar/common_styles/YearList.style.tsx index d12aad95ff..288536681a 100644 --- a/frontend/src/features/VesselSidebar/common_styles/YearList.style.tsx +++ b/frontend/src/features/Vessel/components/VesselSidebar/common_styles/YearList.style.tsx @@ -1,6 +1,6 @@ import styled from 'styled-components' -import { COLORS } from '../../../constants/constants' +import { COLORS } from '../../../../../constants/constants' import ChevronIconSVG from '../../icons/Chevron_simple_gris.svg?react' import type { HTMLProps } from 'react' diff --git a/frontend/src/features/VesselSidebar/common_styles/common.style.tsx b/frontend/src/features/Vessel/components/VesselSidebar/common_styles/common.style.tsx similarity index 100% rename from frontend/src/features/VesselSidebar/common_styles/common.style.tsx rename to frontend/src/features/Vessel/components/VesselSidebar/common_styles/common.style.tsx diff --git a/frontend/src/features/VesselSidebar/index.tsx b/frontend/src/features/Vessel/components/VesselSidebar/index.tsx similarity index 94% rename from frontend/src/features/VesselSidebar/index.tsx rename to frontend/src/features/Vessel/components/VesselSidebar/index.tsx index 550a0dc25d..7be4fee00d 100644 --- a/frontend/src/features/VesselSidebar/index.tsx +++ b/frontend/src/features/Vessel/components/VesselSidebar/index.tsx @@ -7,8 +7,8 @@ import { ShowFishingActivitiesOnMap } from './actions/show_fishing_activities' import { TrackRequest } from './actions/TrackRequest' import { Body } from './Body' import { Tabs } from './Tabs' -import { useMainAppSelector } from '../../hooks/useMainAppSelector' -import { MapComponent } from '../commonStyles/MapComponent' +import { useMainAppSelector } from '../../../../hooks/useMainAppSelector' +import { MapComponent } from '../../../commonStyles/MapComponent' export function VesselSidebar() { const rightMenuIsOpen = useMainAppSelector(state => state.global.rightMenuIsOpen) diff --git a/frontend/src/features/VesselSidebar/risk_factor/RiskFactorBox.tsx b/frontend/src/features/Vessel/components/VesselSidebar/risk_factor/RiskFactorBox.tsx similarity index 94% rename from frontend/src/features/VesselSidebar/risk_factor/RiskFactorBox.tsx rename to frontend/src/features/Vessel/components/VesselSidebar/risk_factor/RiskFactorBox.tsx index bbbd6a4760..741235d271 100644 --- a/frontend/src/features/VesselSidebar/risk_factor/RiskFactorBox.tsx +++ b/frontend/src/features/Vessel/components/VesselSidebar/risk_factor/RiskFactorBox.tsx @@ -1,6 +1,6 @@ import styled from 'styled-components' -import { COLORS } from '../../../constants/constants' +import { COLORS } from '../../../../../constants/constants' import type { CSSProperties } from 'react' diff --git a/frontend/src/features/VesselSidebar/risk_factor/RiskFactorCursor.tsx b/frontend/src/features/Vessel/components/VesselSidebar/risk_factor/RiskFactorCursor.tsx similarity index 100% rename from frontend/src/features/VesselSidebar/risk_factor/RiskFactorCursor.tsx rename to frontend/src/features/Vessel/components/VesselSidebar/risk_factor/RiskFactorCursor.tsx diff --git a/frontend/src/features/VesselSidebar/risk_factor/RiskFactorExplanationModal.tsx b/frontend/src/features/Vessel/components/VesselSidebar/risk_factor/RiskFactorExplanationModal.tsx similarity index 97% rename from frontend/src/features/VesselSidebar/risk_factor/RiskFactorExplanationModal.tsx rename to frontend/src/features/Vessel/components/VesselSidebar/risk_factor/RiskFactorExplanationModal.tsx index eff17ce3c0..834a48e46f 100644 --- a/frontend/src/features/VesselSidebar/risk_factor/RiskFactorExplanationModal.tsx +++ b/frontend/src/features/Vessel/components/VesselSidebar/risk_factor/RiskFactorExplanationModal.tsx @@ -8,9 +8,9 @@ import { getImpactRiskFactorText, getProbabilityRiskFactorText, getRiskFactorColor -} from '../../../domain/entities/vessel/riskFactor' -import { StyledModalHeader } from '../../commonComponents/StyledModalHeader' -import { basePrimaryButton, SecondaryButton } from '../../commonStyles/Buttons.style' +} 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' diff --git a/frontend/src/features/VesselSidebar/risk_factor/RiskFactorExplanationSchema.tsx b/frontend/src/features/Vessel/components/VesselSidebar/risk_factor/RiskFactorExplanationSchema.tsx similarity index 97% rename from frontend/src/features/VesselSidebar/risk_factor/RiskFactorExplanationSchema.tsx rename to frontend/src/features/Vessel/components/VesselSidebar/risk_factor/RiskFactorExplanationSchema.tsx index 3dbeeeb199..f7e5012d7e 100644 --- a/frontend/src/features/VesselSidebar/risk_factor/RiskFactorExplanationSchema.tsx +++ b/frontend/src/features/Vessel/components/VesselSidebar/risk_factor/RiskFactorExplanationSchema.tsx @@ -1,7 +1,7 @@ import styled from 'styled-components' import { RiskFactorBox } from './RiskFactorBox' -import { COLORS } from '../../../constants/constants' +import { COLORS } from '../../../../../constants/constants' 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' diff --git a/frontend/src/features/VesselSidebar/risk_factor/RiskFactorResume.tsx b/frontend/src/features/Vessel/components/VesselSidebar/risk_factor/RiskFactorResume.tsx similarity index 97% rename from frontend/src/features/VesselSidebar/risk_factor/RiskFactorResume.tsx rename to frontend/src/features/Vessel/components/VesselSidebar/risk_factor/RiskFactorResume.tsx index cd76e04267..6e5bb95fcf 100644 --- a/frontend/src/features/VesselSidebar/risk_factor/RiskFactorResume.tsx +++ b/frontend/src/features/Vessel/components/VesselSidebar/risk_factor/RiskFactorResume.tsx @@ -13,9 +13,9 @@ import { getImpactRiskFactorText, getProbabilityRiskFactorText, getRiskFactorColor -} from '../../../domain/entities/vessel/riskFactor' -import { useMainAppSelector } from '../../../hooks/useMainAppSelector' -import { ChevronIcon } from '../../commonStyles/icons/ChevronIcon.style' +} from '../../../../../domain/entities/vessel/riskFactor' +import { useMainAppSelector } from '../../../../../hooks/useMainAppSelector' +import { ChevronIcon } from '../../../../commonStyles/icons/ChevronIcon.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' diff --git a/frontend/src/features/VesselSidebar/risk_factor/details/DetectabilityRiskFactorDetails.tsx b/frontend/src/features/Vessel/components/VesselSidebar/risk_factor/details/DetectabilityRiskFactorDetails.tsx similarity index 96% rename from frontend/src/features/VesselSidebar/risk_factor/details/DetectabilityRiskFactorDetails.tsx rename to frontend/src/features/Vessel/components/VesselSidebar/risk_factor/details/DetectabilityRiskFactorDetails.tsx index 3a5157e0ad..fd3413df85 100644 --- a/frontend/src/features/VesselSidebar/risk_factor/details/DetectabilityRiskFactorDetails.tsx +++ b/frontend/src/features/Vessel/components/VesselSidebar/risk_factor/details/DetectabilityRiskFactorDetails.tsx @@ -4,9 +4,9 @@ import { getControlPriorityLevel, getControlRateRiskFactorText, getRiskFactorColor -} from '../../../../domain/entities/vessel/riskFactor' -import { useMainAppSelector } from '../../../../hooks/useMainAppSelector' -import { getDate } from '../../../../utils' +} from '../../../../../../domain/entities/vessel/riskFactor' +import { useMainAppSelector } from '../../../../../../hooks/useMainAppSelector' +import { getDate } from '../../../../../../utils' import { RiskFactorCursor } from '../RiskFactorCursor' type DetectabilityRiskFactorDetailsProps = { diff --git a/frontend/src/features/VesselSidebar/risk_factor/details/ImpactRiskFactorDetails.tsx b/frontend/src/features/Vessel/components/VesselSidebar/risk_factor/details/ImpactRiskFactorDetails.tsx similarity index 98% rename from frontend/src/features/VesselSidebar/risk_factor/details/ImpactRiskFactorDetails.tsx rename to frontend/src/features/Vessel/components/VesselSidebar/risk_factor/details/ImpactRiskFactorDetails.tsx index a581169a42..81601376fa 100644 --- a/frontend/src/features/VesselSidebar/risk_factor/details/ImpactRiskFactorDetails.tsx +++ b/frontend/src/features/Vessel/components/VesselSidebar/risk_factor/details/ImpactRiskFactorDetails.tsx @@ -1,7 +1,7 @@ import { useEffect, useRef, useState } from 'react' import styled from 'styled-components' -import { useMainAppSelector } from '../../../../hooks/useMainAppSelector' +import { useMainAppSelector } from '../../../../../../hooks/useMainAppSelector' import InfoSVG from '../../../icons/Information.svg?react' export function ImpactRiskFactorDetails({ isOpen }) { diff --git a/frontend/src/features/VesselSidebar/risk_factor/details/ProbabilityRiskFactorDetails.tsx b/frontend/src/features/Vessel/components/VesselSidebar/risk_factor/details/ProbabilityRiskFactorDetails.tsx similarity index 96% rename from frontend/src/features/VesselSidebar/risk_factor/details/ProbabilityRiskFactorDetails.tsx rename to frontend/src/features/Vessel/components/VesselSidebar/risk_factor/details/ProbabilityRiskFactorDetails.tsx index d83b9d2726..d0f9fd346a 100644 --- a/frontend/src/features/VesselSidebar/risk_factor/details/ProbabilityRiskFactorDetails.tsx +++ b/frontend/src/features/Vessel/components/VesselSidebar/risk_factor/details/ProbabilityRiskFactorDetails.tsx @@ -1,7 +1,7 @@ import styled from 'styled-components' -import { COLORS } from '../../../../constants/constants' -import { useMainAppSelector } from '../../../../hooks/useMainAppSelector' +import { COLORS } from '../../../../../../constants/constants' +import { useMainAppSelector } from '../../../../../../hooks/useMainAppSelector' import { InfractionsSummary } from '../../Controls/InfractionsSummary' export function ProbabilityRiskFactorDetails({ isOpen }) { diff --git a/frontend/src/features/VesselSidebar/warnings/AlertWarning.tsx b/frontend/src/features/Vessel/components/VesselSidebar/warnings/AlertWarning.tsx similarity index 88% rename from frontend/src/features/VesselSidebar/warnings/AlertWarning.tsx rename to frontend/src/features/Vessel/components/VesselSidebar/warnings/AlertWarning.tsx index 7dfe7f0d63..27ea8face2 100644 --- a/frontend/src/features/VesselSidebar/warnings/AlertWarning.tsx +++ b/frontend/src/features/Vessel/components/VesselSidebar/warnings/AlertWarning.tsx @@ -1,12 +1,12 @@ import { batch } from 'react-redux' import styled from 'styled-components' -import { SideWindowMenuKey } from '../../../domain/entities/sideWindow/constants' -import { useMainAppDispatch } from '../../../hooks/useMainAppDispatch' +import { SideWindowMenuKey } from '../../../../../domain/entities/sideWindow/constants' +import { useMainAppDispatch } from '../../../../../hooks/useMainAppDispatch' +import { getAlertNameFromType } from '../../../../SideWindow/Alert/AlertListAndReportingList/utils' +import { focusOnAlert } from '../../../../SideWindow/Alert/slice' +import { openSideWindowPath } from '../../../../SideWindow/useCases/openSideWindowPath' import AlertSVG from '../../icons/Icone_alertes.svg?react' -import { getAlertNameFromType } from '../../SideWindow/Alert/AlertListAndReportingList/utils' -import { focusOnAlert } from '../../SideWindow/Alert/slice' -import { openSideWindowPath } from '../../SideWindow/useCases/openSideWindowPath' export function AlertWarning({ selectedVessel }) { const dispatch = useMainAppDispatch() diff --git a/frontend/src/features/VesselSidebar/warnings/BeaconMalfunctionWarning.tsx b/frontend/src/features/Vessel/components/VesselSidebar/warnings/BeaconMalfunctionWarning.tsx similarity index 83% rename from frontend/src/features/VesselSidebar/warnings/BeaconMalfunctionWarning.tsx rename to frontend/src/features/Vessel/components/VesselSidebar/warnings/BeaconMalfunctionWarning.tsx index 515d18f967..12fe11358e 100644 --- a/frontend/src/features/VesselSidebar/warnings/BeaconMalfunctionWarning.tsx +++ b/frontend/src/features/Vessel/components/VesselSidebar/warnings/BeaconMalfunctionWarning.tsx @@ -1,11 +1,11 @@ import { THEME } from '@mtes-mct/monitor-ui' import styled from 'styled-components' -import { SideWindowMenuKey } from '../../../domain/entities/sideWindow/constants' -import { openBeaconMalfunctionInKanban } from '../../../domain/use_cases/beaconMalfunction/openBeaconMalfunctionInKanban' -import { useMainAppDispatch } from '../../../hooks/useMainAppDispatch' +import { SideWindowMenuKey } from '../../../../../domain/entities/sideWindow/constants' +import { openBeaconMalfunctionInKanban } from '../../../../../domain/use_cases/beaconMalfunction/openBeaconMalfunctionInKanban' +import { useMainAppDispatch } from '../../../../../hooks/useMainAppDispatch' +import { openSideWindowPath } from '../../../../SideWindow/useCases/openSideWindowPath' import BeaconMalfunctionSVG from '../../icons/Icone_VMS_dark.svg?react' -import { openSideWindowPath } from '../../SideWindow/useCases/openSideWindowPath' export function BeaconMalfunctionWarning({ selectedVessel }) { const dispatch = useMainAppDispatch() diff --git a/frontend/src/features/map/overlays/map_menu/TrackRangeModal.jsx b/frontend/src/features/map/overlays/map_menu/TrackRangeModal.jsx index 9f92cc137f..af540e8738 100644 --- a/frontend/src/features/map/overlays/map_menu/TrackRangeModal.jsx +++ b/frontend/src/features/map/overlays/map_menu/TrackRangeModal.jsx @@ -1,7 +1,7 @@ import styled from 'styled-components' import { COLORS } from '../../../../constants/constants' import { Modal } from 'rsuite' -import { DateRange } from '../../../VesselSidebar/actions/TrackRequest/DateRange' +import { DateRange } from '../../../Vessel/components/VesselSidebar/actions/TrackRequest/DateRange' import { StyledModalHeader } from '../../../commonComponents/StyledModalHeader' /** @@ -17,18 +17,10 @@ import { StyledModalHeader } from '../../../commonComponents/StyledModalHeader' */ export const TrackRangeModal = ({ isOpen, onChange, onClose, selectedDates }) => { return ( - + - - Afficher la piste VMS sur une période précise - + Afficher la piste VMS sur une période précise