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:
@@ -586,7 +586,7 @@ func (st DBstore) GetAlertRulesForScheduling(ctx context.Context, query *ngmodel
|
||||
}
|
||||
|
||||
// DeleteInFolder deletes the rules contained in a given folder along with their associated data.
|
||||
func (st DBstore) DeleteInFolder(ctx context.Context, orgID int64, folderUID string) error {
|
||||
func (st DBstore) DeleteInFolder(ctx context.Context, orgID int64, folderUID string, user *user.SignedInUser) error {
|
||||
rules, err := st.ListAlertRules(ctx, &ngmodels.ListAlertRulesQuery{
|
||||
OrgID: orgID,
|
||||
NamespaceUIDs: []string{folderUID},
|
||||
|
||||
@@ -474,7 +474,7 @@ func TestIntegration_DeleteInFolder(t *testing.T) {
|
||||
}
|
||||
rule := createRule(t, store, nil)
|
||||
|
||||
err := store.DeleteInFolder(context.Background(), rule.OrgID, rule.NamespaceUID)
|
||||
err := store.DeleteInFolder(context.Background(), rule.OrgID, rule.NamespaceUID, nil)
|
||||
require.NoError(t, err)
|
||||
|
||||
c, err := store.CountInFolder(context.Background(), rule.OrgID, rule.NamespaceUID, nil)
|
||||
|
||||
Reference in New Issue
Block a user