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

Wrap system configuration elements in error boundary. #10472

Merged
merged 9 commits into from
Apr 26, 2021

Conversation

dennisoelkers
Copy link
Member

@dennisoelkers dennisoelkers commented Apr 20, 2021

Description

Motivation and Context

Before this change, an individual core or plugin configuration element could raise an error and render the whole configurations page unusable.

This PR is adding an error boundary which is used to contain errors from each configuration element. If a single configuration element throws an error, a fallback component will be rendered instead, showing the actual error. In case of the plugin configuration elements, the config type (an fqcn) will be shown instead of the title. This gives at least an indication where the error is coming from. The rest of the page is still usable in case of an individual configuration element failing.

In addition, a general overhaul of the ConfigurationsPage was performed, migrating it to TypeScript and turning it into a functional component. Also, some quirks were removed, like polling the configuration prop to set the loaded state, which was replaced with a
promise handler.

How Has This Been Tested?

Screenshots (if appropriate):

Before:
image

After (Core configuration element failing):
image

After (Plugin configuration element failing):
image

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Refactoring (non-breaking change)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.

@dennisoelkers dennisoelkers requested a review from a team April 20, 2021 10:26
@edmundoa edmundoa self-assigned this Apr 22, 2021
Copy link
Contributor

@edmundoa edmundoa left a comment

Choose a reason for hiding this comment

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

I like the changes and I think make the component more comprehensible and resilient 👍 Besides a couple inline comments, I was wondering: the PR was inspired by an error in one of the configlets but I cannot reproduce it now. Did you manage to fix it or was it some temporary error?

Copy link
Contributor

@edmundoa edmundoa left a comment

Choose a reason for hiding this comment

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

Looks good to me. Thank you for the improvements!

@edmundoa edmundoa merged commit d919a44 into master Apr 26, 2021
@edmundoa edmundoa deleted the configlets-error-boundary branch April 26, 2021 14:06
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.

None yet

2 participants