Commit Graph

62 Commits

Author SHA1 Message Date
Sergej-Vlasov 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
Sergej-Vlasov bbe21bb1d2
Bump Scenes to 5.42.0 (#100205)
* update scenes and weekStart prop type

* update test

* adjust weekStart type in schemaV2

* clean up weekStart error message

* clean up weekStart in test data
2025-02-11 13:20:47 +00:00
Haris Rozajac 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
Oscar Kilhed 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
Haris Rozajac 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
Alexa V 0fced84796
Dashboards: SchemaV2 - Fix saving dashboards on folder (#100037)
* Remove folder annotations not relevant to v2 api
* Add unit test for folder annotations
2025-02-04 12:57:38 +02:00
Alex Khomenko f51eacef9a
RTK APIs: Extract base query logic (#99800)
* RTK APIs: Extract base query function

* Add error handling

* Add return type

* Use createBaseQuery in browseDashboards

* Support custom manageError

* Export getConfigError

* Remove redundant type

* data -> body
2025-01-31 14:25:16 +02:00
Dominik Prokop bfdd00665b
Schema V2: Support v2 custom home dashboards (#99748) 2025-01-31 10:36:56 +01:00
Alexa V bda4deb20c
Dashboards - Schema V2 - Implement move dashboards using v2 api (#99664)
* Dashboards - Schema V2 - Implement move dashboards using v2 api
* Fix root folder uid not being picked by FolderPicker
2025-01-31 10:30:39 +01: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
Dominik Prokop ae62b3817b
Dashboards: Change the way dashboard not found error is handled (#98950)
* Get rid of _dashboardLoadFailed

* Get rid of dashboardNotFound meta

* Update public dashboards tests

* Fix DashboardPage tests

* DashboardPageProxy tests

* DashboardScenePageStateManager test fix

* Beterer

* Fix merge

* Nits

* Fix test

* remove debugger

* Update get folder to throw

* translate error title

* Update public/app/features/apiserver/types.ts

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

* Update public/app/features/dashboard/services/DashboardLoaderSrv.ts

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

* Update public/app/features/dashboard/services/DashboardLoaderSrv.ts

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

* Update public/app/features/dashboard/services/DashboardLoaderSrv.ts

Co-authored-by: Haris Rozajac <58232930+harisrozajac@users.noreply.github.com>

* Betterer

* Update test cases

* More test updates

* More translations

---------

Co-authored-by: Ivan Ortega Alba <ivanortegaalba@gmail.com>
Co-authored-by: Haris Rozajac <58232930+harisrozajac@users.noreply.github.com>
2025-01-27 15:54:10 +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 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
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
Haris Rozajac 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
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 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
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
Dominik Prokop 79d8201b49
Dashboards API: v0 k8s dashboards saving (#98695)
* Dashboards API: v0 k8s dashboards saving

* Build dashboard url with a slug

* fix test

* fix test

---------

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2025-01-08 23:58:54 +01:00
Ivan Ortega Alba 51d9b577d5
DashboardV2: Add support for revision and gnetId in schema and response transformers (#98477) 2025-01-03 13:17:27 +01:00
Dominik Prokop 0836f71da6
Schema v2 queries transformation: Respect panel defined data source (#98444) 2025-01-03 10:25:06 +01: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
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
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
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
Jack Westbrook 1fc9b4bfc1
Chore: Remove dashboard state barrel file (#97562)
* refactor(dashboard-state): delete dashboard/state barrel file and update imports

* chore(betterer): update results
2024-12-06 16:01:51 +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
Georges Chaudy e270412dbf
unistore: wire the authz client (#96632)
* unistore: wire the authz client

* rename dashboards.grafana.app into dashboard.grafana.app

* wire the authz client

* wire the authz client

* resuse the Standalone constructor

* configure default migration for resource folder

* add tests

* cleanup

* add logging
2024-11-19 15:13:30 +02:00
Bogdan Matei 97c0ff2ae4
Dashboards: Reload the dashboard based on time range and filters changes (#94190) 2024-10-25 15:56:54 +03:00
Bogdan Matei 2a2813b577
Scopes: Reload dashboards when on scopes change (#92804) 2024-09-12 13:58:45 +02:00
Juan Cabanas 8b2091ee4f
ShareDrawer: Improvements (#92956) 2024-09-06 09:37:00 -03:00
Bogdan Matei 3303900c09
Scopes: Lift scopes at global level (#90136) 2024-08-12 14:11:50 +03:00
Ryan McKinley 529d4e1169
Dashboards: Use dashboard_api k8s wrapper for save options also (#89598) 2024-06-26 13:35:04 +03:00
Ryan McKinley 4651506319
K8s/Dashboards: Replace multiple calls with a single endpoint (#89639) 2024-06-26 07:27:52 +03:00
Ryan McKinley 579bfa477e
K8s: improve frontend resource client (#89621) 2024-06-24 18:25:04 +03:00
Bogdan Matei 543e71eb28
Scopes: Pass selected scopes to dashboard JSON fetching (#89157) 2024-06-20 18:49:19 +03:00
Juan Cabanas 7664b89209
ShareModal: Share externally (#88259) 2024-06-12 17:02:06 -03:00
Ryan McKinley 41e0430f83
K8s/Dashboards: Add frontend api to switch between implementations (#88632) 2024-06-05 17:34:23 +03:00
Juan Cabanas a85c1b69d5
PublicDashboards: Remove publicDashboardUid from DashboardMeta (#85126) 2024-05-23 11:21:21 -03:00
Juan Cabanas 5147bdeb4b
PublicDashboards: Revoke all public dashboards access to a specific user (#78709) 2023-12-11 16:55:16 -03:00
kay delaney d0180957d1
Scenes/ShareModal: Implement public dashboard tab (#76837)
Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
2023-11-14 17:05:24 +00:00
Juan Cabanas ee73d41d24
PublicDashboards: Audit table pagination (#69823) 2023-06-21 10:48:09 -03:00
Juan Cabanas 9890ff7c92
PublicDashboards: Audit table redesign (#68137) 2023-05-29 12:59:29 -03:00
Juan Cabanas fc3737bf4f
PublicDashboards: Email sharing users page (#67124) 2023-04-27 14:20:03 -03:00
juanicabanas 10476043ea
PublicDashboards: Reshare public dashboard to recipient API call (#64178) 2023-03-06 16:09:19 -03:00
juanicabanas 528dc28657
PublicDashboards: Add recipient uid to recipient list (#64076)
uid added for recipients
2023-03-02 17:15:56 -05:00