Skip to content

Add clone dashboard to analytics dashboards

Jiaan Louw requested to merge 461079-add-clone-dashboard-action into master

What does this MR do and why?

Adds the ability to clone any existing analytics dashboard from the dashboard listing view as described in Create the ability to duplicate/clone/copy a da... (#461079 - closed).

Cloning is accomplished by:

  • Fetching the full configuration of the dashboard to clone.
  • Appending (Copy) to the dashboard title and _copy to the filename.
    • If a dashboard with that name already exists, then the above action is performed recursively. For example (Copy) (Copy).
  • Using the commit API a new custom dashboard file is created using the reference dashboard configuration.
  • Finally the apollo cache is updated so that the new dashboard appears in the listing view.

FAQ:

  • Can users define their own dashboard name for clones?
    • Answer: Yes, they can using the dashboard editor. A future update might see us doing so using a dialog.
  • Is this available on group-level analytics dashboards?
    • Answer: No. Both creating new dashboards and the editor is not available on groups yet.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Recording

Screen_Recording_2024-08-07_at_13.59.17

Screenshots

Description Before After
Listing image image
Dropdown menu n/a image
Busy cloning n/a image
Clone created n/a image
Error while cloning n/a image

How to set up and validate locally

  1. Follow these instructions to set up Product Analytics in GDK. For this specific MR, since we're dealing with the onboarding UI only. You don't actually need to run Product Analytics DevKit. We just require the changes within GitLab to get into the onboarding flow itself.
  2. Visit Project > Analytics > Analytics dashboards.
  3. Onboard Product analytics by clicking on the set up button.
  4. View the dashboard listing at Project > Analytics > Analytics dashboards.
  5. Click on the dropdown menu and click on Clone.
  6. Verify that a clone has been created.

Related to #461079 (closed)

Edited by Jiaan Louw

Merge request reports

Loading