mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Fix the disjuction of panels (#39412)
[As code] Correct trim apply defaults when import/export dashboards
This commit is contained in:
@@ -33,7 +33,7 @@ Verifies common usecases for trimdefault/applydefault functions:
|
||||
}
|
||||
}
|
||||
|
||||
-- Trimed --
|
||||
-- Trimmed --
|
||||
{
|
||||
"timepicker": {
|
||||
"collapse": true
|
@@ -17,19 +17,19 @@ Verifies common usecases for trimdefault/applydefault functions:
|
||||
|
||||
-- Full --
|
||||
{
|
||||
"id": 42,
|
||||
"uid": "emal8gQMz",
|
||||
"style": "light",
|
||||
"editable": true,
|
||||
"graphTooltip": 0,
|
||||
"id": 42,
|
||||
"schemaVersion": 27,
|
||||
"version": 2,
|
||||
"graphTooltip": 0
|
||||
"style": "light",
|
||||
"uid": "emal8gQMz",
|
||||
"version": 2
|
||||
}
|
||||
|
||||
-- Trimed --
|
||||
-- Trimmed --
|
||||
{
|
||||
"id": 42,
|
||||
"uid": "emal8gQMz",
|
||||
"schemaVersion": 27,
|
||||
"uid": "emal8gQMz",
|
||||
"version": 2
|
||||
}
|
71
pkg/schema/testdata/trimapplydefaults/disjuctList.txtar
vendored
Normal file
71
pkg/schema/testdata/trimapplydefaults/disjuctList.txtar
vendored
Normal file
@@ -0,0 +1,71 @@
|
||||
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"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
5749
pkg/schema/testdata/trimapplydefaults/fullDashboard.txtar
vendored
Normal file
5749
pkg/schema/testdata/trimapplydefaults/fullDashboard.txtar
vendored
Normal file
File diff suppressed because it is too large
Load Diff
@@ -20,27 +20,27 @@ Verifies common usecases for trimdefault/applydefault functions:
|
||||
-- Full --
|
||||
{
|
||||
"annotations": {
|
||||
"list": [
|
||||
{
|
||||
"builtIn": 1,
|
||||
"datasource": "-- Grafana --",
|
||||
"name": "Annotations & Alerts",
|
||||
"type": "dashboard",
|
||||
"showIn": 0
|
||||
}
|
||||
]
|
||||
"list": [
|
||||
{
|
||||
"builtIn": 1,
|
||||
"datasource": "-- Grafana --",
|
||||
"name": "Annotations & Alerts",
|
||||
"showIn": 0,
|
||||
"type": "dashboard"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
-- Trimed --
|
||||
-- Trimmed --
|
||||
{
|
||||
"annotations": {
|
||||
"list": [
|
||||
{
|
||||
"builtIn": 1,
|
||||
"datasource": "-- Grafana --",
|
||||
"name": "Annotations & Alerts"
|
||||
}
|
||||
]
|
||||
"list": [
|
||||
{
|
||||
"builtIn": 1,
|
||||
"datasource": "-- Grafana --",
|
||||
"name": "Annotations & Alerts"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
@@ -39,7 +39,7 @@ Verifies common usecases for trimdefault/applydefault functions:
|
||||
}
|
||||
}
|
||||
|
||||
-- Trimed --
|
||||
-- Trimmed --
|
||||
{
|
||||
"templating": {
|
||||
"list": [
|
Reference in New Issue
Block a user