-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Embeddable] Add unified error UI #143367
Conversation
6ad366b
to
be121b7
Compare
be121b7
to
ea9cad0
Compare
Pinging @elastic/kibana-app-services (Team:AppServicesUx) |
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.
Thanks so much for making these changes, @dokmic! Leaving you a few small comments below for your review.
src/plugins/embeddable/public/lib/panel/embeddable_panel_error.tsx
Outdated
Show resolved
Hide resolved
src/plugins/embeddable/public/lib/panel/embeddable_panel_error.tsx
Outdated
Show resolved
Hide resolved
> | ||
{node} | ||
</EuiPanel> | ||
<EuiEmptyPrompt |
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.
Would it make sense to also include a title
prop (along with an appropriate titleSize
) for this EuiEmptyPrompt
component (either dynamic or static)? If a static title, would something like Unable to render visualization
work?
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 tried to add that similarly to the button, but it requires significant changes in the code to get the embeddable type. I would rather leave that without the title prop. Especially since the error appearance is similar to what we had before.
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.
Code review: Primarily looked at embeddable and dashboard_error_handling.ts
changes, but did briefly look through Lens/Visualize changes as well - left one tiny nit, but otherwise looks good!
Tested locally:
src/plugins/embeddable/public/lib/embeddables/embeddable_error.tsx
Outdated
Show resolved
Hide resolved
ea9cad0
to
442fc06
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 tested missing data view (thanks @Heenawter ) and an error thrown from within the expression chain. Looks good. Code LGTM on the vis editors side.
fcb640b
to
e8024c9
Compare
@MichaelMarcialis @Heenawter I've updated the PR according to your feedback -- all the findings are fixed now. Could you please take another look? |
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.
@dokmic Taking another look at this :)
-
Seems like the "No data view" error embeddable no longer includes a link to edit the visualization for Lens panels.
Also, for Visualize panels, it looks like... the entire panel is now clickable, even though there is minimal indication of this besides the cursor change? I wonder if we could still limit the button to the
"Edit in <X> editor to fix the error"
text, while making it more clear that the text is clickable - for example, making the text blue/underlined. @MichaelMarcialis I know you recommended changes to the button appearance, so diverting to your opinion here :) -
The behaviour between panel types is very different when the index is deleted (but the data view remains) - for example, some throw an error whilst others simply report no data. Is this to be expected?
Screen.Recording.2022-10-28.at.4.32.17.PM.mov
-
Looks like both the Visualize and Maps "No data view" errors are still clipping:
-
Maps doesn't seem to have a call to action, despite the panel being clickable:
-
Not sure if there are plans to add this error UI to TSVB/Vega visualizations as well? The panel on the left is Aggregation based, whereas the panel on the right is TSVB.
And is what it looks like for a Vega visualization:
However, from the user's perspective. all three of these panels are both considered "Visualize" panels so it's a bit confusing that there are three different ways of displaying the error.
@Heenawter Thanks for such an extensive review! Those cases are coming deep from the Lens and Visualizations code. I've opened #144224 to cover them, which should be done separately by @elastic/kibana-vis-editors as they know this area the best. |
e8024c9
to
b22997e
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.
Code changes LGTM
+1 to @Heenawter's comments mentioned above. I understand the desire to want to split off some of these as separate issues/PRs, but I think comments 1, 3, and 4 should be addressed here before this PR is merged. Specifically in regard to comment 1, my recommendation is that the entire panel should not be clickable. Instead, only a button within the panel should allow clicking to the edit action. I just wanted the previous |
@MichaelMarcialis @Heenawter Those are not even errors for the embeddable component. They come from the expressions invoked inside the visualizations. Changing the code to throw an error breaks some other places, and fixing that as part of this requires more effort than with the original PR. |
@dokmic Sorry, I guess I'm a bit confused :) In my original review, I recall that
In my second review, I was simply noting that this behaviour was different than what I remember during my original review - the original behaviour was preferable to me and hence why I brought it up (although I am obviously open to discussion on whether or not these changes were made for a reason that has not yet been mentioned here). Considering these changes have occurred between my first and second review, I think it still makes sense to fix this behaviour in this PR, no? Unless these changes are somehow unrelated to your PR - please, let me know if I'm misunderstanding! I understand that some of the things noted in my second review are edge cases, and I'm 100% fine with these being tackled in a follow up by the respective teams. Just would appreciate some clarification. Sorry about holding this up! |
b22997e
to
370cbee
Compare
@Heenawter Thanks for clarifying this. After trying to reproduce that, I realized that the problems you discovered are relevant to the main branch. It seems like you haven't rebuilt Kibana before the second attempt. Could you please try once more?
Should be resolved once rebuilt.
Should be fixed once rebuilt.
Works as expected.
TSVB and Vega should be refactored separately by the relevant team as it is not super straightforward how the error is encapsulated there. In the meantime, I've fixed the missing data view error for the visualizations. Now, it is aligned with the rest. |
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.
Thank you so much for clarifying + fixing where necessary! I did rebuild Kibana before my second review, but I didn't restart my Elasticsearch client and so I forgot to remove + re-import the sample data so that was probably part of the problem. Sorry about that! 🙇
Tested again and everything worked great (minus the stuff that will be fixed in the follow up) 🎉
370cbee
to
86bea8f
Compare
86bea8f
to
4da17ef
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.
Thanks for making these changes, @dokmic! LGTM!
💚 Build Succeeded
Metrics [docs]Module Count
Public APIs missing comments
Async chunks
Page load bundle
Unknown metric groupsAPI count
ESLint disabled in files
ESLint disabled line counts
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: |
Summary
Resolves #141676.
Before:
After:
Checklist
For maintainers