mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
dashboard folder search fix
This commit is contained in:
@@ -44,7 +44,7 @@ func searchHandler(query *Query) error {
|
||||
IsStarred: query.IsStarred,
|
||||
DashboardIds: query.DashboardIds,
|
||||
Type: query.Type,
|
||||
ParentId: query.FolderId,
|
||||
FolderId: query.FolderId,
|
||||
Mode: query.Mode,
|
||||
}
|
||||
|
||||
|
||||
@@ -20,9 +20,7 @@ func TestSearch(t *testing.T) {
|
||||
&Hit{Id: 10, Title: "AABB", Type: "dash-db", Tags: []string{"CC", "AA"}},
|
||||
&Hit{Id: 15, Title: "BBAA", Type: "dash-db", Tags: []string{"EE", "AA", "BB"}},
|
||||
&Hit{Id: 25, Title: "bbAAa", Type: "dash-db", Tags: []string{"EE", "AA", "BB"}},
|
||||
&Hit{Id: 17, Title: "FOLDER", Type: "dash-folder", Dashboards: []Hit{
|
||||
{Id: 18, Title: "ZZAA", Tags: []string{"ZZ"}},
|
||||
}},
|
||||
&Hit{Id: 17, Title: "FOLDER", Type: "dash-folder"},
|
||||
}
|
||||
return nil
|
||||
})
|
||||
|
||||
@@ -14,14 +14,15 @@ const (
|
||||
)
|
||||
|
||||
type Hit struct {
|
||||
Id int64 `json:"id"`
|
||||
Title string `json:"title"`
|
||||
Uri string `json:"uri"`
|
||||
Type HitType `json:"type"`
|
||||
Tags []string `json:"tags"`
|
||||
IsStarred bool `json:"isStarred"`
|
||||
ParentId int64 `json:"parentId"`
|
||||
Dashboards []Hit `json:"dashboards"`
|
||||
Id int64 `json:"id"`
|
||||
Title string `json:"title"`
|
||||
Uri string `json:"uri"`
|
||||
Type HitType `json:"type"`
|
||||
Tags []string `json:"tags"`
|
||||
IsStarred bool `json:"isStarred"`
|
||||
FolderId int64 `json:"folderId,omitempty"`
|
||||
FolderTitle string `json:"folderTitle,omitempty"`
|
||||
FolderSlug string `json:"folderSlug,omitempty"`
|
||||
}
|
||||
|
||||
type HitList []*Hit
|
||||
@@ -62,7 +63,7 @@ type FindPersistedDashboardsQuery struct {
|
||||
IsStarred bool
|
||||
DashboardIds []int64
|
||||
Type string
|
||||
ParentId int64
|
||||
FolderId int64
|
||||
Mode string
|
||||
|
||||
Result HitList
|
||||
|
||||
Reference in New Issue
Block a user