feat(nested folders): add CountDashboardsInFolder (#57847)

* 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
This commit is contained in:
Kristin Laemmert
2022-11-02 09:15:50 -04:00
committed by GitHub
parent 409ed84136
commit 706b301285
14 changed files with 271 additions and 118 deletions
+1 -1
View File
@@ -920,7 +920,7 @@ func TestDashboardAPIEndpoint(t *testing.T) {
t.Run("Given provisioned dashboard", func(t *testing.T) {
mockSQLStore := mockstore.NewSQLStoreMock()
dashboardStore := dashboards.NewFakeDashboardStore(t)
dashboardStore.On("GetProvisionedDataByDashboardID", mock.Anything).Return(&models.DashboardProvisioning{ExternalId: "/dashboard1.json"}, nil).Once()
dashboardStore.On("GetProvisionedDataByDashboardID", mock.Anything, mock.AnythingOfType("int64")).Return(&models.DashboardProvisioning{ExternalId: "/dashboard1.json"}, nil).Once()
teamService := &teamtest.FakeService{}
dashboardService := dashboards.NewFakeDashboardService(t)