-
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 old URL params [OTP-1233] #1226
Conversation
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! Thanks for the changes
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 looks fine, definitely a nice simple solution. I'd like to remove the getDefaultQuery() call entirely though eventually. What are we still using it for? Is it the date/time picker and from/to fields only?
lib/util/api.ts
Outdated
|
||
/** | ||
* Drops unused params so they don't show up in URL. | ||
* TODO: Remove those params from core-utils. |
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.
Removing these from core-utils would be a big project, because they're still relied on by some other packages which are used in custom uis by some users. I think we should try to remove the dependency on them from OTP-RR instead.
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.
You are right. The stuff that comes out of getDefaultQuery
is not very useful anyway:
bikeSpeed: 3.58
date: "2024-06-11"
departArrive: "NOW"
endTime: "09:00"
from: null
intermediatePlaces: Array []
maxBikeTime: 20
maxEScooterDistance: 4828
maxWalkTime: 15
mode: "WALK,TRANSIT"
numItineraries: 3
otp2: true
routingType: "ITINERARY"
startTime: "07:00"
time: "10:36"
to: null
watts: 250
wheelchair: false
lib/util/api.ts
Outdated
* Drops unused params so they don't show up in URL. | ||
* TODO: Remove those params from core-utils. | ||
*/ | ||
export function removeUnusedQueryParams(params: any): void { |
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.
make the type Record<string, any>
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.
Updated in b3f93e4
Description
This PR remove some (not all) params that are no longer used in OTP searches from the URL.
PR Checklist