Skip to content

Commit 61d899c

Browse files
Merge pull request #550 from ibi-group/fare-table-route-long-name
fix(trip-details): support routes without a short name
2 parents 17e2482 + 523fd1d commit 61d899c

File tree

4 files changed

+16
-6
lines changed

4 files changed

+16
-6
lines changed

Diff for: __snapshots__/storybook.test.ts.snap

+3-4
Original file line numberDiff line numberDiff line change
@@ -241739,7 +241739,6 @@ exports[`Storyshots TripDetails Fare Leg Table Story Leg Products 1`] = `
241739241739
"routeColor": "0070c0",
241740241740
"routeId": "CommTrans:101",
241741241741
"routeLongName": "Mariner P&R - Aurora Village",
241742-
"routeShortName": "101",
241743241742
"routeTextColor": "ffffff",
241744241743
"routeType": 3,
241745241744
"serviceDate": "2023-01-23",
@@ -242313,7 +242312,7 @@ exports[`Storyshots TripDetails Fare Leg Table Story Leg Products 2`] = `
242313242312
<td
242314242313
className="no-zebra"
242315242314
>
242316-
101
242315+
Mariner P&R - Aurora Village
242317242316
</td>
242318242317
<td>
242319242318
$2.50
@@ -242391,7 +242390,7 @@ exports[`Storyshots TripDetails Fare Leg Table Story Leg Products 2`] = `
242391242390
<td
242392242391
className="no-zebra"
242393242392
>
242394-
101
242393+
Mariner P&R - Aurora Village
242395242394
</td>
242396242395
<td>
242397242396
$0.00
@@ -242446,7 +242445,7 @@ exports[`Storyshots TripDetails Fare Leg Table Story Leg Products 2`] = `
242446242445
<td
242447242446
className="no-zebra"
242448242447
>
242449-
101
242448+
Mariner P&R - Aurora Village
242450242449
</td>
242451242450
<td>
242452242451
$1.25

Diff for: packages/itinerary-body/src/__mocks__/itineraries/otp2-with-fareproducts.json

-1
Original file line numberDiff line numberDiff line change
@@ -728,7 +728,6 @@
728728
"length": 368
729729
},
730730
"steps": [],
731-
"routeShortName": "101",
732731
"routeLongName": "Mariner P&R - Aurora Village",
733732
"duration": 1560
734733
},

Diff for: packages/trip-details/src/fare-table.tsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,9 @@ const FareTypeTable = ({
113113
</TableHeader>
114114
{legs.map((leg, index) => (
115115
<tr key={index}>
116-
<td className="no-zebra">{leg.routeShortName}</td>
116+
<td className="no-zebra">
117+
{leg.routeShortName || leg.route || leg.routeLongName}
118+
</td>
117119
{colsToRender.map(col => {
118120
const fare = hasLegProducts
119121
? getLegCost(leg, col.riderCategory, col.fareContainer)

Diff for: yarn.lock

+10
Original file line numberDiff line numberDiff line change
@@ -2845,6 +2845,16 @@
28452845
resolved "https://registry.yarnpkg.com/@open-draft/until/-/until-1.0.3.tgz#db9cc719191a62e7d9200f6e7bab21c5b848adca"
28462846
integrity sha512-Aq58f5HiWdyDlFffbbSjAlv596h/cOnt2DO1w3DOC7OJ5EHs0hd/nycJfiu9RJbT6Yk6F1knnRRXNSpxoIVZ9Q==
28472847

2848+
"@opentripplanner/[email protected]":
2849+
version "1.3.4"
2850+
resolved "https://registry.yarnpkg.com/@opentripplanner/geocoder/-/geocoder-1.3.4.tgz#94f1b4085ab3005ef6c8960ab5f75387db29a123"
2851+
integrity sha512-Dqzkt5wRjTbgzUg79H5ZSHHI/OG58+jeQJaPUMkBzyx759hUiHKuj5X7VwDtF3LI9mfR7SUyxOtu4QQtNvyGmQ==
2852+
dependencies:
2853+
"@conveyal/geocoder-arcgis-geojson" "^0.0.3"
2854+
"@conveyal/lonlat" "^1.4.1"
2855+
isomorphic-mapzen-search "^1.6.1"
2856+
lodash.memoize "^4.1.2"
2857+
28482858
"@pmmmwh/react-refresh-webpack-plugin@^0.5.1":
28492859
version "0.5.4"
28502860
resolved "https://registry.yarnpkg.com/@pmmmwh/react-refresh-webpack-plugin/-/react-refresh-webpack-plugin-0.5.4.tgz#df0d0d855fc527db48aac93c218a0bf4ada41f99"

0 commit comments

Comments
 (0)