From fe61323da7409b62d3432b964475082e9e3383bb Mon Sep 17 00:00:00 2001 From: Andreas Helms Date: Mon, 9 Dec 2024 11:35:58 +0100 Subject: [PATCH] fix(itinerary-page): scooter connections not showing up --- app/component/ItineraryPage.js | 2 ++ app/component/ItineraryPageUtils.js | 13 +++++++++++-- app/component/TransitLeg.js | 8 +++++--- 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/app/component/ItineraryPage.js b/app/component/ItineraryPage.js index e0dce7fe8b..335530ff2f 100644 --- a/app/component/ItineraryPage.js +++ b/app/component/ItineraryPage.js @@ -93,6 +93,8 @@ const streetHashes = [ streetHash.bikeAndVehicle, streetHash.car, streetHash.parkAndRide, + streetHash.scooter, + streetHash.onDemandTaxi, ]; const showVehiclesThresholdMinutes = 720; const emptyPlans = { diff --git a/app/component/ItineraryPageUtils.js b/app/component/ItineraryPageUtils.js index c08973536a..f033eebc06 100644 --- a/app/component/ItineraryPageUtils.js +++ b/app/component/ItineraryPageUtils.js @@ -19,7 +19,12 @@ import { import { getMapLayerOptions } from '../util/mapLayerUtils'; import { streetHash } from '../util/path'; -export const noTransitHash = [streetHash.walk, streetHash.bike, streetHash.car]; +export const noTransitHash = [ + streetHash.walk, + streetHash.bike, + streetHash.car, + streetHash.scooter, +]; /** * Returns the index of selected itinerary. Attempts to look for @@ -69,7 +74,11 @@ export function getSelectedItineraryIndex( // this func is a bit fuzzy because it compares strings and numbers export function showDetailView(hash, secondHash, itineraries) { - if (hash === streetHash.bikeAndVehicle || hash === streetHash.parkAndRide) { + if ( + hash === streetHash.bikeAndVehicle || + hash === streetHash.parkAndRide || + hash === streetHash.scooter + ) { // note that '0' < 1 in javascript, because strings are converted to numbers return secondHash < itineraries.length; } diff --git a/app/component/TransitLeg.js b/app/component/TransitLeg.js index 0de482dcf2..fa3134aecb 100644 --- a/app/component/TransitLeg.js +++ b/app/component/TransitLeg.js @@ -529,10 +529,12 @@ class TransitLeg extends React.Component { to={ (alert.route && alert.route.gtfsId && + leg.route && + leg.trip && `/${PREFIX_ROUTES}/${leg.route.gtfsId}/${PREFIX_DISRUPTION}/${leg.trip.pattern.code}`) || - (alert.stop && - alert.stop.gtfsId && - `/${PREFIX_STOPS}/${alert.stop.gtfsId}/${PREFIX_DISRUPTION}/`) + (alert.stop && alert.stop.gtfsId + ? `/${PREFIX_STOPS}/${alert.stop.gtfsId}/${PREFIX_DISRUPTION}/` + : '') } className="disruption-link" >