Browse Source

Merge pull request #6726 from nocodb/fix/url-mismatch-in-import

fix(nc-gui): import type mismatch
pull/6730/head
Raju Udava 1 year ago committed by GitHub
parent
commit
356651cc2e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  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) { } else if (colProps.uidt === UITypes.SingleLineText) {
if (isEmailType(colData)) { if (isEmailType(colData)) {
colProps.uidt = UITypes.Email colProps.uidt = UITypes.Email
} } else if (isUrlType(colData)) {
if (isUrlType(colData)) {
colProps.uidt = UITypes.URL colProps.uidt = UITypes.URL
} else if (isCheckboxType(colData)) {
colProps.uidt = UITypes.Checkbox
} else { } else {
if (isCheckboxType(colData)) { if (data[columnIdx] && columnIdx < this.config.maxRowsToParse) {
colProps.uidt = UITypes.Checkbox this.columnValues[columnIdx].push(data[columnIdx])
} else { 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) { } 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 // check for long text
if (isMultiLineTextType(rows, col)) { if (isMultiLineTextType(rows, col)) {
column.uidt = UITypes.LongText column.uidt = UITypes.LongText
} } else if (isEmailType(rows, col)) {
if (isEmailType(rows, col)) {
column.uidt = UITypes.Email column.uidt = UITypes.Email
} } else if (isUrlType(rows, col)) {
if (isUrlType(rows, col)) {
column.uidt = UITypes.URL column.uidt = UITypes.URL
} else { } else {
const vals = rows const vals = rows

Loading…
Cancel
Save