Browse Source

fix(nc-gui): Fixed issue with lookup when combined with links

pull/6582/head
Muhammed Mustafa 1 year ago
parent
commit
cfe6c234ee
  1. 2
      packages/nc-gui/components/smartsheet/VirtualCell.vue
  2. 13
      packages/nc-gui/components/virtual-cell/Links.vue

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

@ -101,7 +101,7 @@ onUnmounted(() => {
@keydown.shift.enter.exact="onNavigate(NavigateDir.PREV, $event)" @keydown.shift.enter.exact="onNavigate(NavigateDir.PREV, $event)"
> >
<template v-if="intersected"> <template v-if="intersected">
<LazyVirtualCellLinks v-if="isLink(column)" :readonly="isUnderLookup" /> <LazyVirtualCellLinks v-if="isLink(column)" />
<LazyVirtualCellHasMany v-else-if="isHm(column)" /> <LazyVirtualCellHasMany v-else-if="isHm(column)" />
<LazyVirtualCellManyToMany v-else-if="isMm(column)" /> <LazyVirtualCellManyToMany v-else-if="isMm(column)" />
<LazyVirtualCellBelongsTo v-else-if="isBt(column)" /> <LazyVirtualCellBelongsTo v-else-if="isBt(column)" />

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

@ -5,10 +5,6 @@ import { ref } from 'vue'
import type { Ref } from 'vue' import type { Ref } from 'vue'
import { ActiveCellInj, CellValueInj, ColumnInj, IsUnderLookupInj, inject, useSelectedCellKeyupListener } from '#imports' import { ActiveCellInj, CellValueInj, ColumnInj, IsUnderLookupInj, inject, useSelectedCellKeyupListener } from '#imports'
const props = defineProps<{
readonly: boolean
}>()
const value = inject(CellValueInj, ref(0)) const value = inject(CellValueInj, ref(0))
const column = inject(ColumnInj)! const column = inject(ColumnInj)!
@ -19,9 +15,7 @@ const reloadRowTrigger = inject(ReloadRowDataHookInj, createEventHook())
const isForm = inject(IsFormInj) const isForm = inject(IsFormInj)
const _readOnly = inject(ReadonlyInj, ref(false)) const readOnly = inject(ReadonlyInj, ref(false))
const readOnly = computed(() => props.readonly || _readOnly.value)
const isLocked = inject(IsLockedInj, ref(false)) const isLocked = inject(IsLockedInj, ref(false))
@ -83,7 +77,7 @@ const onAttachRecord = () => {
} }
const openChildList = () => { const openChildList = () => {
if (readOnly.value) return if (isUnderLookup.value) return
if (!isLocked.value) { if (!isLocked.value) {
childListDlg.value = true childListDlg.value = true
@ -108,7 +102,8 @@ const localCellValue = computed<any[]>(() => {
}) })
const openListDlg = () => { const openListDlg = () => {
if (readOnly.value) return if (isUnderLookup.value) return
listItemsDlg.value = true listItemsDlg.value = true
} }
</script> </script>

Loading…
Cancel
Save