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:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user