From 8a2429425ef7c9ca8a6c19f5ffe08e3e6851f730 Mon Sep 17 00:00:00 2001 From: miles-grant-ibigroup Date: Wed, 6 Nov 2024 19:59:36 -0500 Subject: [PATCH 1/3] nearby: use stoptime headsigns if applicable --- lib/components/viewers/nearby/stop.tsx | 3 ++- lib/components/viewers/pattern-row.tsx | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/components/viewers/nearby/stop.tsx b/lib/components/viewers/nearby/stop.tsx index de0ccc0f5..176710618 100644 --- a/lib/components/viewers/nearby/stop.tsx +++ b/lib/components/viewers/nearby/stop.tsx @@ -37,7 +37,8 @@ const Stop = ({ }: Props): JSX.Element => { const patternRows = (stopData.stoptimesForPatterns || []) ?.reduce((acc, cur) => { - const currentHeadsign = extractHeadsignFromPattern(cur.pattern) + const currentHeadsign = + cur.stoptimes?.[0]?.headsign || extractHeadsignFromPattern(cur.pattern) const dupe = acc.findIndex((p) => { // TODO: use OTP_generated ids let sameRoute = false diff --git a/lib/components/viewers/pattern-row.tsx b/lib/components/viewers/pattern-row.tsx index 4f87a8c7a..e4bbef83c 100644 --- a/lib/components/viewers/pattern-row.tsx +++ b/lib/components/viewers/pattern-row.tsx @@ -113,6 +113,7 @@ const PatternRow = ({ id="components.NearbyView.headsign" values={{ destination: + stopTimes?.[0]?.headsign || extractHeadsignFromPattern(pattern) || (pattern.route.longName !== routeName && pattern.route.longName) From b54cf000afb5af7741bd28c777d2a82248a57bd5 Mon Sep 17 00:00:00 2001 From: miles-grant-ibigroup Date: Wed, 13 Nov 2024 15:29:09 -0500 Subject: [PATCH 2/3] revert unneeded change --- lib/components/viewers/nearby/stop.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/components/viewers/nearby/stop.tsx b/lib/components/viewers/nearby/stop.tsx index 176710618..de0ccc0f5 100644 --- a/lib/components/viewers/nearby/stop.tsx +++ b/lib/components/viewers/nearby/stop.tsx @@ -37,8 +37,7 @@ const Stop = ({ }: Props): JSX.Element => { const patternRows = (stopData.stoptimesForPatterns || []) ?.reduce((acc, cur) => { - const currentHeadsign = - cur.stoptimes?.[0]?.headsign || extractHeadsignFromPattern(cur.pattern) + const currentHeadsign = extractHeadsignFromPattern(cur.pattern) const dupe = acc.findIndex((p) => { // TODO: use OTP_generated ids let sameRoute = false From 8482e98426627918251d056fe04fa5e18506fc97 Mon Sep 17 00:00:00 2001 From: miles-grant-ibigroup Date: Wed, 13 Nov 2024 15:38:40 -0500 Subject: [PATCH 3/3] update snapshots --- .../components/viewers/__snapshots__/nearby-view.js.snap | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/__tests__/components/viewers/__snapshots__/nearby-view.js.snap b/__tests__/components/viewers/__snapshots__/nearby-view.js.snap index dd1dcddc1..a3a1b7bc5 100644 --- a/__tests__/components/viewers/__snapshots__/nearby-view.js.snap +++ b/__tests__/components/viewers/__snapshots__/nearby-view.js.snap @@ -30968,7 +30968,7 @@ exports[`components > viewers > nearby view renders proper scooter dates 1`] = ` id="components.NearbyView.headsign" values={ Object { - "destination": "Sand Point East Green Lake", + "destination": "Sand Point", } } > @@ -59945,7 +59945,7 @@ exports[`components > viewers > nearby view renders proper scooter dates 1`] = ` id="components.NearbyView.headsign" values={ Object { - "destination": "Kenmore P&R Roosevelt Station", + "destination": "Kenmore P&R", } } >