Browse Source

refactor: remove substituteColumnIdWithAliasInFormula as now it is in sdk

pull/1979/head
Wing-Kam Wong 3 years ago
parent
commit
a9fd828859
  1. 32
      packages/nocodb/src/lib/noco/meta/helpers/formulaHelpers.ts

32
packages/nocodb/src/lib/noco/meta/helpers/formulaHelpers.ts

@ -58,35 +58,3 @@ export async function substituteColumnAliasWithIdInFormula(
await substituteId(parsedFormula); await substituteId(parsedFormula);
return jsepTreeToFormula(parsedFormula); return jsepTreeToFormula(parsedFormula);
} }
// not in use
// export function substituteColumnIdWithAliasInFormula(
// formula,
// columns: Column[]
// ) {
// const substituteId = (pt: any) => {
// if (pt.type === 'CallExpression') {
// for (const arg of pt.arguments || []) {
// substituteId(arg);
// }
// } else if (pt.type === 'Literal') {
// return;
// } else if (pt.type === 'Identifier') {
// const colNameOrId = pt.name;
// const column = columns.find(
// c =>
// c.id === colNameOrId ||
// c.column_name === colNameOrId ||
// c.title === colNameOrId
// );
// pt.name = column.id;
// } else if (pt.type === 'BinaryExpression') {
// substituteId(pt.left);
// substituteId(pt.right);
// }
// };
//
// const parsedFormula = jsep(formula);
// substituteId(parsedFormula);
// return jsepTreeToFormula(parsedFormula);
// }

Loading…
Cancel
Save