mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Transformers: Add template variable substitution (#44486)
* Transformers: Add template variable replacement to transformer operator * Transformers: Add template variable replacement to calculateField transformer * Transformers: Add scopedVars to transformer template replacement * Transformers: Add calculateField template variable test * Transformers: Fix 'undefined' is not assignable to type 'string' * Transformers: Fix lint-frontend bug * Fix lint check * Fix lint
This commit is contained in:
@@ -183,6 +183,13 @@ export class PanelQueryRunner {
|
||||
return of(data);
|
||||
}
|
||||
|
||||
const replace = (option: string): string => {
|
||||
return getTemplateSrv().replace(option, data?.request?.scopedVars);
|
||||
};
|
||||
transformations.forEach((transform: any) => {
|
||||
transform.replace = replace;
|
||||
});
|
||||
|
||||
return transformDataFrame(transformations, data.series).pipe(map((series) => ({ ...data, series })));
|
||||
})
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user