Skip to content

Commit

Permalink
fix: replace scopedVars
Browse files Browse the repository at this point in the history
  • Loading branch information
jsers committed Feb 28, 2023
1 parent 1dd2a15 commit 468e787
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ export const replaceExpressionVarsSpecifyRule = (
_.forEach(scopedVars, (vValue, vKey) => {
newExpression = replaceAllPolyfill(newExpression, getPlaceholder(vKey), vValue);
});

return newExpression;
};

Expand All @@ -53,7 +52,7 @@ export const replaceExpressionScopedVars = (expression: string, scopedVars: any)
export default function replaceFieldWithVariable(dashboardId, value: string, variableConfig?: IVariable[], scopedVars?: any) {
if (!value) return value;
if (scopedVars) {
return replaceExpressionScopedVars(value, scopedVars);
value = replaceExpressionScopedVars(value, scopedVars);
}
if (!variableConfig) {
return value;
Expand Down
3 changes: 3 additions & 0 deletions src/pages/dashboard/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@ function convertPanlesGrafanaToN9E(panels: any) {
...item.gridPos,
i: uid,
},

panels: convertPanlesGrafanaToN9E(item.panels),
};
}
Expand Down Expand Up @@ -297,6 +298,8 @@ function convertPanlesGrafanaToN9E(panels: any) {
.value(),
options: convertOptionsGrafanaToN9E(item),
custom: chartsMap[item.type] ? chartsMap[item.type].fn(item) : {},
maxPerRow: item.maxPerRow || 4,
repeat: item.repeat,
};
})
.value();
Expand Down

0 comments on commit 468e787

Please sign in to comment.