-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Discover] Inline data fetching errors #152311
[Discover] Inline data fetching errors #152311
Conversation
5a0ce83
to
3ed0bfb
Compare
Pinging @elastic/kibana-data-discovery (Team:DataDiscovery) |
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.
Fleet change 🚀
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.
Service addition in dashboard LGTM! Code only review.
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.
LGTM for Core changes
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.
👍 it's much better this way! quick first question, this PR doesn't change the saved search embeddable handling currently, this will be a follow up, right? (just tested an embeddable fetching in offline mode, there ain't any message displayed about this state)
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.
Management team changes LGTM, quickly tested locally that Index Management works as expected
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.
LGTM!
if (error.constructor.name === 'HttpFetchError' || error instanceof BfetchRequestError) { | ||
const defaultMsg = i18n.translate('data.errors.fetchError', { | ||
defaultMessage: 'Check your network connection and try again.', | ||
}); | ||
|
||
return { | ||
title: i18n.translate('data.search.httpErrorTitle', { | ||
defaultMessage: 'Unable to connect to the Kibana server', | ||
}), | ||
body: error.message || defaultMsg, | ||
}; | ||
} | ||
} |
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.
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 was also curious about this. I think we should discuss it and decide if it might be more useful to always show the defaultMessage
for these errors. Or maybe at least showing the defaultMessage
+ the error message.
text: toMountPoint(e.message || defaultMsg, { | ||
theme$: this.deps.theme.theme$, | ||
}), | ||
title: overrideDisplay.title, |
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.
It's unrelated to this PR, but just a thought, it would be interesting if when this is called (which is no longer the case in Discover 🥳 ) could lead to the storm of toast in certain situations
E.g. here:
kibana/src/plugins/visualizations/public/visualize_app/utils/get_visualization_instance.ts
Line 72 in cb0a805
data.search.showError( |
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 imagine calling data.search.showError
too much probably is responsible for some of the toast storms. It might be a candidate to consider throttling too.
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.
Design changes LGTM 🥳
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.
Transform changes LGTM.
…when showing inline error banner
b60c1aa
to
e74ef63
Compare
💚 Build Succeeded
Metrics [docs]Module Count
Public APIs missing comments
Async chunks
Page load bundle
Unknown metric groupsAPI count
ESLint disabled line counts
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: cc @davismcphee |
Summary
Note: If your team's review is requested on this PR related to notification service changes, it's likely because somewhere in your codebase
NotificationsSetup
was being passed to a function/component requiringNotificationsStart
or vice versa. The interfaces were previously identical so it didn't matter, but an additional function was added toNotificationsStart
in this PR that created type errors which needed to be resolved.This PR updates Discover to use inline error messages for data fetching errors instead of toasts.
For most error messages, the title and full message will be displayed inline as well as a "Show details" button which opens the standard error dialog. For errors which have special handling and render custom content instead of just the error message, the custom content will be rendered in the callout body for the "No results" state, or rendered in a popover when clicking the "Show details" button for the banner-style error display.
No results with regular error message:
Banner-style with regular error message:
Banner-style with regular error message in mobile:
Standard error dialog:
No results with overridden content:
Banner-style with overridden content modal:
Resolves #149488.
Checklist
Documentation was added for features that require explanation or tutorialsAny UI touched in this PR does not create any new axe failures (run axe in browser: FF, Chrome)If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the docker listFor maintainers