* Guardian: Use dashboard UID instead of ID
* Apply suggestions from code review
Introduce several guardian constructors and each time use
the most appropriate one.
* block move operation that could introduce more than 8 level of depth, forbid circular reference
* move getHeight to store, mock store in service
* fix linter
* Fix deleting subfolder
It used to fail with beause of missing signed in user
* Add logging
* fixup
* Fail request if deleting nested folder has failed
Before we only used to log the error
* Fix failing test
During failed nested folder creation
call the dashboard store deletion instead of the service one.
* Nested Folders: Do not refer to the configuration for checking for the flag
Use always features.IsEnabled() instead
* Depend on the interface instead
* add db migration at service start time
* make changes for the 3 db
* revert migrator
* fix feature toggle check
Co-authored-by: Serge Zaitsev <serge.zaitsev@grafana.com>
* Nested Folders: Support getting of nested folder in folder service when feature flag is set
* Fix lint
* Fix some tests
* Fix ngalert test
* ngalert fix
* Fix API tests
* Fix some tests and lint
* Fix lint 2
* Fix library elements and panels
* Add access control to get folder
* Cleanup and minor test change
* transfer DeleteFolder changes from larger PR
* finish some thingies
* add the simplest delete logics
* some intermedia steps
* fix tests
* add test
* fix some comments
Co-authored-by: yangkb09 <yangkb09@gmail.com>
* Folder: Add folder service implementation
* Add Move
* Add tests
* Add new servie method and adjust Update, Delete and Move
* Remove contains
* GetTree return children of depth one
* clean up and document integration test convention
* clarify integration test conventions
* clean up integration tests that don't follow convention
* mark testIntegration* functions as helpers to avoid confusion
* feat(nested folders): add CountDashboardsInFolder
This commit adds a new method to the Dashboard service and stores: CountDashboardsInFolder. The command struct takes a folderUID, but the store implementation still depends on the parent folder ID. This is temporary; eventually we will replace all references to FolderIDs (associated with Dashboards) with folder UIDs.
There are some unfortunate additional test changes that were necessary after generating the service & store mocks; it looks like that hasn't been generated since the last change(s).
* more test updates
* don't forget the service test
* that didn't end up used, so bye for now
* agree to disagree with the linter
* Add implementation for folder store methods
* Add Move implementation
* Add back comment and fix query
* Remove Move from store
* Adjust GetChildren
* Fix errutil error declaration and usage
* Add org id to get children query
* feat: add new Folder table migration
Add a new folder table to support the Nested Folders feature.
https://github.com/grafana/grafana/issues/56880
* register nested folders feature flag (unused)
* feat: nested folder service (experiment)
This commit adds a NestedFolderSvc interface and stubbed out implementation as an alternative to the existing folder service. This is an experimental feature to try out different methods for backwards compatibility and parallelization, so that Grafana can continue to store folders in the existing (non-nested) manner while also using the new nested folder service.
Eventually the new service will (hopefully) become _the_ service, at which point the legacy service can be deprecated (or remain, with the new service methods replacing the original. whatever makes sense at the time).
* nested folders: don't run the new migration
This commit removes the nested folder migration from the list of active migrations so we can merge this branch and continue development without impacting Grafana instances built off main.
* Chore: move folder service interface into a separate package
* copy implementation into a standalone package
* move implementation and tests to the new folder package
* remove leftovers from wire
* add test doubles for folder service
* fix tests in library panels/elements
* fix provideservice in ngalert