From c94d2b322dae9560d92fc5e47ba5ec5faaf1ba0c Mon Sep 17 00:00:00 2001 From: j8seangel Date: Thu, 24 Oct 2024 13:59:52 +0200 Subject: [PATCH 1/3] show extended map controls --- apps/fishing-map/features/map/controls/MapControls.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/fishing-map/features/map/controls/MapControls.tsx b/apps/fishing-map/features/map/controls/MapControls.tsx index dcc7ee51c1..585ed322a8 100644 --- a/apps/fishing-map/features/map/controls/MapControls.tsx +++ b/apps/fishing-map/features/map/controls/MapControls.tsx @@ -21,6 +21,7 @@ import { selectIsAnyReportLocation, selectIsWorkspaceLocation, selectIsMapDrawing, + selectIsVesselGroupReportLocation, } from 'routes/routes.selectors' import { useDownloadDomElementAsImage } from 'hooks/screen.hooks' import { setInlineStyles, cleantInlineStyles } from 'utils/dom' @@ -70,10 +71,12 @@ const MapControls = ({ const isWorkspaceLocation = useSelector(selectIsWorkspaceLocation) const isVesselLocation = useSelector(selectIsAnyVesselLocation) const reportLocation = useSelector(selectIsAnyReportLocation) + const isVesselGroupReportLocation = useSelector(selectIsVesselGroupReportLocation) const isMapDrawing = useSelector(selectIsMapDrawing) const { isErrorNotificationEditing, toggleErrorNotification } = useMapErrorNotification() const showExtendedControls = - (isWorkspaceLocation || isVesselLocation || reportLocation) && !isMapDrawing + (isWorkspaceLocation || isVesselLocation || reportLocation || isVesselGroupReportLocation) && + !isMapDrawing const showScreenshot = !isVesselLocation && !reportLocation const rootElement = useRootElement() From b1227605f4ef199a0d8e895f15c4872320404b94 Mon Sep 17 00:00:00 2001 From: satellitestudiodesign Date: Thu, 24 Oct 2024 15:46:33 +0200 Subject: [PATCH 2/3] fix are names --- apps/fishing-map/features/vessel/areas/VesselAreas.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/fishing-map/features/vessel/areas/VesselAreas.tsx b/apps/fishing-map/features/vessel/areas/VesselAreas.tsx index 4d6e9215a1..7c1ecde666 100644 --- a/apps/fishing-map/features/vessel/areas/VesselAreas.tsx +++ b/apps/fishing-map/features/vessel/areas/VesselAreas.tsx @@ -25,6 +25,7 @@ import { TrackCategory, trackEvent } from 'features/app/analytics.hooks' import { selectVesselProfileColor } from 'features/dataviews/selectors/dataviews.instances.selectors' import { useMapFitBounds } from 'features/map/map-bounds.hooks' import { useDebouncedDispatchHighlightedEvent } from 'features/map/map-interactions.hooks' +import { useFetchRegionsData } from 'features/vessel/activity/event/event.hook' import { useVesselProfileEventsLoading } from '../vessel-events.hooks' import { VesselAreaSubsection } from '../vessel.types' import styles from './VesselAreas.module.css' @@ -98,6 +99,7 @@ const AreaTooltip = ({ payload }: any) => { } const VesselAreas = ({ updateAreaLayersVisibility }: VesselAreasProps) => { + useFetchRegionsData() const { t } = useTranslation() const { dispatchQueryParams } = useLocationConnect() const events = useSelector(selectVesselEventsFilteredByTimerange) From 65e15bf65ae442b9d44fccb0402ce99d7d7488b3 Mon Sep 17 00:00:00 2001 From: satellitestudiodesign Date: Thu, 24 Oct 2024 16:18:48 +0200 Subject: [PATCH 3/3] request only user vessel groups --- apps/fishing-map/features/vessel-groups/vessel-groups.slice.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/apps/fishing-map/features/vessel-groups/vessel-groups.slice.ts b/apps/fishing-map/features/vessel-groups/vessel-groups.slice.ts index 423ffe3e4f..b5489f5225 100644 --- a/apps/fishing-map/features/vessel-groups/vessel-groups.slice.ts +++ b/apps/fishing-map/features/vessel-groups/vessel-groups.slice.ts @@ -81,8 +81,7 @@ export const fetchVesselGroupsThunk = createAsyncThunk< const vesselGroupsParams = { ...DEFAULT_PAGINATION_PARAMS, cache: false, - // 'logged-user': true, - ...(ids?.length && { ids }), + ...(ids?.length ? { ids } : { 'logged-user': true }), } const url = `/vessel-groups?${stringify(vesselGroupsParams)}` const vesselGroups = await GFWAPI.fetch>(url, { cache: 'reload' })