Commit Graph

61 Commits

Author SHA1 Message Date
Dominik Prokop
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
Bogdan Matei
b23541c298 Implement Scopes UI (#82920) 2024-03-21 13:01:47 +02:00
kay delaney
c13e248384 Scenes: Fix issue with discarding unsaved changes modal in new dashboards (#84369) 2024-03-15 09:58:08 +00:00
Victor Marin
90e0f8cab6 Allows re-entering edit mode after version restore (#84298)
* Allows re-entering edit mode after version restore

* refactor

* revert to previous commit
2024-03-13 18:24:26 +02:00
Dominik Prokop
8c7e65f6f4 Dashboard settings: Allow saving dashboard from JSON model view (#84343)
* Dashboard settings: Allow saving dashboard from JSON model view

* Dashboard settings: Allow saving dashboard from JSON model view

* Review fix
2024-03-13 16:15:40 +01:00
Dominik Prokop
7c1ad64bb2 DashboardScene: Make sure dashboard prompt is shown when navigating away way from an edited dashboard (#84077)
DashboardScene: Make sure dashboard prompt is shown when navigating away from an edited dashboard

Co-authored-by: Oscar Kilhed <oscar.kilhed@grafana.com>
2024-03-12 16:12:00 +01:00
Dominik Prokop
39b682e333 DashboardScene: Fix dashboard being restored to initial state after successful save (#84183)
* Failing test

* Do not restore initial state after edit mode exit when dashboard is not dirty
2024-03-12 13:54:47 +01:00
Victor Marin
f50624d257 Scenes: Duplicate library panels (#84159)
duplicate library panels
2024-03-12 10:11:15 +02:00
Ivan Ortega Alba
4a81a0388b Playlist: run on Scenes (#83551)
* DashboardScene: Implement playlist controls

* Mock the runtime config properly

* PlaylistSrv: with state you can subscribe to (#83828)

---------

Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
2024-03-11 13:33:32 +01:00
Victor Marin
9c22a6144e Scenes: Row controls (#83607)
* wip row controls

* wip row repeats

* wip

* wip

* row repeat functional

* refactor

* refactor to reuse RepeatRowSelect2

* refactor + tests

* remove comment

* refactor
2024-03-11 12:34:40 +02:00
Dominik Prokop
1da78ac846 DashboardScene: Allow unlinking a library panel (#83956)
* DashboardScene: Allow unlinking a library panel

* Betterer

* Revert

* Review
2024-03-07 18:11:34 +01:00
Victor Marin
20d201ca6a Scenes: Remove normal and library panels from layout or rows (#83969)
* Remove normal/lib panels from layout or rows

* refactor
2024-03-07 10:24:12 +02:00
Victor Marin
d269b4bf0d Scenes: Copy/paste library panels (#83962)
* Scenes: Copy/paste library panels

* more tests
2024-03-06 14:47:18 +02:00
Ivan Ortega Alba
29d6cd8fa0 DashboardScene: Share change detection logic between saving and runtime (#81958)
Co-authored-by: Alexandra Vargas <alexa1866@gmail.com>
Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
2024-02-29 18:18:26 +02:00
Victor Marin
04539ffccb Scenes: Add 'Import from library' functionality (#83498)
* wip

* tests + refactor ad panel func

* Add row functionality

* update row state only when there are children

* Add new row + copy paste panels

* Add library panel functionality

* tests

* PR mods

* reafctor + tests

* reafctor

* fix test

* refactor

* fix bug on cancelling lib widget

* dashboard now saves with lib panel widget

* add lib panels widget works in rows as well

* split add lib panel func to another PR

* Add library panel functionality

* refactor

* take panelKey into account when getting next panel id in dashboard

* fix tests
2024-02-28 16:41:12 +02:00
Victor Marin
738e9126de Scenes: Add new row and copy/paste functionalities (#83231)
* wip

* tests + refactor ad panel func

* Add row functionality

* update row state only when there are children

* Add new row + copy paste panels

* Add library panel functionality

* tests

* PR mods

* reafctor + tests

* reafctor

* fix test

* refactor

* fix bug on cancelling lib widget

* dashboard now saves with lib panel widget

* add lib panels widget works in rows as well

* split add lib panel func to another PR
2024-02-28 11:13:01 +02:00
Victor Marin
09c8e7ccc0 Scenes: Add new vizualisation functionality (#83145)
* wip

* tests + refactor ad panel func

* PR mods
2024-02-26 14:48:27 +02:00
Haris Rozajac
e4276a4ede Dashboard-Scene: Show empty state after removing last panel (#83114)
* Show empty state after removing last panel

* betterer

* Refactor isEmpty state update in DashboardScene.tsx

* don't need viewPanelScene check

* track isEmpty through a behavior

* Fix test

* Add test for empty state

* minor fix

* Refactor isEmpty check

* Don't use const

* clean up
2024-02-23 15:03:35 -07:00
Torkel Ödegaard
64e0a4282e DataQuery: Track panel plugin id not type (#83091) 2024-02-21 09:38:42 +01:00
Torkel Ödegaard
6db2d1a411 DashboardScene: Simplify controls a bit (#82908)
* DashboardScene: Simplify controls a bit

* update tests

* more test updates

* Update

* improvements

* Fix

* Fix merge

* Update

* update
2024-02-20 08:43:02 +01:00
Haris Rozajac
16f5220adc DashboardScene: Empty dashboard state (#82338)
* Organize

* Refactor

* Fix where settings were not showing up
2024-02-15 09:40:58 -07:00
Ezequiel Victorero
dbde08b03c Scenes: Refactor original snapshot button in a new component (#82199) 2024-02-13 14:15:55 -03:00
Victor Marin
1fe32479d7 Scenes: Annotations functionality in settings (#81361)
* wip listing/viewing annotations

* list annotations in settings

* fix tests

* wip edit mode

* PR mods

* move, delete, edit, add new

* edit annotation in settings

* Annotations functionality

* revert change

* add ui tests, move angularEditorLoader

* remove flaky test

* refactor

* bump scenes version, refactor getVizPanels, refactor edit page

* fix nav breadcrumbs

* annotation set dirty flag, add overlay to edit view

* PR mods

* PR mods

* remove flaky test

* change dirty flag setting logic for anotations

* change button variants
2024-02-12 16:06:46 +02:00
Haris Rozajac
00aa876e46 Dashboard Scene: All panel menu items available (#81678)
* WIP: removing panel functionality

* wip

* Deleting works with old model and with unified alerting

* Add shortcut for removing panel

* Add duplicate panel functionality; improve remove panel logic

* Copy and new alert rule

* Hide legend

* WIP: Help wizard

* Fix PanelMenuBehavior tests

* Got help wizard to work in scenes

* Fix HelpWizard and SupportSnapshotService tests

* Use object for writing styles

* betterer

* Fix create lib panel

* PanelRepeaterItem should be duplicated

* Share randomizer from dashboard-scenes

* share randomizer

* Fix import

* Update error message

* Fix test

* When duplicating PanelRepeaterGridItem's child use  PanelRepeaterGridItem.state.source

* Don't use getResultsStream

---------

Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
2024-02-07 06:32:08 -07:00
Ezequiel Victorero
83ea51f241 Scenes: Add snapshots view support (#81522) 2024-02-06 19:29:57 -03:00
Torkel Ödegaard
61c7fcc270 DashboardScene: Action toolbar progress (#81664)
* DashboardScene: Action toolbar progress

* Add discard confirmation modal

* minor fix

* Update

* tweaked

* Updating

* Progress

* Update

* Update

* Added some unit tests

* fix test

* Change name to Exit edit

* Tweaks

* fix test

* Minor margin fix

* Move share to left of edit
2024-02-05 16:08:12 +01:00
Torkel Ödegaard
d3f7231a27 DashboardScene: Reload when someone else saves changes (#81855)
* DashboardScene: Reload when someone else saves changes

* Update public/app/features/dashboard-scene/pages/DashboardScenePage.tsx

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

* Fixes

---------

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
2024-02-05 15:25:12 +01:00
Torkel Ödegaard
3b2352f066 DashboardScene: Initial work to support "new" dashboard route and creation logic (#81549)
* DashboardScene: Initial work to get new route to work

* Update

* remove caching of new dashboard

* remove old new dashboard func

* Update

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

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

* Fixing test

* dam messy tests

---------

Co-authored-by: Ivan Ortega Alba <ivanortegaalba@gmail.com>
2024-01-31 11:33:46 +01:00
Dominik Prokop
f77c831e3f Data query: Allow logging panel plugin id when executing queries (#81164)
* Data query: Allo logging panel plugin id when executing queries

* Update tracing header middleware

* Test fix

* Add panelPluginType to query analytics

* Cleanup
2024-01-30 00:06:31 -08:00
Torkel Ödegaard
1d5edb2a18 DashboardScene: Saving (#81163)
* DashboardScene: First save works

* Updates

* version mismatch works

* Error handling

* save current time range working

* Progress on save as

* Save as works

* Progress

* First tests

* Add unit tests

* Minor tweak

* Update

* Update isDirty state when saving
2024-01-29 12:04:45 +01:00
Torkel Ödegaard
5770828871 Scenes: Updates to scene v2.0 (#80953)
* Scenes: Updates to scene v2.0

* Update
2024-01-22 19:22:04 +01:00
Victor Marin
b93567a839 Scenes: Restore dashboard from version settings (#80600)
* Add versions tab in dashboard settings

* Fetch and render dashboard versions

* Be able to compare two versions

* PR discussion changes

* remove unnecessary async in test

* PR discussion mods

* linter fix

* styles and tests

* Fix show more versions bug

* migrate files + style fix

* fix test

* refactor styles - css object keys to camelCase

* refactor file migrations

* more files migrations

* wip restore

* remove unused type, cleanup

* wip

* restore functionality

* revert defaults

* wip

* restore functional

* refactor + tests

* CR modifications

* fix tests - CR mods
2024-01-19 10:58:20 +02:00
Victor Marin
5a509ef1f1 Scenes: Compare versions in dashboard settings (#80286)
* Add versions tab in dashboard settings

* Fetch and render dashboard versions

* Be able to compare two versions

* PR discussion changes

* remove unnecessary async in test

* PR discussion mods

* linter fix

* styles and tests

* Fix show more versions bug

* migrate files + style fix

* fix test

* refactor styles - css object keys to camelCase

* refactor file migrations

* more files migrations

* remove unused type, cleanup
2024-01-17 17:14:29 +02:00
Dominik Prokop
3356fb7726 DashboardScene: Add dashboard slug support (#80726) 2024-01-17 06:58:57 -08:00
Dominik Prokop
1de876c354 DashboardScene: Get rid of panel edit route (#80605)
* Wip: get rod of panel edit route

* Cleanup unused code

* Test update

* Simplify url sync for inspect and vie/edit panel

* Update navigating back to dashboard from edit panel

* DashboardScene:  Panel inspect improvements (#80655)

Improve inspect, andle view pane end edit mode inspection

* Url sync fixes

* Test update
2024-01-17 05:53:53 -08:00
Ivan Ortega Alba
07778cb221 DashboardLinksSettings: Move them to Scenes (#79998) 2024-01-16 13:24:54 +02:00
Torkel Ödegaard
f0c38611a2 Scenes: Remove old scenes stuff (#79760)
* Scenes: Remove old scenes stuff

* Fixes

* Fixes

* update
2024-01-04 15:44:41 +01:00
Ivan Ortega Alba
9fd3c9df55 GeneralSettings: hide time picker from settings using scenes (#79526) 2023-12-15 12:52:34 +02:00
Ivan Ortega Alba
e56a252158 GeneralSettings: Edit general dashboards settings to scenes (#78492) 2023-12-01 17:04:56 +02:00
Dominik Prokop
303c3ddc24 DashboardScene: Pass hashed panelId to query runner if a panel is a clone (#78820)
* DashboardScene: Pass hashed panelId  to query runner if a panel is a clone

* Test

* Nit
2023-12-01 01:07:55 -08:00
Torkel Ödegaard
d33a624ba6 DashboardScene: View panel scene (#78718)
* DashboardScene: View panel fixes

* Update

* Update

* Update

* works and added tests

* Update

* Update
2023-11-30 11:20:15 +01:00
Dominik Prokop
2b953660a4 DashboardSettings: Provide skeleton for list editing (#78789)
* DashboardSettings: Provide basics for list editing

* Update public/app/features/dashboard-scene/scene/DashboardSceneUrlSync.ts

Co-authored-by: Torkel Ödegaard <torkel@grafana.com>

* Lint

* Review

* Fix page nav for items

* Move links to dashbaord scene state

---------

Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
2023-11-29 06:01:40 -08:00
Dominik Prokop
6e4418ffd2 DashboardScene: Show plugin extensions in panel menu (#78702)
* DashboardScene: Show plugin extensions in panel menu

* FIx test

* Nits

* Nit

* Review nits
2023-11-28 03:26:09 -08:00
Ashley Harrison
4290ed3d86 Chore: Remove newBrowseDashboards feature toggle (#78190)
* remove all the things

* fix OldFolderPicker tests

* i18n

* remove more unused code

* remove mutation of error object since it's now frozen in the redux state

* fix error handling
2023-11-22 15:22:00 +00:00
Torkel Ödegaard
d70d939294 DashboardScene: Basics stubs for starting with editviews (dashboard settings) (#78209) 2023-11-20 18:19:30 +01:00
Torkel Ödegaard
848efba0de DashList: Update links with time range and variables change (#77850)
* user essentials mob! 🔱

lastFile:public/app/plugins/panel/dashlist/DashList.tsx

* DashList: Update variables in URL when they change

Co-authored-by: eledobleefe <laura.fernandez@grafana.com>
Co-authored-by: Joao Silva <joao.silva@grafana.com>
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>

* add e2e test to check dashlist variables are always correctly passed

* add comment with link to issue

* Alternative solution

* Minor tweaks

* revert accidental change

* fix

* New solution

* Fix test

* refinement

* Added unit test

* Update devenv/dev-dashboards/panel-dashlist/dashlist.json

Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>

---------

Co-authored-by: Joao Silva <joao.silva@grafana.com>
Co-authored-by: joshhunt <josh@trtr.co>
Co-authored-by: eledobleefe <laura.fernandez@grafana.com>
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
2023-11-08 14:08:59 +01:00
Dominik Prokop
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 95836bdb2c.

* 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
Torkel Ödegaard
7759e2f8a3 DashboardScene: Panel Keybindings and some others (#76233)
* DashboardScene: Keybindings like v to view panel

* more bindings

* Fix imports

* Progress

* Nit update

* Fix merge

---------

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
2023-10-20 06:22:56 -07:00
Torkel Ödegaard
a42040a59a DashboardScene: Backward compatability with getDashboardSrv.getCurrent and DashboardModel props and functions (#76371)
* DashboardSrv.getCurrent backward compatibility

* fixes
2023-10-13 16:24:04 +02:00
Torkel Ödegaard
de8ab7efe7 DashboardScene: Support for dashboard PanelContext actions via state hook (#76192)
* DashboardScene: Support for dashboard PanelContext actions via state hook

* Update

* Progress

* Update

* Update

* update
2023-10-13 11:42:42 +02:00