CloudMonitoring: Fix TypeError in annotation queries (#40740) (#40852)

(cherry picked from commit d5de885633)

Co-authored-by: Junya Hayashi <junya.hayashi@groove-x.com>
This commit is contained in:
Grot (@grafanabot)
2021-10-25 11:19:56 +02:00
committed by GitHub
co-authored by Junya Hayashi
parent 0f2e309b4a
commit 543e9c2e50
@@ -62,7 +62,7 @@ export default class CloudMonitoringDatasource extends DataSourceWithBackend<
metricType: this.templateSrv.replace(annotation.target.metricType, options.scopedVars || {}),
title: this.templateSrv.replace(annotation.target.title, options.scopedVars || {}),
text: this.templateSrv.replace(annotation.target.text, options.scopedVars || {}),
tags: this.templateSrv.replace(annotation.target.tags, options.scopedVars || {}),
tags: (annotation.target.tags || []).map((t: string) => this.templateSrv.replace(t, options.scopedVars || {})),
projectName: this.templateSrv.replace(
annotation.target.projectName ? annotation.target.projectName : this.getDefaultProject(),
options.scopedVars || {}