mirror of
https://github.com/grafana/grafana.git
synced 2025-09-22 09:24:31 +08:00
TemplateVariables: Introduces $__searchFilter to Query Variables (#19858)
* WIP: Initial hardcoded version * Feature: Introduces SearchFiltering to Graphite * Feature: Adds searchFiltering to MySql * Tests: Adds tests to Graphite and MySql * Feature: Adds $__searchFilter to TestData * Refactor: Adds searchFilter to Postgres and extracts function * Tests: Adds tests to variable * Refactor: Adds debounce and lodash import optimization * Docs: Adds documentation * Refactor: Removes unused function and fixes typo * Docs: Updates docs * Fixed issue with UI not updating when no was used due to async func and no .apply in the non lazy path
This commit is contained in:

committed by
Torkel Ödegaard

parent
c674fa1d79
commit
cb0e80e7b9
@ -7,6 +7,7 @@ import { TemplateSrv } from 'app/features/templating/template_srv';
|
||||
import { TimeSrv } from 'app/features/dashboard/services/TimeSrv';
|
||||
//Types
|
||||
import { PostgresQueryForInterpolation } from './types';
|
||||
import { interpolateSearchFilter } from '../../../features/templating/variable';
|
||||
|
||||
export class PostgresDatasource {
|
||||
id: any;
|
||||
@ -132,10 +133,17 @@ export class PostgresDatasource {
|
||||
refId = optionalOptions.variable.name;
|
||||
}
|
||||
|
||||
const rawSql = interpolateSearchFilter({
|
||||
query: this.templateSrv.replace(query, {}, this.interpolateVariable),
|
||||
options: optionalOptions,
|
||||
wildcardChar: '%',
|
||||
quoteLiteral: true,
|
||||
});
|
||||
|
||||
const interpolatedQuery = {
|
||||
refId: refId,
|
||||
datasourceId: this.id,
|
||||
rawSql: this.templateSrv.replace(query, {}, this.interpolateVariable),
|
||||
rawSql,
|
||||
format: 'table',
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user