Create the ability to duplicate/clone/copy a dashboard
Much like Product Analytics did with the Audience & Behavior dashboards, the Observability team would like to deliver prebuilt dashboards for their use cases. Following other Obs vendors model, these dashboards would serve as a getting started mechanism for the customers, but could be cloned and modified by the user so they are tailored to their specific needs.
Note that also a user can clone any dashboard within the same project. We should also support exporting in a future iteration that allows users to copy a dashboard to a different project.
A sample workflow for this is:
- User enables observability for APM (Infra, etc)
- They navigate to the Analytics dashboards and see that there is a Host Metrics dashboard "created by GitLab" available for use.
- The click into this dashboard to view the associated information and find that they need to make a few tweaks
- The user can select "Duplicate/Clone/Copy" dashboard and supply the name
- The original GitLab dashboard stays in the list (they can make multiple clones to help them get started), the new dashboard appears in the list.
- The new dashboard does not have the "Created by GitLab" label and can be edited by the user
See Figma mockup flow for o11y
Design
Implementation plan
frontend
- Update the analytics dashboard list.
- Add a disclosure dropdown to the right-hand side of each row.
- Add an action for
Clonewith a copy icon. - When a user clicks on the action.
- Fetch the dashboard config.
- Commit an exact copy of the selected dashboard's configuration with a the title
Previous title (1)and increment the integer if the title already includes(1)at the end. - Show a toast on success / failure.
- Update specs.
Edited by Jiaan Louw
