-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Conversation
7d754cb
to
efda2dc
Compare
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 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?
efda2dc
to
5caab84
Compare
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 good to me. Thank you for the improvements!
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 theloaded
state, which was replaced with apromise handler.
How Has This Been Tested?
Screenshots (if appropriate):
Before:
![image](https://user-images.githubusercontent.com/41929/115381748-291f7c00-a1d4-11eb-95e9-5c7679419bf3.png)
After (Core configuration element failing):
![image](https://user-images.githubusercontent.com/41929/115381366-ca5a0280-a1d3-11eb-8bdd-348eecc70a76.png)
After (Plugin configuration element failing):
![image](https://user-images.githubusercontent.com/41929/115381532-f1b0cf80-a1d3-11eb-9097-a0b7eab8c031.png)
Types of changes
Checklist: