Browse Source

Merge pull request #6583 from nocodb/nc-fix/trailing-select

fix: text to select conversion
pull/6597/head
Raju Udava 11 months ago committed by GitHub
parent
commit
83bab30a32
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      packages/nc-gui/components/cell/MultiSelect.vue
  2. 2
      packages/nc-gui/components/cell/SingleSelect.vue
  3. 9
      packages/nocodb/src/services/columns.service.ts

4
packages/nc-gui/components/cell/MultiSelect.vue

@ -142,8 +142,8 @@ const selectedTitles = computed(() =>
}
return 0
})
: modelValue.split(',')
: modelValue
: modelValue.split(',').map((el) => el.trim())
: modelValue.map((el) => el.trim())
: [],
)

2
packages/nc-gui/components/cell/SingleSelect.vue

@ -102,7 +102,7 @@ const hasEditRoles = computed(() => isUIAllowed('dataEdit'))
const editAllowed = computed(() => (hasEditRoles.value || isForm.value) && active.value)
const vModel = computed({
get: () => tempSelectedOptState.value ?? modelValue,
get: () => tempSelectedOptState.value ?? modelValue?.trim(),
set: (val) => {
if (val && isNewOptionCreateEnabled.value && (options.value ?? []).every((op) => op.title !== val)) {
tempSelectedOptState.value = val

9
packages/nocodb/src/services/columns.service.ts

@ -303,9 +303,14 @@ export class ColumnsService {
);
}
} else if (
[UITypes.SingleLineText, UITypes.LongText].includes(column.uidt)
[
UITypes.SingleLineText,
UITypes.Email,
UITypes.PhoneNumber,
UITypes.URL,
].includes(column.uidt)
) {
// SingleLineText/LongText to SingleSelect/MultiSelect
// Text to SingleSelect/MultiSelect
const dbDriver = await reuseOrSave('dbDriver', reuse, async () =>
NcConnectionMgrv2.get(source),
);

Loading…
Cancel
Save