Browse Source

Merge pull request #4800 from nocodb/fix/LTAR-display

fix(nc-gui): show LTAR record in view for users to add even it is empty
pull/4810/head
աɨռɢӄաօռɢ 2 years ago committed by GitHub
parent
commit
5b7bbffb66
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      packages/nc-gui/components/smartsheet/Gallery.vue
  2. 60
      packages/nc-gui/components/smartsheet/Kanban.vue

6
packages/nc-gui/components/smartsheet/Gallery.vue

@ -17,6 +17,7 @@ import {
createEventHook, createEventHook,
extractPkFromRow, extractPkFromRow,
inject, inject,
isLTAR,
nextTick, nextTick,
onMounted, onMounted,
provide, provide,
@ -210,7 +211,10 @@ watch(view, async (nextView) => {
</template> </template>
<div v-for="col in fieldsWithoutCover" :key="`record-${record.row.id}-${col.id}`"> <div v-for="col in fieldsWithoutCover" :key="`record-${record.row.id}-${col.id}`">
<div v-if="!isRowEmpty(record, col)" class="flex flex-col space-y-1 px-4 mb-6 bg-gray-50 rounded-lg w-full"> <div
v-if="!isRowEmpty(record, col) || isLTAR(col.uidt)"
class="flex flex-col space-y-1 px-4 mb-6 bg-gray-50 rounded-lg w-full"
>
<div class="flex flex-row w-full justify-start border-b-1 border-gray-100 py-2.5"> <div class="flex flex-row w-full justify-start border-b-1 border-gray-100 py-2.5">
<div class="w-full text-gray-600"> <div class="w-full text-gray-600">
<LazySmartsheetHeaderVirtualCell v-if="isVirtualCol(col)" :column="col" :hide-menu="true" /> <LazySmartsheetHeaderVirtualCell v-if="isVirtualCol(col)" :column="col" :hide-menu="true" />

60
packages/nc-gui/components/smartsheet/Kanban.vue

@ -13,6 +13,7 @@ import {
MetaInj, MetaInj,
OpenNewRecordFormHookInj, OpenNewRecordFormHookInj,
inject, inject,
isLTAR,
onBeforeMount, onBeforeMount,
onBeforeUnmount, onBeforeUnmount,
provide, provide,
@ -472,35 +473,40 @@ watch(view, async (nextView) => {
:key="`record-${record.row.id}-${col.id}`" :key="`record-${record.row.id}-${col.id}`"
class="flex flex-col rounded-lg w-full" class="flex flex-col rounded-lg w-full"
> >
<!-- Smartsheet Header (Virtual) Cell --> <div v-if="!isRowEmpty(record, col) || isLTAR(col.uidt)">
<div v-if="!isRowEmpty(record, col)" class="flex flex-row w-full justify-start pt-2"> <!-- Smartsheet Header (Virtual) Cell -->
<div class="w-full text-gray-400"> <div class="flex flex-row w-full justify-start pt-2">
<LazySmartsheetHeaderVirtualCell v-if="isVirtualCol(col)" :column="col" :hide-menu="true" /> <div class="w-full text-gray-400">
<LazySmartsheetHeaderCell v-else :column="col" :hide-menu="true" /> <LazySmartsheetHeaderVirtualCell
v-if="isVirtualCol(col)"
:column="col"
:hide-menu="true"
/>
<LazySmartsheetHeaderCell v-else :column="col" :hide-menu="true" />
</div>
</div> </div>
</div>
<!-- Smartsheet (Virtual) Cell --> <!-- Smartsheet (Virtual) Cell -->
<div <div
v-if="!isRowEmpty(record, col)" class="flex flex-row w-full items-center justify-start pl-[6px]"
class="flex flex-row w-full items-center justify-start pl-[6px]" :class="{ '!ml-[-12px]': col.uidt === UITypes.SingleSelect }"
:class="{ '!ml-[-12px]': col.uidt === UITypes.SingleSelect }" >
> <LazySmartsheetVirtualCell
<LazySmartsheetVirtualCell v-if="isVirtualCol(col)"
v-if="isVirtualCol(col)" v-model="record.row[col.title]"
v-model="record.row[col.title]" class="text-sm pt-1"
class="text-sm pt-1" :column="col"
:column="col" :row="record"
:row="record" />
/> <LazySmartsheetCell
<LazySmartsheetCell v-else
v-else v-model="record.row[col.title]"
v-model="record.row[col.title]" class="text-sm pt-1"
class="text-sm pt-1" :column="col"
:column="col" :edit-enabled="false"
:edit-enabled="false" :read-only="true"
:read-only="true" />
/> </div>
</div> </div>
</div> </div>
</a-card> </a-card>

Loading…
Cancel
Save