Skip to content

Conversation

@narsaynorath
Copy link
Member

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.
@narsaynorath narsaynorath requested a review from a team as a code owner May 28, 2025 19:54
@narsaynorath narsaynorath requested a review from a team May 28, 2025 19:54
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label May 28, 2025

if ('responseJSON' in e) {
const response = e.responseJSON;
if (response?.non_field_errors && Array.isArray(response.non_field_errors)) {
Copy link
Member Author

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
Copy link

codecov bot commented May 28, 2025

Codecov Report

All 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     

Copy link
Member

@nikkikapadia nikkikapadia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sweeetttt

@narsaynorath narsaynorath merged commit 33c27e8 into master May 29, 2025
42 checks passed
@narsaynorath narsaynorath deleted the nar/fix/dashboards-message-user-for-invalid-state branch May 29, 2025 16:09
andrewshie-sentry pushed a commit that referenced this pull request Jun 2, 2025
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.
@github-actions github-actions bot locked and limited conversation to collaborators Jun 14, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants