Browse Source

fix(nc-gui): use isCheckboxType for init detect

pull/6725/head
աɨռɢӄաօռɢ 1 year ago
parent
commit
185f78e1c0
  1. 5
      packages/nc-gui/helpers/parsers/CSVTemplateAdapter.ts

5
packages/nc-gui/helpers/parsers/CSVTemplateAdapter.ts

@ -85,7 +85,7 @@ export default class CSVTemplateAdapter {
detectInitialUidt(v: string) { detectInitialUidt(v: string) {
if (!isNaN(Number(v)) && !isNaN(parseFloat(v))) return UITypes.Number if (!isNaN(Number(v)) && !isNaN(parseFloat(v))) return UITypes.Number
if (validateDateWithUnknownFormat(v)) return UITypes.DateTime if (validateDateWithUnknownFormat(v)) return UITypes.DateTime
if (['true', 'True', 'false', 'False', '1', '0', 'T', 'F', 'Y', 'N'].includes(v)) return UITypes.Checkbox if (isCheckboxType(v)) return UITypes.Checkbox
return UITypes.SingleLineText return UITypes.SingleLineText
} }
@ -105,8 +105,7 @@ export default class CSVTemplateAdapter {
if (isUrlType(colData)) { if (isUrlType(colData)) {
colProps.uidt = UITypes.URL colProps.uidt = UITypes.URL
} else { } else {
const checkboxType = isCheckboxType(colData) if (isCheckboxType(colData)) {
if (checkboxType.length === 1) {
colProps.uidt = UITypes.Checkbox colProps.uidt = UITypes.Checkbox
} else { } else {
if (data[columnIdx] && columnIdx < this.config.maxRowsToParse) { if (data[columnIdx] && columnIdx < this.config.maxRowsToParse) {

Loading…
Cancel
Save