Open mckn opened 1 year ago
@mckn iirc 2 of our examples use replaceVariables
, 1 uses templateSrv
. Is this just to update the one which uses templateSrv or are there other changes we should make.
In terms of documentation, again it would be good to expand upon where you're thinking for this and where a user would have first thought to use templateSrv
as that user journey is unclear to me at this point
@mckn iirc 2 of our examples use
replaceVariables
, 1 usestemplateSrv
. Is this just to update the one which uses templateSrv or are there other changes we should make.In terms of documentation, again it would be good to expand upon where you're thinking for this and where a user would have first thought to use
templateSrv
as that user journey is unclear to me at this point
Yupp, agree about the docs! The example using templateSrv
is a data source and in that context it should be ok to use the templateSrv
.
When building a panel you should use the
replaceVariables
function instead of using thetemplateSrv
directly. The main reason for this is to get proper support for template variabels when repeating the panel based on a template variable.We should add an example show casing this along side of documentation highlighting what additional scenarios the panel will support by using this function.
For more information see the following PR and issue.
https://github.com/grafana/grafana-iot-twinmaker-app/pull/188