From a8ad8467ce9fab536e306efc492f95f5c87e4bc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Kv=C3=A1=C4=8Dek?= Date: Sun, 30 Jun 2024 02:38:31 +0200 Subject: [PATCH] Ve verejne casti s detailem planu ukazovat jen pouzite POI --- src/pages/public/pilotProfile/FlightPlanDetail.vue | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/pages/public/pilotProfile/FlightPlanDetail.vue b/src/pages/public/pilotProfile/FlightPlanDetail.vue index 6ca6b00..5e0287d 100644 --- a/src/pages/public/pilotProfile/FlightPlanDetail.vue +++ b/src/pages/public/pilotProfile/FlightPlanDetail.vue @@ -20,7 +20,7 @@ import {useAirspacesStore} from "stores/Airspaces"; import {usePointsOfInterestStore} from "stores/PointsOfInterest"; import {useAirportsStore} from "stores/Airports"; import {formatDatetime, minutesToHumanReadable} from "src/composables/datetimeUtils"; -import {useFlightPlanCalculations} from "src/composables/flightPlan"; +import {useFlightPlanCalculations, useFlightPlanUtils} from "src/composables/flightPlan"; import FlightPlanRouteTable from "components/flightPlans/FlightPlanRouteTable.vue"; import {useMeta} from "quasar"; import {metaData} from "src/composables/meta"; @@ -56,6 +56,13 @@ const {pointsOfInterest} = storeToRefs(usePointsOfInterestStore()); const {airspaces: airspacesData, areAirspacesLoading: isQueryRunning} = storeToRefs(useAirspacesStore()) const {airports} = storeToRefs(useAirportsStore()); +const {getMarkersFrom} = useFlightPlanUtils(); + +const usedPointsOfInterest = computed(() => { + const poisInTrackIds = getMarkersFrom(flightPlan.value).filter(m => !!m.pointOfInterestId).map(poi => poi.id); + return pointsOfInterest.value.filter(poi => poisInTrackIds.includes(poi.id)) +}); + const openedTab = ref("map"); const {getTotalDistance, getTotalDuration} = useFlightPlanCalculations(); @@ -75,7 +82,7 @@ const showInfoCard = computed(() => flightPlan.value.aircraft || flightPlan.valu