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

[EuiErrorBoundary] Add onError callback prop #6810

Merged
merged 4 commits into from
May 25, 2023

Conversation

cee-chen
Copy link
Contributor

@cee-chen cee-chen commented May 25, 2023

Summary

closes #6755
closes #6127 (or would have anyway, before it auto-closed :)

Adding an onError callback should hopefully give our consumers significantly more flexibility in usage (e.g. reporting errors to a 3rd party API, potentially resetting/remounting the error boundary depending on the error, etc.).

The first commit of this PR is general misc cleanup unrelated to the actual feature.

QA

General checklist

  • Props have proper autodocs (using @default if default values are missing) and playground toggles
  • Added or updated jest and cypress tests
  • A changelog entry exists and is marked appropriately

- [ ] Added documentation - I skipped adding an extra doc example as the prop docs feel sufficient & usage feels incredibly self-evident. Feel free to poke me if you disagree

cee-chen added 2 commits May 24, 2023 18:30
we're going to be grabbing the full `error` soon so we should make the state name a bit more descriptive
@cee-chen cee-chen requested a review from a team May 25, 2023 01:44
@cee-chen
Copy link
Contributor Author

@sqren I think the onError callback added in this PR should satisfy your use case - let us know if not!

@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_6810/

Copy link
Member

@sorenlouv sorenlouv left a comment

Choose a reason for hiding this comment

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

lgtm!

+ [misc] convert EuiErrorBoundary demo to tsx
@cee-chen cee-chen enabled auto-merge (squash) May 25, 2023 15:39
@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_6810/

@cee-chen cee-chen merged commit f2963e0 into elastic:main May 25, 2023
@cee-chen cee-chen deleted the errorboundary/onerror branch May 25, 2023 16:17
cee-chen added a commit to elastic/kibana that referenced this pull request Jun 5, 2023
## Summary

`[email protected]` ⏩ `[email protected]`

- Most changes to source code in this PR are CSS cleanups/deprecations
in `EuiSuperDatePicker`/`EuiDatePickerRange`
- One team (ML) had a `inline` specific usage of `EuiDatePickerRange`
that they reached out to us about via Slack, and that we have fixed in
this PR.
- All other usages of date picker components should have remained
working as-is with no changes, but please ping us if you see otherwise!

___

## [`81.2.0`](https://github.com/elastic/eui/tree/v81.2.0)

- Updated `EuiSuperDatePicker` to accept an object configuration for
`isDisabled` ([#6821](elastic/eui#6821))

**Bug fixes**

- Fixed broken `EuiSuperDatePicker` styles
([#6821](elastic/eui#6821))

## [`81.1.0`](https://github.com/elastic/eui/tree/v81.1.0)

- Added `EuiInlineEditText` and `EuiInlineEditTitle` components
([#6757](elastic/eui#6757))
- Updated `EuiDatePickerRange` to support `inline` display
([#6795](elastic/eui#6795))
- Added an `onError` callback prop to `EuiErrorBoundary`
([#6810](elastic/eui#6810))
- Updated `EuiDataGrid` to only render screen reader text announcing
cell position if the cell is currently focused. This should improve the
ability to copy and paste multiple cells without SR text.
([#6817](elastic/eui#6817))

**Bug fixes**

- Fixed `EuiDatePicker`'s `inline` display to correctly render and
prevent user interaction when `disabled` or `readOnly`
([#6795](elastic/eui#6795))
- Fixed `EuiDatePicker`'s `inline` display to correctly render
`isInvalid` and `isLoading` icons
([#6795](elastic/eui#6795))

**CSS-in-JS conversions**

- Converted `EuiDatePickerRange` to Emotion
([#6795](elastic/eui#6795))

---------

Co-authored-by: Kibana Machine <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error boundary does not reset state [EuiErrorBoundary] add support of onError property
3 participants