Browse Source

fix(nc-gui): import type mismatch

pull/6726/head
աɨռɢӄաօռɢ 1 year ago
parent
commit
b50c4afc32
  1. 15
      packages/nc-gui/helpers/parsers/CSVTemplateAdapter.ts
  2. 8
      packages/nc-gui/helpers/parsers/ExcelTemplateAdapter.ts

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

@ -101,17 +101,14 @@ export default class CSVTemplateAdapter {
} else if (colProps.uidt === UITypes.SingleLineText) {
if (isEmailType(colData)) {
colProps.uidt = UITypes.Email
}
if (isUrlType(colData)) {
} else if (isUrlType(colData)) {
colProps.uidt = UITypes.URL
} else if (isCheckboxType(colData)) {
colProps.uidt = UITypes.Checkbox
} else {
if (isCheckboxType(colData)) {
colProps.uidt = UITypes.Checkbox
} else {
if (data[columnIdx] && columnIdx < this.config.maxRowsToParse) {
this.columnValues[columnIdx].push(data[columnIdx])
colProps.uidt = UITypes.SingleSelect
}
if (data[columnIdx] && columnIdx < this.config.maxRowsToParse) {
this.columnValues[columnIdx].push(data[columnIdx])
colProps.uidt = UITypes.SingleSelect
}
}
} else if (colProps.uidt === UITypes.Number) {

8
packages/nc-gui/helpers/parsers/ExcelTemplateAdapter.ts

@ -144,13 +144,9 @@ export default class ExcelTemplateAdapter extends TemplateGenerator {
// check for long text
if (isMultiLineTextType(rows, col)) {
column.uidt = UITypes.LongText
}
if (isEmailType(rows, col)) {
} else if (isEmailType(rows, col)) {
column.uidt = UITypes.Email
}
if (isUrlType(rows, col)) {
} else if (isUrlType(rows, col)) {
column.uidt = UITypes.URL
} else {
const vals = rows

Loading…
Cancel
Save