Commit Graph

19 Commits

Author SHA1 Message Date
Alexa V 80e58efd46
Dashboard - Schema V2 Stateless variables (ds ref independent) (#102571)
* 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
2025-03-26 09:59:34 -06:00
Torkel Ödegaard dc922717dc
Dashboard: Auto grid options (#102374)
* Dashboard: Auto grid options

* Update

* Fix

* update trans

* Update cue

* Fix persisting auto grid options (#102744)

* Fix persisting auto grid options

* Update i18n

* fix serializer test

* update schema

* reset dashboard_object_gen.go files, run update-codegen.sh

* rename in code

* rename height fill in schema

* rename heightFill fillScreen in code

* fix test

---------

Co-authored-by: oscarkilhed <oscar.kilhed@grafana.com>
2025-03-25 16:40:28 +01:00
Haris Rozajac 26acc66ea3
Dashboard - Schema V2 Stateless (ds ref independent) queries (#101661)
- 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>
2025-03-20 12:45:25 -06:00
kay delaney 4eab2ea9d3
Scenes: Implement drag and drop support for SceneCSSGridLayout (#99386)
* Draft: Move css grid stuff to main

* Scenes: Implement drag and drop support for SceneCSSGridLayout

* Fix some nits

* WIP Refactor

* Added a comment

* Add orchestrator to v2schema and fix error (#100964)

* Add orchestrator to v2schema and fix error

* Display placeholder directly when starting to drag

---------

Co-authored-by: kay delaney <kay@grafana.com>

* Fix merge issue

* Fix panel drag offset and remove console.logs

* Fix small nit

* Fix issue where layout options weren't refreshed on changing layout

* Return empty array from useEditPaneOptions if dashboard body isn't LayoutOrchestrator

* Expect layoutOrchestrator when serializing scene

* Fix tests to expect orchestrator instead of layoutManager

* Fix tests in transformSaveModelSchemaV2ToScene.test.ts

* Fix tests in transformSceneToSaveModelSchemaV2.test.ts

* More test fixes

* fix lint issues

* Small fixes

* default to adding layout orchestrator?

* Empty commit

* delete artifactspage.go

* remove artifactspage.tmpl.html

* betterer

* WIP refactor, not ready for review

* Slightly fix placeholder behavior. still broken though

* Fixed some visual glitches. Still very buggy

* Fix layout bugginess when initiating dragging

* more WIP

* Fix some broken logic

* clean up

* Move LayoutOrchestrator to dashboard state

* More cleanup

* Fix misaligned placeholders after changing layout options or resizing browser

* Fix issue with dragging vs selection

* Fix scroll position jumping when dragging in vertically-oriented grid

* Fix import order errors

* Remove '!' from layoutOrchestrator references

* Add LazyLoader support

* Dynamic Dashboards: Responsive Grid drag and drop minor fixes (#102430)

Changes

---------

Co-authored-by: Oscar Kilhed <oscar.kilhed@grafana.com>
Co-authored-by: Bogdan Matei <bogdan.matei@grafana.com>
2025-03-19 13:53:58 +02:00
Sergej-Vlasov bf9a34f2ca
TimePicker: Ability to manually specify quick ranges (#101465)
* add quickRanges to scene model transforms

* add test for quickRanges transformations

* fix lint
2025-03-04 10:45:24 +00:00
Torkel Ödegaard 436dc86a09
TabsLayout: Implements url sync and removes double scene object reference (#101115)
* TabsLayout: Implementts url sync and removes double scene object reference

* Do not allow removing last tab

* Update public/app/features/dashboard-scene/scene/layout-tabs/TabsLayoutManager.tsx

Co-authored-by: Bogdan Matei <bogdan.matei@grafana.com>

* Update public/app/features/dashboard-scene/scene/layout-tabs/TabsLayoutManager.tsx

Co-authored-by: Bogdan Matei <bogdan.matei@grafana.com>

* Update

---------

Co-authored-by: Bogdan Matei <bogdan.matei@grafana.com>
2025-02-22 11:06:29 +01:00
Oscar Kilhed 855eadcabd
Dashboards: Tabs layout persistence (#100485)
* Tabs layout persistence

* fix lint issue

* Add tests, add tabs serializer to registry

* Fix deserialize tabs

* more tests

* tab item title optional

* change TabItemKind -> TabLayoutTabKind

* add tests for tabs serializer

* fix name in test

* Fix test after renaming tabs
2025-02-17 12:50:26 +01:00
Oscar Kilhed 6ee3c71ffe
Dashboards: refactor transform scene layout to save model and transform save model to scene layout, schema v2 (#100322)
* Add tests

* refactor transformSaveModelToSchemaV2 and transformSceneToSaveModelV2

* move default grid serializer functions outside of class

* simplify layoutmanager descriptor

* add test for SaveModel -> Scene

* Fix lint issues

* remove auto added import

* Fix name

* Fix test typo
2025-02-11 13:08:07 +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
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
Torkel Ödegaard e0cfd12fb3
Dashboard: Edit mode element selection (#97718)
* Dashboard: Edit mode elemenmt selection

* Add new panel to rows layout (#97729)

* Add new panel to rows layout

* Use `DashboardEditPane` to obtain selected object

* Fixed rows bottom padding issue

* Update

* Minor fix

* Update

* Update

* Update

---------

Co-authored-by: Bogdan Matei <bogdan.matei@grafana.com>
2025-01-13 12:15:16 +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
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
Torkel Ödegaard 71b8f487e0
Dashboards: Rows layout & editing (#96895)
* Dashboard: Panel edit and support for more layout items

* It's working

* Fix discard issue

* remove unused file

* Update

* Editing for responsive grid items now work

* Update

* Update

* Update

* WIP rows

* progres

* Progress

* Progress

* Focus selection works

* Update

* Update

* Progress

* Update

* Editing rows work

* Row editing works

* fix delete

* Update

* Row options fix

* Fix selecting rows

* Update

* update

* Update

* Update

* Remove cog icon button

* add import to toolbar

* Update

* Update
2024-12-10 07:21:30 +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
Torkel Ödegaard 06d0d41183
Dashboard: Edit pane in edit mode (#96971)
* Dashboard: Edit pane foundations

* Update

* fix panel edit padding

* Restore scroll pos works when feature toggle is disabled

* Update

* Update

* remember collapsed state

* Update

* fixed padding issue
2024-11-26 14:39:09 +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