Browse Source

fix: expanded form link issue and header tooltip

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/5848/head
Pranav C 1 year ago
parent
commit
1e862a9172
  1. 4
      packages/nc-gui/components/smartsheet/VirtualCell.vue
  2. 8
      packages/nc-gui/components/virtual-cell/Links.vue
  3. 5
      packages/nc-gui/utils/virtualCell.ts

4
packages/nc-gui/components/smartsheet/VirtualCell.vue

@ -96,11 +96,11 @@ onUnmounted(() => {
@keydown.shift.enter.exact="onNavigate(NavigateDir.PREV, $event)"
>
<template v-if="intersected">
<LazyVirtualCellHasMany v-if="isHm(column)" />
<LazyVirtualCellLinks v-if="isLink(column)" />
<LazyVirtualCellHasMany v-else-if="isHm(column)" />
<LazyVirtualCellManyToMany v-else-if="isMm(column)" />
<LazyVirtualCellBelongsTo v-else-if="isBt(column)" />
<LazyVirtualCellRollup v-else-if="isRollup(column)" />
<LazyVirtualCellLinks v-else-if="isLink(column)" />
<LazyVirtualCellFormula v-else-if="isFormula(column)" />
<LazyVirtualCellQrCode v-else-if="isQrCode(column)" />
<LazyVirtualCellBarcode v-else-if="isBarcode(column)" />

8
packages/nc-gui/components/virtual-cell/Links.vue

@ -79,6 +79,13 @@ useSelectedCellKeyupListener(inject(ActiveCellInj, ref(false)), (e: KeyboardEven
break
}
})
const localCellValue = computed<any[]>(() => {
if (isNew.value) {
return state?.value?.[column?.value.title as string] ?? []
}
return []
})
</script>
<template>
@ -111,6 +118,7 @@ useSelectedCellKeyupListener(inject(ActiveCellInj, ref(false)), (e: KeyboardEven
v-model="childListDlg"
:column="relatedTableDisplayColumn"
@attach-record="onAttachRecord"
:cell-value="localCellValue"
/>
</div>
</template>

5
packages/nc-gui/utils/virtualCell.ts

@ -1,8 +1,7 @@
import type { ColumnType, LinkToAnotherRecordType } from 'nocodb-sdk'
import { RelationTypes, UITypes } from 'nocodb-sdk'
import { RelationTypes, UITypes, isLinksOrLTAR } from 'nocodb-sdk'
export const isLTAR = (uidt: string, colOptions: unknown): colOptions is LinkToAnotherRecordType =>
uidt === UITypes.LinkToAnotherRecord
export const isLTAR = (uidt: string, colOptions: unknown): colOptions is LinkToAnotherRecordType => isLinksOrLTAR(uidt)
export const isHm = (column: ColumnType) =>
isLTAR(column.uidt!, column.colOptions) && column.colOptions.type === RelationTypes.HAS_MANY

Loading…
Cancel
Save