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
bd75adf5
Unverified
Commit
bd75adf5
authored
Aug 16, 2020
by
Hugo Häggmark
Committed by
GitHub
Aug 17, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Templating: Fixes so texts show in picker not the values (#27002)
parent
50ebbb62
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
3 additions
and
9 deletions
+3
-9
public/app/features/variables/pickers/OptionsPicker/actions.test.ts
+0
-0
public/app/features/variables/pickers/OptionsPicker/actions.ts
+1
-1
public/app/features/variables/state/sharedReducer.test.ts
+1
-1
public/app/features/variables/state/sharedReducer.ts
+1
-7
No files found.
public/app/features/variables/pickers/OptionsPicker/actions.test.ts
View file @
bd75adf5
This diff is collapsed.
Click to expand it.
public/app/features/variables/pickers/OptionsPicker/actions.ts
View file @
bd75adf5
...
@@ -183,7 +183,7 @@ function mapToCurrent(picker: OptionsPickerState): VariableOption | undefined {
...
@@ -183,7 +183,7 @@ function mapToCurrent(picker: OptionsPickerState): VariableOption | undefined {
return
{
return
{
value
:
values
,
value
:
values
,
text
:
texts
.
join
(
' + '
)
,
text
:
texts
,
tags
:
picker
.
tags
.
filter
(
t
=>
t
.
selected
),
tags
:
picker
.
tags
.
filter
(
t
=>
t
.
selected
),
selected
:
true
,
selected
:
true
,
};
};
...
...
public/app/features/variables/state/sharedReducer.test.ts
View file @
bd75adf5
...
@@ -290,7 +290,7 @@ describe('sharedReducer', () => {
...
@@ -290,7 +290,7 @@ describe('sharedReducer', () => {
{
selected
:
true
,
text
:
'A'
,
value
:
'A'
},
{
selected
:
true
,
text
:
'A'
,
value
:
'A'
},
{
selected
:
true
,
text
:
'B'
,
value
:
'B'
},
{
selected
:
true
,
text
:
'B'
,
value
:
'B'
},
],
],
current
:
{
selected
:
true
,
text
:
'A + B'
,
value
:
[
'A'
,
'B'
]
},
current
:
{
selected
:
true
,
text
:
[
'A'
,
'B'
]
,
value
:
[
'A'
,
'B'
]
},
}
as
unknown
)
as
QueryVariableModel
,
}
as
unknown
)
as
QueryVariableModel
,
});
});
});
});
...
...
public/app/features/variables/state/sharedReducer.ts
View file @
bd75adf5
...
@@ -4,7 +4,7 @@ import { default as lodashDefaults } from 'lodash/defaults';
...
@@ -4,7 +4,7 @@ import { default as lodashDefaults } from 'lodash/defaults';
import
{
VariableType
}
from
'@grafana/data'
;
import
{
VariableType
}
from
'@grafana/data'
;
import
{
VariableModel
,
VariableOption
,
VariableWithOptions
}
from
'../types'
;
import
{
VariableModel
,
VariableOption
,
VariableWithOptions
}
from
'../types'
;
import
{
AddVariable
,
ALL_VARIABLE_VALUE
,
getInstanceState
,
NEW_VARIABLE_ID
,
VariablePayload
}
from
'./types'
;
import
{
AddVariable
,
getInstanceState
,
NEW_VARIABLE_ID
,
VariablePayload
}
from
'./types'
;
import
{
variableAdapters
}
from
'../adapters'
;
import
{
variableAdapters
}
from
'../adapters'
;
import
{
changeVariableNameSucceeded
}
from
'../editor/reducer'
;
import
{
changeVariableNameSucceeded
}
from
'../editor/reducer'
;
import
{
Deferred
}
from
'../../../core/utils/deferred'
;
import
{
Deferred
}
from
'../../../core/utils/deferred'
;
...
@@ -124,12 +124,6 @@ const sharedReducerSlice = createSlice({
...
@@ -124,12 +124,6 @@ const sharedReducerSlice = createSlice({
const
instanceState
=
getInstanceState
<
VariableWithOptions
>
(
state
,
action
.
payload
.
id
);
const
instanceState
=
getInstanceState
<
VariableWithOptions
>
(
state
,
action
.
payload
.
id
);
const
current
=
{
...
action
.
payload
.
data
.
option
};
const
current
=
{
...
action
.
payload
.
data
.
option
};
if
(
Array
.
isArray
(
current
.
text
)
&&
current
.
text
.
length
>
0
)
{
current
.
text
=
current
.
text
.
join
(
' + '
);
}
else
if
(
Array
.
isArray
(
current
.
value
)
&&
current
.
value
[
0
]
!==
ALL_VARIABLE_VALUE
)
{
current
.
text
=
current
.
value
.
join
(
' + '
);
}
instanceState
.
current
=
current
;
instanceState
.
current
=
current
;
instanceState
.
options
=
instanceState
.
options
.
map
(
option
=>
{
instanceState
.
options
=
instanceState
.
options
.
map
(
option
=>
{
let
selected
=
false
;
let
selected
=
false
;
...
...
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