Analytics custom dashboards error when product analytics is not onboarded
Problem
It is possible to view / load custom dashboards which include product analytics features, before product analytics has been onboarded in a project. This causes the dashboard to display an error when accessed.
Steps to reproduce
- Enable product analytics if not already configured (instructions)
- On a new / fresh project, visit Project > Analytics > Analytics dashboards
- On the banner alert, click the link and configure a project to use as the custom dashboards pointer project
- Select an existing project which already contains some custom product dashboards with product analytics visualizations
- Go back to the dashboards list
- Notice Product Analytics onboarding/setup list item is still there
- Custom dashboards are also now in the list
- Open a custom dashboard - every PA visualization will error
Proposed solutions
Option 1:
Modify the getAllCusomizableDashboards
GraphQL query to include some additional flag / token which will allow the frontend to know if the custom dashboard is usable for the current project or not. E.g. if the dashboard list item included 'productAnalytics'
we can match that against our currently-onboarding-features list. Or an enabled: false
flag or something.
Then modify the style of custom dashboard list items which include product analytics visualizations, so they match the onboarding / set up item (grayed out). Make the item not clickable. Possibly include some badge/ label text explaining why.
Option 2:
Modify the getAllCusomizableDashboards
GraphQL query to exclude any custom dashboards which cannot be used right now due to product analytics not yet being onboarded.
While simpler, I wonder if this option may be confusing to users - why haven't their custom dashboards shown up after configuring the custom dashboard project? It might make them think they have made a mistake setting up the custom dashboard pointer project, or have their custom dashboards in the wrong place or something.
For both proposals we'd want the same info returned form the backend when viewing a dashboard (someone may go directly to the URL even if the item is unavailable on the dashboard list). We cna then show an error state on the dashboard instead of every individual panel failing to load, like they do now.
Implementation plan
Related to Users can add product analytics visualizations ... (#424631 - closed)
However that issue is specifically focused on the dashboard editor and the list of available visualizations