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鈥檒l 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)

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 馃摝馃殌

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

Successfully merging this pull request may close these issues.

None yet

3 participants