Browse Source

fix(gui): checkbox rendering

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/4405/head
Pranav C 2 years ago
parent
commit
25b68a74cd
  1. 2
      packages/nc-gui/components/smartsheet/Cell.vue
  2. 2
      packages/nc-gui/components/smartsheet/header/CellIcon.ts
  3. 3
      packages/nc-gui/utils/cell.ts

2
packages/nc-gui/components/smartsheet/Cell.vue

@ -136,7 +136,7 @@ const syncAndNavigate = (dir: NavigateDir, e: KeyboardEvent) => {
>
<template v-if="column">
<LazyCellTextArea v-if="isTextArea(column)" v-model="vModel" />
<LazyCellCheckbox v-else-if="isBoolean(column)" v-model="vModel" />
<LazyCellCheckbox v-else-if="isBoolean(column, abstractType)" v-model="vModel" />
<LazyCellAttachment v-else-if="isAttachment(column)" v-model="vModel" :row-index="props.rowIndex" />
<LazyCellSingleSelect v-else-if="isSingleSelect(column)" v-model="vModel" :row-index="props.rowIndex" />
<LazyCellMultiSelect v-else-if="isMultiSelect(column)" v-model="vModel" :row-index="props.rowIndex" />

2
packages/nc-gui/components/smartsheet/header/CellIcon.ts

@ -68,7 +68,7 @@ const renderIcon = (column: ColumnType, abstractType: any) => {
return MultiSelectIcon
} else if (isSingleSelect(column)) {
return SingleSelectIcon
} else if (isBoolean(column)) {
} else if (isBoolean(column, abstractType)) {
return BooleanIcon
} else if (isTextArea(column)) {
return TextAreaIcon

3
packages/nc-gui/utils/cell.ts

@ -2,7 +2,8 @@ import type { ColumnType } from 'nocodb-sdk'
import { UITypes } from 'nocodb-sdk'
export const dataTypeLow = (column: ColumnType) => column.dt?.toLowerCase()
export const isBoolean = (abstractType: any) => abstractType === 'boolean'
export const isBoolean = (column: ColumnType, abstractType?: any) =>
column.uidt === UITypes.Checkbox || abstractType === 'boolean'
export const isString = (column: ColumnType, abstractType: any) =>
column.uidt === UITypes.SingleLineText || abstractType === 'string'
export const isTextArea = (column: ColumnType) => column.uidt === UITypes.LongText

Loading…
Cancel
Save