Skip to content

Commit

Permalink
Improve variable name matcher
Browse files Browse the repository at this point in the history
  • Loading branch information
insmac committed Jun 27, 2024
1 parent cb39342 commit 3ce9a68
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/components/queryBuilder/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -824,7 +824,8 @@ function formatStringValue(
multipleValue?: boolean
): string {
const filter = Array.isArray(currentFilter) ? currentFilter[0] : currentFilter;
const varConfigForFilter = templateVars.find((tv) => tv.name === filter.substring(1));
const extractedVariableName = filter.substring(1).replace(/[{}]/g, '');
const varConfigForFilter = templateVars.find((tv) => tv.name === extractedVariableName);
return filter.startsWith('$') && (multipleValue || varConfigForFilter?.current.value.length === 1)
? ` ${filter || ''}`
: ` '${filter || ''}'`;
Expand Down

0 comments on commit 3ce9a68

Please sign in to comment.