WIP: remove browse mode for dashboard search

Dashboard folders included in all searches. If a dashboard matches
a search and has a parent folder then the parent folder is appended
to the search result. A hierarchy is then returned in the result
with child dashboards under their parent folders.
This commit is contained in:
Daniel Lee
2017-05-08 22:23:25 +02:00
parent f1e1da39e3
commit 53d11d50fc
9 changed files with 44 additions and 52 deletions

View File

@@ -45,7 +45,6 @@ func searchHandler(query *Query) error {
IsStarred: query.IsStarred,
OrgId: query.OrgId,
DashboardIds: query.DashboardIds,
BrowseMode: query.BrowseMode,
}
if err := bus.Dispatch(&dashQuery); err != nil {

View File

@@ -68,17 +68,5 @@ func TestSearch(t *testing.T) {
})
})
Convey("That returns result in browse mode", func() {
query.BrowseMode = true
err := searchHandler(&query)
So(err, ShouldBeNil)
Convey("should return correct results", func() {
So(query.Result[0].Title, ShouldEqual, "FOLDER")
So(len(query.Result[0].Dashboards), ShouldEqual, 1)
})
})
})
}

View File

@@ -47,7 +47,6 @@ type Query struct {
Limit int
IsStarred bool
DashboardIds []int
BrowseMode bool
Result HitList
}
@@ -58,7 +57,6 @@ type FindPersistedDashboardsQuery struct {
UserId int64
IsStarred bool
DashboardIds []int
BrowseMode bool
Result HitList
}