Skip to content

Commit

Permalink
Merge pull request #550 from ibi-group/fare-table-route-long-name
Browse files Browse the repository at this point in the history
fix(trip-details): support routes without a short name
  • Loading branch information
miles-grant-ibigroup authored Mar 7, 2023
2 parents 17e2482 + 523fd1d commit 61d899c
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 6 deletions.
7 changes: 3 additions & 4 deletions __snapshots__/storybook.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -241739,7 +241739,6 @@ exports[`Storyshots TripDetails Fare Leg Table Story Leg Products 1`] = `
"routeColor": "0070c0",
"routeId": "CommTrans:101",
"routeLongName": "Mariner P&R - Aurora Village",
"routeShortName": "101",
"routeTextColor": "ffffff",
"routeType": 3,
"serviceDate": "2023-01-23",
Expand Down Expand Up @@ -242313,7 +242312,7 @@ exports[`Storyshots TripDetails Fare Leg Table Story Leg Products 2`] = `
<td
className="no-zebra"
>
101
Mariner P&R - Aurora Village
</td>
<td>
$2.50
Expand Down Expand Up @@ -242391,7 +242390,7 @@ exports[`Storyshots TripDetails Fare Leg Table Story Leg Products 2`] = `
<td
className="no-zebra"
>
101
Mariner P&R - Aurora Village
</td>
<td>
$0.00
Expand Down Expand Up @@ -242446,7 +242445,7 @@ exports[`Storyshots TripDetails Fare Leg Table Story Leg Products 2`] = `
<td
className="no-zebra"
>
101
Mariner P&R - Aurora Village
</td>
<td>
$1.25
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -728,7 +728,6 @@
"length": 368
},
"steps": [],
"routeShortName": "101",
"routeLongName": "Mariner P&R - Aurora Village",
"duration": 1560
},
Expand Down
4 changes: 3 additions & 1 deletion packages/trip-details/src/fare-table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,9 @@ const FareTypeTable = ({
</TableHeader>
{legs.map((leg, index) => (
<tr key={index}>
<td className="no-zebra">{leg.routeShortName}</td>
<td className="no-zebra">
{leg.routeShortName || leg.route || leg.routeLongName}
</td>
{colsToRender.map(col => {
const fare = hasLegProducts
? getLegCost(leg, col.riderCategory, col.fareContainer)
Expand Down
10 changes: 10 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2845,6 +2845,16 @@
resolved "https://registry.yarnpkg.com/@open-draft/until/-/until-1.0.3.tgz#db9cc719191a62e7d9200f6e7bab21c5b848adca"
integrity sha512-Aq58f5HiWdyDlFffbbSjAlv596h/cOnt2DO1w3DOC7OJ5EHs0hd/nycJfiu9RJbT6Yk6F1knnRRXNSpxoIVZ9Q==

"@opentripplanner/[email protected]":
version "1.3.4"
resolved "https://registry.yarnpkg.com/@opentripplanner/geocoder/-/geocoder-1.3.4.tgz#94f1b4085ab3005ef6c8960ab5f75387db29a123"
integrity sha512-Dqzkt5wRjTbgzUg79H5ZSHHI/OG58+jeQJaPUMkBzyx759hUiHKuj5X7VwDtF3LI9mfR7SUyxOtu4QQtNvyGmQ==
dependencies:
"@conveyal/geocoder-arcgis-geojson" "^0.0.3"
"@conveyal/lonlat" "^1.4.1"
isomorphic-mapzen-search "^1.6.1"
lodash.memoize "^4.1.2"

"@pmmmwh/react-refresh-webpack-plugin@^0.5.1":
version "0.5.4"
resolved "https://registry.yarnpkg.com/@pmmmwh/react-refresh-webpack-plugin/-/react-refresh-webpack-plugin-0.5.4.tgz#df0d0d855fc527db48aac93c218a0bf4ada41f99"
Expand Down

0 comments on commit 61d899c

Please sign in to comment.