Commit 36d64fec by Torkel Ödegaard Committed by GitHub

Search: Fixed search issue introduced in recent PR (#16652)

parent e4eb0817
......@@ -288,6 +288,21 @@ func TestDashboardDataAccess(t *testing.T) {
So(query.Result[0].Title, ShouldEqual, "test dash 23")
})
Convey("Should be able to filter by tag and type", func() {
query := search.FindPersistedDashboardsQuery{
OrgId: 1,
Type: "dash-db",
Tags: []string{"prod"},
SignedInUser: &m.SignedInUser{OrgId: 1, OrgRole: m.ROLE_EDITOR},
}
err := SearchDashboards(&query)
So(err, ShouldBeNil)
So(len(query.Result), ShouldEqual, 3)
So(query.Result[0].Title, ShouldEqual, "test dash 23")
})
Convey("Should be able to search for a dashboard folder's children", func() {
query := search.FindPersistedDashboardsQuery{
OrgId: 1,
......
......@@ -149,7 +149,7 @@ func (sb *SearchBuilder) buildTagQuery() {
sb.buildSearchWhereClause()
// this ends the inner select (tag filtered part)
sb.sql.WriteString(`GROUP BY dashboard.id HAVING COUNT(dashboard.id) >= ? `)
sb.sql.WriteString(` GROUP BY dashboard.id HAVING COUNT(dashboard.id) >= ? `)
sb.params = append(sb.params, len(sb.tags))
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment