Skip to content

Commit

Permalink
User defined variables incorrectly rendered
Browse files Browse the repository at this point in the history
It fixes an issue with variable names on Grafana 11.3, where these
variables were rendered as undefined.

Github issue #278

CMK-20263
  • Loading branch information
lpetrora committed Nov 18, 2024
1 parent 29f79f3 commit 219a7e9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/ui/components.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,10 @@ export const CheckMkGenericAsyncSelect = function <Value extends string | (strin
const data = await autocompleter(inputValue);
if (showVariables !== false) {
for (const variable of getTemplateSrv().getVariables()) {
const variableId = variable?.id || variable.name
data.splice(0, 0, {
value: `$${variable.id}` as Value,
label: `$${variable.id}`,
value: `$${variableId}` as Value,
label: `$${variableId}`,
isGrafanaVariable: true,
});
}
Expand Down

0 comments on commit 219a7e9

Please sign in to comment.