mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Fix: Graphite query rendering fix (#16390)
Only interpolate string parameters Fixes #16367
This commit is contained in:
parent
c2d399b059
commit
173e7fd839
@ -966,7 +966,6 @@ export class FuncInstance {
|
||||
const str = this.def.name + '(';
|
||||
|
||||
const parameters = _.map(this.params, (value, index) => {
|
||||
const valueInterpolated = replaceVariables(value);
|
||||
let paramType;
|
||||
|
||||
if (index < this.def.params.length) {
|
||||
@ -980,6 +979,8 @@ export class FuncInstance {
|
||||
return value;
|
||||
}
|
||||
|
||||
const valueInterpolated = _.isString(value) ? replaceVariables(value) : value;
|
||||
|
||||
// param types that might be quoted
|
||||
// To quote variables correctly we need to interpolate it to check if it contains a numeric or string value
|
||||
if (_.includes(['int_or_interval', 'node_or_tag'], paramType) && _.isFinite(+valueInterpolated)) {
|
||||
|
@ -31,7 +31,8 @@ describe('when creating func instance from func names', () => {
|
||||
});
|
||||
|
||||
function replaceVariablesDummy(str: string) {
|
||||
return str;
|
||||
// important that this does replace
|
||||
return str.replace('asdasdas', 'asdsad');
|
||||
}
|
||||
|
||||
describe('when rendering func instance', () => {
|
||||
|
Loading…
Reference in New Issue
Block a user