Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
36d64fec
Unverified
Commit
36d64fec
authored
Apr 17, 2019
by
Torkel Ödegaard
Committed by
GitHub
Apr 17, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Search: Fixed search issue introduced in recent PR (#16652)
parent
e4eb0817
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
1 deletions
+16
-1
pkg/services/sqlstore/dashboard_test.go
+15
-0
pkg/services/sqlstore/search_builder.go
+1
-1
No files found.
pkg/services/sqlstore/dashboard_test.go
View file @
36d64fec
...
...
@@ -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
,
...
...
pkg/services/sqlstore/search_builder.go
View file @
36d64fec
...
...
@@ -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
))
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment