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

Loading…
Cancel
Save