Add error state to visualizations selector
What does this MR do and why?
Adds error handling to the availableVisualizations query and displays it inside the new visualization selector drawer.
The error alert displays inline in the visualizations drawer rather than as a global alert because when loading the dashboard we don't know if the user intends to just view the dashboard (in which case it doesn't matter that there was an error in the visualizations list), or, if they do want to edit, if they plan to use the available visualizations drawer, or just remove / move / resize panels.
Note: Analytics dashboard is an experimental feature hidden behind a default off feature flag
Screenshots or screen recordings
Before | After |
---|---|
(forever loading) |
How to set up and validate locally
- Follow these instructions to setup Product Analytics in GDK.
- Onboard
Product Analytics
by setting up the feature at Project > Analytics > Analytics dashboards. - Enable custom dashboards by following the alert prompt on Project > Analytics > Analytics dashboards.
- Create a new custom dashboard by clicking on
New dashboard
on Project > Analytics > Analytics dashboards. - Cause the
availableVisualizations
query to fail, e.g. by addingthrow 'oh no'
intoee/app/graphql/resolvers/product_analytics/visualizations_resolver.rb
- Edit your newly created custom dashboard by clicking on
Edit
->Add visualization
and verify there is an error shown in the visualizations drawer
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #425119 (closed)