Skip to content

Commit ad74298

Browse files
authored
fix: use arrow function to preserve this and fix template errors #150 (#153)
1 parent 899e931 commit ad74298

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
## tip
44

5+
* BUGFIX: fix an issue in the template variable service where accessing the `datasource` property of `undefined` caused a failure. See [this issue](https://github.com/VictoriaMetrics/grafana-datasource/issues/150).
6+
57
## [v0.8.0](https://github.com/VictoriaMetrics/grafana-datasource/releases/tag/v0.8.0)
68

79
* FEATURE: add variable type selector to optimize API usage, favoring [/api/v1/labels](https://docs.victoriametrics.com/url-examples/#apiv1labels) and [/api/v1/label/.../values](https://docs.victoriametrics.com/url-examples/#apiv1labelvalues) over [/api/v1/series](https://docs.victoriametrics.com/url-examples/#apiv1series). See [this issue](https://github.com/VictoriaMetrics/grafana-datasource/issues/144)

src/variables.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export class PrometheusVariableSupport extends CustomVariableSupport<PrometheusD
4242

4343
editor = VariableQueryEditor;
4444

45-
query(request: DataQueryRequest<PromVariableQuery>): Observable<DataQueryResponse> {
45+
query = (request: DataQueryRequest<PromVariableQuery>): Observable<DataQueryResponse> => {
4646
// Handling grafana as code from jsonnet variable queries which are strings and not objects
4747
// Previously, when using StandardVariableSupport
4848
// the variable query string was changed to be on the expr attribute

0 commit comments

Comments
 (0)