-
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
Persist routerId across page reloads #162
Conversation
Codecov Report
@@ Coverage Diff @@
## dev #162 +/- ##
==========================================
+ Coverage 10.51% 10.53% +0.01%
==========================================
Files 107 107
Lines 3796 3808 +12
Branches 1023 1028 +5
==========================================
+ Hits 399 401 +2
- Misses 2954 2961 +7
- Partials 443 446 +3
Continue to review full report at Codecov.
|
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.
Jus a minor naming preference but otherwise good 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.
Not sure if a window.confirm is necessary, also agree with @binh-dam-ibigroup on variable name change.
Codecov Report
@@ Coverage Diff @@
## dev #162 +/- ##
==========================================
- Coverage 10.51% 10.03% -0.49%
==========================================
Files 107 107
Lines 3796 3998 +202
Branches 1023 1106 +83
==========================================
+ Hits 399 401 +2
- Misses 2954 3119 +165
- Partials 443 478 +35
Continue to review full report at Codecov.
|
if (routerId) { | ||
const parts = url.split('#') | ||
if (parts.length === 2) { | ||
url = `${parts[0]}#/start/x/x/x/${routerId}${parts[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.
Not sure I like this magic URL fragment!
🎉 This PR is included in version 1.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This PR fixes #161. otp-rr already has a provision for overriding the default router (note: this feature will be going away with otp 2.x). This simply adds persistence of this override value for the session (across page reloads, but not new tabs). It also adds a confirm message with the option to revert to the default router.
To test:
yarn start
http://localhost:9966/#/start/40.5885995/-73.6394705/11/City_of_Long_Beach_ea05fbd9-bfc6-413a-ab04-e777b95484dd
/otp/routers/City_of_Long_Beach_ea05fbd9-bfc6-413a-ab04-e777b95484dd
Copy Link
button to get a URL with the routerId included. Paste into new tab and verify that trip is planned correctly.http://localhost:9966/#/start/40.5885995/-73.6394705/11/SOME_OTHER_VALUE
. And click Cancel.