Skip to content

Commit

Permalink
Merge pull request #5060 from HSLdevcom/DT-6182-scooter-fixes
Browse files Browse the repository at this point in the history
DT-6182 Scooter routing config
  • Loading branch information
vesameskanen authored Sep 4, 2024
2 parents a5e36fb + 6d750b5 commit 3e3c495
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 20 deletions.
19 changes: 8 additions & 11 deletions app/component/itinerary/BicycleLeg.js
Original file line number Diff line number Diff line change
Expand Up @@ -464,17 +464,14 @@ export default function BicycleLeg(
</div>
)}
{isScooter && (
<div>
<div className="divider" />
<VehicleRentalLeg
stationName={leg.from.name}
isScooter={isScooter}
vehicleRentalStation={leg.from.vehicleRentalStation}
returnBike
rentalVehicle={leg.from.rentalVehicle}
nextLegMode={nextLegMode}
/>
</div>
<VehicleRentalLeg
stationName={leg.from.name}
isScooter={isScooter}
vehicleRentalStation={leg.from.vehicleRentalStation}
returnBike
rentalVehicle={leg.from.rentalVehicle}
nextLegMode={nextLegMode}
/>
)}
</div>
</div>
Expand Down
19 changes: 12 additions & 7 deletions app/component/itinerary/WalkLeg.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,13 +173,18 @@ function WalkLeg(
) : (
<div>
{returnNotice ? (
<VehicleRentalLeg
isScooter={isScooter}
stationName={leg[toOrFrom].name}
vehicleRentalStation={leg[toOrFrom].vehicleRentalStation}
returnBike
rentalVehicle={leg.from.rentalVehicle}
/>
<>
<div className="divider" />
<VehicleRentalLeg
isScooter={isScooter}
stationName={leg[toOrFrom].name}
vehicleRentalStation={
leg[toOrFrom].vehicleRentalStation
}
returnBike
rentalVehicle={leg.from.rentalVehicle}
/>
</>
) : (
leg[toOrFrom].name
)}
Expand Down
5 changes: 3 additions & 2 deletions app/util/planParamUtil.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,11 +197,12 @@ export function planQueryNeeded(
);

case PLANTYPE.SCOOTERTRANSIT:
/* special logic: relaxed scooter query is made only if no networks allowed, and scooters are available for selection */
/* special logic: relaxed scooter query is made only if no networks allowed */
return (
config.transportModes.scooter.availableForSelection &&
transitModes.length > 0 &&
!wheelchair &&
(relaxSettings && config.transportModes.scooter.availableForSelection
(relaxSettings
? settings.scooterNetworks.length === 0
: settings.scooterNetworks.length > 0)
);
Expand Down

0 comments on commit 3e3c495

Please sign in to comment.