Max number of repeated panels per row

Instead of min width
This commit is contained in:
Pierre GIRAUD
2018-08-20 15:33:49 +02:00
parent a9808ef518
commit a881497908
9 changed files with 33 additions and 20 deletions

View File

@@ -21,7 +21,7 @@ export class DashboardMigrator {
let i, j, k, n;
const oldVersion = this.dashboard.schemaVersion;
const panelUpgrades = [];
this.dashboard.schemaVersion = 16;
this.dashboard.schemaVersion = 17;
if (oldVersion === this.dashboard.schemaVersion) {
return;
@@ -368,6 +368,15 @@ export class DashboardMigrator {
this.upgradeToGridLayout(old);
}
if (oldVersion < 17) {
panelUpgrades.push(panel => {
if (panel.minSpan) {
panel.maxPerRow = GRID_COLUMN_COUNT / panel.minSpan;
}
delete panel.minSpan;
});
}
if (panelUpgrades.length === 0) {
return;
}