From 0f4b36a696ec8195a908b884f70ec85485916efb Mon Sep 17 00:00:00 2001 From: amy-corson-ibigroup <115499534+amy-corson-ibigroup@users.noreply.github.com> Date: Wed, 10 Jan 2024 14:42:49 -0600 Subject: [PATCH 1/8] Fix colors in route viewer --- lib/components/narrative/metro/default-route-renderer.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/components/narrative/metro/default-route-renderer.tsx b/lib/components/narrative/metro/default-route-renderer.tsx index aed908708..63b7b060a 100644 --- a/lib/components/narrative/metro/default-route-renderer.tsx +++ b/lib/components/narrative/metro/default-route-renderer.tsx @@ -26,7 +26,7 @@ const Block = styled.span<{ color: string; isOnColoredBackground?: boolean }>` ` export type RouteRendererProps = { - leg: Leg & { onColoredBackground?: boolean } + leg: Leg & { onColoredBackground?: boolean; origColor: string } style?: CSSProperties } @@ -37,7 +37,7 @@ const DefaultRouteRenderer = ({ const routeTitle = leg.routeShortName || leg.routeLongName return ( Date: Wed, 10 Jan 2024 14:50:38 -0600 Subject: [PATCH 2/8] Fix route block crop --- lib/components/narrative/metro/default-route-renderer.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/components/narrative/metro/default-route-renderer.tsx b/lib/components/narrative/metro/default-route-renderer.tsx index 63b7b060a..5e4841764 100644 --- a/lib/components/narrative/metro/default-route-renderer.tsx +++ b/lib/components/narrative/metro/default-route-renderer.tsx @@ -7,7 +7,6 @@ const Block = styled.span<{ color: string; isOnColoredBackground?: boolean }>` border-radius: 5px; border-top: 5px solid #${(props) => props.color}; display: inline-block; - margin-top: -2px; padding: 3px 7px; /* Below is for route names that are too long: cut-off and show ellipsis. */ max-width: 150px; From 9031f06efecd87da387e7999d71e911a742b8873 Mon Sep 17 00:00:00 2001 From: Amy Corson <115499534+amy-corson-ibigroup@users.noreply.github.com> Date: Wed, 10 Jan 2024 15:11:13 -0600 Subject: [PATCH 3/8] Update lib/components/narrative/metro/default-route-renderer.tsx Co-authored-by: miles-grant-ibigroup <86619099+miles-grant-ibigroup@users.noreply.github.com> --- lib/components/narrative/metro/default-route-renderer.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/components/narrative/metro/default-route-renderer.tsx b/lib/components/narrative/metro/default-route-renderer.tsx index 5e4841764..7b153f433 100644 --- a/lib/components/narrative/metro/default-route-renderer.tsx +++ b/lib/components/narrative/metro/default-route-renderer.tsx @@ -25,7 +25,7 @@ const Block = styled.span<{ color: string; isOnColoredBackground?: boolean }>` ` export type RouteRendererProps = { - leg: Leg & { onColoredBackground?: boolean; origColor: string } + leg: Leg & { onColoredBackground?: boolean; origColor?: string } style?: CSSProperties } From dd5a7554ef32210f0bd6cbc8ae65d24a8d841077 Mon Sep 17 00:00:00 2001 From: amy-corson-ibigroup <115499534+amy-corson-ibigroup@users.noreply.github.com> Date: Wed, 10 Jan 2024 15:12:28 -0600 Subject: [PATCH 4/8] provide routeColor as fallback --- lib/components/narrative/metro/default-route-renderer.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/components/narrative/metro/default-route-renderer.tsx b/lib/components/narrative/metro/default-route-renderer.tsx index 5e4841764..4cc0b01ca 100644 --- a/lib/components/narrative/metro/default-route-renderer.tsx +++ b/lib/components/narrative/metro/default-route-renderer.tsx @@ -36,7 +36,7 @@ const DefaultRouteRenderer = ({ const routeTitle = leg.routeShortName || leg.routeLongName return ( Date: Thu, 11 Jan 2024 12:00:20 -0600 Subject: [PATCH 5/8] Revert adding origcolor to route viewer and instead fix color path --- lib/actions/apiV2.js | 4 ++-- lib/components/narrative/metro/default-route-renderer.tsx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/actions/apiV2.js b/lib/actions/apiV2.js index 5bca59ad8..2c581173f 100644 --- a/lib/actions/apiV2.js +++ b/lib/actions/apiV2.js @@ -711,7 +711,7 @@ export const findRoute = (params) => }, getState().otp.config.transitOperators ), - { color: newRoute?.route?.color, mode: newRoute.mode } + { color: newRoute?.color, mode: newRoute.mode } ).split('#')?.[1] newRoute.patterns = routePatterns @@ -784,7 +784,7 @@ export function findRoutes() { config.transitOperators ), { - color: route?.route?.color, + color: route?.color, mode: route.mode } ).split('#')?.[1] diff --git a/lib/components/narrative/metro/default-route-renderer.tsx b/lib/components/narrative/metro/default-route-renderer.tsx index 371d6cc12..c0d4e398e 100644 --- a/lib/components/narrative/metro/default-route-renderer.tsx +++ b/lib/components/narrative/metro/default-route-renderer.tsx @@ -25,7 +25,7 @@ const Block = styled.span<{ color: string; isOnColoredBackground?: boolean }>` ` export type RouteRendererProps = { - leg: Leg & { onColoredBackground?: boolean; origColor?: string } + leg: Leg & { onColoredBackground?: boolean } style?: CSSProperties } @@ -36,7 +36,7 @@ const DefaultRouteRenderer = ({ const routeTitle = leg.routeShortName || leg.routeLongName return ( Date: Thu, 11 Jan 2024 12:59:01 -0600 Subject: [PATCH 6/8] Correct path on route ids --- lib/actions/apiV2.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/actions/apiV2.js b/lib/actions/apiV2.js index 2c581173f..eeab2708e 100644 --- a/lib/actions/apiV2.js +++ b/lib/actions/apiV2.js @@ -707,7 +707,7 @@ export const findRoute = (params) => getRouteOperator( { agencyId: newRoute?.agency?.id, - id: newRoute?.route?.id + id: newRoute?.id }, getState().otp.config.transitOperators ), @@ -779,7 +779,7 @@ export function findRoutes() { getRouteOperator( { agencyId: route?.agency?.id, - id: route?.route?.id + id: route?.id }, config.transitOperators ), From f656b0bb5f8425cbd8005bd263fad55902103a36 Mon Sep 17 00:00:00 2001 From: amy-corson-ibigroup <115499534+amy-corson-ibigroup@users.noreply.github.com> Date: Thu, 11 Jan 2024 15:13:28 -0600 Subject: [PATCH 7/8] sneak in itinerary score comment --- lib/util/accessibility-routing.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/util/accessibility-routing.js b/lib/util/accessibility-routing.js index 5dd13690e..cadd30cfc 100644 --- a/lib/util/accessibility-routing.js +++ b/lib/util/accessibility-routing.js @@ -3,7 +3,8 @@ */ export const itineraryHasAccessibilityScore = (itinerary) => { return ( - // If accessibility score is 0, we still want to return true + // If accessibility score is 0, we still want to return true so use the -1 to + // make sure all scores are returned even if they're 0. itinerary.accessibilityScore !== null && itinerary.accessibilityScore > -1 ) } From bae49bb34e04a138d0b1ba3ec0dbbe594074297b Mon Sep 17 00:00:00 2001 From: amy-corson-ibigroup <115499534+amy-corson-ibigroup@users.noreply.github.com> Date: Thu, 11 Jan 2024 15:15:35 -0600 Subject: [PATCH 8/8] Update snapshots --- .../viewers/__snapshots__/stop-viewer.js.snap | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/__tests__/components/viewers/__snapshots__/stop-viewer.js.snap b/__tests__/components/viewers/__snapshots__/stop-viewer.js.snap index e93d8f57d..a42e0b1ab 100644 --- a/__tests__/components/viewers/__snapshots__/stop-viewer.js.snap +++ b/__tests__/components/viewers/__snapshots__/stop-viewer.js.snap @@ -1437,7 +1437,7 @@ exports[`components > viewers > stop viewer should render countdown times after title="20" > viewers > stop viewer should render countdown times for st title="20" > viewers > stop viewer should render times after midnight w title="20" > viewers > stop viewer should render with OTP transit index title="36" > viewers > stop viewer should render with TriMet transit in title="20" >