From 5bab016837749fdefe229abb02da9ba46b20c95c Mon Sep 17 00:00:00 2001 From: bergquist Date: Mon, 5 Mar 2018 22:03:26 +0100 Subject: [PATCH] ignore iteration property when checking for unsaved changes closes #11063 (cherry picked from commit a7d62f44d3e422ba6b982d2beeb4bc9a303683bc) --- .../features/dashboard/specs/unsaved_changes_srv_specs.ts | 5 +++++ public/app/features/dashboard/unsaved_changes_srv.ts | 3 +++ 2 files changed, 8 insertions(+) diff --git a/public/app/features/dashboard/specs/unsaved_changes_srv_specs.ts b/public/app/features/dashboard/specs/unsaved_changes_srv_specs.ts index 4d720945553..8bd639de681 100644 --- a/public/app/features/dashboard/specs/unsaved_changes_srv_specs.ts +++ b/public/app/features/dashboard/specs/unsaved_changes_srv_specs.ts @@ -66,6 +66,11 @@ describe('unsavedChangesSrv', function() { expect(tracker.hasChanges()).to.be(false); }); + it('Should ignore .iteration changes', () => { + dash.iteration = new Date().getTime() + 1; + expect(tracker.hasChanges()).to.be(false); + }); + it.skip('Should ignore row collapse change', function() { dash.rows[0].collapse = true; expect(tracker.hasChanges()).to.be(false); diff --git a/public/app/features/dashboard/unsaved_changes_srv.ts b/public/app/features/dashboard/unsaved_changes_srv.ts index 12eebb1077f..ebf0101cee0 100644 --- a/public/app/features/dashboard/unsaved_changes_srv.ts +++ b/public/app/features/dashboard/unsaved_changes_srv.ts @@ -97,6 +97,9 @@ export class Tracker { dash.refresh = 0; dash.schemaVersion = 0; + // ignore iteration property + delete dash.iteration; + // filter row and panels properties that should be ignored dash.rows = _.filter(dash.rows, function(row) { if (row.repeatRowId) {