From 169ac6dfd557f3ede3c06dd831954d1df53ecf07 Mon Sep 17 00:00:00 2001 From: lwih Date: Tue, 19 Nov 2024 18:35:21 +0100 Subject: [PATCH 1/2] fix: fix validation for ActionRescueEntity --- .../entities/mission/nav/action/ActionRescueEntity.kt | 1 + .../components/elements/patchable-monitor-daterange.tsx | 6 +----- .../components/elements/actions/action-control-nav.tsx | 2 -- .../components/elements/actions/action-status-form.tsx | 3 --- 4 files changed, 2 insertions(+), 10 deletions(-) diff --git a/backend/src/main/kotlin/fr/gouv/dgampa/rapportnav/domain/entities/mission/nav/action/ActionRescueEntity.kt b/backend/src/main/kotlin/fr/gouv/dgampa/rapportnav/domain/entities/mission/nav/action/ActionRescueEntity.kt index 7b524264a..3dab17a2b 100644 --- a/backend/src/main/kotlin/fr/gouv/dgampa/rapportnav/domain/entities/mission/nav/action/ActionRescueEntity.kt +++ b/backend/src/main/kotlin/fr/gouv/dgampa/rapportnav/domain/entities/mission/nav/action/ActionRescueEntity.kt @@ -20,6 +20,7 @@ data class ActionRescueEntity( @MandatoryForStats override val startDateTimeUtc: Instant, + @MandatoryForStats override val endDateTimeUtc: Instant? = null, @MandatoryForStats diff --git a/frontend/src/features/common/components/elements/patchable-monitor-daterange.tsx b/frontend/src/features/common/components/elements/patchable-monitor-daterange.tsx index 6752fad76..b5a3422c0 100644 --- a/frontend/src/features/common/components/elements/patchable-monitor-daterange.tsx +++ b/frontend/src/features/common/components/elements/patchable-monitor-daterange.tsx @@ -1,7 +1,6 @@ import { FC } from 'react' import DateRangePicker from '@common/components/elements/dates/daterange-picker.tsx' import { DateRange } from '@mtes-mct/monitor-ui/types/definitions' -import useMissionDates from '@features/pam/mission/hooks/use-mission-dates.tsx' import { useParams } from 'react-router-dom' type PatchableMonitorDateRangeProps = { @@ -17,11 +16,9 @@ const PatchableMonitorDateRange: FC = ({ startDateTimeUtc, endDateTimeUtc, label, - isLight, - dateValidation + isLight }) => { const { missionId } = useParams() - const missionDates = useMissionDates(missionId) const onChangeDates = (value?: DateRange) => { if (value) { @@ -34,7 +31,6 @@ const PatchableMonitorDateRange: FC = ({ return ( = ({ action }) => { const navigate = useNavigate() const { missionId, actionId } = useParams() const isMissionFinished = useIsMissionFinished(missionId) - const missionDates = useMissionDates(missionId) const [observationsValue, setObservationsValue] = useState(undefined) const [identityControlledPersonValue, setIdentityControlledPersonValue] = useState(undefined) const [vesselIdentifierValue, setVesselIdentifierValue] = useState(undefined) diff --git a/frontend/src/features/pam/mission/components/elements/actions/action-status-form.tsx b/frontend/src/features/pam/mission/components/elements/actions/action-status-form.tsx index 7d4b85e8f..f9e192926 100644 --- a/frontend/src/features/pam/mission/components/elements/actions/action-status-form.tsx +++ b/frontend/src/features/pam/mission/components/elements/actions/action-status-form.tsx @@ -13,14 +13,12 @@ import { ActionDetailsProps } from './action-mapping.ts' import ActionHeader from './action-header.tsx' import useIsMissionFinished from '../../../hooks/use-is-mission-finished.tsx' import DatePicker from '@common/components/elements/dates/date-picker.tsx' -import useMissionDates from '@features/pam/mission/hooks/use-mission-dates.tsx' type ActionStatusFormProps = ActionDetailsProps const ActionStatusForm: React.FC = ({ action }) => { const navigate = useNavigate() const { missionId, actionId } = useParams() - const missionDates = useMissionDates(missionId) const isMissionFinished = useIsMissionFinished(missionId) const { data: navAction, loading, error } = useActionById(actionId, missionId, action.source, action.type) @@ -110,7 +108,6 @@ const ActionStatusForm: React.FC = ({ action }) => { onChange={async (nextUtcDate: Date) => { await onChange(nextUtcDate)('startDateTimeUtc') }} - allowedRange={missionDates} /> From b88adff4e173b1316a0b2b9c5e1a14ae893b48e6 Mon Sep 17 00:00:00 2001 From: lwih Date: Tue, 19 Nov 2024 20:28:17 +0100 Subject: [PATCH 2/2] fix: dependency check --- frontend/package-lock.json | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 1459e852f..41e43371b 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -1,12 +1,12 @@ { "name": "frontend", - "version": "2.3.1", + "version": "2.3.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "frontend", - "version": "2.3.1", + "version": "2.3.2", "dependencies": { "@apollo/client": "^3.11.0", "@mtes-mct/monitor-ui": "^24.6.0", @@ -2228,12 +2228,12 @@ "peer": true }, "node_modules/@bundled-es-modules/cookie": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@bundled-es-modules/cookie/-/cookie-2.0.0.tgz", - "integrity": "sha512-Or6YHg/kamKHpxULAdSqhGqnWFneIXu1NKvvfBBzKGwpVsYuFIQ5aBPHDnnoR3ghW1nvSkALd+EF9iMtY7Vjxw==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@bundled-es-modules/cookie/-/cookie-2.0.1.tgz", + "integrity": "sha512-8o+5fRPLNbjbdGRRmJj3h6Hh1AQJf2dk3qQ/5ZFb+PXkRNiSoMGGUKlsgLfrxneb72axVJyIYji64E2+nNfYyw==", "dev": true, "dependencies": { - "cookie": "^0.5.0" + "cookie": "^0.7.2" } }, "node_modules/@bundled-es-modules/statuses": { @@ -6334,9 +6334,9 @@ "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==" }, "node_modules/cookie": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.5.0.tgz", - "integrity": "sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==", + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.2.tgz", + "integrity": "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==", "dev": true, "engines": { "node": ">= 0.6" @@ -6400,9 +6400,9 @@ } }, "node_modules/cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", "dependencies": { "path-key": "^3.1.0", "shebang-command": "^2.0.0",