Skip to content

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
image (forever loading) image

How to set up and validate locally

  1. Follow these instructions to setup Product Analytics in GDK.
  2. Onboard Product Analytics by setting up the feature at Project > Analytics > Analytics dashboards.
  3. Enable custom dashboards by following the alert prompt on Project > Analytics > Analytics dashboards.
  4. Create a new custom dashboard by clicking on New dashboard on Project > Analytics > Analytics dashboards.
  5. Cause the availableVisualizations query to fail, e.g. by adding throw 'oh no' into ee/app/graphql/resolvers/product_analytics/visualizations_resolver.rb
  6. 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.

Related to #425119 (closed)

Edited by Elwyn Benson

Merge request reports

Loading