[Bug] Fetching custom dashboard files from an empty repo creates an error
Problem
When enabling custom Analytics Dashboards
on a project with an empty repo the Project > Analytics > Dashboard pages throws an error.
Steps to reproduce
- Follow these instructions to set up Product Analytics in your GDK.
- Create a new project with an empty repository.
- Enable custom dashboards at Project > Settings > Analytics and pick the empty project.
- View the analytics dashboards at Project > Analytics > Dashboard.
- Observe the errors in your browser console.
Likely cause
The cause seems to be that /-/refs/[BRANCH]/logs_tree/
returns an HTML response when a project is empty is empty instead of an JSON encoded array.
Implementation plan
Update dashboards_api.js
to filter out non-array responses.
Edited by Jiaan Louw