From d59358014b899f6220ad7104fa52958fddfe704b Mon Sep 17 00:00:00 2001 From: Mate Date: Thu, 29 Nov 2018 14:19:06 +0100 Subject: [PATCH 1/4] Fixing multiple parameters to use Lucene format --- src/datasource.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/datasource.js b/src/datasource.js index 2480928..eacfdbc 100644 --- a/src/datasource.js +++ b/src/datasource.js @@ -167,7 +167,7 @@ export class TimelionDatasource { _.map(Object.keys(options.scopedVars), key => target = target.replace("$" + key, options.scopedVars[key].value)); return oThis.templateSrv - .replace(target, true) + .replace(target, true, "lucene") .replace(/\r\n|\r|\n/mg, "") .trim(); }; From 53e749adb6617ff7aaaa9ee74ab56cbbcd5bfc06 Mon Sep 17 00:00:00 2001 From: Mate Date: Fri, 30 Nov 2018 10:29:01 +0100 Subject: [PATCH 2/4] Fixed breakdown panels templating substitution --- src/datasource.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/datasource.js b/src/datasource.js index eacfdbc..8737e99 100644 --- a/src/datasource.js +++ b/src/datasource.js @@ -165,7 +165,7 @@ export class TimelionDatasource { }; var expandTemplate = function (target) { _.map(Object.keys(options.scopedVars), key => - target = target.replace("$" + key, options.scopedVars[key].value)); + target = target.replace("$" + key, oThis.templateSrv.replace("$" + key, options.scopedVars, "lucene")); return oThis.templateSrv .replace(target, true, "lucene") .replace(/\r\n|\r|\n/mg, "") From edc75d9fff746f8f3d42fece71641d49c4bec5df Mon Sep 17 00:00:00 2001 From: Mate Date: Fri, 30 Nov 2018 13:09:41 +0100 Subject: [PATCH 3/4] Revert "Fixing multiple parameters to use Lucene format" This reverts commit d59358014b899f6220ad7104fa52958fddfe704b. --- src/datasource.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/datasource.js b/src/datasource.js index 8737e99..41c8099 100644 --- a/src/datasource.js +++ b/src/datasource.js @@ -167,7 +167,7 @@ export class TimelionDatasource { _.map(Object.keys(options.scopedVars), key => target = target.replace("$" + key, oThis.templateSrv.replace("$" + key, options.scopedVars, "lucene")); return oThis.templateSrv - .replace(target, true, "lucene") + .replace(target, true) .replace(/\r\n|\r|\n/mg, "") .trim(); }; From acc1fd4b3272653056199756f79b026bf8ed22e2 Mon Sep 17 00:00:00 2001 From: Mate Date: Fri, 30 Nov 2018 14:34:39 +0100 Subject: [PATCH 4/4] Template replace scopedVars for all occourences --- src/datasource.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/datasource.js b/src/datasource.js index 41c8099..c4f27c4 100644 --- a/src/datasource.js +++ b/src/datasource.js @@ -165,7 +165,7 @@ export class TimelionDatasource { }; var expandTemplate = function (target) { _.map(Object.keys(options.scopedVars), key => - target = target.replace("$" + key, oThis.templateSrv.replace("$" + key, options.scopedVars, "lucene")); + target = target.replace(new RegExp("\\$" + key, 'g'), oThis.templateSrv.replace("$" + key, options.scopedVars, "lucene")); return oThis.templateSrv .replace(target, true) .replace(/\r\n|\r|\n/mg, "")