Fix analytics dashboards Apollo cache issues causing duplicate items
What does this MR do and why?
Creating and then editing a new dashboard's
title
results in the both the old & new title being listed in the Analytics dashboards list.Then when opening either of the duplicate dashboards shows the original
title
at the top of the dashboard.Also when editing the panels on one of these dashboards the user can save the changes, but opening it back up renders the original state and the changes appear to be lost.
These issues are all the result of incorrect Apollo cache updates. The changes were always correctly saved to YML, but not reflected in the UI until refreshing the page (invalidating the incorrect Apollo cache).
This MR reworks the Apollo cache updating code to resolve these problems. It refactors to use the style recommended by the frontend guidelines.
Screenshots or screen recordings
Before | After |
---|---|
How to set up and validate locally
Steps to reproduce original bug from the issue:
-
Follow these instructions to setup Product Analytics in GDK.
-
On a project or instance with shared analytics dashboards enabled & custom dashboards configured.
-
View the Project > Analytics > Analytics dashboards page.
-
Create a new dashboard named
dashboard-one
. -
Go back to the dashboards list.
-
Open the dashboard
dashboard-one
and edit its name todashboard-two
. -
Go back to the dashboards list.
-
Observe that both
dashboard-one
anddashboard-two
are listed. -
Open both dashboards and observe that both have the title
dashboard-one
when you'd expectdashboard-two
. -
Go back to the dashboards list.
-
Open
dashboard-one
and add some visualizations and clicksave
. -
Go back to the dashboards list and open
dashboard-one
again. -
Observe that the changes made have been lost.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #425268 (closed)