mirror of
https://github.com/grafana/grafana.git
synced 2025-08-02 22:58:35 +08:00
Transformations: Add documentation around new behavior of Calculate field (#104429)
* Docs changes * remove generated placeholder for binary ops with variables * Update public/app/features/transformers/docs/content.ts Co-authored-by: Isabel Matwawana <76437239+imatwawana@users.noreply.github.com> * Update public/app/features/transformers/docs/content.ts Co-authored-by: Isabel Matwawana <76437239+imatwawana@users.noreply.github.com> --------- Co-authored-by: Isabel Matwawana <76437239+imatwawana@users.noreply.github.com>
This commit is contained in:
@ -695,9 +695,9 @@ export function getNameFromOptions(options: CalculateFieldTransformerOptions) {
|
||||
const { binary } = options;
|
||||
const alias = `${binary?.left?.matcher?.options ?? binary?.left?.fixed ?? ''} ${binary?.operator ?? ''} ${binary?.right?.matcher?.options ?? binary?.right?.fixed ?? ''}`;
|
||||
|
||||
//Remove $ signs as they will be interpolated and cause issues. Variables can still be used
|
||||
//in alias but shouldn't in the autogenerated name
|
||||
return alias.replace(/\$/g, '');
|
||||
// binary calculations with variables will be interpolated on the visualization but we don't want to do that here, so just give a blank placeholder
|
||||
const variableFound = /\$/g.test(alias);
|
||||
return variableFound ? '' : alias;
|
||||
}
|
||||
case CalculateFieldMode.ReduceRow:
|
||||
{
|
||||
|
Reference in New Issue
Block a user