mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Changes to unsaved changes service to ignore repeated panels and rows, #1888
This commit is contained in:
parent
5768f10769
commit
f6a61c1ec5
@ -85,9 +85,6 @@ function (angular, _) {
|
|||||||
panel = copy.panels[i];
|
panel = copy.panels[i];
|
||||||
panel.id = this.dashboard.getNextPanelId();
|
panel.id = this.dashboard.getNextPanelId();
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
|
||||||
// update reused instance
|
|
||||||
}
|
}
|
||||||
|
|
||||||
copy.repeat = null;
|
copy.repeat = null;
|
||||||
|
@ -81,6 +81,26 @@ function(angular, _, config) {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
this.cleanDashboardFromRepeatedPanelsAndRows = function(dash) {
|
||||||
|
dash.rows = _.filter(dash.rows, function(row) {
|
||||||
|
if (row.repeatRowId) {
|
||||||
|
console.log('filtering out row');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
row.panels = _.filter(row.panels, function(panel) {
|
||||||
|
if (panel.repeatPanelId) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
// remove scopedVars
|
||||||
|
panel.scopedVars = null;
|
||||||
|
return true;
|
||||||
|
});
|
||||||
|
|
||||||
|
return true;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
this.has_unsaved_changes = function() {
|
this.has_unsaved_changes = function() {
|
||||||
if (!self.original) {
|
if (!self.original) {
|
||||||
return false;
|
return false;
|
||||||
@ -106,6 +126,9 @@ function(angular, _, config) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this.cleanDashboardFromRepeatedPanelsAndRows(current);
|
||||||
|
this.cleanDashboardFromRepeatedPanelsAndRows(original);
|
||||||
|
|
||||||
// ignore some panel and row stuff
|
// ignore some panel and row stuff
|
||||||
current.forEachPanel(function(panel, panelIndex, row, rowIndex) {
|
current.forEachPanel(function(panel, panelIndex, row, rowIndex) {
|
||||||
var originalRow = original.rows[rowIndex];
|
var originalRow = original.rows[rowIndex];
|
||||||
|
Loading…
Reference in New Issue
Block a user