Skip to content

Commit d0ec6cf

Browse files
Merge branch 'dev' into realtime-destination
2 parents 5e7c4cb + 519b06d commit d0ec6cf

File tree

11 files changed

+204
-100
lines changed

11 files changed

+204
-100
lines changed

Diff for: __tests__/components/viewers/__snapshots__/nearby-view.js.snap

+4
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,7 @@ exports[`components > viewers > nearby view renders nothing on a blank page 1`]
239239
onKeyDown={[Function]}
240240
placeholder="components.NearbyView.searchNearby"
241241
role="combobox"
242+
spellCheck={false}
242243
value=""
243244
>
244245
<input
@@ -257,6 +258,7 @@ exports[`components > viewers > nearby view renders nothing on a blank page 1`]
257258
onKeyDown={[Function]}
258259
placeholder="components.NearbyView.searchNearby"
259260
role="combobox"
261+
spellCheck={false}
260262
value=""
261263
/>
262264
</styled__Input>
@@ -4517,6 +4519,7 @@ exports[`components > viewers > nearby view renders proper scooter dates 1`] = `
45174519
onKeyDown={[Function]}
45184520
placeholder="components.NearbyView.searchNearby"
45194521
role="combobox"
4522+
spellCheck={false}
45204523
value=""
45214524
>
45224525
<input
@@ -4535,6 +4538,7 @@ exports[`components > viewers > nearby view renders proper scooter dates 1`] = `
45354538
onKeyDown={[Function]}
45364539
placeholder="components.NearbyView.searchNearby"
45374540
role="combobox"
4541+
spellCheck={false}
45384542
value=""
45394543
/>
45404544
</styled__Input>

Diff for: example-config.yml

+12
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,18 @@ routingTypes:
348348

349349
# Itinerary options
350350
itinerary:
351+
# Provides an array of valid mode combinations that returned itineraries will be filtered against
352+
# If left blank, all itineraries deemed valid by OTP will be returned
353+
validModeCombinations: [
354+
['WALK'],
355+
['WALK', 'PERSONAL'],
356+
['WALK', 'TRANSIT', 'SHARED'],
357+
['WALK', 'SHARED'],
358+
['WALK', 'TRANSIT'],
359+
['WALK', 'TRANSIT', 'PERSONAL'],
360+
['WALK', 'TRANSIT', 'CAR'],
361+
['CAR']
362+
]
351363
# Show fares for each transit leg (false if omitted).
352364
# (Requires using LineItinerary.)
353365
showRouteFares: false

Diff for: lib/actions/apiV2.js

+17
Original file line numberDiff line numberDiff line change
@@ -982,6 +982,7 @@ export function routingQuery(searchId = null, updateSearchInReducer) {
982982
{}
983983

984984
const strictModes = !!config?.itinerary?.strictItineraryFiltering
985+
const validModeCombinations = config?.itinerary?.validModeCombinations
985986

986987
// Filter mode definitions based on active mode keys
987988
const activeModeButtons = config.modes?.modeButtons.filter((mb) =>
@@ -1114,6 +1115,22 @@ export function routingQuery(searchId = null, updateSearchInReducer) {
11141115
activeModeStrings.includes(SIMPLIFICATIONS[leg.mode])
11151116
)
11161117
)
1118+
// If "acceptableValidModeCombos" is provided, filter out itineraries that do not match our list of valid mode combinations
1119+
// (e.g. "WALK" + "DRIVE")
1120+
// TODO: Remove this once we switch to planConnection API
1121+
if (validModeCombinations?.length > 0) {
1122+
filteredItineraries = filteredItineraries.filter((itin) => {
1123+
const modeCombo = Array.from(
1124+
new Set(itin.legs.map((leg) => SIMPLIFICATIONS[leg.mode]))
1125+
)
1126+
return validModeCombinations.find(
1127+
(vc) =>
1128+
modeCombo.length === vc.length &&
1129+
vc.every((m) => modeCombo.includes(m))
1130+
)
1131+
})
1132+
}
1133+
11171134
// ... Otherwise return all itineraries.
11181135
}
11191136

Diff for: lib/actions/map.js

+19-2
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,30 @@ export function setLocationToCurrent(payload, intl) {
7777
return function (dispatch, getState) {
7878
const currentPosition = getState().otp.location.currentPosition
7979
if (currentPosition.error || !currentPosition.coords) return
80-
payload.location = {
80+
81+
const location = {
8182
category: 'CURRENT_LOCATION',
8283
lat: currentPosition.coords.latitude,
8384
lon: currentPosition.coords.longitude,
8485
name: intl.formatMessage({ id: 'actions.map.currentLocation' })
8586
}
86-
dispatch(settingLocation(payload))
87+
88+
// Immediately dispatch with current coordinates for responsiveness
89+
dispatch(
90+
settingLocation({
91+
...payload,
92+
location
93+
})
94+
)
95+
96+
// Then use setLocation to handle the reverse geocoding
97+
dispatch(
98+
setLocation({
99+
...payload,
100+
location,
101+
reverseGeocode: true
102+
})
103+
)
87104
}
88105
}
89106

Diff for: lib/components/narrative/save-trip-button.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ const SaveTripButton = ({
9393
}
9494

9595
return (
96-
<UnstyledLink className="pull-right" to={CREATE_TRIP_PATH}>
96+
<UnstyledLink className="pull-right" id="save-trip" to={CREATE_TRIP_PATH}>
9797
<IconWithText Icon={PlusCircle}>
9898
<FormattedMessage id="components.SaveTripButton.saveTripText" />
9999
</IconWithText>

Diff for: lib/components/util/company-icon-internal.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const CompanyIcon = ({
1212
fallbackContent = null,
1313
...otherProps
1414
}: Props): ReactElement | null => {
15-
const CompanyIcon = getCompanyIcon ? getCompanyIcon(company) : null
15+
const CompanyIcon = getCompanyIcon && company ? getCompanyIcon(company) : null
1616
return CompanyIcon ? (
1717
<Suspense fallback={<span>{company}</span>}>
1818
<CompanyIcon {...otherProps} />

Diff for: lib/components/viewers/nearby/rental-station.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const RentalStation = ({ companies, fromToSlot, place }: Props) => {
2525

2626
const stationIcon = (
2727
<CompanyIcon
28-
company={company}
28+
company={company || ''}
2929
fallbackContent={<Bicycle />}
3030
height={22}
3131
style={{ marginRight: '5px' }}

Diff for: lib/components/viewers/nearby/stop.tsx

+6
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,12 @@ export const patternArrayforStops = (
4242
p.pattern.route?.shortName === cur.pattern.route?.shortName
4343
} else if (p.pattern.route?.longName && cur.pattern.route?.longName) {
4444
sameRoute = p.pattern.route?.longName === cur.pattern.route?.longName
45+
} else if (
46+
p?.stoptimes?.[0]?.headsign &&
47+
cur?.stoptimes?.[0]?.headsign
48+
) {
49+
sameRoute =
50+
p?.stoptimes?.[0]?.headsign === cur?.stoptimes?.[0]?.headsign
4551
}
4652
return (
4753
extractHeadsignFromPattern(p.pattern) === currentHeadsign && sameRoute

Diff for: lib/components/viewers/nearby/vehicle-rent.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ const Vehicle = ({
9797
<IconWithText
9898
icon={
9999
<CompanyIcon
100-
company={vehicle.network}
100+
company={vehicle.network || ''}
101101
fallbackContent={getVehicleIcon(formFactor)}
102102
height={22}
103103
style={{ marginRight: '5px' }}

Diff for: package.json

+14-14
Original file line numberDiff line numberDiff line change
@@ -44,26 +44,26 @@
4444
"@floating-ui/react": "^0.19.2",
4545
"@opentripplanner/base-map": "4.0.0",
4646
"@opentripplanner/building-blocks": "2.1.0",
47-
"@opentripplanner/core-utils": "12.0.1",
48-
"@opentripplanner/endpoints-overlay": "3.1.0",
49-
"@opentripplanner/from-to-location-picker": "3.0.0",
50-
"@opentripplanner/geocoder": "^3.0.2",
47+
"@opentripplanner/core-utils": "12.0.2",
48+
"@opentripplanner/endpoints-overlay": "3.1.1",
49+
"@opentripplanner/from-to-location-picker": "3.0.1",
50+
"@opentripplanner/geocoder": "^3.0.3",
5151
"@opentripplanner/humanize-distance": "^1.2.0",
52-
"@opentripplanner/icons": "3.0.1",
53-
"@opentripplanner/location-field": "3.1.1",
54-
"@opentripplanner/itinerary-body": "6.1.1",
52+
"@opentripplanner/icons": "3.0.2",
53+
"@opentripplanner/itinerary-body": "6.1.3",
54+
"@opentripplanner/location-field": "3.1.3",
5555
"@opentripplanner/location-icon": "^1.4.1",
56-
"@opentripplanner/map-popup": "5.1.1",
56+
"@opentripplanner/map-popup": "5.1.2",
5757
"@opentripplanner/otp2-tile-overlay": "2.1.1",
5858
"@opentripplanner/park-and-ride-overlay": "3.0.0",
59-
"@opentripplanner/printable-itinerary": "3.0.0",
60-
"@opentripplanner/route-viewer-overlay": "3.0.0",
59+
"@opentripplanner/printable-itinerary": "3.0.1",
60+
"@opentripplanner/route-viewer-overlay": "3.0.1",
6161
"@opentripplanner/stop-viewer-overlay": "3.0.0",
6262
"@opentripplanner/stops-overlay": "6.0.0",
63-
"@opentripplanner/transit-vehicle-overlay": "5.0.1",
64-
"@opentripplanner/transitive-overlay": "4.0.1",
65-
"@opentripplanner/trip-details": "6.0.0",
66-
"@opentripplanner/trip-form": "4.1.2",
63+
"@opentripplanner/transit-vehicle-overlay": "5.0.2",
64+
"@opentripplanner/transitive-overlay": "4.0.3",
65+
"@opentripplanner/trip-details": "6.0.1",
66+
"@opentripplanner/trip-form": "4.1.3",
6767
"@opentripplanner/trip-viewer-overlay": "3.0.0",
6868
"@opentripplanner/vehicle-rental-overlay": "3.0.0",
6969
"@styled-icons/fa-regular": "^10.34.0",

0 commit comments

Comments
 (0)