From b50c4afc32dd2f10d7d5f63cd042a30b2f7e6fad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D5=A1=C9=A8=D5=BC=C9=A2=D3=84=D5=A1=D6=85=D5=BC=C9=A2?= Date: Wed, 18 Oct 2023 17:36:11 +0800 Subject: [PATCH] fix(nc-gui): import type mismatch --- .../nc-gui/helpers/parsers/CSVTemplateAdapter.ts | 15 ++++++--------- .../helpers/parsers/ExcelTemplateAdapter.ts | 8 ++------ 2 files changed, 8 insertions(+), 15 deletions(-) diff --git a/packages/nc-gui/helpers/parsers/CSVTemplateAdapter.ts b/packages/nc-gui/helpers/parsers/CSVTemplateAdapter.ts index c35c6a0e90..002e8b0e87 100644 --- a/packages/nc-gui/helpers/parsers/CSVTemplateAdapter.ts +++ b/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) { diff --git a/packages/nc-gui/helpers/parsers/ExcelTemplateAdapter.ts b/packages/nc-gui/helpers/parsers/ExcelTemplateAdapter.ts index 5d9cff094a..80aa8daa58 100644 --- a/packages/nc-gui/helpers/parsers/ExcelTemplateAdapter.ts +++ b/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