Browse Source

fix(gui-v2): use client type property

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/3435/head
Pranav C 2 years ago
parent
commit
9dba1b9e1c
  1. 10
      packages/nc-gui-v2/composables/useColumn.ts

10
packages/nc-gui-v2/composables/useColumn.ts

@ -7,14 +7,14 @@ export function useColumn(column: Ref<ColumnType>) {
const { project } = useProject()
const uiDatatype: ComputedRef<UITypes> = computed(() => column?.value?.uidt as UITypes)
const abstractType = computed(() =>
const abstractType = computed(() => {
// kludge: CY test hack; column.value is being received NULL during attach cell delete operation
isVirtualCol(column?.value) || !column?.value
return isVirtualCol(column?.value) || !column?.value
? null
: SqlUiFactory.create(
project.value?.bases?.[0]?.config ? { client: project.value.bases[0].config.type } : { client: 'mysql2' },
).getAbstractType(column?.value),
)
project.value?.bases?.[0]?.config ? { client: project.value.bases[0].type } : { client: 'mysql2' },
).getAbstractType(column?.value)
})
const dataTypeLow = computed(() => column?.value?.dt?.toLowerCase())
const isBoolean = computed(() => abstractType.value === 'boolean')

Loading…
Cancel
Save