-
Notifications
You must be signed in to change notification settings - Fork 133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DT-5921 Add car ferry functionality #5121
base: v3
Are you sure you want to change the base?
Conversation
…ar and disable leg text for ferries in the matka config.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good work. I suggested a fair amount of mainly cosmetic changes, which make the code easier to read and understand.
In general, try to avoid adding unncecessary validation checks 'just in case'. The code should fail fast and crash if variable values are not valid.
app/component/itinerary/CarLeg.js
Outdated
<div className={cx('itinerary-leg-action', 'car')}> | ||
<div className="itinerary-leg-action-content"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Merge these into one div
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did not change these for now. For example, there are similar divs in BicycleLeg, BikeParkLeg, CarParkLeg. Do you want all of these changed or none?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok I understand. I would love to see all code improving continuously. Please fix this unless it feels unreasonably big task.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These two divs have been merged everywhere I could find them.
app/component/itinerary/CarLeg.js
Outdated
<div className={cx('itinerary-leg-action', 'car')}> | ||
<div className="itinerary-leg-action-content"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Merge divs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did not change these for now. For example, there are similar divs in BicycleLeg, BikeParkLeg, CarParkLeg. Do you want all of these changed or none?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These two divs have been merged everywhere I could find them.
There is a conflict. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found some new logic errors related to car+public itinerary list creation. Please read my review comments.
app/util/planParamUtil.js
Outdated
return ( | ||
transitModes.length > 0 && | ||
settings.includeCarSuggestions && | ||
config.carBoardingModes?.FERRY !== undefined |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems wrong. I suggest:
settings.includeCarSuggestions && filterTransitModes(...).length > 0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed this to transitModes.length > 0 && settings.includeCarSuggestions. I didn't realize previously that transitModes is filtered earlier with filterTransitModes.
…n-icon CSS classes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good now but merge confict must be resolved.
app/component/itinerary/Itinerary.js
Outdated
@@ -277,6 +280,9 @@ const Itinerary = ( | |||
); | |||
const usingOwnBicycleWholeTrip = | |||
usingOwnBicycle && itinerary.legs.every(leg => !leg.to?.vehicleParking); | |||
const usingOwnCar = itinerary.legs.some(leg => getLegMode(leg) === 'CAR'); | |||
const usingOwnCarWholeTrip = | |||
usingOwnCar && itinerary.legs.every(leg => !leg.to?.vehicleParking); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right, unit tests often use bad mock data. Fixing code causes huge amount of test failures which is really annoying.
Merge conflicts resolved |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will be merged after next hotfix release
This should not be merged before the functionality from this pr can be used opentripplanner/OpenTripPlanner#5966,
Proposed Changes