Commit Graph

18 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
Dominik Prokop 99e1780527
Revert "Schema v2: Reason about new dashboard based on UID (#98800)" (#98877)
This reverts commit 72846e3431.
2025-01-13 13:07:45 +01:00
Dominik Prokop 72846e3431
Schema v2: Reason about new dashboard based on UID (#98800)
* Schema v2: Reason about new dashboard based on UID

* Fix test
2025-01-13 12:16:35 +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
Haris Rozajac 6b03adbbb0
Dashboard V2: Snapshot variables and read snapshot (#98463)
* 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

* Enable snapshot variables

* Support getSnapshotUrl() for v2 serializer

* fix

* Make metadata available in the serializer

* Test

* Decouple meta info

* State Manager: Extract snapshot loading into loadSnapshot

* Fix tests

* Add test for snapshot url

* Don't expose dashboardLoaderSrvV2

* Remove TODO

* Bubble up loading snapshot error to error boundary

* Fix test

---------

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
2025-01-09 08:14:41 -07:00
Juan Cabanas f9c2a5fae9
Reporting: Disable lazy loading for panels (#98065) 2025-01-07 10:55:03 -03: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
Dominik Prokop bc96da3a95
Schema v2: Express isNew dashboard through client annotations (#98408)
* Schema v2: Express isNew dashboard through client annotations

* Betterer update

* Revert "Betterer update"

This reverts commit e9d1fe3c4e.
2024-12-31 11:56:42 +01:00
Dominik Prokop 746bde0fac
DashboardSceneSerializerLike: Update interface to support initial version and snapshot url (#98206)
* Make dashboard prompt ignoreChanges schema version independent

* Serializer: add interface for snapshot url retrieval

* Revert "Make dashboard prompt ignoreChanges schema version independent"

This reverts commit 65466c2ef1.

* Add dashbaord version to scene metadata

* Add tracking info

* Revert "Add tracking info"

This reverts commit 4c58c6687b.

---------

Co-authored-by: Ivan Ortega <ivanortegaalba@gmail.com>
2024-12-19 16:09:19 +01:00
Dominik Prokop 070f0e4457
Dashboard API versions handling (#96666)
* structure apic

* API versioning proposal

* Make api service independent from version

* Update v2

* Fix public dashboards page test

* Uncomment reload dashboard feature code

* Revert

* Betterer

* Fix imports

* useV2DashboardsAPI feature toggle

* POC/v2 schema: Add v1<-> v2 transformers (#97058)

* Make dshboard access interface more precise

* Add first pass for schema v1<->v2 transformers

* Update response transformer test

* Import fixes

* Manage dashboards validation: Handle v2 schema

* Handle new dashboard with v2

* Fix tests

* Move dashboard is folder error handling to legacy API implementation

* Add tests for dashboard api client

* betterer

* Use dashboard DTO when capturing dashbaord impression

* prettier

* Dashboard API: resolve folder metadata

* Add tests for resolving folder metadata

* Fix DashboardPicker

* Renames and nits

* POC Alternative Suggestion for  Dashboard API versions handling (#97789)

* Add transitional_dashboard_api, reset components that are not ready for v2 schema, and start working on migrating
DashboardPicker to use v2 schema

* reset DashboardScenePageStateManager

* Improve logic in transitional api, also remove isDashboardResource checks from components

* REmove transitional_dashboard_api and apply PR feedback

* Apply PR feedback, use 'v2' as a parameter and remove unnecesary if

* Fix tests

* Adding missing comments from original PR and also changing order to improve diffing in github :)

* update betterer

* fix prettier

* Add tests for DashboardPicker

* Do not use unified alerting mocks

* Fix unused type in dashboard test

* Improve comments in DahboardPicker

* Update folder validation fn

* Validation update

* Update legacy api test

* Lint

---------

Co-authored-by: alexandra vargas <alexa1866@gmail.com>
Co-authored-by: Alexa V <239999+axelavargas@users.noreply.github.com>
Co-authored-by: Ivan Ortega <ivanortegaalba@gmail.com>
2024-12-17 22:17:09 +01: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
Haris Rozajac 4871cd8825
Dashboard SchemaV2: v2->scene tests for layout, transformations (#97819)
* Tests for layout, transformations; displayMode

* remove fixme; update helper with the correct type

* Rename to transparent

* Fix
2024-12-13 15:29:22 -07: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 9e885cab7c
Dashboard Schema v2: Add tests for variables, annotations, and dataTransformer (#97314)
* Add tests for variables, annotations, dataTransformer

* Simplify variable validation; test additional variable fields

* Move helpers to a separate file

* remove unused param, rename helpers file

* fix

* Move remaining vizPanel test to helper

* use ts
2024-12-05 10:49:11 -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 d18cdae3e2
Schema V2 to DashboardScene: Settings + Panels (#96074)
* Transform Save mode to Scene: Settings

* Transform Save mode to Scene: Panels

---------

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
Co-authored-by: alexandra vargas <alexa1866@gmail.com>
Co-authored-by: Haris Rozajac <haris.rozajac12@gmail.com>
2024-11-27 14:35:37 +01:00