-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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] Extend DiscoverNoResults component to show different message on error #79671
[Discover] Extend DiscoverNoResults component to show different message on error #79671
Conversation
@elasticmachine merge upstream |
@elasticmachine merge upstream |
…-06-discover-add-static-error-message
… of github.com:kertal/kibana into kertal-pr-2020-10-06-discover-add-static-error-message
src/plugins/discover/public/application/angular/directives/no_results.tsx
Outdated
Show resolved
Hide resolved
Pinging @elastic/kibana-app (Team:KibanaApp) |
@elasticmachine merge upstream |
… of github.com:kertal/kibana into kertal-pr-2020-10-06-discover-add-static-error-message
How about: We encountered an error retrieving your search results Button: Show error message |
|
The cluster is on fire! :-D |
@elasticmachine merge upstream |
1 similar comment
@elasticmachine merge upstream |
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.
Tested this in Chrome on Mac OS according to instructions. Works as expected. A few code comments below.
src/plugins/discover/public/application/angular/directives/no_results.tsx
Outdated
Show resolved
Hide resolved
src/plugins/discover/public/application/angular/directives/no_results.tsx
Outdated
Show resolved
Hide resolved
src/plugins/discover/public/application/angular/directives/no_results.tsx
Outdated
Show resolved
Hide resolved
@majagrubic thx, yes, makes sense to clean it up a bit further when touching this code. will adapt! |
src/plugins/discover/public/application/angular/directives/no_results.tsx
Outdated
Show resolved
Hide resolved
@@ -814,7 +816,7 @@ function discoverController($element, $route, $scope, $timeout, $window, Promise | |||
if (error instanceof Error && error.name === 'AbortError') return; | |||
|
|||
$scope.fetchStatus = fetchStatuses.NO_RESULTS; | |||
$scope.rows = []; | |||
$scope.fetchError = error; | |||
|
|||
data.search.showError(error); |
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's an annoying problem here, that if the error is a SearchTimeoutError
- it's won't show again.
I'm not sure it's worth fixing, but at least it might be worth documenting.
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 just displayed once in a session?
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.
@lizozom but the error is displayed in the toast, right?
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.
Yeah, but that popover will be displayed only once. Since you're re-calling shower to, it doesn't get shown. Not sure if I have a good proposition for fixing it, but I don't think it's critical.
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 see, so the replay doesn't work, also think it's not critical, the button is an additional option if you have missed the toast. would be interesting why it's just callable once.
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.
Tested with all types of errors I have stored.
LGTM.
…-06-discover-add-static-error-message
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.
Looks a lot nicer!
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.
src/plugins/discover/public/application/components/no_results/no_results.tsx
Outdated
Show resolved
Hide resolved
src/plugins/discover/public/application/components/no_results/no_results.tsx
Outdated
Show resolved
Hide resolved
…no_results.tsx Co-authored-by: Andrea Del Rio <delrio.andre@gmail.com>
…no_results.tsx Co-authored-by: Andrea Del Rio <delrio.andre@gmail.com>
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
💚 Build SucceededMetrics [docs]@kbn/optimizer bundle module count
async chunks size
History
To update your PR or re-run it, just comment with: |
…ge on error (elastic#79671) Co-authored-by: Andrea Del Rio <delrio.andre@gmail.com>
…arm-phase-to-formlib * 'master' of github.com:elastic/kibana: (55 commits) [UX] Fix map color variance and apply proper filter for extended stats (elastic#81106) [User Experience] Use EuiSelect for percentiles instead of SuperSelect (elastic#81082) [DOCS] Add link for monitoring ssl settings (elastic#81057) [test] Await loading indicator in monitoring test (elastic#81279) [ILM] Minor copy and link additions to cloud CTA for cold phase (elastic#80512) [Mappings editor] Add scaled_float and date_range comp integration tests (elastic#81287) [Discover] Deangularize context.app (elastic#80851) [O11y Overview] Add code to display/hide UX section when appropriate (elastic#80873) [Discover] Extend DiscoverNoResults component to show different message on error (elastic#79671) Fix tagcloud word overlapping (elastic#81161) [Security Solution] Fixes flaky test rules (elastic#81040) Changed the code to avoid tech debt with hacky solutions after receiving comments on EUI issue reported about this problem. (elastic#81183) [Security Solution][All] Replace old markdown renderer with the new one (elastic#80301) Add namespaced version of the API call (elastic#81278) [ML] Data Frame Analytics: Fix race condition and support for feature influence legacy format. (elastic#81123) [Fleet] Fix POLICY_CHANGE action creation for new policy (elastic#81236) [Security Solution][Endpoint][Admin] Malware user notification checkbox (elastic#78084) [SecuritySolution][Unit Tests] - fix flakey unit test (elastic#81239) skip flaky suite (elastic#81264) [Maps] fix top-level Map page is called 'Kibana' (elastic#81238) ... # Conflicts: # x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/hot_phase/hot_phase.tsx # x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/shared/forcemerge_field.tsx # x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/warm_phase.tsx
Summary
With the alignment of error notification in PR #77788 all error messages in Discover were migrated to be a toast. This could be misleading when there's an error and the no-results page is displayed:
This PR displays a different message in the error case
Furthermore this PR converts
DiscoverNoResults
to TypeScript, modularizes the component, migrates testing to no longer use snapshots of the whole component, and moves the whole component out of theangular
folder.Testing
logs*
index pattern. Add data to thelogs
indexlogs
index pattern, adapt time rangeChecklist