Browse Source

fix: multi paste user field

pull/7202/head
mertmit 12 months ago
parent
commit
f9ff3a08b1
  1. 6
      packages/nc-gui/components/cell/User.vue
  2. 2
      packages/nc-gui/composables/useMultiSelect/convertCellData.ts

6
packages/nc-gui/components/cell/User.vue

@ -96,9 +96,9 @@ const vModel = computed({
get: () => {
let selected: { label: string; value: string }[] = []
if (typeof modelValue === 'string') {
const ids = modelValue.split(',')
selected = ids.reduce((acc, id) => {
const user = options.value.find((u) => u.id === id)
const idsOrMails = modelValue.split(',').map((idOrMail) => idOrMail.trim())
selected = idsOrMails.reduce((acc, idOrMail) => {
const user = options.value.find((u) => u.id === idOrMail || u.email === idOrMail)
if (user) {
acc.push({
label: user?.display_name || user?.email,

2
packages/nc-gui/composables/useMultiSelect/convertCellData.ts

@ -201,7 +201,7 @@ export default function convertCellData(
try {
parsedVal = typeof value === 'string' ? JSON.parse(value) : value
} catch {
parsedVal = null
parsedVal = value
}
} catch (e) {
if (isMultiple) {

Loading…
Cancel
Save