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

@@ -33,7 +33,7 @@ Verifies common usecases for trimdefault/applydefault functions:
}
}
-- Trimed --
-- Trimmed --
{
"timepicker": {
"collapse": true

View File

@@ -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
}

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

File diff suppressed because it is too large Load Diff

View File

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

View File

@@ -39,7 +39,7 @@ Verifies common usecases for trimdefault/applydefault functions:
}
}
-- Trimed --
-- Trimmed --
{
"templating": {
"list": [