* Create basic logic for stateless variables
* Refactor function to get DS from queries and variables
* Simplify code, remove unnecessary wrappers
* Fix typo
* improve naming
* Add unit test for variables
* Fix tests
* Add extra logic to keep backwards compatibility, variables can be used without dashboard scene
* Adjust logic for variables ds
* Refactor code, pass dsReferenceMap
- Rename `initializeMapping` into `initializeElementMapping`
- Create new `initializeDSReferencesMapping` to track queries without explicit datasources
- Fix panel datasource detection to use default datasource when none is specified
- Improve datasource resolution by searching for best match by query kind
- Add unit test
---------
Co-authored-by: alexandra vargas <alexa1866@gmail.com>
Co-authored-by: Alexa V <239999+axelavargas@users.noreply.github.com>
Co-authored-by: Ivan Ortega Alba <ivanortegaalba@gmail.com>
* wip: Create a proxy state manager to avoid complexity
* Read path redirecting
* add tests for unified dashboard API
* add tests
* Contemplate both formats in DashboardProxy
* Fix force old
* Fix tests for proxy
* catch errors
* Save as V2 when dynamic dashboard is enabled
* Improve tests
* Remove feature toggle
* Use kubernetesDashboards for e2e suite
* Fix issue when loading snapshots
* Fix typescript errors
* Integrate with backend conversion error
* Remove legacy annotation
* fix snapshot loading; lint
* Add missing hideTimeControls
* fix test
* make setupDashboardAPI to all suites
* refactor getDashboardAPI
* Add tests
* fix DashboardScenePage tests
* fix tests
* fix go tests
* Refactor to understand better the need of transforming to v2 to compare
* Fix detect changes logic
* yes status from schema gen
---------
Co-authored-by: alexandra vargas <alexa1866@gmail.com>
Co-authored-by: Haris Rozajac <haris.rozajac12@gmail.com>
* Create element panel lookup table
* When transforming to schema v2 get the element_identifier
* Add element identifier logic to layouts
* Retrieve element id in the serialization of each layout
* Keep ElementMapping updated when adding, removing panels
* Add basic unit test
* Wip: implement element mapping in serializer
* Remove Singleton
* Apply suggestions from code review
Co-authored-by: Haris Rozajac <58232930+harisrozajac@users.noreply.github.com>
* bring back missing functions - poc works at this point
* Move getElementIdentifierForVizPanel to dashboardSceneGraph
* poc - don't keep elementMapping updated
* Move logic to layout type serializer
* Remove unused code and remove layout tests
* clean up code, remove unnecessary functions
* Fix issue with initializeMapping
* remove console errors
* Remove testing code from response transformers
* Add unit test for DashboardSceneSerializer
* reset file, change not needed
* Improve comments on getElementIDForPanel
---------
Co-authored-by: Haris Rozajac <58232930+harisrozajac@users.noreply.github.com>
* 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
* Dashboard: Schema V2 - Remove Dashboard id from spec
* Fix issue with dashboard id used in examples and serializers for schema v2
* Fix snapshot test
* Schema v2: Reason about new dashboard based on UID
* Fix test
* Alerting: respect isNew dashboard for legacy and new arch
* Translate untranslated strings
* Unify is new checks
* PanelInspectDrawer update
* typo fix
* on close test for panel inspect drawer
* Update public/app/features/alerting/unified/PanelAlertTabContent.tsx
* 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
* 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>
* 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>
* 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