Open samjewell opened 1 year ago
Hey @samjewell 👋🏾, thank you for bringing this issue to our attention. After investigating, I found that the issue originates from the datalink configured in the tree map panel.
Current URL redirected from data link: /d/forcesavebug/?var-org_slug=grafana&var-org_id=.....etc
Our current logic for displaying unsaved changes modals checks if we are redirecting to the same dashboard. This check is based on location.path
(relevant code). In your dashboard example, the initially loaded dashboard URL is d/forcesavebug/walk-thru-and-repro-force-save-bug?var-org_slug=......etc
(the path contain the dashboard name). When compared, these URLs are identified as different dashboards, which is incorrect.
Change the data link to include the dashboard name: d/forcesavebug/walk-thru-and-repro-force-save-bug?${org_slug:queryparam}
.
The correct solution is to enhance our logic for identifying if we are redirecting to the same dashboard. I will give it a try and see how hard is to fix this issue.
I found that the issue originates from the datalink configured in the tree map panel.
Ah thanks so much, great to have found the root cause so quickly 😌
Change the data link to include the dashboard name:
Thanks also for sharing the workaround with me. I'd like to hold off doing this for now, however - I can see that including the dashboard name here will fix the issue, but only as long as the Dashboard itself doesn't get renamed. As soon as I rename the dashboard and save it, and then forget to update the data-links, won't the same problem occur again?
Hey @samjewell 👋🏾 ,
As soon as I rename the dashboard and save it, and then forget to update the data-links, won't the same problem occur again?
Yes, that's correct 😢
This issue has been automatically marked as stale because it has not had activity in the last year. It will be closed in 30 days if no further activity occurs. Please feel free to leave a comment if you believe the issue is still relevant. Thank you for your contributions!
I find this SUPER irritating - it always interrupts me mid-flow, when I'm trying to make a lot of dashboard edits very quickly.
Watch this Loom video to build some empathy and feel my pain firsthand: https://www.loom.com/share/dde3ea455967459a9a196475f86baf43
What happened:
What I expected to happen
Reproduction steps
I've built a reproduction dashboard especially to reproduce the issue on this ticket. Just take these steps to see it in action: