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
a567939f
Commit
a567939f
authored
Sep 28, 2015
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(elasticsearch): quote variable value in lucene variable mulit format, fixes #2828
parent
b80dc92c
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
4 deletions
+10
-4
public/app/features/templating/templateSrv.js
+4
-1
public/app/features/templating/templateValuesSrv.js
+4
-1
public/test/specs/templateSrv-specs.js
+1
-1
public/test/specs/templateValuesSrv-specs.js
+1
-1
No files found.
public/app/features/templating/templateSrv.js
View file @
a567939f
...
...
@@ -44,7 +44,10 @@ function (angular, _) {
return
'('
+
value
.
join
(
'|'
)
+
')'
;
}
case
"lucene"
:
{
return
'('
+
value
.
join
(
' OR '
)
+
')'
;
var
quotedValues
=
_
.
map
(
value
,
function
(
val
)
{
return
'
\\\
"'
+
val
+
'
\\\
"'
;
});
return
'('
+
quotedValues
.
join
(
' OR '
)
+
')'
;
}
case
"pipe"
:
{
return
value
.
join
(
'|'
);
...
...
public/app/features/templating/templateValuesSrv.js
View file @
a567939f
...
...
@@ -262,7 +262,10 @@ function (angular, _, kbn) {
break
;
}
case
'lucene'
:
{
allValue
=
'('
+
_
.
pluck
(
variable
.
options
,
'text'
).
join
(
' OR '
)
+
')'
;
var
quotedValues
=
_
.
map
(
variable
.
options
,
function
(
val
)
{
return
'
\\\
"'
+
val
.
text
+
'
\\\
"'
;
});
allValue
=
'('
+
quotedValues
.
join
(
' OR '
)
+
')'
;
break
;
}
case
'regex values'
:
{
...
...
public/test/specs/templateSrv-specs.js
View file @
a567939f
...
...
@@ -68,7 +68,7 @@ define([
value
:
[
'test'
,
'test2'
],
}
});
expect
(
result
).
to
.
be
(
'(
test OR test2
)'
);
expect
(
result
).
to
.
be
(
'(
\\\
"test
\\\
" OR
\\\
"test2
\\\
"
)'
);
});
it
(
'multi value and regex format should render regex string'
,
function
()
{
...
...
public/test/specs/templateValuesSrv-specs.js
View file @
a567939f
...
...
@@ -321,7 +321,7 @@ define([
});
it
(
'should add lucene glob'
,
function
()
{
expect
(
scenario
.
variable
.
options
[
0
].
value
).
to
.
be
(
'(
backend1 OR backend2
)'
);
expect
(
scenario
.
variable
.
options
[
0
].
value
).
to
.
be
(
'(
\\\
"backend1
\\\
" OR
\\\
"backend2
\\\
"
)'
);
});
});
...
...
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