From 6ce3ee312f7c45ba25f6743621b269b7ea16b83a Mon Sep 17 00:00:00 2001 From: Wing-Kam Wong Date: Sat, 27 May 2023 16:15:00 +0800 Subject: [PATCH] feat(nc-gui): pass belongsToColumn to ItemChip & ListItems --- .../nc-gui/components/virtual-cell/BelongsTo.vue | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/packages/nc-gui/components/virtual-cell/BelongsTo.vue b/packages/nc-gui/components/virtual-cell/BelongsTo.vue index 2347991ec3..aa4b068639 100644 --- a/packages/nc-gui/components/virtual-cell/BelongsTo.vue +++ b/packages/nc-gui/components/virtual-cell/BelongsTo.vue @@ -42,7 +42,7 @@ const listItemsDlg = ref(false) const { state, isNew, removeLTARRef } = useSmartsheetRowStoreOrThrow() -const { loadRelatedTableMeta, relatedTableDisplayValueProp, unlink } = useProvideLTARStore( +const { relatedTableMeta, loadRelatedTableMeta, relatedTableDisplayValueProp, unlink } = useProvideLTARStore( column as Ref>, row, isNew, @@ -78,13 +78,23 @@ useSelectedCellKeyupListener(active, (e: KeyboardEvent) => { break } }) + +const belongsToColumn = computed( + () => + relatedTableMeta.value?.columns?.find((c: any) => c.title === relatedTableDisplayValueProp.value) as ColumnType | undefined, +)