Browse Source

refactor: exclude Links from lookup support

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/5848/head
Pranav C 1 year ago
parent
commit
257e59211a
  1. 10
      packages/nc-gui/components/smartsheet/column/LookupOptions.vue
  2. 9
      packages/nc-gui/components/virtual-cell/Links.vue

10
packages/nc-gui/components/smartsheet/column/LookupOptions.vue

@ -1,7 +1,7 @@
<script setup lang="ts">
import { onMounted } from '@vue/runtime-core'
import type { ColumnType, LinkToAnotherRecordType, TableType } from 'nocodb-sdk'
import { RelationTypes, isLinksOrLTAR, isSystemColumn, isVirtualCol } from 'nocodb-sdk'
import { RelationTypes, UITypes, isLinksOrLTAR, isSystemColumn, isVirtualCol } from 'nocodb-sdk'
import { MetaInj, inject, ref, storeToRefs, useColumnCreateStoreOrThrow, useMetas, useProject, useVModel } from '#imports'
const props = defineProps<{
@ -57,7 +57,9 @@ const columns = $computed<ColumnType[]>(() => {
if (!selectedTable?.id) {
return []
}
return metas[selectedTable.id].columns.filter((c: ColumnType) => !isSystemColumn(c) && c.id !== vModel.value.id)
return metas[selectedTable.id].columns.filter(
(c: ColumnType) => !isSystemColumn(c) && c.id !== vModel.value.id && c.uidt !== UITypes.Links,
)
})
onMounted(() => {
@ -109,8 +111,8 @@ const cellIcon = (column: ColumnType) =>
>
<a-select-option v-for="(column, index) of columns" :key="index" :value="column.id">
<div class="flex items-center -ml-1">
<component :is="cellIcon(column)" :column-meta="column" />
{{ column.title }}
<component :is="cellIcon(column)" :column-meta="column" />
{{ column.title }}
</div>
</a-select-option>
</a-select>

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

@ -3,7 +3,7 @@ import { computed } from '@vue/reactivity'
import type { ColumnType } from 'nocodb-sdk'
import { ref } from 'vue'
import type { Ref } from 'vue'
import { ActiveCellInj, CellValueInj, ColumnInj, EditModeInj, MetaInj, inject, useSelectedCellKeyupListener } from '#imports'
import { ActiveCellInj,IsUnderLookupInj, CellValueInj, ColumnInj, EditModeInj, MetaInj, inject, useSelectedCellKeyupListener } from '#imports'
const value = inject(CellValueInj, ref(0))
@ -29,6 +29,9 @@ const active = inject(ActiveCellInj, ref(false))
const editable = inject(EditModeInj, ref(false))
const isUnderLookup = inject(IsUnderLookupInj, ref(false))
const listItemsDlg = ref(false)
const childListDlg = ref(false)
@ -97,8 +100,8 @@ const localCellValue = computed<any[]>(() => {
<div class="block flex-shrink truncate">
<component
:title="textVal"
:is="isLocked ? 'span' : 'a'"
class="text-center pl-3 nc-datatype-link "
:is="isLocked || IsUnderLookupInj ? 'span' : 'a'"
class="text-center pl-3 nc-datatype-link"
:class="{ '!text-gray-300': !value }"
@click.stop.prevent="openChildList"
>

Loading…
Cancel
Save