Files
grafana/pkg/schema/testdata/trimapplydefaults/disjuctList.txtar
ying-jeanne 227c8403b5 Fix the disjuction of panels (#39412)
[As code] Correct trim apply defaults when import/export dashboards
2021-10-06 11:39:23 +02:00

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"
}
]
}
}