Browse Source

fix(nc-gui): delete dtxp if the final uidt is not singleSelect and multiSelect

pull/3811/head
Wing-Kam Wong 2 years ago
parent
commit
35fb048a47
  1. 10
      packages/nc-gui/components/template/Editor.vue

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

@ -436,14 +436,10 @@ async function importTemplate() {
column.rqd = true
}
if (!isSystemColumn(column) && column.uidt !== UITypes.SingleSelect && column.uidt !== UITypes.MultiSelect) {
// reset dtxp if the final data type is not single / multi select
// otherwise, it'll fail when column is being inserted
// delete dtxp if the final data type is not single & multi select
// e.g. import -> detect as single / multi select -> switch to SingleLineText
column.dtxp = sqlUi?.value?.getDefaultLengthForDatatype(column.dt)
} else if (column.uidt === UITypes.SingleSelect || column.uidt === UITypes.MultiSelect) {
// remove .dt for single select / multi select
// otherwise, it'll fail when column is being inserted
delete column.dt
// the correct dtxp will be generated during column creation
delete column.dtxp
}
}
}

Loading…
Cancel
Save