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
c052abed
Unverified
Commit
c052abed
authored
Oct 09, 2020
by
Hugo Häggmark
Committed by
GitHub
Oct 09, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Variables: hides dropdown before refreshing starts (#28112)
parent
3b442765
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
8 deletions
+9
-8
public/app/features/variables/pickers/OptionsPicker/actions.test.ts
+6
-6
public/app/features/variables/pickers/OptionsPicker/actions.ts
+3
-2
No files found.
public/app/features/variables/pickers/OptionsPicker/actions.test.ts
View file @
c052abed
...
...
@@ -192,9 +192,9 @@ describe('options picker actions', () => {
toggleOption
({
option
:
options
[
1
],
forceSelect
:
true
,
clearOthers
}),
setCurrentVariableValue
(
toVariablePayload
(
variable
,
{
option
})),
changeVariableProp
(
toVariablePayload
(
variable
,
{
propName
:
'queryValue'
,
propValue
:
''
})),
hideOptions
(),
setCurrentVariableValue
(
toVariablePayload
(
variable
,
{
option
})),
updateLocation
({
query
:
{
'var-Constant'
:
[
'B'
]
}
}),
hideOptions
()
updateLocation
({
query
:
{
'var-Constant'
:
[
'B'
]
}
})
);
});
});
...
...
@@ -265,9 +265,9 @@ describe('options picker actions', () => {
tester
.
thenDispatchedActionsShouldEqual
(
setCurrentVariableValue
(
toVariablePayload
(
variable
,
{
option
})),
changeVariableProp
(
toVariablePayload
(
variable
,
{
propName
:
'queryValue'
,
propValue
:
''
})),
hideOptions
(),
setCurrentVariableValue
(
toVariablePayload
(
variable
,
{
option
})),
updateLocation
({
query
:
{
'var-Constant'
:
[]
}
}),
hideOptions
()
updateLocation
({
query
:
{
'var-Constant'
:
[]
}
})
);
});
});
...
...
@@ -297,9 +297,9 @@ describe('options picker actions', () => {
tester
.
thenDispatchedActionsShouldEqual
(
setCurrentVariableValue
(
toVariablePayload
(
variable
,
{
option
})),
changeVariableProp
(
toVariablePayload
(
variable
,
{
propName
:
'queryValue'
,
propValue
:
'C'
})),
hideOptions
(),
setCurrentVariableValue
(
toVariablePayload
(
variable
,
{
option
})),
updateLocation
({
query
:
{
'var-Constant'
:
[]
}
}),
hideOptions
()
updateLocation
({
query
:
{
'var-Constant'
:
[]
}
})
);
});
});
...
...
public/app/features/variables/pickers/OptionsPicker/actions.ts
View file @
c052abed
...
...
@@ -82,14 +82,15 @@ export const commitChangesToVariable = (): ThunkResult<void> => {
dispatch
(
setCurrentVariableValue
(
toVariablePayload
(
existing
,
currentPayload
)));
dispatch
(
changeVariableProp
(
toVariablePayload
(
existing
,
searchQueryPayload
)));
const
updated
=
getVariable
<
VariableWithMultiSupport
>
(
picker
.
id
,
getState
());
dispatch
(
hideOptions
());
if
(
getCurrentText
(
existing
)
===
getCurrentText
(
updated
))
{
return
dispatch
(
hideOptions
())
;
return
;
}
const
adapter
=
variableAdapters
.
get
(
updated
.
type
);
await
adapter
.
setValue
(
updated
,
updated
.
current
,
true
);
return
dispatch
(
hideOptions
())
;
return
;
};
};
...
...
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