|
|
@ -67,11 +67,7 @@ export async function substituteColumnAliasWithIdInFormula( |
|
|
|
}; |
|
|
|
}; |
|
|
|
// register jsep curly hook
|
|
|
|
// register jsep curly hook
|
|
|
|
jsep.plugins.register(jsepCurlyHook); |
|
|
|
jsep.plugins.register(jsepCurlyHook); |
|
|
|
const parsedFormula = jsep( |
|
|
|
const parsedFormula = jsep(formula); |
|
|
|
// formula may include double curly brackets in previous version
|
|
|
|
|
|
|
|
// convert to single curly bracket here for compatibility
|
|
|
|
|
|
|
|
formula.replaceAll('{{', '{').replaceAll('}}', '}') |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
await substituteId(parsedFormula); |
|
|
|
await substituteId(parsedFormula); |
|
|
|
return jsepTreeToFormula(parsedFormula); |
|
|
|
return jsepTreeToFormula(parsedFormula); |
|
|
|
} |
|
|
|
} |
|
|
@ -106,11 +102,7 @@ export function substituteColumnIdWithAliasInFormula( |
|
|
|
|
|
|
|
|
|
|
|
// register jsep curly hook
|
|
|
|
// register jsep curly hook
|
|
|
|
jsep.plugins.register(jsepCurlyHook); |
|
|
|
jsep.plugins.register(jsepCurlyHook); |
|
|
|
const parsedFormula = jsep( |
|
|
|
const parsedFormula = jsep(formula); |
|
|
|
// formula may include double curly brackets in previous version
|
|
|
|
|
|
|
|
// convert to single curly bracket here for compatibility
|
|
|
|
|
|
|
|
formula.replaceAll('{{', '{').replaceAll('}}', '}') |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
const parsedRawFormula = rawFormula && jsep(rawFormula); |
|
|
|
const parsedRawFormula = rawFormula && jsep(rawFormula); |
|
|
|
substituteId(parsedFormula, parsedRawFormula); |
|
|
|
substituteId(parsedFormula, parsedRawFormula); |
|
|
|
return jsepTreeToFormula(parsedFormula); |
|
|
|
return jsepTreeToFormula(parsedFormula); |
|
|
|