24 Commits

Author SHA1 Message Date
3dccd29f89 Repeating: Minor refactoring and unification for DashboardGridItem and AutoGridItem (#109723)
* Repeating: Refactoring and unification

* Update

* update

* fix e2e

* fixes

* Update

* adjust e2e test

---------

Co-authored-by: Sergej-Vlasov <sergej.s.vlasov@gmail.com>
2025-08-18 12:02:45 +02:00
20c700dd52 Chore: reduces barrel files part II (#107688)
* Chore: reduce barrel files

* chore: fixes unit test

* Chore: reduces barrel files part II

* chore: fix import sorting
2025-07-09 06:15:33 +02:00
61f5f215ee Dashboards: Implement rows repeat in rows layout (#99300) 2025-02-03 11:46:47 +02:00
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
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
2485286c03 DashboardScene: Move DashboardGridItem (#95768)
* DashboardScene: Move DashboardGridItem

* fix lints

* fixes
2024-11-05 08:05:09 +01:00
1941ae21d7 DashboardScene: Refactor body property to be layout manager interface (#93738)
* Began layout refactor

* fixing tests

* Progress

* Progress

* Progress

* Progress

* Progress

* Progress

* finally no errors

* Remove unused interface

* Remove unused interface

* fixed tests

* Update

* Update

* Fixes to keyboard shortcuts and solo route

* fix lint issues
2024-09-27 15:11:28 +02:00
4a4e3a4063 DashboardScenes: Use behavior for library panels (#90886)
* wip - refactor using libPanelBehavior

* wip

* wip

* wip

* migrate test

* wip

* nearly all tests done, except one commented which breaks

* migrate last test

* revert defaults.ini

* fix tests

* tests + fixes

* fix

* fix bug -- adding lib panel through CTA in empty dashboard didn't enter edit mode

* show unsaved lib panel changes modal

* fix height problems

* fix

* LibPanelBehavior: Fixes view panel and edit panel full page reload issues (alt fix)  (#92850)

* LibPanelsBehavior: Fixes view panel

* Sort of working except panel edit

* Got panel edit working

* LibraryPanelsBehavior: Simpler fix

* Cleanup

* Remove more stuff

* Update tests

* fix tests

* Work around timing issues

* remove log

* fix repeated panels not showing due to gridItem height not being set + translations

* remove log that affects tests

---------

Co-authored-by: Victor Marin <victor.marin@grafana.com>

* fix translations

* Fix save issue

---------

Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
2024-09-05 18:08:25 +03:00
31c9084a3a DashboardGridItem: Fixes repeating panels issue when variable depends on time range (#92661)
* DashboardGridItem: Fixes repeating panels issue when variable depends on time range

* tests

---------

Co-authored-by: Victor Marin <victor.marin@grafana.com>
2024-08-30 15:50:09 +03:00
1897de68d4 DashboardGridItem: Add placeholder option when repeat panel options are empty (#91149)
* add placeholder option for repeat panel with empty options

* add tests and update to scenes canary

* adjust tests to not fail on expected console.error
2024-07-31 17:08:29 +03:00
e7f9d592f0 Revert "Scenes: Fixes issue with panel repeat height calculation (#90221)" (#90478)
This reverts commit 5cab595f451098059d77d6d7f77dba957116d991.
2024-07-16 17:19:51 +02:00
5cab595f45 Scenes: Fixes issue with panel repeat height calculation (#90221)
* Scenes: Fixes issue with panel repeat height calculation
2024-07-09 16:03:32 +01:00
9cd7c87b48 DashboardScene: Fixing major row repeat issues (#87539)
* DashboardScene: Fixing major row repeat issues

* Fixing edit scope

* Use dashboard variableDependendency to notify row repeat behaviors

* update scenes lib

* Do not repeat if values are the same

* Update public/app/features/dashboard-scene/scene/DashboardScene.tsx

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>

* Updated scenes

* Update

* Update

* Do not render row actions for repeated rows

* Fixed e2e

---------

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
2024-05-14 12:39:10 +02:00
3c69de6be5 Chore: removing some type assertions (#85839)
* fix some type assertions in loops

* some more cleanup

* some alerting fixes

* put comments in correct place to ignore rule

* couple more

* undo SilencesFilter changes
2024-04-10 14:54:31 +01:00
a4ff2abd9d PanelGridItemRepeater: Refactor (#84710)
* wip

* serialisation tests updates

* VizPanelManager test updates

* ests updates

* Making it green

* Use DashboardGridItem instead of SceneGridItem

* Cleanup tests that unnecessarily depend on dashboard grid items

* Fix row repeater behavior test

* Update public/app/features/dashboard-scene/panel-edit/PanelEditor.tsx

Co-authored-by: Oscar Kilhed <oscar.kilhed@grafana.com>

* Fix unnecessary library panel changes detection

* Fix test

---------

Co-authored-by: Oscar Kilhed <oscar.kilhed@grafana.com>
2024-03-21 14:38:00 +01:00
4b0547014a Scenes/LibraryPanels: Fix transformSceneToSaveModel for library panel repeats (#83843) 2024-03-05 14:09:24 +00:00
f20053e4b6 DashboardScene: Allow editing panel links (#81560)
* Panel links supplier for VizPanel

* Update panel links behavior

* Allow editing panel links

* Update so that single link is rendered without a dropdown

* Serialise links in scene -> save model transformation

* Betterer fix

* Fix inspect json tab test
2024-01-31 13:30:27 +02:00
6e80a3d59b DashboardScene: Viewer role only support (#76748)
* Allow starring DashboardScene

* Add feature toggle to enable dashbaord scene for viewers

* Basics for proxying viewers to a dashboard scene

* Removed isHomeDashboard flag

* Don't use proxy for rendering dashboard page

* Revert "Don't use proxy for rendering dashboard page"

This reverts commit 95836bdb2c33426db942825f4676ce5356965f9b.

* Pre-fetch dashboard prior page rendering

* Depend only on dashboard permissions

* Update default home dashboard to proper model...

* Fix breadcrumbs

* Types update

* Dashboards page proxy tests

* Fix missing controls

* URLs generation

* DashboardScenePageStateManager caching test

* Tests updates

* Fix wrong import

* Test update

* Gen
2023-11-02 12:02:25 -07:00
120247667b DashboardScene: Transform scene repeats to snapshot (#76428)
* WIP : Transform scene panel repeats to snapshot

* Set scoped vars correctly on repeated panel snapshot

* Row repeats snapshots

* Fix scoped vars for repeated rows

* Tests

* Fix merge
2023-10-23 02:46:35 -07:00
46dc898a87 Fix container width not being set after latest scenes update (#76372)
* Fix container width after latest scenes update

* typecheck
2023-10-11 17:56:50 +03:00
ff0642bf6e Chore: Type improvements 🧹 (#75271)
* fix some e2e flows types

* some type fixes

* must... fix... more...

* MOAR

* MOREMOREMORE

* 1 more
2023-09-22 15:06:49 +01:00
0c44a6f9bb Chore: Improve typings 🧹 (#74599)
* various type fixes

* candlestick panel type fixes

* few more fixes

* some fixes

* more :)

* moar!

* undo change to SilencesFilter

* undo change to configureStore
2023-09-13 09:17:07 +01:00
d82a3c9fc6 DashboardScene: Repeat panel by variable (#74294)
* Progress

* think this a bad approach

* Scene panel repeats looking good

* Update

* update

* Update

* Use key instead for inspect/view

* refactorings to improve tests

* Update

* More tests

* Update

* added support for key / value variables

* Update

* Fixes

* remove log

* Update

* Removed old gdev templating dashboard and added new and improved one

* Update

* Added repeating panels coded demo

* Update to latest scenes lib

* review feedback fixes

* update

* Sync schema
2023-09-05 13:51:46 +02:00
eab6250142 DashboardScene: Move to new folder structure, some refactorings and progress on inspect (#73810)
* Progress refactoring

* Update

* Update

* Update

* DashboardScene: Folder struct propsal

* Rename loading to persistance

* Moving and renaming
2023-08-25 14:11:47 +02:00