mirror of
https://github.com/grafana/grafana.git
synced 2024-11-26 02:40:26 -06:00
InfluxDB: Fix measurement interpolation on visual query builder (#85423)
* fix measurement interpolation * fix unit test * fix unit test 2
This commit is contained in:
parent
b0aa575643
commit
64236a3923
@ -289,7 +289,7 @@ describe('InfluxDataSource Frontend Mode', () => {
|
||||
function influxChecks(query: InfluxQuery) {
|
||||
expect(templateSrv.replace).toBeCalledTimes(12);
|
||||
expect(query.alias).toBe(text);
|
||||
expect(query.measurement).toBe(justText);
|
||||
expect(query.measurement).toBe(textWithFormatRegex);
|
||||
expect(query.policy).toBe(justText);
|
||||
expect(query.limit).toBe(justText);
|
||||
expect(query.slimit).toBe(justText);
|
||||
|
@ -297,7 +297,12 @@ export default class InfluxDatasource extends DataSourceWithBackend<InfluxQuery,
|
||||
), // The raw sql query text
|
||||
alias: this.templateSrv.replace(query.alias ?? '', scopedVars),
|
||||
limit: this.templateSrv.replace(query.limit?.toString() ?? '', scopedVars),
|
||||
measurement: this.templateSrv.replace(query.measurement ?? '', scopedVars),
|
||||
measurement: this.templateSrv.replace(
|
||||
query.measurement ?? '',
|
||||
scopedVars,
|
||||
(value: string | string[] = [], variable: QueryVariableModel) =>
|
||||
this.interpolateQueryExpr(value, variable, query.measurement)
|
||||
),
|
||||
policy: this.templateSrv.replace(query.policy ?? '', scopedVars),
|
||||
slimit: this.templateSrv.replace(query.slimit?.toString() ?? '', scopedVars),
|
||||
tz: this.templateSrv.replace(query.tz ?? '', scopedVars),
|
||||
|
@ -180,7 +180,7 @@ describe('InfluxDataSource Backend Mode', () => {
|
||||
function influxChecks(query: InfluxQuery) {
|
||||
expect(templateSrv.replace).toBeCalledTimes(12);
|
||||
expect(query.alias).toBe(text);
|
||||
expect(query.measurement).toBe(justText);
|
||||
expect(query.measurement).toBe(textWithFormatRegex);
|
||||
expect(query.policy).toBe(justText);
|
||||
expect(query.limit).toBe(justText);
|
||||
expect(query.slimit).toBe(justText);
|
||||
|
Loading…
Reference in New Issue
Block a user