Dashboards: Fix preload field not being persisted via /v1beta1 (#112475)

This commit is contained in:
Ivan Ortega Alba
2025-10-16 12:45:29 +02:00
committed by GitHub
parent 6e66a98ef7
commit ebd0d334bc
16 changed files with 16 additions and 1 deletions
@@ -1061,7 +1061,6 @@ func cleanupDashboardDefaults(dashboard map[string]interface{}) {
// Remove transient properties that frontend filters out during getSaveModelClone()
// These properties are lost during frontend's property copying loop in getSaveModelCloneOld()
delete(dashboard, "preload") // Transient dashboard loading state
delete(dashboard, "iteration") // Template variable iteration timestamp
delete(dashboard, "nav") // Removed after V7 migration
delete(dashboard, "pulldowns") // Removed after V6 migration - frontend doesn't have this property
@@ -1293,6 +1293,7 @@
"type": "timeseries"
}
],
"preload": false,
"refresh": false,
"schemaVersion": 42,
"tags": [
@@ -3941,6 +3941,7 @@
"type": "canvas"
}
],
"preload": false,
"refresh": "",
"schemaVersion": 42,
"tags": [
@@ -1537,6 +1537,7 @@
"type": "table"
}
],
"preload": false,
"schemaVersion": 42,
"tags": [],
"templating": {
@@ -1848,6 +1848,7 @@
"type": "table"
}
],
"preload": false,
"schemaVersion": 42,
"tags": [],
"templating": {
@@ -107,6 +107,7 @@
"type": "table"
}
],
"preload": false,
"schemaVersion": 42,
"tags": [],
"templating": {
@@ -576,6 +576,7 @@
"type": "table"
}
],
"preload": false,
"refresh": "",
"schemaVersion": 42,
"tags": [],
@@ -982,6 +982,7 @@
"type": "table"
}
],
"preload": false,
"refresh": "",
"schemaVersion": 42,
"tags": [
@@ -2172,6 +2172,7 @@
"type": "table"
}
],
"preload": false,
"schemaVersion": 42,
"tags": [],
"templating": {
@@ -1071,6 +1071,7 @@
"type": "state-timeline"
}
],
"preload": false,
"refresh": "",
"schemaVersion": 42,
"tags": [
@@ -3409,6 +3409,7 @@
"type": "state-timeline"
}
],
"preload": false,
"refresh": false,
"schemaVersion": 42,
"tags": [
@@ -196,6 +196,7 @@
"type": "trend"
}
],
"preload": false,
"refresh": "",
"schemaVersion": 42,
"tags": [
@@ -1433,6 +1433,7 @@
"type": "xychart"
}
],
"preload": false,
"refresh": "",
"schemaVersion": 42,
"tags": [
@@ -79,6 +79,7 @@
"type": "debug"
}
],
"preload": false,
"refresh": "",
"schemaVersion": 42,
"tags": [],
@@ -1049,6 +1049,7 @@
"type": "xychart"
}
],
"preload": false,
"refresh": "",
"schemaVersion": 42,
"tags": [
@@ -81,6 +81,7 @@ export class DashboardModel implements TimeModel {
graphTooltip: DashboardCursorSync;
time: any;
liveNow?: boolean;
preload?: boolean;
private originalTime: any;
timepicker: any;
templating: { list: any[] };
@@ -154,6 +155,7 @@ export class DashboardModel implements TimeModel {
this.timezone = data.timezone ?? '';
this.weekStart = data.weekStart ?? '';
this.editable = data.editable !== false;
this.preload = data.preload;
this.graphTooltip = data.graphTooltip || 0;
this.time = data.time ?? { from: 'now-6h', to: 'now' };
this.timepicker = data.timepicker ?? {};