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
bef4b9b3
Commit
bef4b9b3
authored
Sep 19, 2017
by
tamayika
Committed by
Torkel Ödegaard
Sep 19, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix adhoc filters restoration (#9303)
parent
3b565dcc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
public/app/features/templating/adhoc_variable.ts
+2
-2
public/app/features/templating/specs/adhoc_variable_specs.ts
+4
-4
No files found.
public/app/features/templating/adhoc_variable.ts
View file @
bef4b9b3
...
...
@@ -67,11 +67,11 @@ export class AdhocVariable implements Variable {
}
escapeDelimiter
(
value
)
{
return
value
.
replace
(
'|'
,
'__gfp__'
);
return
value
.
replace
(
/
\|
/g
,
'__gfp__'
);
}
unescapeDelimiter
(
value
)
{
return
value
.
replace
(
'__gfp__'
,
'|'
);
return
value
.
replace
(
/__gfp__/g
,
'|'
);
}
setFilters
(
filters
:
any
[])
{
...
...
public/app/features/templating/specs/adhoc_variable_specs.ts
View file @
bef4b9b3
...
...
@@ -11,11 +11,11 @@ describe('AdhocVariable', function() {
filters
:
[
{
key
:
'key1'
,
operator
:
'='
,
value
:
'value1'
},
{
key
:
'key2'
,
operator
:
'!='
,
value
:
'value2'
},
{
key
:
'key3'
,
operator
:
'='
,
value
:
'value3a|value3b'
},
{
key
:
'key3'
,
operator
:
'='
,
value
:
'value3a|value3b
|value3c
'
},
]
});
var
urlValue
=
variable
.
getValueForUrl
();
expect
(
urlValue
).
to
.
eql
([
"key1|=|value1"
,
"key2|!=|value2"
,
"key3|=|value3a__gfp__value3b"
]);
expect
(
urlValue
).
to
.
eql
([
"key1|=|value1"
,
"key2|!=|value2"
,
"key3|=|value3a__gfp__value3b
__gfp__value3c
"
]);
});
});
...
...
@@ -24,7 +24,7 @@ describe('AdhocVariable', function() {
it
(
'should restore filters'
,
function
()
{
var
variable
=
new
AdhocVariable
({});
variable
.
setValueFromUrl
([
"key1|=|value1"
,
"key2|!=|value2"
,
"key3|=|value3a__gfp__value3b"
]);
variable
.
setValueFromUrl
([
"key1|=|value1"
,
"key2|!=|value2"
,
"key3|=|value3a__gfp__value3b
__gfp__value3c
"
]);
expect
(
variable
.
filters
[
0
].
key
).
to
.
be
(
'key1'
);
expect
(
variable
.
filters
[
0
].
operator
).
to
.
be
(
'='
);
...
...
@@ -36,7 +36,7 @@ describe('AdhocVariable', function() {
expect
(
variable
.
filters
[
2
].
key
).
to
.
be
(
'key3'
);
expect
(
variable
.
filters
[
2
].
operator
).
to
.
be
(
'='
);
expect
(
variable
.
filters
[
2
].
value
).
to
.
be
(
'value3a|value3b'
);
expect
(
variable
.
filters
[
2
].
value
).
to
.
be
(
'value3a|value3b
|value3c
'
);
});
});
...
...
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