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
fix(router): preserve replaceUrl when returning a urlTree from CanAct… #54042
fix(router): preserve replaceUrl when returning a urlTree from CanAct… #54042
Conversation
|
Hi @atscott I have updated the pull request as well as added extra tests to confirm that your above suggestion is working. |
|
@blathers16 It looks like something went wrong during rebase. Your PR includes 167 commits, can you have a look ? thank you. |
|
hi @JeanMeche that is probably because I didn't try to rebase. What is the goal here? To end up with a single commit for the entire PR? |
|
Yes, the PR should include only the changes intended for the fix. Currently having 1,017 file changes makes it hard to review. |
d285510
to
3c857f3
Compare
|
Hi, @JeanMeche, I think I fixed it. I have no idea where the 1,017 files came from, all I did was merge in upstream/main. Anyways, it should be all in one commit with no unrelated changes now. |
c7a0e23
to
1048a1c
Compare
0daf811
to
973e9b6
Compare
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.
There's quite a lot of unused code here and tests that could be simplified by using newer features: standalone, functional guards, RouterTestingHarness, etc. Older tests in the router code unfortunately aren't good examples of how new ones should be written.
9ba1b83
to
7cd0f71
Compare
|
Hi, @atscott, I made most of the requested changes except using RouterTestingHarness. It doesn't seem to have a way to pass NavigationExtras, so I don't think it can be used in this case. Feel free to correct me if I am wrong. |
7cd0f71
to
3841e7d
Compare
65fc0fd
to
531414d
Compare
…ivate This commit will fix the issue of the setting of NavigationExtras.replaceUrl being lost when returning a urlTree from a CanActivateFn. Fixes angular#53503 BREAKING CHANGE: When a a guard returns a `UrlTree` as a redirect, the redirecting navigation will now use `replaceUrl` if the initial navigation was also using the `replaceUrl` option. If this is not desirable, the redirect can configure new `NavigationBehaviorOptions` by returning a `RedirectCommand` with the desired options instead of `UrlTree`.
531414d
to
4701889
Compare
|
caretaker: this change has a green TGP above |
|
This PR was merged into the repository by commit 60f1d68. |
…ivate (angular#54042) This commit will fix the issue of the setting of NavigationExtras.replaceUrl being lost when returning a urlTree from a CanActivateFn. Fixes angular#53503 BREAKING CHANGE: When a a guard returns a `UrlTree` as a redirect, the redirecting navigation will now use `replaceUrl` if the initial navigation was also using the `replaceUrl` option. If this is not desirable, the redirect can configure new `NavigationBehaviorOptions` by returning a `RedirectCommand` with the desired options instead of `UrlTree`. PR Close angular#54042
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |


…ivate
This commit will fix the issue of the setting of NavigationExtras.replaceUrl being lost when returning a urlTree from a CanActivateFn.
Fixes #53503
PR Checklist
Please check if your PR fulfills the following requirements:
I didn't see anything in the docs that mentions the bug.
PR Type
What kind of change does this PR introduce?
What is the current behavior?
#53503
Issue Number: 53503
What is the new behavior?
NavigationExtras.replaceUrl is preserved.
Does this PR introduce a breaking change?
Other information