mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Search: add sort information in dashboard results (#30609)
* Search: add SortMeta in dashboard results * fix integration tests * trim SortMeta * fix searchstore tests * Update pkg/services/sqlstore/dashboard.go Co-authored-by: Emil Tullstedt <emil.tullstedt@grafana.com> Co-authored-by: Emil Tullstedt <emil.tullstedt@grafana.com>
This commit is contained in:
@@ -91,8 +91,8 @@ func GetAlerts(c *models.ReqContext) response.Response {
|
||||
}
|
||||
|
||||
for _, d := range searchQuery.Result {
|
||||
if d.Type == search.DashHitDB && d.Id > 0 {
|
||||
dashboardIDs = append(dashboardIDs, d.Id)
|
||||
if d.Type == search.DashHitDB && d.ID > 0 {
|
||||
dashboardIDs = append(dashboardIDs, d.ID)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -112,8 +112,8 @@ func TestAlertingAPIEndpoint(t *testing.T) {
|
||||
bus.AddHandler("test", func(query *search.Query) error {
|
||||
searchQuery = query
|
||||
query.Result = search.HitList{
|
||||
&search.Hit{Id: 1},
|
||||
&search.Hit{Id: 2},
|
||||
&search.Hit{ID: 1},
|
||||
&search.Hit{ID: 2},
|
||||
}
|
||||
return nil
|
||||
})
|
||||
|
||||
@@ -51,11 +51,11 @@ func populateDashboardsByTag(orgID int64, signedInUser *models.SignedInUser, das
|
||||
if err := bus.Dispatch(&searchQuery); err == nil {
|
||||
for _, item := range searchQuery.Result {
|
||||
result = append(result, dtos.PlaylistDashboard{
|
||||
Id: item.Id,
|
||||
Id: item.ID,
|
||||
Slug: item.Slug,
|
||||
Title: item.Title,
|
||||
Uri: item.Uri,
|
||||
Url: item.Url,
|
||||
Uri: item.URI,
|
||||
Url: item.URL,
|
||||
Order: dashboardTagOrder[tag],
|
||||
})
|
||||
}
|
||||
|
||||
@@ -80,6 +80,7 @@ func (hs *HTTPServer) ListSortOptions(c *models.ReqContext) response.Response {
|
||||
"name": o.Name,
|
||||
"displayName": o.DisplayName,
|
||||
"description": o.Description,
|
||||
"meta": o.MetaName,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user