-
Notifications
You must be signed in to change notification settings - Fork 53
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
Remove use of isTransit() function #1267
Conversation
I also deleted a file that wasn't imported anywhere. Did we mean to be using that? |
That's from the tabbed UI. Nobody that I know of currently uses that but technically it's still supported? What do we think |
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.
We're really on OTP2 now... eek!
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.
Updating my review here to continue using the isTransit
method in core-utils instead. Let's refactor that! This PR shouldn't be closed though I like the cleanup
Well it wasn't even exported in index.js |
Let's just update core-utils instead |
Will block this one until the OTP UI side is merged EDIT: ready to go! |
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.
Swaggy
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 trusted you! Post lunch I'm seeing this with new clairty
(leg.transitLeg || isTransit(mode)) && | ||
duration > primaryTransitDuration | ||
) { | ||
if (isTransitLeg(leg) && duration > primaryTransitDuration) { |
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'm scared to remove the current check
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.
time to get over your fears
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.
🤬
itinerary.legs[i - 1].transitLeg && | ||
itinerary.legs[i + 1].transitLeg | ||
!isTransitLeg(leg) && | ||
isTransitLeg(itinerary.legs[i - 1]) && |
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'd like to keep the old check maybe
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.
maybe, but maybe not
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.
🤬
all the problems are fixed |
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.
It can be swaggier
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.
Excited for the second reviewer
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.
Uh well it does work.... I will be honest I am missing the logic of why we need this in core utils? Why import a function when we can just use leg.isTransit
@@ -68,7 +65,7 @@ export function ItineraryDescription({ itinerary }: Props): JSX.Element { | |||
let transitMode | |||
itinerary.legs.forEach((leg) => { | |||
const { duration, mode, rentedBike, rentedVehicle } = leg | |||
if (isTransit(mode) && duration > primaryTransitDuration) { | |||
if (isTransitLeg(leg) && duration > primaryTransitDuration) { |
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.
Maybe make this check a variable? It's used twice, here and 35
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 thought about that too but decided against it because it's a simple check anyway
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 guess
Description:
The isTransit() function is unneeded because we can just use the
transitLeg
propery on legs. It was causing bugs with some of our custom modes.