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(() => { onMounted(() => {
updateCdfValue(vModel.value?.cdf ? vModel.value.cdf : null) updateCdfValue(vModel.value?.cdf ? vModel.value.cdf : null)
}) })
watch(
() => vModel.value.cdf,
(newValue) => {
cdfValue.value = newValue
},
)
</script> </script>
<template> <template>

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

@ -32,12 +32,19 @@ vModel.value.meta = {
onMounted(() => { onMounted(() => {
initialIsMulti.value = vModel.value.meta.is_multi 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> </script>
<template> <template>
<div class="flex flex-col"> <div class="flex flex-col">
<div> <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> <span class="text-[10px] text-gray-600">Allow adding multiple users</span>
</a-checkbox> </a-checkbox>
</div> </div>

Loading…
Cancel
Save