Commit Graph

14 Commits

Author SHA1 Message Date
Kévin Gomez 77f7ab27be
Use cog as a cli tool to generate code for kinds v2 schemas (#99044)
* Use cog as a cli tool to generate code for kinds v2 schemas

* Update imports to dashboard v2 package in frontend

* Ensure cog is installed before using it
2025-01-16 13:18:47 +01:00
Haris Rozajac f3d2313f09
Dashboard SchemaV2: Panel repeater (#98654)
* Wip: working layout for repeaters

* Update schema

* only persist orig panel

* Keep only supported mode and rename repeater function

* refactor dimension calcs

* v1 transformer uses calculateGridItemDimensions
2025-01-10 08:09:06 -07:00
Alexa V f04d72a49c
Dashboards: SchemaV2 - Fix default datasource logic (#98573)
Get defaultDatasource config option from config.bootData.settings.defaultDatasource
2025-01-09 11:51:53 +02:00
Haris Rozajac 8b72e2188a
Dash-SchemaV2: Don't persist undefined fields (#98493)
Don't persist undefined values
2025-01-07 10:54:56 -07:00
Dominik Prokop e974cb87d8
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>
2025-01-02 12:23:58 +01:00
Haris Rozajac a110917577
Dashboard SchemaV2: V2 -> Scene -> V2 integration test (#98146)
* Tests for layout, transformations; displayMode

* wip

* fix annotations

* fix panel query and transformation topic

* fix dash id, default options, fieldConfig

* Complete integration test

* fix annotation query

* Fix test

* Clarify

* Have default value of builtIn

* update import path
2024-12-31 11:43:04 -07:00
Ivan Ortega Alba a06779614e
Implement detect changes tracking to V2 Schema (#98153)
Co-authored-by: Haris Rozajac <haris.rozajac12@gmail.com>
2024-12-19 13:00:59 +02:00
Haris Rozajac 27c979b0bf
Dashboard SchemaV2: Use id in PanelSpec (#98069)
* PanelSpec: replace uid with id

* Update examples
2024-12-17 08:35:55 -07:00
Dominik Prokop f8686be56a
Schema v2: Make DashboardScene accept v1 and v2 schema (#96931)
* WIP

* Refactor useSaveDashboard to make it dashboard type independent when used

* DashboardPrompt: makeit Dashboard type independent

* DashboardScene: accept both v1 and v2 schema

* Update save dashboard command interface

* Fix test

* Lint

* Refactor

* Add onSaveComplete to DashboardSceneSerializer

* Cleanup tests

* Remove unused code

* Refactor dashboard tracking information

* added a todo

* Fix betterer

* Update betterer results
2024-12-13 10:20:22 +01:00
Haris Rozajac c4e19f3570
Dashboard Schema v2: Panel links (#97441)
* panel links

* Update transformer scene -> v2; update snapshot

* clean up

* data links test

* Remove type assertion
2024-12-09 08:23:23 -07:00
Haris Rozajac 4721d5164b
Dashboard Schema v2: Transformation to v2 supports annotations (#96787)
* Annotations

* Default to configured default DS when datasource is undefined

---------

Co-authored-by: Ivan Ortega <ivanortegaalba@gmail.com>
Co-authored-by: alexandra vargas <alexa1866@gmail.com>
2024-11-28 12:36:09 +02:00
Kévin Gomez c8d3ea58f8
Support importing local cue modules when generating TS types with cog (#96876)
* Support importing local cue modules when generating TS types with cog

* Generate enums as unions of values instead of an actual `enum` statement

* Update transformers to use the new TS enums

* Update go workspaces

---------

Co-authored-by: Ivan Ortega <ivanortegaalba@gmail.com>
2024-11-28 10:45:31 +01:00
Ivan Ortega Alba 1a7faed56a
Add tests to SceneToSaveModelV2 transformer (#96700)
* Add tests to SceneToSaveModelV2 transformer

* Add text properties always
2024-11-20 14:53:58 +02:00
Alexa V 3c182a37fa
Transform DashboardScene into Schema V2 (#95546)
---------

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
Co-authored-by: Ivan Ortega Alba <ivanortegaalba@gmail.com>
Co-authored-by: Haris Rozajac <haris.rozajac12@gmail.com>
2024-11-19 13:01:40 +01:00