-
Notifications
You must be signed in to change notification settings - Fork 0
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
Enhancement/update success error messages to wp admin notices #85
base: develop
Are you sure you want to change the base?
Enhancement/update success error messages to wp admin notices #85
Conversation
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've highlighted some areas that I think would benefit from additional scrutiny. If anyone would like to request changes I would be happy to make them =).
I don't think this needs to be called out in the readme. |
@vikrampm1 do you want me to rebase these changes with develop? It might be hard for another dev to accurately fix the merge conflict and I don't mind, but checking in first. |
@MaxwellGarceau sure, if it doesn't take too much of your time then please go ahead. Otherwise, please have @iamdharmesh help and progress this PR further. |
Lint project and fix errors
Only admin notices should be displayed here
This better explains the functions purpose and will prevent confusion in the future. Updated mailchimp_sf_frontend_msg comments to explain how WP admin notices are used in the WP admin
Set up the structure for classmaps and autoload for future development.
f0c253e
to
fe3b7ba
Compare
Rebased changesRebased Used rebase specifically because I was prompted by the PR bot, but let me know if another method is preferred in the future. A backup of the original branch can be found at before-rebase/enhancement/update-success-error-messages-to-wp-admin-notices Fixed merge conflicts and verified changes by testing validation and submission locally with the GUI. AutoloadAdded autoloading to the admin notice functions that was not possible at the original time of development due to the composer autoloading changes not being merged to develop. |
Description of the Change
On the plugin settings page, replace the custom Mailchimp UI for admin notices to the standard WP admin notices API
Drawbacks
Possible regressions
While I've tested for all of these scenarios and fixed any issues I've found the following items are the most likely regressions.
Closes #62
How to test the Change
WP Admin messages
A video recording can be made on request for any of the testing items below.
I've documented all of the possible testing scenarios that I found while making the changes, but due to the extensive list of areas to test I recommend making a note of any items that are too difficult or time consuming to efficiently test. We can then look at the items that were not tested and decide on a plan.
For example, testing the error message for an invalid Mailchimp API token would require finding a way to fail the OAuth flow while still navigating to the plugin settings page. It might be better to talk about items like that and brainstorm easier ways of ensuring regression proof code, such as relying on the OAuth test in
/tests/cypress/e2e/connect.test.js
or extending it.Success message
Settings page URL:
/wp-admin/admin.php?page=mailchimp_sf_options
Error message
FE messages
FE messages should remain unchanged
Success Messages
Submit the form after filling out all required fields to trigger the success message
Error Messages
Submit the form without entering any details to trigger the error message
The following scenarios will also throw errors on the FE
Changelog Entry
Credits
Props @MaxwellGarceau
Checklist: