Commit Graph

22 Commits

Author SHA1 Message Date
Bogdan Matei 61f5f215ee
Dashboards: Implement rows repeat in rows layout (#99300) 2025-02-03 11:46:47 +02:00
Oscar Kilhed 800c9fa3e6
SchemaV2: Rows in dashboard schema v2 (#99239)
* Testing out rows in schemav2

* update schema

* loading sort of works

* descibe position in relation to row

* add row repeats by variable

* explain ts-expect-error

* Save repeats as well

* Update tests for repeat behavior of rows

* Don't add the clones of the repeated rows

* Add row support for response transformer for V2

* Add row actions

* fix panel name

* fix merge issue

* fix tests

* Implement ensureV1

* set key of GridRow

* fix lint issue

* When going from V2 to V1 rows should be assigned unique ids following max panel id

* remove old comment

* Add panel repeats in V2 -> V1 transform
2025-01-30 15:24:37 +02:00
Alexa V 30c8ac7108
Dashboard: Schema V2 - Remove Dashboard id from spec (#99590)
* Dashboard: Schema V2 - Remove Dashboard id from spec

* Fix issue with dashboard id used in examples and serializers for schema v2

* Fix snapshot test
2025-01-29 10:13:56 +01:00
Alexa V 8f3fd8f91d
Schema v2: Write Path Implement saveDashboard in v2 client API (#98263)
Create new function for save dashboards written in schema v2 and using the v2 api from k8s
2025-01-27 14:14:19 +01:00
Ivan Ortega Alba 83bbdbf8b6
LibraryPanel: Use id and title from panel model (#99281) 2025-01-23 13:57:45 +02:00
Haris Rozajac 1c8a7d8872
Dashboard Schema V2: Remove type assertions and anys from schemav2 code (#99222)
* Remove type assertions and anys from schemav2 code

* Handle type conversion

* fix test

* Filter undefined
2025-01-22 09:45:49 -07:00
Dominik Prokop daced46d27
Schema v2: Remove schemaVersion property (#99375)
* Schema v2: Remove schemaVersion property

* ah snap
2025-01-22 16:52:34 +01:00
Ivan Ortega Alba 95d4f83889
DashboardSchema: Add library panel to v2 (#98484)
Co-authored-by: Haris Rozajac <haris.rozajac12@gmail.com>
2025-01-20 12:44:36 +01:00
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