22 Commits

Author SHA1 Message Date
4f18ad30c9 SchemaV2: Remove legacy rows from schema v2. (#105238)
* save transparent setting

* make sure we test both transparent and non transparent

* no more legacy rows

* schema changes

* Add testing, fix first row offset

* Remove legacy row from transform test

* Remove panel that's not present in layout

* Remove expects after removing the row, fix lint issues

* Remove unused commit

* update codegen

* update openapi snapshot

* Fix snapshot

* add missing default prop

* Fix repeating, fix first row, fix not flushing last row

* Use correct repeater

* fix lint, remove unused empty check

* update codegen

* update openapi test snapshot
2025-05-26 14:33:30 +02:00
17d089d38a Schema V2: Use App SDK generated types (#103100)
* Use App SDK generated types

* Move examples

* Merge fix

* PAth updates
2025-04-02 16:22:24 +02:00
1a53e85bc5 DashboardSchemaV2: Fix crash in response transformer (#103041)
* DashboardSchemaV2: Fix crash in response transformer

* update test only test for the missing current prop

* restore warning
2025-04-01 09:13:11 +02:00
070d4b2ee4 SchemaV2: Accept rows with no panel property (#101503)
accept rows with no panel property
2025-03-03 11:19:17 +01:00
9ad6653871 Dashboard Schema V2: Improve diffing (#100022)
* improve diffing

* define dash spec props a-z

* Fix

* sort deep initialSaveModel

* update tests

* Fix test, description, and query ds issues

* Fix seralizer test

* response transformers

* skip panelMerge tests
2025-02-13 07:20:17 -07:00
d1dee968c3 Schema V2: Adjust quick_ranges in time settings and remove time_options (#100135)
* adjut quickRanges type in v2

* clean up unused time_options property

* remove deprecated time_options property on time picker

* add schema migration for time_options

* adjust test
2025-02-12 19:23:09 +00:00
f5d8f42635 Dashboard Scene: Fix unnecessary diffing (#100158)
* Fix unnecessary diffing

* use a diferent approach; update legacyId type

* fix test
2025-02-07 10:47:07 -07:00
a412394a14 Dashboards: Save rows and responsive grid layouts in v2 (#100035)
* save rows and responsive grid layouts in v2

* Add back accidentally removed assert

* adress feedback

* use getGridItemKeyForPanel

* Fix import

* fix another import

* Remove RowGridLayout
2025-02-07 14:45:04 +01:00
4c52abb6b4 Dashboard Schema V2: Introduce __legacyStringValue and deprecate string type for query prop in QueryVariableSpec (#99716)
* Introduce __legacyStringValue and deprecate string type for query

* Fix tests

* Fix tests

* remove default

* kind should default to default ds if variable doesn't have ds field

* lint

* getDefaultDataSourceRef should not return undefined
2025-02-06 07:33:06 -07:00
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
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
83bbdbf8b6 LibraryPanel: Use id and title from panel model (#99281) 2025-01-23 13:57:45 +02:00
a0e7569e4f Dashboard Schema V2: ResponseTransformers: Transform layout, panels, annotations and variables when ensuring v1 (#99050)
* wip

* Fix annotationV1

* variables

* tests

* Fix query variable

* Don't need extra chaining arg in maxPerRow

* Logic for libary panels; tests for variables and library panels

* lint
2025-01-22 08:56:20 -07:00
daced46d27 Schema v2: Remove schemaVersion property (#99375)
* Schema v2: Remove schemaVersion property

* ah snap
2025-01-22 16:52:34 +01:00
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
4f337b99d4 Dashboards Schema V2: ResponseTransformers: Transform remaining variables when ensuring v2 (#98777)
* add missing vars

* Don't create undefined variable fields

* tests

* Fix test; remove allValue from groupBy

* Fix tests

* betterer

* Use @ts-expect-error

* betterer
2025-01-17 09:54:42 -07:00
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
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
51d9b577d5 DashboardV2: Add support for revision and gnetId in schema and response transformers (#98477) 2025-01-03 13:17:27 +01:00
0836f71da6 Schema v2 queries transformation: Respect panel defined data source (#98444) 2025-01-03 10:25:06 +01:00
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
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