Browse Source

Nc feature: Import CSV - skip field mapping during import (#8915)

* fix(nc-gui): import csv changes

* fix(nc-gui): tooltip alignment issue

* fix(nc-gui): duplicate table name issue

* fix(nc-gui): uncheck auto select field type checkbox

* fix(nc-gui): skip field mapping during csv import

* chore(nc-gui): lint

* fix(nc-gui): small changes

* fix(nc-gui): remove auto mapping option

* fix(test): update import excel test cases

* fix(nc-gui): review changes

* fix(nc-gui): quick import modal width issue

* fix(nc-gui): w.replace is not a function
pull/8952/head
Ramesh Mane 5 months ago committed by GitHub
parent
commit
5cfe0f781b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 58
      packages/nc-gui/components/dlg/QuickImport.vue
  2. 215
      packages/nc-gui/components/template/Editor.vue
  3. 11
      packages/nc-gui/components/template/utils.ts
  4. 10
      packages/nc-gui/helpers/parsers/ExcelTemplateAdapter.ts
  5. 5
      packages/nc-gui/lang/en.json
  6. 5
      tests/playwright/tests/db/features/import.spec.ts

58
packages/nc-gui/components/dlg/QuickImport.vue

@ -70,6 +70,7 @@ const defaultImportState = {
autoSelectFieldTypes: true, autoSelectFieldTypes: true,
firstRowAsHeaders: true, firstRowAsHeaders: true,
shouldImportData: true, shouldImportData: true,
importDataOnly: true,
}, },
} }
const importState = reactive(defaultImportState) const importState = reactive(defaultImportState)
@ -84,7 +85,6 @@ const IsImportTypeExcel = computed(() => importType === 'excel')
const validators = computed(() => ({ const validators = computed(() => ({
url: [fieldRequiredValidator(), importUrlValidator, isImportTypeCsv.value ? importCsvUrlValidator : importExcelUrlValidator], url: [fieldRequiredValidator(), importUrlValidator, isImportTypeCsv.value ? importCsvUrlValidator : importExcelUrlValidator],
maxRowsToParse: [fieldRequiredValidator()],
})) }))
const { validate, validateInfos } = useForm(importState, validators) const { validate, validateInfos } = useForm(importState, validators)
@ -152,10 +152,6 @@ const disableImportButton = computed(() => !templateEditorRef.value?.isValid ||
const disableFormatJsonButton = computed(() => !jsonEditorRef.value?.isValid) const disableFormatJsonButton = computed(() => !jsonEditorRef.value?.isValid)
const modalWidth = computed(() => { const modalWidth = computed(() => {
if (importType === 'excel' && templateEditorModal.value) {
return 'max(90vw, 600px)'
}
return 'max(60vw, 600px)' return 'max(60vw, 600px)'
}) })
@ -254,9 +250,10 @@ function formatJson() {
jsonEditorRef.value?.format() jsonEditorRef.value?.format()
} }
function populateUniqueTableName(tn: string) { function populateUniqueTableName(tn: string, draftTn: string[] = []) {
let c = 1 let c = 1
while ( while (
draftTn.includes(tn) ||
baseTables.value.get(baseId)?.some((t: TableType) => { baseTables.value.get(baseId)?.some((t: TableType) => {
const s = t.table_name.split('___') const s = t.table_name.split('___')
let target = t.table_name let target = t.table_name
@ -492,10 +489,13 @@ async function parseAndExtractData(val: UploadFile[] | ArrayBuffer | string) {
if (importDataOnly) importColumns.value = templateGenerator!.getColumns() if (importDataOnly) importColumns.value = templateGenerator!.getColumns()
else { else {
// ensure the target table name not exist in current table list // ensure the target table name not exist in current table list
templateData.value.tables = templateData.value.tables.map((table: Record<string, any>) => ({ const draftTableNames = [] as string[]
...table,
table_name: populateUniqueTableName(table.table_name), templateData.value.tables = templateData.value.tables.map((table: Record<string, any>) => {
})) const table_name = populateUniqueTableName(table.table_name, draftTableNames)
draftTableNames.push(table_name)
return { ...table, table_name }
})
} }
importData.value = templateGenerator!.getData() importData.value = templateGenerator!.getData()
} }
@ -517,6 +517,11 @@ const onError = () => {
const onChange = () => { const onChange = () => {
isError.value = false isError.value = false
} }
onMounted(() => {
importState.parserConfig.importDataOnly = importDataOnly
importState.parserConfig.autoSelectFieldTypes = importDataOnly
})
</script> </script>
<template> <template>
@ -531,7 +536,12 @@ const onChange = () => {
<div class="px-5"> <div class="px-5">
<div class="prose-xl font-weight-bold my-5">{{ importMeta.header }}</div> <div class="prose-xl font-weight-bold my-5">{{ importMeta.header }}</div>
<div class="mt-5"> <div
class="mt-5"
:class="{
'mb-4': templateEditorModal,
}"
>
<LazyTemplateEditor <LazyTemplateEditor
v-if="templateEditorModal" v-if="templateEditorModal"
ref="templateEditorRef" ref="templateEditorRef"
@ -582,6 +592,9 @@ const onChange = () => {
<p class="ant-upload-hint"> <p class="ant-upload-hint">
{{ importMeta.uploadHint }} {{ importMeta.uploadHint }}
</p> </p>
<template #removeIcon>
<component :is="iconMap.deleteListItem" />
</template>
</a-upload-dragger> </a-upload-dragger>
</div> </div>
</a-tab-pane> </a-tab-pane>
@ -608,9 +621,9 @@ const onChange = () => {
</template> </template>
<div class="pr-10 pt-5"> <div class="pr-10 pt-5">
<a-form :model="importState" name="quick-import-url-form" layout="vertical" class="mb-0"> <a-form :model="importState" name="quick-import-url-form" layout="vertical" class="mb-0 !ml-0.5">
<a-form-item :label="importMeta.urlInputLabel" v-bind="validateInfos.url"> <a-form-item :label="importMeta.urlInputLabel" v-bind="validateInfos.url">
<a-input v-model:value="importState.url" size="large" /> <a-input v-model:value="importState.url" size="large" class="!rounded-md" />
</a-form-item> </a-form-item>
</a-form> </a-form>
</div> </div>
@ -625,16 +638,6 @@ const onChange = () => {
<!-- Advanced Settings --> <!-- Advanced Settings -->
<span class="prose-lg">{{ $t('title.advancedSettings') }}</span> <span class="prose-lg">{{ $t('title.advancedSettings') }}</span>
<a-form-item class="!my-2" :label="t('msg.info.footMsg')" v-bind="validateInfos.maxRowsToParse">
<a-input-number v-model:value="importState.parserConfig.maxRowsToParse" :min="1" :max="50000" />
</a-form-item>
<a-form-item v-if="!importDataOnly" class="!my-2">
<a-checkbox v-model:checked="importState.parserConfig.autoSelectFieldTypes">
<span class="caption">{{ $t('labels.autoSelectFieldTypes') }}</span>
</a-checkbox>
</a-form-item>
<a-form-item v-if="isImportTypeCsv || IsImportTypeExcel" class="!my-2"> <a-form-item v-if="isImportTypeCsv || IsImportTypeExcel" class="!my-2">
<a-checkbox v-model:checked="importState.parserConfig.firstRowAsHeaders"> <a-checkbox v-model:checked="importState.parserConfig.firstRowAsHeaders">
<span class="caption">{{ $t('labels.firstRowAsHeaders') }}</span> <span class="caption">{{ $t('labels.firstRowAsHeaders') }}</span>
@ -699,3 +702,12 @@ const onChange = () => {
</template> </template>
</a-modal> </a-modal>
</template> </template>
<style lang="scss" scoped>
:deep(.ant-upload-list-item-thumbnail) {
line-height: 48px;
}
:deep(.ant-upload-list-item-card-actions-btn.ant-btn-icon-only) {
@apply !h-6;
}
</style>

215
packages/nc-gui/components/template/Editor.vue

@ -101,7 +101,7 @@ const isImporting = ref(false)
const importingTips = ref<Record<string, string>>({}) const importingTips = ref<Record<string, string>>({})
const checkAllRecord = ref<boolean[]>([]) const checkAllRecord = ref<Record<string, boolean>>({})
const formError = ref() const formError = ref()
@ -168,14 +168,20 @@ watch(
let res = true let res = true
if (importDataOnly) { if (importDataOnly) {
for (const tn of Object.keys(srcDestMapping.value)) { for (const tn of Object.keys(srcDestMapping.value)) {
let flag = false
if (!atLeastOneEnabledValidation(tn)) { if (!atLeastOneEnabledValidation(tn)) {
res = false res = false
} }
for (const record of srcDestMapping.value[tn]) { for (const record of srcDestMapping.value[tn]) {
if (!fieldsValidation(record, tn)) { if (!fieldsValidation(record, tn)) {
return false res = false
flag = true
break
} }
} }
if (flag) {
break
}
} }
} else { } else {
for (const [_, o] of Object.entries(validateInfos)) { for (const [_, o] of Object.entries(validateInfos)) {
@ -258,20 +264,13 @@ function deleteTable(tableIdx: number) {
function deleteTableColumn(tableIdx: number, columnKey: number) { function deleteTableColumn(tableIdx: number, columnKey: number) {
const columnIdx = data.tables[tableIdx].columns.findIndex((c: ColumnType & { key: number }) => c.key === columnKey) const columnIdx = data.tables[tableIdx].columns.findIndex((c: ColumnType & { key: number }) => c.key === columnKey)
data.tables[tableIdx].columns.splice(columnIdx, 1) data.tables[tableIdx].columns.splice(columnIdx, 1)
} let key = 0
function addNewColumnRow(tableIdx: number, uidt: string) {
data.tables[tableIdx].columns.push({
key: data.tables[tableIdx].columns.length,
title: `title${data.tables[tableIdx].columns.length + 1}`,
column_name: `title${data.tables[tableIdx].columns.length + 1}`,
uidt,
})
nextTick(() => { data.tables[tableIdx].columns.forEach((_c: ColumnType & { key: number }, i: number) => {
const input = inputRefs.value[data.tables[tableIdx].columns.length - 1] if (data.tables[tableIdx].columns[i].key !== undefined) {
input.focus() data.tables[tableIdx].columns[i].key = key
input.select() key++
}
}) })
} }
@ -763,7 +762,7 @@ watch(modelRef, async () => {
</template> </template>
<template #extra> <template #extra>
<a-tooltip bottom> <NcTooltip bottom class="inline-block">
<template #title> <template #title>
<span>{{ $t('activity.deleteTable') }}</span> <span>{{ $t('activity.deleteTable') }}</span>
</template> </template>
@ -773,7 +772,7 @@ watch(modelRef, async () => {
class="text-lg mr-8" class="text-lg mr-8"
@click.stop="deleteTable(tableIdx)" @click.stop="deleteTable(tableIdx)"
/> />
</a-tooltip> </NcTooltip>
</template> </template>
<a-table <a-table
@ -801,10 +800,10 @@ watch(modelRef, async () => {
<template #bodyCell="{ column, record }"> <template #bodyCell="{ column, record }">
<template v-if="column.key === 'source_column'"> <template v-if="column.key === 'source_column'">
<NcTooltip class="truncate" <NcTooltip class="truncate inline-block">
><template #title>{{ record.srcCn }}</template <template #title>{{ record.srcCn }}</template>
>{{ record.srcCn }}</NcTooltip {{ record.srcCn }}
> </NcTooltip>
</template> </template>
<template v-else-if="column.key === 'destination_column'"> <template v-else-if="column.key === 'destination_column'">
@ -815,10 +814,13 @@ watch(modelRef, async () => {
:filter-option="filterOption" :filter-option="filterOption"
dropdown-class-name="nc-dropdown-filter-field" dropdown-class-name="nc-dropdown-filter-field"
> >
<template #suffixIcon>
<GeneralIcon icon="arrowDown" class="text-current" />
</template>
<a-select-option v-for="(col, i) of columns" :key="i" :value="col.title"> <a-select-option v-for="(col, i) of columns" :key="i" :value="col.title">
<div class="flex items-center"> <div class="flex items-center gap-2">
<component :is="getUIDTIcon(col.uidt)" /> <component :is="getUIDTIcon(col.uidt)" class="w-3.5 h-3.5" />
<span class="ml-2">{{ col.title }}</span> <span>{{ col.title }}</span>
</div> </div>
</a-select-option> </a-select-option>
</a-select> </a-select>
@ -849,13 +851,13 @@ watch(modelRef, async () => {
<a-collapse-panel v-for="(table, tableIdx) of data.tables" :key="tableIdx"> <a-collapse-panel v-for="(table, tableIdx) of data.tables" :key="tableIdx">
<template #header> <template #header>
<a-form-item v-bind="validateInfos[`tables.${tableIdx}.table_name`]" no-style> <a-form-item v-bind="validateInfos[`tables.${tableIdx}.table_name`]" no-style>
<div class="flex flex-col w-full"> <div class="flex flex-col w-full mr-2">
<a-input <a-input
v-model:value="table.table_name" v-model:value="table.table_name"
class="font-weight-bold text-lg" class="font-weight-bold text-lg !rounded-md"
size="large" size="large"
hide-details hide-details
:bordered="false" :bordered="true"
@click.stop @click.stop
@blur="handleEditableTnChange(tableIdx)" @blur="handleEditableTnChange(tableIdx)"
@keydown.enter="handleEditableTnChange(tableIdx)" @keydown.enter="handleEditableTnChange(tableIdx)"
@ -869,17 +871,17 @@ watch(modelRef, async () => {
</template> </template>
<template #extra> <template #extra>
<a-tooltip bottom> <NcTooltip bottom class="inline-block mr-8">
<template #title> <template #title>
<span>{{ $t('activity.deleteTable') }}</span> <span>{{ $t('activity.deleteTable') }}</span>
</template> </template>
<component <component
:is="iconMap.delete" :is="iconMap.deleteListItem"
v-if="data.tables.length > 1" v-if="data.tables.length > 1"
class="text-lg mr-8" class="text-lg"
@click.stop="deleteTable(tableIdx)" @click.stop="deleteTable(tableIdx)"
/> />
</a-tooltip> </NcTooltip>
</template> </template>
<a-table <a-table
v-if="table.columns && table.columns.length" v-if="table.columns && table.columns.length"
@ -916,117 +918,71 @@ watch(modelRef, async () => {
<template #bodyCell="{ column, record }"> <template #bodyCell="{ column, record }">
<template v-if="column.key === 'column_name'"> <template v-if="column.key === 'column_name'">
<a-form-item v-bind="validateInfos[`tables.${tableIdx}.columns.${record.key}.${column.key}`]"> <a-form-item v-bind="validateInfos[`tables.${tableIdx}.columns.${record.key}.${column.key}`]">
<a-input :ref="(el: HTMLInputElement) => (inputRefs[record.key] = el)" v-model:value="record.title" /> <a-input
:ref="(el: HTMLInputElement) => (inputRefs[record.key] = el)"
v-model:value="record.title"
class="!rounded-md"
/>
</a-form-item> </a-form-item>
</template> </template>
<template v-else-if="column.key === 'uidt'"> <template v-else-if="column.key === 'uidt'">
<a-form-item v-bind="validateInfos[`tables.${tableIdx}.columns.${record.key}.${column.key}`]"> <a-form-item v-bind="validateInfos[`tables.${tableIdx}.columns.${record.key}.${column.key}`]">
<a-select <NcTooltip :disabled="importDataOnly">
v-model:value="record.uidt" <template #title>
class="w-52" {{ $t('tooltip.useFieldEditMenuToConfigFieldType') }}
show-search </template>
:filter-option="filterOption" <a-select
dropdown-class-name="nc-dropdown-template-uidt" v-model:value="record.uidt"
@change="handleUIDTChange(record, table)" class="w-52"
> show-search
<a-select-option v-for="(option, i) of uiTypeOptions" :key="i" :value="option.value"> :filter-option="filterOption"
<a-tooltip placement="right"> dropdown-class-name="nc-dropdown-template-uidt"
<template v-if="isSelectDisabled(option.label, table.columns[record.key]?._disableSelect)" #title> :disabled="!importDataOnly"
{{ @change="handleUIDTChange(record, table)"
$t('msg.tooLargeFieldEntity', { >
entity: option.label, <template #suffixIcon>
}) <GeneralIcon icon="arrowDown" class="text-current" />
}} </template>
</template>
{{ option.label }} <a-select-option v-for="(option, i) of uiTypeOptions" :key="i" :value="option.value">
</a-tooltip> <div class="flex items-center gap-2">
</a-select-option> <component :is="getUIDTIcon(UITypes[option.value])" class="h-3.5 w-3.5" />
</a-select> <NcTooltip placement="right" :disabled="!importDataOnly" show-on-truncate-only>
</a-form-item> <template v-if="isSelectDisabled(option.label, table.columns[record.key]?._disableSelect)" #title>
</template> {{
$t('msg.tooLargeFieldEntity', {
<template v-else-if="column.key === 'dtxp'"> entity: option.label,
<a-form-item v-if="isSelect(record)"> })
<a-input v-model:value="record.dtxp" /> }}
</template>
{{ option.label }}
</NcTooltip>
</div>
</a-select-option>
</a-select>
</NcTooltip>
</a-form-item> </a-form-item>
</template> </template>
<template v-if="column.key === 'action'"> <template v-if="column.key === 'action'">
<a-tooltip v-if="record.key === 0"> <NcTooltip class="inline-block">
<template #title>
<span>{{ $t('general.primaryValue') }}</span>
</template>
<div class="flex items-center float-right mr-4">
<mdi-key-star class="text-lg" />
</div>
</a-tooltip>
<a-tooltip v-else>
<template #title> <template #title>
<span>{{ $t('activity.column.delete') }}</span> <span>{{ $t('activity.column.delete') }}</span>
</template> </template>
<a-button type="text" @click="deleteTableColumn(tableIdx, record.key)"> <NcButton
<div class="flex items-center"> type="text"
<component :is="iconMap.delete" class="text-lg" /> size="small"
</div> :disabled="table.columns.length === 1"
</a-button> @click="deleteTableColumn(tableIdx, record.key)"
</a-tooltip> >
<component :is="iconMap.deleteListItem" />
</NcButton>
</NcTooltip>
</template> </template>
</template> </template>
</a-table> </a-table>
<div class="mt-5 flex gap-2 justify-center">
<a-tooltip bottom>
<template #title>
<span>{{ $t('activity.column.addNumber') }}</span>
</template>
<a-button class="group" @click="addNewColumnRow(tableIdx, 'Number')">
<div class="flex items-center">
<component :is="iconMap.number" class="group-hover:!text-accent flex text-lg" />
</div>
</a-button>
</a-tooltip>
<a-tooltip bottom>
<template #title>
<span>{{ $t('activity.column.addSingleLineText') }}</span>
</template>
<a-button class="group" @click="addNewColumnRow(tableIdx, 'SingleLineText')">
<div class="flex items-center">
<component :is="iconMap.text" class="group-hover:!text-accent text-lg" />
</div>
</a-button>
</a-tooltip>
<a-tooltip bottom>
<template #title>
<span>{{ $t('activity.column.addLongText') }}</span>
</template>
<a-button class="group" @click="addNewColumnRow(tableIdx, 'LongText')">
<div class="flex items-center">
<component :is="iconMap.longText" class="group-hover:!text-accent text-lg" />
</div>
</a-button>
</a-tooltip>
<a-tooltip bottom>
<template #title>
<span>{{ $t('activity.column.addOther') }}</span>
</template>
<a-button class="group" @click="addNewColumnRow(tableIdx, 'SingleLineText')">
<div class="flex items-center gap-1">
<component :is="iconMap.plus" class="group-hover:!text-accent text-lg" />
</div>
</a-button>
</a-tooltip>
</div>
</a-collapse-panel> </a-collapse-panel>
</a-collapse> </a-collapse>
</a-form> </a-form>
@ -1051,4 +1007,11 @@ watch(modelRef, async () => {
} }
} }
} }
:deep(.ant-collapse-header) {
@apply !items-center;
& > div {
@apply flex;
}
}
</style> </style>

11
packages/nc-gui/components/template/utils.ts

@ -13,14 +13,15 @@ export const tableColumns: (Omit<ColumnGroupType<any>, 'children'> & { dataIndex
key: 'uidt', key: 'uidt',
width: 250, width: 250,
}, },
{ // {
name: 'Select Option', // name: 'Select Option',
key: 'dtxp', // key: 'dtxp',
}, // },
{ {
name: 'Action', name: 'Action',
key: 'action', key: 'action',
align: 'right', align: 'center',
width: 40,
}, },
] ]

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

@ -142,9 +142,11 @@ export default class ExcelTemplateAdapter extends TemplateGenerator {
r: +this.config.firstRowAsHeaders, r: +this.config.firstRowAsHeaders,
}) })
const cellProps = ws[cellId] || {} const cellProps = ws[cellId] || {}
column.uidt = excelTypeToUidt[cellProps.t] || UITypes.SingleLineText column.uidt = this.config.importDataOnly
? excelTypeToUidt[cellProps.t] || UITypes.SingleLineText
: UITypes.SingleLineText
if (column.uidt === UITypes.SingleLineText) { if (column.uidt === UITypes.SingleLineText && this.config.importDataOnly) {
// check for long text // check for long text
if (isMultiLineTextType(rows, col)) { if (isMultiLineTextType(rows, col)) {
column.uidt = UITypes.LongText column.uidt = UITypes.LongText
@ -238,7 +240,7 @@ export default class ExcelTemplateAdapter extends TemplateGenerator {
for (const row of rows.slice(1)) { for (const row of rows.slice(1)) {
const rowData: Record<string, any> = {} const rowData: Record<string, any> = {}
for (let i = 0; i < table.columns.length; i++) { for (let i = 0; i < table.columns.length; i++) {
if (!this.config.autoSelectFieldTypes) { if (!this.config.autoSelectFieldTypes || !this.config.importDataOnly) {
// take raw data instead of data parsed by xlsx // take raw data instead of data parsed by xlsx
const cellId = this.xlsx.utils.encode_cell({ const cellId = this.xlsx.utils.encode_cell({
c: range.s.c + i, c: range.s.c + i,
@ -257,7 +259,7 @@ export default class ExcelTemplateAdapter extends TemplateGenerator {
const cellObj = ws[cellId] const cellObj = ws[cellId]
rowData[table.columns[i].column_name] = rowData[table.columns[i].column_name] =
(cellObj && cellObj.w && cellObj.w.replace(/[^\d.]+/g, '')) || row[i] (cellObj && typeof cellObj?.w === 'string' && cellObj.w.replace(/[^\d.]+/g, '')) || row[i]
} else if (table.columns[i].uidt === UITypes.SingleSelect || table.columns[i].uidt === UITypes.MultiSelect) { } else if (table.columns[i].uidt === UITypes.SingleSelect || table.columns[i].uidt === UITypes.MultiSelect) {
rowData[table.columns[i].column_name] = (row[i] || '').toString().trim() || null rowData[table.columns[i].column_name] = (row[i] || '').toString().trim() || null
} else if (table.columns[i].uidt === UITypes.Date) { } else if (table.columns[i].uidt === UITypes.Date) {

5
packages/nc-gui/lang/en.json

@ -483,7 +483,7 @@
"quickImportExcel": "Quick Import - Excel", "quickImportExcel": "Quick Import - Excel",
"quickImportJSON": "Quick Import - JSON", "quickImportJSON": "Quick Import - JSON",
"jsonEditor": "JSON Editor", "jsonEditor": "JSON Editor",
"comingSoon": "Coming Soon", "comingSoon": "Coming soon",
"advancedSettings": "Advanced Settings", "advancedSettings": "Advanced Settings",
"codeSnippet": "Code Snippet", "codeSnippet": "Code Snippet",
"keyboardShortcut": "Keyboard Shortcuts", "keyboardShortcut": "Keyboard Shortcuts",
@ -1149,7 +1149,8 @@
"clientCA": "Select CA file", "clientCA": "Select CA file",
"changeIconColour": "Change icon colour", "changeIconColour": "Change icon colour",
"preFillFormInfo": "To get a prefilled link, make sure you’ve filled the necessary fields in the form view builder.", "preFillFormInfo": "To get a prefilled link, make sure you’ve filled the necessary fields in the form view builder.",
"surveyFormInfo": "Form mode with one field per page" "surveyFormInfo": "Form mode with one field per page",
"useFieldEditMenuToConfigFieldType": "Use field edit menu for type conversions after file is imported"
}, },
"placeholder": { "placeholder": {
"selectSlackChannels": "Select Slack channels", "selectSlackChannels": "Select Slack channels",

5
tests/playwright/tests/db/features/import.spec.ts

@ -37,9 +37,10 @@ test.describe('Import', () => {
}); });
test('Excel', async () => { test('Excel', async () => {
// Everything will be mapped with `SingleLineText` as we disabled auto column mapping
const col = [ const col = [
{ type: 'Number', name: 'number' }, { type: 'SingleLineText', name: 'number' },
{ type: 'Decimal', name: 'float' }, { type: 'SingleLineText', name: 'float' },
{ type: 'SingleLineText', name: 'text' }, { type: 'SingleLineText', name: 'text' },
]; ];
const expected = [ const expected = [

Loading…
Cancel
Save