Schema v2: Read API integration (#97953)

* Introduce DashboardScenePageStateManagerLike interface

* Implement dash loader for handling v2 api

* Transformation improvements

* Update response transformer test

* v2 schema: Remove defaultOptionEnabled from ds variable schema

* v2 schema: Make annotations filter optional

* WIP render dashboard from v2 schema

* Force dashbaord scene for v2 api

* V2 schema -> scene meta transformation

* v2 api: Handle home dashboard

* Use correct api client in DashboardScenePage

* Correctly use v2 dashboard scene serializer

* Remove unnecesary type assertions

* Handle v2 dashboard not found

* Fix type

* Fix test

* Some more tests fix

* snapshot

* Add dashboard id annotation

* Nits

* Nits

* Rename v2 api

* Update public/app/features/dashboard-scene/serialization/transformSaveModelSchemaV2ToScene.ts

Co-authored-by: Ivan Ortega Alba <ivanortegaalba@gmail.com>

* add getDashboardsApiVersion test for forcing scenes through URL

* add links to ResponseTransformers

* Update public/app/features/dashboard/api/ResponseTransformers.test.ts

Co-authored-by: Ivan Ortega Alba <ivanortegaalba@gmail.com>

* Nit rename test case

* Add tests for DashboardScenePageStateManagerV2

* Update test

* Typecheck

* Add console error for debugging

* Fix typo

---------

Co-authored-by: Ivan Ortega Alba <ivanortegaalba@gmail.com>
Co-authored-by: Haris Rozajac <haris.rozajac12@gmail.com>
This commit is contained in:
Dominik Prokop
2025-01-02 12:23:58 +01:00
committed by GitHub
parent 8ab12aede4
commit e974cb87d8
24 changed files with 1594 additions and 422 deletions

View File

@@ -477,18 +477,17 @@ export const defaultVizConfigKind = (): VizConfigKind => ({
export interface AnnotationQuerySpec {
datasource?: DataSourceRef;
query?: DataQueryKind;
builtIn?: boolean;
enable: boolean;
filter: AnnotationPanelFilter;
hide: boolean;
iconColor: string;
name: string;
builtIn?: boolean;
filter?: AnnotationPanelFilter;
}
export const defaultAnnotationQuerySpec = (): AnnotationQuerySpec => ({
builtIn: false,
enable: false,
filter: defaultAnnotationPanelFilter(),
hide: false,
iconColor: "",
name: "",

View File

@@ -370,12 +370,12 @@ VizConfigKind: {
AnnotationQuerySpec: {
datasource?: DataSourceRef
query?: DataQueryKind
builtIn?: bool | *false
enable: bool
filter: AnnotationPanelFilter
hide: bool
iconColor: string
name: string
builtIn?: bool | *false
filter?: AnnotationPanelFilter
}
AnnotationQueryKind: {