Skip to content

Commit

Permalink
feat: Allow empty TextVariable value for conditionalAll (grafana#266)
Browse files Browse the repository at this point in the history
  • Loading branch information
fionera authored Dec 30, 2022
1 parent 13f6bad commit 08521c9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/data/CHDatasource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ export class Datasource extends DataSourceWithBackend<CHQuery, CHConfig> {
const templateVar = params[1].trim();
const key = templateVars.find((x) => x.name === templateVar.substring(1, templateVar.length)) as any;
let phrase = params[0];
if (key?.current.value.toString() === '$__all') {
let value = key?.current.value.toString();
if (value === '' || value === '$__all') {
phrase = '1=1';
}
rawQuery = rawQuery.replace(`${macro}${params[0]},${params[1]})`, phrase);
Expand Down

0 comments on commit 08521c9

Please sign in to comment.