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
e03d702d
Unverified
Commit
e03d702d
authored
Nov 21, 2019
by
Hugo Häggmark
Committed by
GitHub
Nov 21, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix: Prevents crash when searchFilter is non string (#20526)
parent
2079386a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
2 deletions
+10
-2
public/app/features/templating/specs/variable.test.ts
+8
-0
public/app/features/templating/variable.ts
+2
-2
No files found.
public/app/features/templating/specs/variable.test.ts
View file @
e03d702d
...
...
@@ -85,6 +85,14 @@ describe('containsSearchFilter', () => {
});
});
describe
(
'when called with an object'
,
()
=>
{
it
(
'then it should return false'
,
()
=>
{
const
result
=
containsSearchFilter
({});
expect
(
result
).
toBe
(
false
);
});
});
describe
(
`when called with a query without
${
SEARCH_FILTER_VARIABLE
}
`
,
()
=>
{
it
(
'then it should return false'
,
()
=>
{
const
result
=
containsSearchFilter
(
'$app.*'
);
...
...
public/app/features/templating/variable.ts
View file @
e03d702d
...
...
@@ -18,8 +18,8 @@ export const variableRegexExec = (variableString: string) => {
export
const
SEARCH_FILTER_VARIABLE
=
'__searchFilter'
;
export
const
containsSearchFilter
=
(
query
:
string
):
boolean
=>
query
?
query
.
indexOf
(
SEARCH_FILTER_VARIABLE
)
!==
-
1
:
false
;
export
const
containsSearchFilter
=
(
query
:
string
|
unknown
):
boolean
=>
query
&&
typeof
query
===
'string'
?
query
.
indexOf
(
SEARCH_FILTER_VARIABLE
)
!==
-
1
:
false
;
export
const
getSearchFilterScopedVar
=
(
args
:
{
query
:
string
;
...
...
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