Browse Source

fix: keep only first user for default value on converting single

pull/7202/head
mertmit 12 months ago
parent
commit
b9fb75b8fb
  1. 7
      packages/nc-gui/components/smartsheet/column/DefaultValue.vue
  2. 9
      packages/nc-gui/components/smartsheet/column/UserOptions.vue

7
packages/nc-gui/components/smartsheet/column/DefaultValue.vue

@ -34,6 +34,13 @@ const updateCdfValue = (cdf: string | null) => {
onMounted(() => {
updateCdfValue(vModel.value?.cdf ? vModel.value.cdf : null)
})
watch(
() => vModel.value.cdf,
(newValue) => {
cdfValue.value = newValue
},
)
</script>
<template>

9
packages/nc-gui/components/smartsheet/column/UserOptions.vue

@ -32,12 +32,19 @@ vModel.value.meta = {
onMounted(() => {
initialIsMulti.value = vModel.value.meta.is_multi
})
const updateIsMulti = (e) => {
vModel.value.meta.is_multi = e.target.checked
if (!vModel.value.meta.is_multi) {
vModel.value.cdf = vModel.value.cdf?.split(',')[0] || null
}
}
</script>
<template>
<div class="flex flex-col">
<div>
<a-checkbox v-if="vModel.meta" v-model:checked="vModel.meta.is_multi" class="ml-1 mb-1">
<a-checkbox v-if="vModel.meta" :checked="vModel.meta.is_multi" class="ml-1 mb-1" @change="updateIsMulti">
<span class="text-[10px] text-gray-600">Allow adding multiple users</span>
</a-checkbox>
</div>

Loading…
Cancel
Save