NestedFolders: Add library panels counting and deletion to folder registry (#69149)
* Expose library element service's folder service * Register library panels, add count implementation * Expand folder counts test * Update registry deletion method interface * Allow getting library elements from any folder * Add test for library panel deletion * Add test for library panel counting
This commit is contained in:
@@ -635,7 +635,7 @@ func (dr DashboardServiceImpl) CountInFolder(ctx context.Context, orgID int64, f
|
||||
return dr.dashboardStore.CountDashboardsInFolder(ctx, &dashboards.CountDashboardsInFolderRequest{FolderID: folder.ID, OrgID: orgID})
|
||||
}
|
||||
|
||||
func (dr *DashboardServiceImpl) DeleteInFolder(ctx context.Context, orgID int64, folderUID string) error {
|
||||
func (dr *DashboardServiceImpl) DeleteInFolder(ctx context.Context, orgID int64, folderUID string, u *user.SignedInUser) error {
|
||||
return dr.dashboardStore.DeleteDashboardsInFolder(ctx, &dashboards.DeleteDashboardsInFolderRequest{FolderUID: folderUID, OrgID: orgID})
|
||||
}
|
||||
|
||||
|
||||
@@ -244,7 +244,7 @@ func TestDashboardService(t *testing.T) {
|
||||
t.Run("Delete dashboards in folder", func(t *testing.T) {
|
||||
args := &dashboards.DeleteDashboardsInFolderRequest{OrgID: 1, FolderUID: "uid"}
|
||||
fakeStore.On("DeleteDashboardsInFolder", mock.Anything, args).Return(nil).Once()
|
||||
err := service.DeleteInFolder(context.Background(), 1, "uid")
|
||||
err := service.DeleteInFolder(context.Background(), 1, "uid", nil)
|
||||
require.NoError(t, err)
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user