Browse Source

fix(nc-gui): revise getCheckboxValue type

pull/4135/head
Wing-Kam Wong 2 years ago
parent
commit
a8640df6a9
  1. 3
      packages/nc-gui/utils/parsers/CSVTemplateAdapter.ts
  2. 2
      packages/nc-gui/utils/parsers/parserHelpers.ts

3
packages/nc-gui/utils/parsers/CSVTemplateAdapter.ts

@ -211,8 +211,7 @@ export default class CSVTemplateAdapter {
const column = that.project.tables[tableIdx].columns[columnIdx]
const data = (row.data as [])[columnIdx] === '' ? null : (row.data as [])[columnIdx]
if (column.uidt === UITypes.Checkbox) {
// TODO(import): check type
// rowData[column.column_name] = getCheckboxValue(+data)
rowData[column.column_name] = getCheckboxValue(data)
rowData[column.column_name] = data
} else if (column.uidt === UITypes.Currency) {
rowData[column.column_name] = data

2
packages/nc-gui/utils/parsers/parserHelpers.ts

@ -41,7 +41,7 @@ export const isCheckboxType: any = (values: [], col = null) => {
return options
}
export const getCheckboxValue = (value: number) => {
export const getCheckboxValue = (value: any) => {
return value && aggBooleanOptions[value]
}

Loading…
Cancel
Save