dashboard folder search fix

This commit is contained in:
Torkel Ödegaard
2017-06-23 16:00:26 -04:00
parent 456225365f
commit fc69d59cae
19 changed files with 146 additions and 254 deletions

View File

@@ -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,
}

View File

@@ -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
})

View File

@@ -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