fix: Row state is now ignored when looking for dashboard changes (#11608)

* fix: Row state is now ignored when looking for dashboawrd changes, had to fix bug in expand logic to make fix work. Also moved the ChangeTracker to it's own file and moved tests to jest, fixes #11208

* removed commented out log calls
This commit is contained in:
Torkel Ödegaard
2018-04-17 09:41:07 +02:00
committed by GitHub
parent 9733172d3c
commit 85121e55c9
7 changed files with 296 additions and 313 deletions

View File

@@ -649,6 +649,7 @@ export class DashboardModel {
for (let panel of row.panels) {
// make sure y is adjusted (in case row moved while collapsed)
// console.log('yDiff', yDiff);
panel.gridPos.y -= yDiff;
// insert after row
this.panels.splice(insertPos, 0, new PanelModel(panel));
@@ -657,7 +658,7 @@ export class DashboardModel {
yMax = Math.max(yMax, panel.gridPos.y + panel.gridPos.h);
}
const pushDownAmount = yMax - row.gridPos.y;
const pushDownAmount = yMax - row.gridPos.y - 1;
// push panels below down
for (let panelIndex = insertPos; panelIndex < this.panels.length; panelIndex++) {