Alert tab fails when datasource method targetContainsTemplate doesnt exist #14274

This commit is contained in:
Johannes Schill
2018-12-04 15:00:37 +01:00
parent 9cbdd07315
commit fe9e4b51f1

View File

@ -262,7 +262,7 @@ export class AlertTabCtrl {
this.datasourceSrv.get(datasourceName).then(ds => {
if (!ds.meta.alerting) {
this.error = 'The datasource does not support alerting queries';
} else if (ds.targetContainsTemplate(foundTarget)) {
} else if (ds.targetContainsTemplate && ds.targetContainsTemplate(foundTarget)) {
this.error = 'Template variables are not supported in alert queries';
} else {
this.error = '';