Fix the disjuction of panels (#39412)

[As code] Correct trim apply defaults when import/export dashboards
This commit is contained in:
ying-jeanne
2021-10-06 11:39:23 +02:00
committed by GitHub
parent ccd6a2eae3
commit 227c8403b5
25 changed files with 27834 additions and 131 deletions

View File

@@ -0,0 +1,73 @@
Verifies common usecases for trimdefault/applydefault functions:
* open structure should be kept when fields not present
-- CUE --
{
templating?: list: [...{...}]
}
-- Full --
{
"templating": {
"list": [
{
"allValue": null,
"current": {
"text": "America",
"value": "America"
},
"datasource": "gdev-postgres",
"definition": "",
"hide": 0,
"includeAll": false,
"label": "Datacenter",
"multi": false,
"name": "datacenter",
"options": [],
"query": "SELECT DISTINCT datacenter FROM grafana_metric",
"refresh": 1,
"regex": "",
"skipUrlSync": false,
"sort": 1,
"tagValuesQuery": "",
"tags": [],
"tagsQuery": "",
"type": "query",
"useTags": false
}
]
}
}
-- Trimmed --
{
"templating": {
"list": [
{
"allValue": null,
"current": {
"text": "America",
"value": "America"
},
"datasource": "gdev-postgres",
"definition": "",
"hide": 0,
"includeAll": false,
"label": "Datacenter",
"multi": false,
"name": "datacenter",
"options": [],
"query": "SELECT DISTINCT datacenter FROM grafana_metric",
"refresh": 1,
"regex": "",
"skipUrlSync": false,
"sort": 1,
"tagValuesQuery": "",
"tags": [],
"tagsQuery": "",
"type": "query",
"useTags": false
}
]
}
}