-
Notifications
You must be signed in to change notification settings - Fork 68
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 and improve admin child pages redirections logic #9400
Fix and improve admin child pages redirections logic #9400
Conversation
Test the buildOption 1. Jetpack Beta
Option 2. Jurassic Ninja - available for logged-in A12s🚀 Launch a JN site with this branch 🚀 ℹ️ Install this Tampermonkey script to get more options. Build info:
Note: the build is updated when a new commit is pushed to this PR. |
Size Change: 0 B Total Size: 1.33 MB ℹ️ View Unchanged
|
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.
Tested and this works as expected. Thanks for handling it!
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.
Thanks for working on it, Vlad!
The $force_refresh
parameter was introduced with the Test-drive PR, and I have thoroughly tested it through the following scenarios:
- Onboarding a test-drive account locally with both Jetpack connected and Dev Tools enabled.
- Onboarding a test-drive account locally with Jetpack disconnected and Dev Tools enabled.
- Onboarding a test-drive account on a JN site with Jetpack connected and without Dev Tools.
- Onboarding a test-drive account on a JN site with Jetpack disconnected and without Dev Tools.
✅ Code changes are looking good!
Fixes #9395
Changes proposed in this Pull Request
We match the logic from
WC_Payments_Admin::maybe_redirect_from_payments_admin_child_pages()
with the one inWC_Payments_Account::maybe_redirect_from_overview_page()
for a more robust logic and consistent UX. Themaybe_redirect_from_payments_admin_child_pages()
action hook is now called after the redirections action hooks inWC_Payments_Account
(those have a priority of 15, we use 16).At the same time, we eliminate the erroneous
is_stripe_connected()
call with the$force_refresh
parameter set totrue
.Testing instructions
Pre-testing setup
US
)npm run tube:start
) so you will be able to set up your Jetpack connectiontrunk
of the WCPay Dev ToolsTesting broken setup
/wp-admin/admin.php?page=wc-admin&path=/payments/overview
and you should be redirected to the Connect page with an error notice at the top:/wp-admin/admin.php?page=wc-admin&path=/payments/deposits
and you should be redirected to the Connect page with an error notice at the top:/wp-admin/admin.php?page=wc-admin&path=/payments/transactions
and you should be redirected to the Connect page with an error notice at the top./wp-admin/admin.php?page=wc-admin&path=/payments/disputes
and you should be redirected to the Connect page with an error notice at the top./wp-admin/admin.php?page=wc-admin&path=/payments/overview
and you should be redirected to the Connect page with an error notice at the top:/wp-admin/admin.php?page=wc-admin&path=/payments/deposits
and you should be redirected to the Connect page with an error notice at the top:/wp-admin/admin.php?page=wc-admin&path=/payments/transactions
and you should be redirected to the Connect page with an error notice at the top./wp-admin/admin.php?page=wc-admin&path=/payments/disputes
and you should be redirected to the Connect page with an error notice at the top.Testing working setup
enabled
/complete
account on our Payments > Overview pagenpm run changelog
to add a changelog file, choosepatch
to leave it empty if the change is not significant. You can add multiple changelog files in one PR by running this command a few times.Post merge