Schema-driven customizable dashboards for Product Analytics, aka Dashboard Designer
## Long term vision
A user can choose a data source (within GitLab or out), a dashboard layout and visualizations for display.
## JTBD statement(s)
* When there's new data, I want to organize it myself, so I can present what's important to my stakeholders.
## Use Cases to support / User Stories
* As a PM/EM who is curious about the usage of software my team is shipping, I want to customize a view of saved visualizations, so I can get all/only the data I care about in a single dashboard.
- [Iteration 1](https://gitlab.com/groups/gitlab-org/-/epics/10939) - create a custom dashboard using saved visualizations
- [Solution Validation issue](https://gitlab.com/gitlab-org/ux-research/-/issues/2492)
- Iteration 2 - TBD
- The next step is to ship the [first iteration](### MVC) of the [Product Analytics visualization Designer](https://gitlab.com/groups/gitlab-org/-/epics/9386) and then we may work that flow into the dashboard creation / a user can add a custom saved visualization into their dashboard.
### [MVC](https://gitlab.com/groups/gitlab-org/-/epics/10939)
1. Data from current project
1. List of built in visualizations possible
1. Set layout of dashboard
A walk through of the vision and MVC using the Story Map and Design is available [here](https://gitlab.zoom.us/rec/share/YOC8YndXhC0__ZnfVlUmaOIF246m3YRRtWt9Vjm11NABWpQM612e7Guu-IEsC19w.UZ5APZ5O81hE7Kv_)
As part of demoing our Vision POC, as well as identifying work to be done as part of [building our first sets of dashboards and visualizations](https://gitlab.com/groups/gitlab-org/-/epics/8466 "Product analytics first sets of dashboards and visualizations"), we've discussed the need to have customizable, schema-driven dashboards to help organize and manage dashboards throughout our features. This epic represents the work necessary to support this functionality.
Work is already being done to [identify and refactor any repeated part of our dashboard views](https://gitlab.com/gitlab-org/gitlab/-/issues/370557 "Create any necessary reusable UI components and services for production-ready dashboards"). It would make sense a next step to then be able to define dimensions and metrics required for a dashboard, map them to options on how to visualize them, in addition to remembering any customizations made by users (reordering, resizing, tweaking any configurable options).
### Future iterations
Things we want to support later within either the Dashboard Creation flow or the editor.
* ~~Support for Value Stream Analytics/Value Stream Dashboard Components~~ Now done.
* Creation of a visualization in the creator flow
- After [Visualization Designer](https://gitlab.com/groups/gitlab-org/-/epics/11555) implementation
* Support for other components (Observability, Secure)
* Support for other data sources (pending validation)
- Multiple GitLab projects
- Data Upload (xcel, csv, json, ??)
- External data Stores (a database, "other" clickhouse, prometheus, etc.)
## Proposal
1. Provide a set of pre-defined dashboards and allow users to create their own using this schema.
1. Pre-defined dashboards should live in a central directory or location for the GitLab installation that all project can reference. These should be read-only from the projects perspective.
2. User-defined dashboards should live in the `.gitlab/` folder (or subfolder) of the project.
1. Living in the project implies that they are read-write by project members. [CODEOWNERS](https://docs.gitlab.com/ee/user/project/code_owners.html) can be used to lock down access to these files if desired.
2. Allow users to customize the dashboards (within the scope defined below)
1. Users should have a GUI-based approach for rearranging and resizing widgets
1. Notably, GUI-based customization of the query that a widget uses is out of scope for this iteration
2. Users should be able to use the underlying schema to customize a dashboard with respect to rearranging and resizing widgets, as well as adding/remove widgets and modifying the queries that they use.
1. The first phase will be to add a hand crafted visualization.
2. Further work on creating/editing visualizations will be in another epic.
## Dashboard definition
The dashboard definition is being defined in https://gitlab.com/gitlab-org/gitlab/-/issues/378878+
<details><summary>Older dashboard initial definition</summary>
We should seek to support the following dashboard definition, a number of terms here follow Cube's [data schema concept](https://cube.dev/docs/schema/fundamentals/concepts):
_(This is WIP)_
- Charts
- Chart
- ID/Name
- Type
- Potentially configurable, to allow the user to switch between different types of charts depending on how they would like to visualize it
- Query
- Measures
- Dimensions
- Time Dimensions
- Layout (this requires being able to save changes to a schema-driven dashboard, requisite issues to come)
- Size
- Order
</details>
### A General Dashboard design that could be created (concept)

epic