-
Notifications
You must be signed in to change notification settings - Fork 69
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
Payments settings improvements #8428
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: +82 B (0%) Total Size: 1.2 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.
I think that this task is not part of the flow anymore. I will confirm it and remove it separately.
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.
The changes are providing an excellent improvement, great idea!
One thing I'd like to note as an implementation alternative: I noticed the change in client/settings/save-settings-section/index.js
that updates the data store within the component. In order to do so, you also needed to change the implementation of the useGetPaymentMethodStatuses
and the implementation (and return value) of the saveSettings
action.
But with this, you're relying on the client/settings/save-settings-section/index.js
component's body to do the update, and the usePaymentMethodStatuses
is now a hook that can technically also update the payment_method_statuses
settings key (even tho this settings key doesn't have a related UI element).
By implementing this change on the saveSettings
action, you can avoid modifying useGetPaymentMethodStatuses
(and all the related test/component changes), and you can also avoid relying on the client/settings/save-settings-section/index.js
component to do the update:
yield updateIsSavingSettings( true, null );
const response = yield apiFetch( {
path: `${ NAMESPACE }/settings`,
method: 'post',
data: settings,
} );
yield updateSettingsValues( {
payment_method_statuses: response.data.payment_method_statuses,
} );
yield dispatch( 'core/notices' ).createSuccessNotice(
__( 'Settings saved.', 'woocommerce-payments' )
);
What do you think of this alternative?
afb850b
to
6336843
Compare
@frosso Love the suggestion, I applied it because it's definitely the better way of doing things! Thanks! |
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 the changes! One small note on client/data/settings/test/actions.js
- just because I'm not sure if we should export updateSettingsValues
.
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 so much for the changes and your patience, Timur!
Thank you @frosso ! |
Co-authored-by: Timur Karimov <[email protected]>
Closes #8246
The ACs for #8246 are essentially listed in #8246 (comment).
Changes proposed in this Pull Request
This PR removes the spinner when checking the payment method on the Settings page (the spinner was there only to meet design expectations. Confirmed in this discussion.
This PR also updates payment method statuses if they were updated after clicking the
Save settings
button. This means that merchants don't necessarily need to refresh the page to see the update.Testing instructions
Payment methods checkbox has no spinner
ideal
in Settings$this->account_data['capability_requirements']['ideal_payments'][] = 'business_profile.support_email';
, clear account cachePayment methods list updates after saving settings without the need to refresh the page
Rejected
without refreshing the 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