mirror of
https://github.com/grafana/grafana.git
synced 2024-11-25 10:20:29 -06:00
a7ea0ca849
* refactory to move trim/apply default into schema.go * fix comments * move schema test outside of load folder
73 lines
1.5 KiB
Plaintext
73 lines
1.5 KiB
Plaintext
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
|
|
}
|
|
]
|
|
}
|
|
}
|
|
|
|
-- Trimed --
|
|
{
|
|
"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
|
|
}
|
|
]
|
|
}
|
|
} |