-
Notifications
You must be signed in to change notification settings - Fork 13.9k
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: better error messages for dashboard properties modal #11382
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lilykuang
approved these changes
Oct 22, 2020
@@ -165,13 +165,25 @@ class PropertiesModal extends React.PureComponent { | |||
} | |||
|
|||
async handleErrorResponse(response) { | |||
const { error, statusText } = await getClientErrorObject(response); | |||
const { error, statusText, message } = await getClientErrorObject(response); | |||
let errorText = error || statusText || t('An error has occurred'); |
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.
Could be good to refactor that message and similar ones in a constant in a module:
$ git grep -i "error.*occurred'" superset-frontend/
superset-frontend/src/SqlLab/components/ExploreCtasResultsButton.jsx: this.props.errorMessage || t('An error occurred'),
superset-frontend/src/SqlLab/components/ExploreResultsButton.jsx: this.props.errorMessage || t('An error occurred'),
superset-frontend/src/components/TableLoader.tsx: props.addDangerToast(t('An error occurred'));
superset-frontend/src/dashboard/components/PropertiesModal.jsx: body: error || statusText || t('An error has occurred'),
superset-frontend/src/datasource/DatasourceEditor.jsx: error || statusText || t('An error has occurred'),
superset-frontend/src/datasource/DatasourceModal.tsx: body: error || t('An error has occurred'),
superset-frontend/src/explore/components/DisplayQueryButton.jsx: error: error || statusText || t('Sorry, An error occurred'),
superset-frontend/src/explore/components/PropertiesModal.tsx: body: error || statusText || t('An error has occurred'),
superset-frontend/src/utils/getClientErrorObject.ts: : t('An error occurred');
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.
Agreed, let's treat that as a separate task.
willbarrett
approved these changes
Oct 26, 2020
auxten
pushed a commit
to auxten/incubator-superset
that referenced
this pull request
Nov 20, 2020
This was referenced Nov 26, 2023
This was referenced Dec 14, 2023
This was referenced Dec 20, 2023
mistercrunch
added
🏷️ bot
A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels
🚢 1.0.0
labels
Mar 12, 2024
This was referenced May 14, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
SUMMARY
The dashboard properties modal raises a generic error message for most cases. Since the api already sends back status codes and validation errors this PR simply exposes them to the user.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
TEST PLAN
json_metadata
, editing a dashboard that user does not own.ADDITIONAL INFORMATION