mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Alerting: Update API to use folders' full paths (#81214)
* update GetUserVisibleNamespaces to use FolderSeriver * update GetNamespaceByUID to use FolderService.GetFolders * update GetAlertRulesForScheduling to use FolderService.GetFolders * Update API and GetAlertRulesForScheduling to use the folder's full path * get full path of folder in RouteTestGrafanaRuleConfig * fix escaping of titles for MySQL
This commit is contained in:
@@ -2,6 +2,7 @@ package api
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"path"
|
||||
"strconv"
|
||||
"testing"
|
||||
"time"
|
||||
@@ -84,9 +85,10 @@ func validGroup(cfg *setting.UnifiedAlertingSettings, rules ...apimodels.Postabl
|
||||
}
|
||||
|
||||
func randFolder() *folder.Folder {
|
||||
title := "TEST-FOLDER-" + util.GenerateShortUID()
|
||||
return &folder.Folder{
|
||||
UID: util.GenerateShortUID(),
|
||||
Title: "TEST-FOLDER-" + util.GenerateShortUID(),
|
||||
Title: title,
|
||||
// URL: "",
|
||||
// Version: 0,
|
||||
Created: time.Time{},
|
||||
@@ -94,6 +96,8 @@ func randFolder() *folder.Folder {
|
||||
// UpdatedBy: 0,
|
||||
// CreatedBy: 0,
|
||||
// HasACL: false,
|
||||
ParentUID: uuid.NewString(),
|
||||
Fullpath: path.Join("parent-folder", title),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user