From c7806636557889ed772bdb82ff72d8896a6ca405 Mon Sep 17 00:00:00 2001 From: miles-grant-ibigroup Date: Mon, 27 Nov 2023 15:02:37 -0500 Subject: [PATCH 1/4] support larger custom route renderers --- lib/components/viewers/RouteRow.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/components/viewers/RouteRow.js b/lib/components/viewers/RouteRow.js index 9bc8631a2..b10893304 100644 --- a/lib/components/viewers/RouteRow.js +++ b/lib/components/viewers/RouteRow.js @@ -63,6 +63,7 @@ export const ModeIconElement = styled.span` const RouteDetailsContainer = styled.div` align-items: center; display: flex; + height: 36px; gap: 12px; margin-left: 5px; overflow: hidden; From d8e18f58d3c8416cc1dd9cea20b6dce175dd4c65 Mon Sep 17 00:00:00 2001 From: miles-grant-ibigroup Date: Mon, 27 Nov 2023 15:46:46 -0500 Subject: [PATCH 2/4] support larger route renderers --- lib/components/viewers/RouteRow.js | 3 ++- lib/components/viewers/viewers.css | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/components/viewers/RouteRow.js b/lib/components/viewers/RouteRow.js index b10893304..0e4021b76 100644 --- a/lib/components/viewers/RouteRow.js +++ b/lib/components/viewers/RouteRow.js @@ -63,7 +63,8 @@ export const ModeIconElement = styled.span` const RouteDetailsContainer = styled.div` align-items: center; display: flex; - height: 36px; + max-height: 180px; + min-height: 36px; gap: 12px; margin-left: 5px; overflow: hidden; diff --git a/lib/components/viewers/viewers.css b/lib/components/viewers/viewers.css index 5d4f4227b..8baf9efad 100644 --- a/lib/components/viewers/viewers.css +++ b/lib/components/viewers/viewers.css @@ -98,6 +98,7 @@ .otp .route-viewer .header-text.route-expanded span { margin: 0; padding: 0; + height: 100%; } /* stop viewer styles */ @@ -562,4 +563,4 @@ align-items: center; justify-content: center; padding-top: 10px; -} \ No newline at end of file +} From 35d70ccb87c4266d8e519de755e7b7a828ec6764 Mon Sep 17 00:00:00 2001 From: miles-grant-ibigroup Date: Mon, 27 Nov 2023 15:56:07 -0500 Subject: [PATCH 3/4] route viewer use custom colors manually --- lib/actions/apiV2.js | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/lib/actions/apiV2.js b/lib/actions/apiV2.js index 673ecabe5..91f39d870 100644 --- a/lib/actions/apiV2.js +++ b/lib/actions/apiV2.js @@ -700,10 +700,6 @@ export const findRoute = (params) => newRoute.patterns = routePatterns // TODO: avoid explicit behavior shift like this newRoute.v2 = true - newRoute.color = getRouteColorBasedOnSettings( - getRouteOperator(route, getState().otp.config.transitOperators), - route - ).split('#')[1] newRoute.mode = checkForRouteModeOverride( newRoute, getState().otp.config?.routeModeOverrides @@ -752,14 +748,12 @@ export function findRoutes() { // To initialize the route viewer, // convert the routes array to a dictionary indexed by route ids. return routes.reduce((result, route) => { - const { agency, id, longName, mode, shortName, type } = route + const { agency, color, id, longName, mode, shortName, type } = + route result[id] = { agencyId: agency.id, agencyName: agency.name, - color: getRouteColorBasedOnSettings( - getRouteOperator(route, config.transitOperators), - route - ).split('#')[1], + color, id, longName, mode: checkForRouteModeOverride( From d4bd0821943ba0bda9c54e49ee6b144d8699935a Mon Sep 17 00:00:00 2001 From: miles-grant-ibigroup Date: Tue, 5 Dec 2023 10:26:33 -0500 Subject: [PATCH 4/4] address pr feedback --- lib/components/viewers/RouteRow.js | 4 ++-- lib/components/viewers/viewers.css | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/components/viewers/RouteRow.js b/lib/components/viewers/RouteRow.js index 9a119e49f..8b794f7fe 100644 --- a/lib/components/viewers/RouteRow.js +++ b/lib/components/viewers/RouteRow.js @@ -63,10 +63,10 @@ export const ModeIconElement = styled.span` const RouteDetailsContainer = styled.div` align-items: center; display: flex; - max-height: 180px; - min-height: 36px; gap: 12px; margin-left: 5px; + max-height: 180px; + min-height: 36px; overflow: hidden; ` diff --git a/lib/components/viewers/viewers.css b/lib/components/viewers/viewers.css index 8baf9efad..5f9c9526a 100644 --- a/lib/components/viewers/viewers.css +++ b/lib/components/viewers/viewers.css @@ -96,9 +96,9 @@ gap: 10px; } .otp .route-viewer .header-text.route-expanded span { + height: 100%; margin: 0; padding: 0; - height: 100%; } /* stop viewer styles */