Skip to content

Update dashboards listing to retrieve dashboards from backend

Robert Hunt requested to merge 382551-fetch-dashboards-for-listing into master

What does this MR do and why?

This MR updates the dashboards listing to retrieve dashboards from the GraphQL endpoint. The GraphQL endpoint uses Snowplow rather than Jitsu, so we also have to make sure Snowplow is enabled using the product_analytics_snowplow_support feature flag.

Specifically the changes made are:

  • Adds a new GraphQL query to get the dashboards
  • Updates listing to retrieve from GraphQL when Snowplow is enabled
  • Updated dashboards YAMLs and dashboards JSONs to match each other (slug instead of id, audience instead of dashboard_audience etc)
  • Updated listing to hide buttons when using Snowplow as visualization designer does not work
  • Updated specs to check the buttons are hidden
  • Updated specs to test with and without Snowplow enabled
  • Added translations for the "By GitLab" label

This MR is part 1/2. The second MR Update individual dashboards to retrieve dashbo... (!121129 - merged) updates the individual dashboards to use the GraphQL endpoint.

Known issues

Screenshots or screen recordings

Setting up with Jitsu

Screen_Recording_2023-05-05_at_15.41.48

Setting up with Snowplow

Screen_Recording_2023-05-12_at_12.59.05

How to set up and validate locally

Note: This feature has a lot of setup steps. If you need help please ask me, or I can step through these during a call with you.

  1. Follow these instructions to set up Product Analytics in your GDK.
  2. Set up three projects within the same group:
    • One is for Jitsu set up
    • One is for Snowplow set up
    • One is to act as a custom dashboards project like in !112481 (merged)
      • This requires this project to have a main branch and have that set to be the default branch for the project.
  3. Go through the set-up process described in the instructions for your Jitsu project.
  4. View the dashboard list at Project → Analytics → Dashboards.
  5. Verify that the new dashboard and visualization editor buttons are rendered.
  6. Verify the listing shows the dashboards.
  7. Enable the Snowplow flag by running the command: echo "Feature.enable(:product_analytics_snowplow_support)" | rails c.
  8. Change to your Snowplow project and go through the set-up process again for Snowplow.
  9. Verify that the new dashboard and visualization editor buttons are not rendered.
  10. Verify the listing shows the dashboards.

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 #382551 (closed)

Edited by Robert Hunt

Merge request reports