From 9c8d3dcbfa315bbe365da41c8097488291d1f3b9 Mon Sep 17 00:00:00 2001 From: Loup Theron Date: Thu, 15 Feb 2024 12:29:58 +0100 Subject: [PATCH 1/2] Add disabled fix --- frontend/src/features/VesselSidebar/Controls/Control.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frontend/src/features/VesselSidebar/Controls/Control.tsx b/frontend/src/features/VesselSidebar/Controls/Control.tsx index b73b45ed56..4e28ba8a87 100644 --- a/frontend/src/features/VesselSidebar/Controls/Control.tsx +++ b/frontend/src/features/VesselSidebar/Controls/Control.tsx @@ -1,3 +1,4 @@ +import { useMainAppSelector } from '@hooks/useMainAppSelector' import { Accent, Button, Tag, TagBullet, TagGroup, THEME } from '@mtes-mct/monitor-ui' import { useCallback, useMemo } from 'react' import styled from 'styled-components' @@ -23,6 +24,7 @@ type ControlProps = { export function Control({ control, isLastItem }: ControlProps) { const isSuperUser = useIsSuperUser() const dispatch = useMainAppDispatch() + const openedMissionId = useMainAppSelector(store => store.sideWindow.selectedPath.id) const numberOfInfractions = useMemo(() => getNumberOfInfractions(control), [control]) const gearAndSpeciesInfractionsLength = useMemo( () => control.gearInfractions.length + control.speciesInfractions.length, @@ -140,7 +142,7 @@ export function Control({ control, isLastItem }: ControlProps) { )} {isSuperUser && ( - + Ouvrir le contrĂ´le )} From 0a45613b6985bf572090ba5587849352a6e4b3d6 Mon Sep 17 00:00:00 2001 From: Loup Theron Date: Thu, 15 Feb 2024 15:08:29 +0100 Subject: [PATCH 2/2] Use draft --- frontend/src/features/VesselSidebar/Controls/Control.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/features/VesselSidebar/Controls/Control.tsx b/frontend/src/features/VesselSidebar/Controls/Control.tsx index 4e28ba8a87..1889d6fbda 100644 --- a/frontend/src/features/VesselSidebar/Controls/Control.tsx +++ b/frontend/src/features/VesselSidebar/Controls/Control.tsx @@ -24,7 +24,7 @@ type ControlProps = { export function Control({ control, isLastItem }: ControlProps) { const isSuperUser = useIsSuperUser() const dispatch = useMainAppDispatch() - const openedMissionId = useMainAppSelector(store => store.sideWindow.selectedPath.id) + const openedMissionDraft = useMainAppSelector(store => store.mission.draft) const numberOfInfractions = useMemo(() => getNumberOfInfractions(control), [control]) const gearAndSpeciesInfractionsLength = useMemo( () => control.gearInfractions.length + control.speciesInfractions.length, @@ -142,7 +142,7 @@ export function Control({ control, isLastItem }: ControlProps) { )} {isSuperUser && ( - + Ouvrir le contrĂ´le )}