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

router(feature): allow configuration of when URL gets updated in navigation flow #24820

Closed
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
5 participants
@jasonaden
Contributor

jasonaden commented Jul 10, 2018

Fixes #24616

In the AngularJS routers (ui-router and ng-route), the URL would be updated before navigation happened. In the Angular Router, this was changed under the assumption that application developers would want to stay on the most recently successfully navigated to route.

However, this might not always be the case. For example, when a user lands on a page they don't have permissions for, we might want the application to show the target URL with a message saying the user doesn't have permissions. This way, if the user were to copy the URL or perform a refresh at this point, they would remain on the same page.

The point of this feature is to allow the developer to choose when the URL gets updated. Error handling has not changed with this PR, meaning the URL will get reset back to the last previously successful URL. There may need to be another change allowing configuration of error handling.

@googlebot googlebot added the cla: yes label Jul 10, 2018

@jasonaden

This comment has been minimized.

Contributor

jasonaden commented Jul 10, 2018

@mary-poppins

This comment has been minimized.

mary-poppins commented Jul 10, 2018

@mary-poppins

This comment has been minimized.

mary-poppins commented Jul 10, 2018

@mary-poppins

This comment has been minimized.

mary-poppins commented Jul 10, 2018

@mary-poppins

This comment has been minimized.

mary-poppins commented Jul 11, 2018

@jasonaden jasonaden requested a review from vicb Jul 11, 2018

@vicb

This comment has been minimized.

Contributor

vicb commented Jul 11, 2018

Changes LGTM.

One question: wouldn't updating the url interfere with the routing process ? (ie could it generate an event that would cause the routing process to re-enter in some config ?)

@vicb

vicb approved these changes Jul 11, 2018

@mary-poppins

This comment has been minimized.

mary-poppins commented Jul 11, 2018

@ngbot

This comment has been minimized.

ngbot bot commented Jul 11, 2018

I see that you just added the PR action: merge label, but the following checks are still failing:
    failure missing required label: "PR target: *"
    pending status "code-review/pullapprove" is pending

If you want your PR to be merged, it has to pass all the CI checks.

If you can't get the PR to a green state due to flakes or broken master, please try rebasing to master and/or restarting the CI job. If that fails and you believe that the issue is not due to your change, please contact the caretaker and ask for help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment