Skip to content

Commit

Permalink
fix(itinerary-page): scooter connections not showing up
Browse files Browse the repository at this point in the history
  • Loading branch information
Andreas Helms authored and Andreas Helms committed Dec 9, 2024
1 parent 7589f8c commit fe61323
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 5 deletions.
2 changes: 2 additions & 0 deletions app/component/ItineraryPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ const streetHashes = [
streetHash.bikeAndVehicle,
streetHash.car,
streetHash.parkAndRide,
streetHash.scooter,
streetHash.onDemandTaxi,
];
const showVehiclesThresholdMinutes = 720;
const emptyPlans = {
Expand Down
13 changes: 11 additions & 2 deletions app/component/ItineraryPageUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
}
Expand Down
8 changes: 5 additions & 3 deletions app/component/TransitLeg.js
Original file line number Diff line number Diff line change
Expand Up @@ -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"
>
Expand Down

0 comments on commit fe61323

Please sign in to comment.