Skip to content

Commit

Permalink
Merge pull request #1079 from opentripplanner/support-larger-route-re…
Browse files Browse the repository at this point in the history
…nderers

Support larger custom route renderers
  • Loading branch information
miles-grant-ibigroup authored Dec 12, 2023
2 parents 4cfbc1a + 875c270 commit 1e49780
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
12 changes: 3 additions & 9 deletions lib/actions/apiV2.js
Original file line number Diff line number Diff line change
Expand Up @@ -705,10 +705,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
Expand Down Expand Up @@ -757,14 +753,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(
Expand Down
2 changes: 2 additions & 0 deletions lib/components/viewers/RouteRow.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ const RouteDetailsContainer = styled.div`
display: flex;
gap: 12px;
margin-left: 5px;
max-height: 180px;
min-height: 36px;
overflow: hidden;
`

Expand Down
3 changes: 2 additions & 1 deletion lib/components/viewers/viewers.css
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@
gap: 10px;
}
.otp .route-viewer .header-text.route-expanded span {
height: 100%;
margin: 0;
padding: 0;
}
Expand Down Expand Up @@ -562,4 +563,4 @@
align-items: center;
justify-content: center;
padding-top: 10px;
}
}

0 comments on commit 1e49780

Please sign in to comment.