Skip to content
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

Add __unstableHTML option to createNotice() with API error messages where appropriate #32190

Closed
jacob-sewell opened this issue Jan 25, 2022 · 1 comment
Labels
plugin: woocommerce Issues related to the WooCommerce Core plugin. priority: normal The issue/PR is of normal priority—not many people are affected or there’s a workaround, etc. type: enhancement The issue is a request for an enhancement.

Comments

@jacob-sewell
Copy link
Contributor

Issue woocommerce/woocommerce-admin#4314 referenced one particular API call whose error message gets put into a Snackbar via createNotice(). As of PR woocommerce/woocommerce-admin#8173 it's possible to preserve tags in messages displayed in a Snackbar if you pass { __unstableHTML: true } as a third parameter to createNotice(). This only affects the specific Sample Products Import case, so any other API calls that display server-provided messages in a Snackbar might need the same change.

From @joshuatf's review:

Just noting that we still need a follow-up for this. This solves the issue in this task, but we would need to do this in all REST API calls since this error has the potential to pop up in any of those.

I would love a more catch-all solution, but this may be the best to handle this.

Originally posted by @joshuatf in woocommerce/woocommerce-admin#8173 (comment)

@jacob-sewell jacob-sewell added priority: normal The issue/PR is of normal priority—not many people are affected or there’s a workaround, etc. type: enhancement The issue is a request for an enhancement. labels Jan 25, 2022
@woocommercebot woocommercebot transferred this issue from woocommerce/woocommerce-admin Mar 19, 2022
@woocommercebot woocommercebot added plugin: woocommerce Issues related to the WooCommerce Core plugin. focus: react admin labels Mar 19, 2022
@github-actions github-actions bot added the status: awaiting triage This is a newly created issue waiting for triage. label Mar 19, 2022
@ObliviousHarmony ObliviousHarmony removed the status: awaiting triage This is a newly created issue waiting for triage. label Mar 21, 2022
@adrianduffell
Copy link
Contributor

Going to close this due to the lack of activity on the issue and unstable APIs are now considered dangerous. Please feel free to re-open however.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
plugin: woocommerce Issues related to the WooCommerce Core plugin. priority: normal The issue/PR is of normal priority—not many people are affected or there’s a workaround, etc. type: enhancement The issue is a request for an enhancement.
Projects
None yet
Development

No branches or pull requests

4 participants