Browse Source

fix: remove duplicate code

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/5848/head
Pranav C 1 year ago
parent
commit
2c95b93456
  1. 18
      packages/nc-gui/components/virtual-cell/Links.vue

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

@ -3,7 +3,16 @@ import { computed } from '@vue/reactivity'
import type { ColumnType } from 'nocodb-sdk' import type { ColumnType } from 'nocodb-sdk'
import { ref } from 'vue' import { ref } from 'vue'
import type { Ref } from 'vue' import type { Ref } from 'vue'
import { ActiveCellInj,IsUnderLookupInj, CellValueInj, ColumnInj, EditModeInj, MetaInj, inject, useSelectedCellKeyupListener } from '#imports' import {
ActiveCellInj,
CellValueInj,
ColumnInj,
EditModeInj,
IsUnderLookupInj,
MetaInj,
inject,
useSelectedCellKeyupListener,
} from '#imports'
const value = inject(CellValueInj, ref(0)) const value = inject(CellValueInj, ref(0))
@ -29,9 +38,6 @@ const active = inject(ActiveCellInj, ref(false))
const editable = inject(EditModeInj, ref(false)) const editable = inject(EditModeInj, ref(false))
const isUnderLookup = inject(IsUnderLookupInj, ref(false))
const listItemsDlg = ref(false) const listItemsDlg = ref(false)
const childListDlg = ref(false) const childListDlg = ref(false)
@ -99,8 +105,8 @@ const localCellValue = computed<any[]>(() => {
<template v-if="!isForm"> <template v-if="!isForm">
<div class="block flex-shrink truncate"> <div class="block flex-shrink truncate">
<component <component
:title="textVal"
:is="isLocked || IsUnderLookupInj ? 'span' : 'a'" :is="isLocked || IsUnderLookupInj ? 'span' : 'a'"
:title="textVal"
class="text-center pl-3 nc-datatype-link" class="text-center pl-3 nc-datatype-link"
:class="{ '!text-gray-300': !value }" :class="{ '!text-gray-300': !value }"
@click.stop.prevent="openChildList" @click.stop.prevent="openChildList"
@ -108,7 +114,7 @@ const localCellValue = computed<any[]>(() => {
{{ textVal }} {{ textVal }}
</component> </component>
</div> </div>
<div class="flex-grow"/> <div class="flex-grow" />
<div v-if="!isLocked && !isUnderLookup" class="flex justify-end gap-1 min-h-[30px] items-center"> <div v-if="!isLocked && !isUnderLookup" class="flex justify-end gap-1 min-h-[30px] items-center">
<GeneralIcon <GeneralIcon

Loading…
Cancel
Save