Browse Source

fix(gui): treat cells in lookup as readonly

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

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

@ -19,8 +19,6 @@ import {
const { metas, getMeta } = useMetas() const { metas, getMeta } = useMetas()
provide(ReadonlyInj, ref(true))
const column = inject(ColumnInj, ref()) const column = inject(ColumnInj, ref())
const meta = inject(MetaInj, ref()) const meta = inject(MetaInj, ref())
@ -94,10 +92,12 @@ const { showEditNonEditableFieldWarning, showClearNonEditableFieldWarning, activ
:edit-enabled="false" :edit-enabled="false"
:model-value="v" :model-value="v"
:column="lookupColumn" :column="lookupColumn"
:readOnly="true"
/> />
</template> </template>
<LazySmartsheetVirtualCell v-else :edit-enabled="false" :model-value="arrValue" :column="lookupColumn" /> <LazySmartsheetVirtualCell v-else :edit-enabled="false"
:readOnly="true" :model-value="arrValue" :column="lookupColumn" />
</div> </div>
<!-- Render normal cell --> <!-- Render normal cell -->
@ -106,7 +106,8 @@ const { showEditNonEditableFieldWarning, showClearNonEditableFieldWarning, activ
v-if="isAttachment(lookupColumn) && arrValue[0] && !Array.isArray(arrValue[0]) && typeof arrValue[0] === 'object'" v-if="isAttachment(lookupColumn) && arrValue[0] && !Array.isArray(arrValue[0]) && typeof arrValue[0] === 'object'"
class="min-w-max" class="min-w-max"
> >
<LazySmartsheetCell :model-value="arrValue" :column="lookupColumn" :edit-enabled="false" /> <LazySmartsheetCell :model-value="arrValue" :column="lookupColumn" :edit-enabled="false"
:readOnly="true" />
</div> </div>
<!-- For attachment cell avoid adding chip style --> <!-- For attachment cell avoid adding chip style -->
<template v-else> <template v-else>
@ -121,7 +122,8 @@ const { showEditNonEditableFieldWarning, showClearNonEditableFieldWarning, activ
), ),
}" }"
> >
<LazySmartsheetCell :model-value="v" :column="lookupColumn" :edit-enabled="false" :virtual="true" /> <LazySmartsheetCell :model-value="v" :column="lookupColumn" :edit-enabled="false" :virtual="true"
:readOnly="true" />
</div> </div>
</template> </template>
</template> </template>

Loading…
Cancel
Save