mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
feat(dashslist): make sure dashbords exists in recently viewd dashboards
closes #4249
This commit is contained in:
@@ -39,10 +39,11 @@ func searchHandler(query *Query) error {
|
||||
hits := make(HitList, 0)
|
||||
|
||||
dashQuery := FindPersistedDashboardsQuery{
|
||||
Title: query.Title,
|
||||
UserId: query.UserId,
|
||||
IsStarred: query.IsStarred,
|
||||
OrgId: query.OrgId,
|
||||
Title: query.Title,
|
||||
UserId: query.UserId,
|
||||
IsStarred: query.IsStarred,
|
||||
OrgId: query.OrgId,
|
||||
DashboardIds: query.DashboardIds,
|
||||
}
|
||||
|
||||
if err := bus.Dispatch(&dashQuery); err != nil {
|
||||
|
||||
@@ -25,21 +25,23 @@ func (s HitList) Swap(i, j int) { s[i], s[j] = s[j], s[i] }
|
||||
func (s HitList) Less(i, j int) bool { return s[i].Title < s[j].Title }
|
||||
|
||||
type Query struct {
|
||||
Title string
|
||||
Tags []string
|
||||
OrgId int64
|
||||
UserId int64
|
||||
Limit int
|
||||
IsStarred bool
|
||||
Title string
|
||||
Tags []string
|
||||
OrgId int64
|
||||
UserId int64
|
||||
Limit int
|
||||
IsStarred bool
|
||||
DashboardIds []int
|
||||
|
||||
Result HitList
|
||||
}
|
||||
|
||||
type FindPersistedDashboardsQuery struct {
|
||||
Title string
|
||||
OrgId int64
|
||||
UserId int64
|
||||
IsStarred bool
|
||||
Title string
|
||||
OrgId int64
|
||||
UserId int64
|
||||
IsStarred bool
|
||||
DashboardIds []int
|
||||
|
||||
Result HitList
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user