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

feat: cleanup plugin error boundary [UX-136] #856

Merged
merged 1 commit into from
Jun 24, 2024

Conversation

tomzemp
Copy link
Member

@tomzemp tomzemp commented Jun 21, 2024

This PR implements styling for plugin error boundaries (see notes on https://dhis2.atlassian.net/issues/UX-136)
https://dhis2.atlassian.net/browse/LIBS-633

Style note on screenshots: note that the teal background / dotted blue line is styling from the app (that is the styling around the plugin). The actual plugin error boundaries are the the grey boxes 9

General note: Off-ticket, I think Joe and I discussed that it might be better to not vertically center the plugin error message (because there's a greater likelihood that you would not see the error in the plugin if it's centered within the iframe). If we did actually want vertically centering, that's a small edit from this.

Default plugin error:

This is the error that you would get if something goes wrong within the plugin's code.

Before
image

After

image

-Note: The parent iframe needs to enable write access to the clipboard in order to copy the error to the clipboard. I've submitted a PR in app-runtime to make the iframe rendered by component include that access. If you implement your own wrapper, you'd need to provide that access yourself.

-To do: the ticket discusses passing the name of the plugin within the error. The premise for that was that the plugin name would be the shortName provided to the app-runtime component for looking up iframe src. I think before adding this shortName, we should revist the actual implementation of the plugin lookup, as I think most people are just passing urls for the src at the moment.

Outer plugin error:

This is the error that you would get if something went wrong with the app-shell logic for loading the plugin. It should (hopefully 😅) be very unlikely that you would end up in this error state, so I've just left this error as a simple "something went wrong" rather than including/refactoring all the additional code for copying error info / trying again.

Before:
image

After:
image

@tomzemp tomzemp requested review from a team and KaiVandivier June 21, 2024 11:25
Copy link
Contributor

@KaiVandivier KaiVandivier 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 🙂

@tomzemp tomzemp merged commit de252fe into master Jun 24, 2024
6 checks passed
@tomzemp tomzemp deleted the UX-136/plugin-error-boundary branch June 24, 2024 11:13
dhis2-bot added a commit that referenced this pull request Jun 24, 2024
# [11.5.0](v11.4.3...v11.5.0) (2024-06-24)

### Features

* cleanup plugin error boundary [UX-136] ([#856](#856)) ([de252fe](de252fe))
@dhis2-bot
Copy link
Contributor

🎉 This PR is included in version 11.5.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

dhis2-bot added a commit that referenced this pull request Jul 8, 2024
# [12.0.0-alpha.3](v12.0.0-alpha.2...v12.0.0-alpha.3) (2024-07-08)

### Bug Fixes

* **alerts:** ensure hiding works correctly and alerts are not re-added [DHIS2-15438] ([#859](#859)) ([6b11fff](6b11fff))
* fixed dimensions plugins [LIBS-634] ([#858](#858)) ([1f717f3](1f717f3))
* small text change in changelog ([824dd2f](824dd2f))

### Features

* cleanup plugin error boundary [UX-136] ([#856](#856)) ([de252fe](de252fe))
* parse additional namespaces from `d2.config.js` and add to `manifest.webapp` [LIBS-638]  ([#860](#860)) ([62782fe](62782fe))
@dhis2-bot
Copy link
Contributor

🎉 This PR is included in version 12.0.0-alpha.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants