Browse Source

fix(gui): if lookup column is attachment and array of objects then pass the array to smartsheet cell

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/5063/head
Pranav C 2 years ago
parent
commit
091b6dd210
  1. 28
      packages/nc-gui/components/virtual-cell/Lookup.vue

28
packages/nc-gui/components/virtual-cell/Lookup.vue

@ -102,20 +102,28 @@ const { showEditNonEditableFieldWarning, showClearNonEditableFieldWarning, activ
<!-- Render normal cell --> <!-- Render normal cell -->
<template v-else> <template v-else>
<!-- For attachment cell avoid adding chip style -->
<div <div
v-for="(v, i) of arrValue" v-if="isAttachment(lookupColumn) && arrValue[0] && !Array.isArray(arrValue[0]) && typeof arrValue[0] === 'object'"
:key="i"
class="min-w-max" class="min-w-max"
:class="{
'bg-gray-100 px-1 rounded-full flex-1': !isAttachment(lookupColumn),
' border-gray-200 rounded border-1': ![UITypes.Attachment, UITypes.MultiSelect, UITypes.SingleSelect].includes(
lookupColumn.uidt,
),
}"
> >
<LazySmartsheetCell :model-value="v" :column="lookupColumn" :edit-enabled="false" :virtual="true" /> <LazySmartsheetCell :model-value="arrValue" :column="lookupColumn" :edit-enabled="false" />
</div> </div>
<!-- For attachment cell avoid adding chip style -->
<template v-else>
<div
v-for="(v, i) of arrValue"
:key="i"
class="min-w-max"
:class="{
'bg-gray-100 px-1 rounded-full flex-1': !isAttachment(lookupColumn),
'border-gray-200 rounded border-1': ![UITypes.Attachment, UITypes.MultiSelect, UITypes.SingleSelect].includes(
lookupColumn.uidt,
),
}"
>
<LazySmartsheetCell :model-value="v" :column="lookupColumn" :edit-enabled="false" :virtual="true" />
</div>
</template>
</template> </template>
</template> </template>
</div> </div>

Loading…
Cancel
Save