mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
71 lines
1.3 KiB
Plaintext
71 lines
1.3 KiB
Plaintext
![]() |
Verifies common usecases for trimdefault/applydefault functions:
|
||
|
* open structure should be kept when fields not present
|
||
|
|
||
|
-- CUE --
|
||
|
#ListA: {
|
||
|
datasource: "gdev-postgres"
|
||
|
hide: number | *0
|
||
|
includeAll : bool | *true
|
||
|
label: string | *"Datacenter"
|
||
|
}
|
||
|
#ListB: {
|
||
|
datasource: "gdev-mysql"
|
||
|
hide: number | *1
|
||
|
includeAll : bool | *false
|
||
|
label: string | *"Datacenter"
|
||
|
}
|
||
|
#ListC: {
|
||
|
datasource: !=""
|
||
|
hide: number | *2
|
||
|
includeAll : bool | *false
|
||
|
label: string | *"Awesome"
|
||
|
}
|
||
|
{
|
||
|
templating?: list: [...#ListA | #ListB | #ListC]
|
||
|
}
|
||
|
|
||
|
-- Full --
|
||
|
{
|
||
|
"templating": {
|
||
|
"list": [
|
||
|
{
|
||
|
"datasource": "gdev-postgres",
|
||
|
"hide": 0,
|
||
|
"includeAll": false,
|
||
|
"label": "Datacenter"
|
||
|
},
|
||
|
{
|
||
|
"datasource": "gdev-mysql",
|
||
|
"hide": 0,
|
||
|
"includeAll": false,
|
||
|
"label": "Datacenter"
|
||
|
},
|
||
|
{
|
||
|
"datasource": "gdev-random",
|
||
|
"hide": 2,
|
||
|
"includeAll": false,
|
||
|
"label": "Datacenter"
|
||
|
}
|
||
|
]
|
||
|
}
|
||
|
}
|
||
|
|
||
|
-- Trimmed --
|
||
|
{
|
||
|
"templating": {
|
||
|
"list": [
|
||
|
{
|
||
|
"datasource": "gdev-postgres",
|
||
|
"includeAll": false
|
||
|
},
|
||
|
{
|
||
|
"datasource": "gdev-mysql",
|
||
|
"hide": 0
|
||
|
},
|
||
|
{
|
||
|
"datasource": "gdev-random",
|
||
|
"label": "Datacenter"
|
||
|
}
|
||
|
]
|
||
|
}
|
||
|
}
|