From 0afbcfe2eb43cae389c9d0020e61db60144d7603 Mon Sep 17 00:00:00 2001 From: Pranav C Date: Sat, 10 Jun 2023 17:46:00 +0530 Subject: [PATCH] fix: overwrite `ColumnInj` in links to behave nested component in the same way as LTAR Signed-off-by: Pranav C --- packages/nc-gui/components/virtual-cell/Link.vue | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/packages/nc-gui/components/virtual-cell/Link.vue b/packages/nc-gui/components/virtual-cell/Link.vue index be521cddad..2f1d7e3253 100644 --- a/packages/nc-gui/components/virtual-cell/Link.vue +++ b/packages/nc-gui/components/virtual-cell/Link.vue @@ -2,7 +2,7 @@ import { computed } from '@vue/reactivity' import type { ColumnType } from 'nocodb-sdk' import type { Ref } from 'vue' -import { CellValueInj, inject } from '#imports' +import { CellValueInj, ColumnInj, inject } from '#imports' const value = inject(CellValueInj) @@ -14,6 +14,8 @@ const relColumn = computed(() => { return meta.value.columns.find((c: ColumnType) => c.id === column.value?.colOptions?.fk_relation_column_id) }) +provide(ColumnInj, relColumn) + const cellValue = inject(CellValueInj)! const row = inject(RowInj)! @@ -34,9 +36,9 @@ const childListDlg = ref(false) const { isUIAllowed } = useUIPermission() -const { state, isNew, removeLTARRef } = useSmartsheetRowStoreOrThrow() +const { state, isNew } = useSmartsheetRowStoreOrThrow() -const { relatedTableMeta, loadRelatedTableMeta, relatedTableDisplayValueProp, unlink } = useProvideLTARStore( +const { relatedTableMeta, loadRelatedTableMeta, relatedTableDisplayValueProp } = useProvideLTARStore( relColumn as Ref>, row, isNew, @@ -68,8 +70,7 @@ const onAttachRecord = () => {