Nested folders: Provide count of all descendant dashboards and folders (#67184)

* Add a method for getting descendant folders
* Include dashboard count for descendant folders
* Return subfolder count
* Replace references to children with descendants
* Update openapi specs
* Add test for descendant counts
* Add logging to GetDescendantCounts
This commit is contained in:
Arati R
2023-04-27 17:00:09 +02:00
committed by GitHub
parent 4d96afa979
commit a5206a1cda
9 changed files with 237 additions and 169 deletions
+6 -6
View File
@@ -7,10 +7,10 @@ import (
)
type FakeService struct {
ExpectedFolders []*folder.Folder
ExpectedFolder *folder.Folder
ExpectedError error
ExpectedChildrenCounts map[string]int64
ExpectedFolders []*folder.Folder
ExpectedFolder *folder.Folder
ExpectedError error
ExpectedDescendantCounts map[string]int64
}
func NewFakeService() *FakeService {
@@ -51,6 +51,6 @@ func (s *FakeService) RegisterService(service folder.RegistryService) error {
return s.ExpectedError
}
func (s *FakeService) GetChildrenCounts(ctx context.Context, cmd *folder.GetChildrenCountsQuery) (folder.ChildrenCounts, error) {
return s.ExpectedChildrenCounts, s.ExpectedError
func (s *FakeService) GetDescendantCounts(ctx context.Context, cmd *folder.GetDescendantCountsQuery) (folder.DescendantCounts, error) {
return s.ExpectedDescendantCounts, s.ExpectedError
}