|
|
@ -9,7 +9,7 @@ import { |
|
|
|
substituteColumnIdWithAliasInFormula, |
|
|
|
substituteColumnIdWithAliasInFormula, |
|
|
|
validateFormulaAndExtractTreeWithType, |
|
|
|
validateFormulaAndExtractTreeWithType, |
|
|
|
} from 'nocodb-sdk' |
|
|
|
} from 'nocodb-sdk' |
|
|
|
import type { ColumnType, FormulaType, LinkToAnotherRecordType, TableType } from 'nocodb-sdk' |
|
|
|
import type { ColumnType, FormulaType } from 'nocodb-sdk' |
|
|
|
import { |
|
|
|
import { |
|
|
|
MetaInj, |
|
|
|
MetaInj, |
|
|
|
NcAutocompleteTree, |
|
|
|
NcAutocompleteTree, |
|
|
@ -21,12 +21,9 @@ import { |
|
|
|
iconMap, |
|
|
|
iconMap, |
|
|
|
inject, |
|
|
|
inject, |
|
|
|
insertAtCursor, |
|
|
|
insertAtCursor, |
|
|
|
isDate, |
|
|
|
|
|
|
|
nextTick, |
|
|
|
nextTick, |
|
|
|
onMounted, |
|
|
|
onMounted, |
|
|
|
ref, |
|
|
|
ref, |
|
|
|
storeToRefs, |
|
|
|
|
|
|
|
useBase, |
|
|
|
|
|
|
|
useColumnCreateStoreOrThrow, |
|
|
|
useColumnCreateStoreOrThrow, |
|
|
|
useDebounceFn, |
|
|
|
useDebounceFn, |
|
|
|
useI18n, |
|
|
|
useI18n, |
|
|
@ -66,7 +63,7 @@ const validators = { |
|
|
|
if (!formula?.trim()) return reject(new Error('Required')) |
|
|
|
if (!formula?.trim()) return reject(new Error('Required')) |
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
try { |
|
|
|
await validateFormulaAndExtractTreeWithType({ formula, columns: supportedColumns.value, clientOrSqlUi: sqlUi.value, getMeta }) |
|
|
|
await validateFormulaAndExtractTreeWithType({ column: column.value, formula, columns: supportedColumns.value, clientOrSqlUi: sqlUi.value, getMeta }) |
|
|
|
} catch (e: any) { |
|
|
|
} catch (e: any) { |
|
|
|
if (e instanceof FormulaError && e.extra?.key) { |
|
|
|
if (e instanceof FormulaError && e.extra?.key) { |
|
|
|
return reject(new Error(t(e.extra.key, e.extra))) |
|
|
|
return reject(new Error(t(e.extra.key, e.extra))) |
|
|
|