Browse Source

refactor: custom render only for specific db type

pull/6987/head
Pranav C 1 year ago
parent
commit
d081661e40
  1. 11
      packages/nc-gui/components/smartsheet/grid/GroupByLabel.vue

11
packages/nc-gui/components/smartsheet/grid/GroupByLabel.vue

@ -1,18 +1,22 @@
<script setup lang="ts"> <script setup lang="ts">
import type { ColumnType } from 'nocodb-sdk' import type { ColumnType } from 'nocodb-sdk'
import { isVirtualCol } from 'nocodb-sdk' import { UITypes, isVirtualCol } from 'nocodb-sdk'
defineProps<{ const props = defineProps<{
column: ColumnType column: ColumnType
modelValue: any modelValue: any
}>() }>()
provide(ReadonlyInj, true) provide(ReadonlyInj, true)
const renderCell = computed(() =>
[UITypes.Lookup, UITypes.Attachment, UITypes.Barcode, UITypes.QrCode, UITypes.Links].includes(props.column?.uidt),
)
</script> </script>
<template> <template>
<div class="pointer-events-none"> <div class="pointer-events-none">
<LazySmartsheetRow v-show="!showSkeleton" :row="{ row: { [column.title]: modelValue }, rowMeta: {} }"> <LazySmartsheetRow v-if="renderCell" :row="{ row: { [column.title]: modelValue }, rowMeta: {} }">
<LazySmartsheetVirtualCell v-if="isVirtualCol(column)" :model-value="modelValue" class="!text-gray-600" :column="column" /> <LazySmartsheetVirtualCell v-if="isVirtualCol(column)" :model-value="modelValue" class="!text-gray-600" :column="column" />
<LazySmartsheetCell <LazySmartsheetCell
@ -24,5 +28,6 @@ provide(ReadonlyInj, true)
:read-only="true" :read-only="true"
/> />
</LazySmartsheetRow> </LazySmartsheetRow>
<template v-else>{{ modelValue }}</template>
</div> </div>
</template> </template>

Loading…
Cancel
Save