Skip to content

Commit

Permalink
KibanaErrorBoundary initial implementation (#168754)
Browse files Browse the repository at this point in the history
## Summary

* Meta issue: https://github.com/elastic/kibana/issues/166584
* This PR implements tasks in:
#167159
* [Technical doc [Elastic
internal]](https://docs.google.com/document/d/1kVD3T08AzLuvRMnFrXzWd6rTQWZDFfjqmOMCoXRI-14/edit)

This PR creates the `ErrorBoundary` component and its provider for
services. It implements the wrapper around a few management apps owned
by Appex-SharedUX.

### Screenshots

Updated 2023-10-18

**Server upgrade scenario:** In this case, the caught error is known to
be recoverable via window refresh:
* <img width="1413" alt="image"
src="https://github.com/elastic/kibana/assets/908371/7f34fbab-0e67-4c67-a4a1-989464d5b0d0">

**Unknown/Custom error:** In this case, the error is something outside
of known cases where the fix is to refresh:
* <img width="1413" alt="image"
src="https://github.com/elastic/kibana/assets/908371/7c39b5df-d4da-4e33-aeca-9ea447010762">

### Testing

1. Use a script proxy in between the browser and the Kibana server.
    * Try **https://github.com/tsullivan/simple-node-proxy**
* or
**https://chrome.google.com/webstore/detail/tweak-mock-and-modify-htt/feahianecghpnipmhphmfgmpdodhcapi**.
2. Script the proxy to send 404 responses for the Reporting plugin
bundle, and for a bundle of some Management app.
3. Try the Share > CSV menu in Discover. It should be blocked, and
handled with a toast message. Buttons in the toast should work.
4. Try the SharedUX management apps that use the wrapper. It should be
blocked, and handled with an EuiCallout. Refresh button and EuiAccordion
should work.

### Checklist
- [x] Ensure the package code is delivered to the browser in the initial
loading of the page (c2559e8)
- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [x]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [x] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
- [x] Any UI touched in this PR does not create any new axe failures
(run axe in browser:
[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),
[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))
- [x] This renders correctly on smaller devices using a responsive
layout. (You can test this [in your
browser](https://www.browserstack.com/guide/responsive-testing-on-local-server))
- [x] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)

---------

Co-authored-by: kibanamachine <[email protected]>
Co-authored-by: Tiago Costa <[email protected]>
  • Loading branch information
3 people authored Oct 23, 2023
1 parent ce931e2 commit 53c83e7
Show file tree
Hide file tree
Showing 36 changed files with 1,474 additions and 427 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -681,6 +681,7 @@ packages/shared-ux/card/no_data/impl @elastic/appex-sharedux
packages/shared-ux/card/no_data/mocks @elastic/appex-sharedux
packages/shared-ux/card/no_data/types @elastic/appex-sharedux
packages/shared-ux/chrome/navigation @elastic/appex-sharedux
packages/shared-ux/error_boundary @elastic/appex-sharedux
packages/shared-ux/file/context @elastic/appex-sharedux
packages/shared-ux/file/image/impl @elastic/appex-sharedux
packages/shared-ux/file/image/mocks @elastic/appex-sharedux
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -684,6 +684,7 @@
"@kbn/shared-ux-card-no-data-mocks": "link:packages/shared-ux/card/no_data/mocks",
"@kbn/shared-ux-card-no-data-types": "link:packages/shared-ux/card/no_data/types",
"@kbn/shared-ux-chrome-navigation": "link:packages/shared-ux/chrome/navigation",
"@kbn/shared-ux-error-boundary": "link:packages/shared-ux/error_boundary",
"@kbn/shared-ux-file-context": "link:packages/shared-ux/file/context",
"@kbn/shared-ux-file-image": "link:packages/shared-ux/file/image/impl",
"@kbn/shared-ux-file-image-mocks": "link:packages/shared-ux/file/image/mocks",
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 53c83e7

Please sign in to comment.