mirror of
https://github.com/grafana/grafana.git
synced 2024-12-30 10:47:30 -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.id = this.dashboard.getNextPanelId();
|
||||
}
|
||||
|
||||
} else {
|
||||
// update reused instance
|
||||
}
|
||||
|
||||
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() {
|
||||
if (!self.original) {
|
||||
return false;
|
||||
@ -106,6 +126,9 @@ function(angular, _, config) {
|
||||
}
|
||||
});
|
||||
|
||||
this.cleanDashboardFromRepeatedPanelsAndRows(current);
|
||||
this.cleanDashboardFromRepeatedPanelsAndRows(original);
|
||||
|
||||
// ignore some panel and row stuff
|
||||
current.forEachPanel(function(panel, panelIndex, row, rowIndex) {
|
||||
var originalRow = original.rows[rowIndex];
|
||||
|
Loading…
Reference in New Issue
Block a user