Skip to content

Commit

Permalink
Merge pull request #1109 from opentripplanner/fix-route-viewer-colors
Browse files Browse the repository at this point in the history
Fix colors in route viewer
  • Loading branch information
amy-corson-ibigroup authored Jan 12, 2024
2 parents 1a70193 + bae49bb commit c84714c
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
10 changes: 5 additions & 5 deletions __tests__/components/viewers/__snapshots__/stop-viewer.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -1437,7 +1437,7 @@ exports[`components > viewers > stop viewer should render countdown times after
title="20"
>
<span
className="sc-edoYdd ckpxJS"
className="sc-edoYdd hkZJFG"
color="333333"
style={
Object {
Expand Down Expand Up @@ -3691,7 +3691,7 @@ exports[`components > viewers > stop viewer should render countdown times for st
title="20"
>
<span
className="sc-edoYdd ckpxJS"
className="sc-edoYdd hkZJFG"
color="333333"
style={
Object {
Expand Down Expand Up @@ -5846,7 +5846,7 @@ exports[`components > viewers > stop viewer should render times after midnight w
title="20"
>
<span
className="sc-edoYdd ckpxJS"
className="sc-edoYdd hkZJFG"
color="333333"
style={
Object {
Expand Down Expand Up @@ -9169,7 +9169,7 @@ exports[`components > viewers > stop viewer should render with OTP transit index
title="36"
>
<span
className="sc-edoYdd ckpxJS"
className="sc-edoYdd hkZJFG"
color="333333"
style={
Object {
Expand Down Expand Up @@ -13547,7 +13547,7 @@ exports[`components > viewers > stop viewer should render with TriMet transit in
title="20"
>
<span
className="sc-edoYdd ckpxJS"
className="sc-edoYdd hkZJFG"
color="333333"
style={
Object {
Expand Down
8 changes: 4 additions & 4 deletions lib/actions/apiV2.js
Original file line number Diff line number Diff line change
Expand Up @@ -707,11 +707,11 @@ export const findRoute = (params) =>
getRouteOperator(
{
agencyId: newRoute?.agency?.id,
id: newRoute?.route?.id
id: newRoute?.id
},
getState().otp.config.transitOperators
),
{ color: newRoute?.route?.color, mode: newRoute.mode }
{ color: newRoute?.color, mode: newRoute.mode }
).split('#')?.[1]

newRoute.patterns = routePatterns
Expand Down Expand Up @@ -779,12 +779,12 @@ export function findRoutes() {
getRouteOperator(
{
agencyId: route?.agency?.id,
id: route?.route?.id
id: route?.id
},
config.transitOperators
),
{
color: route?.route?.color,
color: route?.color,
mode: route.mode
}
).split('#')?.[1]
Expand Down
1 change: 0 additions & 1 deletion lib/components/narrative/metro/default-route-renderer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
padding-left: 7px !important; /* TODO: this does not scale well to alternate zoom levels/text sizes */
padding-right: 7px !important;
Expand Down
3 changes: 2 additions & 1 deletion lib/util/accessibility-routing.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
}

0 comments on commit c84714c

Please sign in to comment.