Files
grafana/apps/dashboard/pkg/migration/conversion/testdata/input/v1beta1.dashboard-properties.json
T
Levente Balogh 0e6166a753 Dashboard Controls: Fix schema transformation for link placement (#114630)
* fix: add missing transformation for scenes -> save model v2

* fix: link placement transformation on the backend between schemas

* fix: update the openapi spec in the tests

* tes: add tests for `transformSceneToSaveModelSchemaV2`

* tests: extend conversion_test.go to cover link placements
2025-12-02 13:12:01 +00:00

172 lines
4.3 KiB
JSON

{
"kind": "Dashboard",
"apiVersion": "dashboard.grafana.app/v1beta1",
"metadata": {
"name": "dashboard-properties-test",
"labels": {
"test": "dashboard-properties"
}
},
"spec": {
"title": "Dashboard Properties Test",
"description": "Testing dashboard-level property transformations including time settings, cursor sync, and links",
"tags": ["test", "properties", "metadata"],
"editable": true,
"preload": true,
"liveNow": true,
"graphTooltip": 2,
"fiscalYearStartMonth": 4,
"timezone": "America/New_York",
"weekStart": "sunday",
"refresh": "30s",
"time": {
"from": "now-12h",
"to": "now"
},
"timepicker": {
"collapse": false,
"enable": true,
"notice": false,
"now": true,
"refresh_intervals": ["5s", "10s", "30s", "1m", "5m", "15m", "30m", "1h", "2h", "1d"],
"status": "Stable",
"time_options": ["5m", "15m", "1h", "6h", "12h", "24h", "2d", "7d", "30d"],
"type": "timepicker",
"hidden": false,
"nowDelay": "1m"
},
"links": [
{
"asDropdown": false,
"icon": "external link",
"includeVars": true,
"keepTime": true,
"tags": ["monitoring", "alerts"],
"targetBlank": true,
"title": "External Monitoring System",
"tooltip": "View in external system",
"type": "link",
"url": "https://monitoring.example.com/dashboard?from=${__from}&to=${__to}"
},
{
"asDropdown": true,
"icon": "dashboard",
"includeVars": false,
"keepTime": false,
"tags": ["grafana", "internal"],
"targetBlank": false,
"title": "Related Dashboards",
"tooltip": "Navigate to related dashboards",
"type": "dashboards",
"url": ""
},
{
"asDropdown": false,
"icon": "info",
"includeVars": false,
"keepTime": false,
"tags": [],
"targetBlank": true,
"title": "Documentation",
"tooltip": "View documentation",
"type": "link",
"placement": "inControlsMenu",
"url": "https://docs.example.com/dashboard-guide"
},
{
"asDropdown": false,
"icon": "tag",
"includeVars": true,
"keepTime": true,
"tags": ["alerts"],
"targetBlank": false,
"title": "Tag-based Link",
"tooltip": "Filtered by tags",
"type": "tag",
"url": "/dashboards/tag/alerts"
}
],
"panels": [
{
"id": 1,
"title": "Simple Panel",
"type": "stat",
"gridPos": {
"x": 0,
"y": 0,
"w": 12,
"h": 8
},
"targets": [
{
"refId": "A"
}
],
"fieldConfig": {
"defaults": {},
"overrides": []
},
"options": {}
}
],
"templating": {
"list": [
{
"name": "simple_var",
"type": "custom",
"query": "value1,value2,value3",
"current": {
"text": "value1",
"value": "value1"
},
"hide": 0,
"skipUrlSync": false
}
]
},
"annotations": {
"list": [
{
"name": "Simple Annotation",
"enable": true,
"hide": false,
"iconColor": "blue",
"target": {
"refId": "Anno"
},
"builtIn": 0
}
]
},
"style": "dark",
"version": 42,
"schemaVersion": 39,
"gnetId": 12345,
"iteration": 1640995200000,
"snapshot": {
"originalUrl": "http://localhost:3000/d/test",
"timestamp": "2023-01-01T00:00:00Z"
},
"meta": {
"canEdit": true,
"canSave": true,
"canStar": true,
"canAdmin": false,
"slug": "dashboard-properties-test",
"url": "/d/test/dashboard-properties-test",
"expires": "2024-01-01T00:00:00Z",
"created": "2023-01-01T00:00:00Z",
"updated": "2023-06-01T00:00:00Z",
"updatedBy": "admin",
"createdBy": "admin",
"version": 42,
"hasAcl": false,
"isFolder": false,
"folderId": 0,
"folderTitle": "General",
"folderUrl": "",
"provisioned": false,
"provisionedExternalId": ""
}
}
}