Browse Source

fix: dblclick column edit restriction (#8822)

pull/8824/head
Pranav C 2 weeks ago committed by GitHub
parent
commit
e6b3137de6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 16
      packages/nc-gui/components/smartsheet/header/Cell.vue

16
packages/nc-gui/components/smartsheet/header/Cell.vue

@ -1,5 +1,5 @@
<script setup lang="ts">
import { type ColumnReqType, type ColumnType } from 'nocodb-sdk'
import { type ColumnReqType, type ColumnType, partialUpdateAllowedTypes, readonlyMetaAllowedTypes } from 'nocodb-sdk'
import { UITypes, UITypesName } from 'nocodb-sdk'
interface Props {
@ -32,7 +32,7 @@ const isDropDownOpen = ref(false)
const column = toRef(props, 'column')
const { isUIAllowed } = useRoles()
const { isUIAllowed, isMetaReadOnly } = useRoles()
provide(ColumnInj, column)
@ -57,10 +57,20 @@ const closeAddColumnDropdown = () => {
editColumnDropdown.value = false
}
const isColumnEditAllowed = computed(() => {
if (
isMetaReadOnly.value &&
!readonlyMetaAllowedTypes.includes(column.value?.uidt) &&
!partialUpdateAllowedTypes.includes(column.value?.uidt)
)
return false
return true
})
const openHeaderMenu = (e?: MouseEvent) => {
if (isLocked.value || (isExpandedForm.value && e?.type === 'dblclick') || isExpandedBulkUpdateForm.value) return
if (!isForm.value && isUIAllowed('fieldEdit') && !isMobileMode.value) {
if (!isForm.value && isUIAllowed('fieldEdit') && !isMobileMode.value && isColumnEditAllowed.value) {
editColumnDropdown.value = true
}
}

Loading…
Cancel
Save