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
bd44d973
Unverified
Commit
bd44d973
authored
Jun 15, 2020
by
Hugo Häggmark
Committed by
GitHub
Jun 15, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Variables: Fixes maximum call stack bug for empty value (#25503)
parent
cf2343fa
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
1 deletions
+29
-1
public/app/core/services/bridge_srv.test.ts
+28
-0
public/app/core/services/bridge_srv.ts
+1
-1
No files found.
public/app/core/services/bridge_srv.test.ts
View file @
bd44d973
...
...
@@ -12,4 +12,32 @@ describe('when checking template variables', () => {
expect
(
findTemplateVarChanges
(
b
,
a
)).
toEqual
({
'var-xyz'
:
'hello'
});
expect
(
findTemplateVarChanges
(
a
,
b
)).
toEqual
({
'var-xyz'
:
''
});
});
it
(
'then should ignore equal values'
,
()
=>
{
const
a
:
UrlQueryMap
=
{
'var-xyz'
:
'hello'
,
bbb
:
'ignore me'
,
};
const
b
:
UrlQueryMap
=
{
'var-xyz'
:
'hello'
,
aaa
:
'ignore me'
,
};
expect
(
findTemplateVarChanges
(
b
,
a
)).
toBeUndefined
();
expect
(
findTemplateVarChanges
(
a
,
b
)).
toBeUndefined
();
});
it
(
'then should ignore equal values with empty values'
,
()
=>
{
const
a
:
UrlQueryMap
=
{
'var-xyz'
:
''
,
bbb
:
'ignore me'
,
};
const
b
:
UrlQueryMap
=
{
'var-xyz'
:
''
,
aaa
:
'ignore me'
,
};
expect
(
findTemplateVarChanges
(
b
,
a
)).
toBeUndefined
();
expect
(
findTemplateVarChanges
(
a
,
b
)).
toBeUndefined
();
});
});
public/app/core/services/bridge_srv.ts
View file @
bd44d973
...
...
@@ -124,7 +124,7 @@ export function findTemplateVarChanges(query: UrlQueryMap, old: UrlQueryMap): Ur
if
(
!
key
.
startsWith
(
'var-'
))
{
continue
;
}
if
(
!
query
[
key
]
)
{
if
(
!
query
.
hasOwnProperty
(
key
)
)
{
changes
[
key
]
=
''
;
// removed
count
++
;
}
...
...
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