diff --git a/frontend/cypress/e2e/vessel_sidebar/fishing.spec.ts b/frontend/cypress/e2e/vessel_sidebar/logbook.spec.ts similarity index 96% rename from frontend/cypress/e2e/vessel_sidebar/fishing.spec.ts rename to frontend/cypress/e2e/vessel_sidebar/logbook.spec.ts index f7212328e6..a21566a315 100644 --- a/frontend/cypress/e2e/vessel_sidebar/fishing.spec.ts +++ b/frontend/cypress/e2e/vessel_sidebar/logbook.spec.ts @@ -1,6 +1,6 @@ /* eslint-disable no-undef */ -context('Vessel sidebar fishing tab', () => { +context('Vessel sidebar logbook tab', () => { beforeEach(() => { cy.loadPath('/#@-824534.42,6082993.21,8.70') }) @@ -93,16 +93,20 @@ context('Vessel sidebar fishing tab', () => { cy.get('*[data-cy="vessel-fishing-message"]').eq(7).contains('Fin de pêche') cy.get('*[data-cy="vessel-fishing-message"]').eq(8).contains('Préavis (notification de retour au port)') + cy.get('*[data-cy="vessel-fishing-message-body"]').eq(8).contains('MERLU NOIR DU CAP (HKC)') cy.get('*[data-cy="vessel-fishing-message"]').eq(9).contains('Retour au port') cy.get('*[data-cy="vessel-fishing-message"]').eq(10).contains('Déclaration de capture') cy.get('*[data-cy="vessel-fishing-message"]').eq(10).siblings().eq(1).contains('MESSAGE CORRIGÉ') + cy.get('*[data-cy="vessel-fishing-message-body"]').eq(10).contains('BONITE A DOS RAYE (BON)') cy.get('*[data-cy="vessel-fishing-message"]').eq(11).contains('Déclaration de rejets') + cy.get('*[data-cy="vessel-fishing-message-body"]').eq(11).contains('LANGOUSTINE (NEP)') cy.get('*[data-cy="vessel-fishing-message"]').eq(12).contains('Débarquement') cy.get('*[data-cy="vessel-fishing-message"]').eq(12).siblings().eq(1).contains('MESSAGE SUPPRIMÉ') + cy.get('*[data-cy="vessel-fishing-message-body"]').eq(12).contains('BONITE A DOS RAYE (BON)') }) it('Fishing Should contain the vessel FLUX logbook messages', () => { diff --git a/frontend/src/features/Logbook/Logbook.types.ts b/frontend/src/features/Logbook/Logbook.types.ts index f8d0fdc375..3c1f3c721b 100644 --- a/frontend/src/features/Logbook/Logbook.types.ts +++ b/frontend/src/features/Logbook/Logbook.types.ts @@ -175,6 +175,14 @@ export type CPSMessageValue = { mesh?: number } +export type LANMessageValue = { + catchLanded: LogbookCatch[] + landingDatetimeUtc: string + port: string + portName?: string + sender?: string +} + export type ProtectedSpeciesCatch = { careMinutes?: number comment?: string diff --git a/frontend/src/features/Logbook/components/VesselLogbook/LogbookMessages/messages/LANMessage.tsx b/frontend/src/features/Logbook/components/VesselLogbook/LogbookMessages/messages/LANMessage.tsx index 5c4e420cd3..aa3820de12 100644 --- a/frontend/src/features/Logbook/components/VesselLogbook/LogbookMessages/messages/LANMessage.tsx +++ b/frontend/src/features/Logbook/components/VesselLogbook/LogbookMessages/messages/LANMessage.tsx @@ -8,9 +8,14 @@ import { buildCatchArray } from '../../../../utils' import { WeightType } from '../constants' import { NoValue, Table, TableBody, TableKey, TableRow, TableValue, Zone, SpeciesList } from '../styles' -export function LANMessage({ message }) { +import type { LANMessageValue } from '@features/Logbook/Logbook.types' + +type LANMessageProps = { + message: LANMessageValue +} +export function LANMessage({ message }: LANMessageProps) { const catchesWithProperties = useMemo(() => { - if (!message?.catches) { + if (!message?.catchLanded) { return [] } diff --git a/frontend/src/features/Logbook/constants.ts b/frontend/src/features/Logbook/constants.ts index 97243d3b6a..5024f89fa3 100644 --- a/frontend/src/features/Logbook/constants.ts +++ b/frontend/src/features/Logbook/constants.ts @@ -92,7 +92,7 @@ export const LogbookMessageType = { code: 'LAN', displayCode: 'LAN', fullName: 'Débarquement', - isFilterable: false, + isFilterable: true, name: 'Débarquement' }, NOT_COE: {