-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
fix(dashboards): Update error toast with message #92437
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(dashboards): Update error toast with message #92437
Conversation
The error toasts were putting up generic messages. Update the toasts so the user doesn't have to look at the network tab to explain their problem.
|
||
if ('responseJSON' in e) { | ||
const response = e.responseJSON; | ||
if (response?.non_field_errors && Array.isArray(response.non_field_errors)) { |
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.
This is very special cased right now, but we can expand it out for other errors. I just know this is what the error for the is:
filter looks like.
Codecov ReportAll modified and coverable lines are covered by tests ✅ ✅ All tests successful. No failed tests found. Additional details and impacted files@@ Coverage Diff @@
## master #92437 +/- ##
==========================================
- Coverage 78.86% 74.16% -4.71%
==========================================
Files 10226 10226
Lines 585940 585936 -4
Branches 22761 22760 -1
==========================================
- Hits 462120 434572 -27548
- Misses 120401 147946 +27545
+ Partials 3419 3418 -1 |
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.
sweeetttt
The error toasts were putting up generic messages. Update the toasts so the user doesn't have to look at the network tab to explain their problem. This fix is applied to Discover, where at the moment `is:unresolved` results in an error when trying to save a query or save as a homepage. In dashboards this fixes the toast to pick the first error message to display in the toast. This isn't ideal, it would be better if the message appeared with the specific field in the form but for now I wanted to make a quick improvement.
The error toasts were putting up generic messages. Update the toasts so the user doesn't have to look at the network tab to explain their problem.
This fix is applied to Discover, where at the moment
is:unresolved
results in an error when trying to save a query or save as a homepage. In dashboards this fixes the toast to pick the first error message to display in the toast. This isn't ideal, it would be better if the message appeared with the specific field in the form but for now I wanted to make a quick improvement.