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
650d3d50
Commit
650d3d50
authored
May 29, 2015
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed tag selection issues
parent
0992b6a6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
5 deletions
+15
-5
public/app/directives/variableValueSelect.js
+2
-4
public/app/features/templating/templateValuesSrv.js
+1
-1
public/test/specs/selectDropdownCtrl-specs.js
+12
-0
No files found.
public/app/directives/variableValueSelect.js
View file @
650d3d50
...
...
@@ -31,7 +31,7 @@ function (angular, app, _) {
vm
.
search
=
{
query
:
''
,
options
:
vm
.
options
};
vm
.
selectedValuesCount
=
currentValues
.
length
;
vm
.
selectedTags
=
vm
.
selectedTag
||
[];
vm
.
selectedTags
=
vm
.
selectedTag
s
||
[];
if
(
!
vm
.
tags
)
{
vm
.
tags
=
_
.
map
(
vm
.
variable
.
tags
,
function
(
value
)
{
...
...
@@ -76,7 +76,6 @@ function (angular, app, _) {
}
});
vm
.
selectedTags
=
_
.
filter
(
vm
.
tags
,
{
selected
:
true
});
vm
.
selectionsChanged
(
false
);
});
};
...
...
@@ -168,10 +167,9 @@ function (angular, app, _) {
return
true
;
});
vm
.
variable
.
current
=
{};
vm
.
variable
.
current
.
value
=
_
.
pluck
(
selected
,
'value'
);
vm
.
variable
.
current
.
text
=
_
.
pluck
(
valuesNotInTag
,
'text'
).
join
(
', '
);
vm
.
selectedValuesCount
=
vm
.
variable
.
current
.
value
.
length
;
vm
.
selectedValuesCount
=
selected
.
length
;
// only single value
if
(
vm
.
selectedValuesCount
===
1
)
{
...
...
public/app/features/templating/templateValuesSrv.js
View file @
650d3d50
...
...
@@ -78,7 +78,7 @@ function (angular, _, kbn) {
};
this
.
setVariableValue
=
function
(
variable
,
option
)
{
variable
.
current
=
option
;
variable
.
current
=
angular
.
copy
(
option
)
;
templateSrv
.
updateTemplateData
();
return
this
.
updateOptionsInChildVariables
(
variable
);
};
...
...
public/test/specs/selectDropdownCtrl-specs.js
View file @
650d3d50
...
...
@@ -74,6 +74,18 @@ function () {
expect
(
ctrl
.
options
[
2
].
selected
).
to
.
be
(
true
);
});
describe
(
'and then dropdown is opened and closed without changes'
,
function
()
{
beforeEach
(
function
()
{
ctrl
.
show
();
ctrl
.
commitChanges
();
rootScope
.
$digest
();
});
it
(
"should still have selected tag"
,
function
()
{
expect
(
ctrl
.
selectedTags
.
length
).
to
.
be
(
1
);
});
});
describe
(
'and then unselected'
,
function
()
{
beforeEach
(
function
()
{
ctrl
.
selectTag
(
ctrl
.
tags
[
0
]);
...
...
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