mirror of
https://github.com/grafana/grafana.git
synced 2025-07-29 04:42:07 +08:00
Templating: global/system variables should be properly replaced in templated values. (#27394)
* Fixed so we try to use the variables in the redux store to replace values in template variables. * First draft of working version. * Including fieldPath when adding :text format. * cleaned up code by introducing helper function. * some minor refactoring. * Added tests and support for multi variables. * added test and code to handle the All scenario of a multivariable. * fixed according to feedback. * added docs. * added text format to gdev dashboard. * updated e2e tests. * make sure we use the same function for formatting och variable lable. * increased the number to 22. * changed label for tests to be All. * existing format should be respected.
This commit is contained in:
@ -143,3 +143,13 @@ servers = ["test'1", "test2"]
|
||||
String to interpolate: '${servers:sqlstring}'
|
||||
Interpolation result: "'test''1','test2'"
|
||||
```
|
||||
|
||||
## Text
|
||||
|
||||
Formats single- and multi-valued variables into their text representation. For a single variable it will just return the text representation. For multi-valued variables it will return the text representation combined with `+`.
|
||||
|
||||
```bash
|
||||
servers = ["test1", "test2"]
|
||||
String to interpolate: '${servers:text}'
|
||||
Interpolation result: "test1 + test2"
|
||||
```
|
Reference in New Issue
Block a user