Skip to content
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

Conversation

kertal
Copy link
Member

@kertal kertal commented Oct 6, 2020

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:

Bildschirmfoto 2020-10-06 um 16 06 04

This PR displays a different message in the error case

Bildschirmfoto 2020-10-20 um 09 57 17

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 the angular folder.

Testing

  1. Add an index pattern containing a invalid painless script by importing the saved object in management export.ndjson.zip
  2. This adds the logs* index pattern. Add data to the logs index
PUT log/_doc/1
{
  "@timestamp":"2020-10-14T07:07:29.952Z",
  "message": "test"
}
  1. Navigate to Discover, select the logs index pattern, adapt time range
  2. Submit and then you should see the error message

Checklist

@kertal kertal added the Feature:Discover Discover Application label Oct 6, 2020
@kertal kertal self-assigned this Oct 6, 2020
@kertal
Copy link
Member Author

kertal commented Oct 6, 2020

@elasticmachine merge upstream

@kertal
Copy link
Member Author

kertal commented Oct 7, 2020

@elasticmachine merge upstream

@kertal kertal added the v7.11.0 label Oct 8, 2020
… of github.com:kertal/kibana into kertal-pr-2020-10-06-discover-add-static-error-message
@kertal kertal marked this pull request as ready for review October 15, 2020 13:00
@kertal kertal requested a review from a team October 15, 2020 13:00
@kertal kertal requested a review from majagrubic October 15, 2020 13:02
@kertal kertal added the Team:Visualizations Visualization editors, elastic-charts and infrastructure label Oct 15, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app (Team:KibanaApp)

@kertal
Copy link
Member Author

kertal commented Oct 15, 2020

@elasticmachine merge upstream

@kertal kertal added release_note:skip Skip the PR/issue when compiling release notes v8.0.0 labels Oct 15, 2020
@kertal kertal requested a review from lizozom October 15, 2020 13:04
… of github.com:kertal/kibana into kertal-pr-2020-10-06-discover-add-static-error-message
@gchaps
Copy link
Contributor

gchaps commented Oct 15, 2020

How about:

We encountered an error retrieving your search results
Or
We encountered an error retrieving search results

Button: Show error message

@kertal
Copy link
Member Author

kertal commented Oct 16, 2020

How about:

We encountered an error retrieving your search results
Or
We encountered an error retrieving search results

Button: Show error message
@gchaps thx, this is much better wording, done 👍

@lizozom
Copy link
Contributor

lizozom commented Oct 16, 2020

The cluster is on fire! :-D

@kertal
Copy link
Member Author

kertal commented Oct 19, 2020

@elasticmachine merge upstream

1 similar comment
@kertal
Copy link
Member Author

kertal commented Oct 19, 2020

@elasticmachine merge upstream

Copy link
Contributor

@majagrubic majagrubic left a 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.

@kertal
Copy link
Member Author

kertal commented Oct 19, 2020

Tested this in Chrome on Mac OS according to instructions. Works as expected. A few code comments below.

@majagrubic thx, yes, makes sense to clean it up a bit further when touching this code. will adapt!

@@ -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);
Copy link
Contributor

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.

Copy link
Member Author

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?

Copy link
Member Author

@kertal kertal Oct 20, 2020

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?

Copy link
Contributor

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.

Copy link
Member Author

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.

Copy link
Contributor

@lizozom lizozom left a 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.

@kertal kertal requested a review from majagrubic October 20, 2020 08:18
Copy link
Contributor

@majagrubic majagrubic left a 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!

@kertal kertal requested review from a team and andreadelrio October 20, 2020 15:00
Copy link
Contributor

@andreadelrio andreadelrio left a comment

Choose a reason for hiding this comment

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

I think this is better suited for a danger callout/button since it is an error.

image

@andreadelrio andreadelrio self-requested a review October 21, 2020 05:25
Copy link
Contributor

@andreadelrio andreadelrio left a comment

Choose a reason for hiding this comment

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

Design changes LGTM

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

@kbn/optimizer bundle module count

id before after diff
discover 243 254 +11

async chunks size

id before after diff
discover 439.3KB 436.4KB -2.9KB

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@kertal kertal merged commit 3a969f4 into elastic:master Oct 21, 2020
kertal added a commit to kertal/kibana that referenced this pull request Oct 21, 2020
jloleysens added a commit to jloleysens/kibana that referenced this pull request Oct 21, 2020
…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
kertal added a commit that referenced this pull request Oct 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Discover Discover Application release_note:skip Skip the PR/issue when compiling release notes Team:Visualizations Visualization editors, elastic-charts and infrastructure v7.11.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants