Browse Source

fix: removed edit option of cell in locked view

pull/6268/head
sreehari jayaraj 1 year ago
parent
commit
90a344e90b
  1. 2
      packages/nc-gui/components/smartsheet/grid/Table.vue
  2. 7
      packages/nc-gui/components/smartsheet/header/Cell.vue

2
packages/nc-gui/components/smartsheet/grid/Table.vue

@ -1124,7 +1124,7 @@ defineExpose({
}) })
// when expand is clicked the drawer should open // when expand is clicked the drawer should open
// and cell should loose focs // and cell should loose focus
const expandAndLooseFocus = (row: Row, col: Record<string, any>) => { const expandAndLooseFocus = (row: Row, col: Record<string, any>) => {
if (expandForm) { if (expandForm) {
expandForm(row, col) expandForm(row, col)

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

@ -1,6 +1,6 @@
<script setup lang="ts"> <script setup lang="ts">
import type { ColumnReqType, ColumnType } from 'nocodb-sdk' import type { ColumnReqType, ColumnType } from 'nocodb-sdk'
import { ColumnInj, IsFormInj, IsKanbanInj, inject, provide, ref, toRef, useUIPermission } from '#imports' import { ActiveViewInj, ColumnInj, IsFormInj, IsKanbanInj, inject, provide, ref, toRef, useUIPermission } from '#imports'
interface Props { interface Props {
column: ColumnType column: ColumnType
@ -18,6 +18,10 @@ const isDropDownOpen = ref(false)
const isKanban = inject(IsKanbanInj, ref(false)) const isKanban = inject(IsKanbanInj, ref(false))
const activeInj = inject(ActiveViewInj, ref())
const isLockedView = computed(() => activeInj.value?.lock_type === 'locked')
const column = toRef(props, 'column') const column = toRef(props, 'column')
const { isUIAllowed } = useUIPermission() const { isUIAllowed } = useUIPermission()
@ -39,6 +43,7 @@ const closeAddColumnDropdown = () => {
} }
const openHeaderMenu = () => { const openHeaderMenu = () => {
if (isLockedView.value) return
if (!isForm.value && isUIAllowed('edit-column')) { if (!isForm.value && isUIAllowed('edit-column')) {
editColumnDropdown.value = true editColumnDropdown.value = true
} }

Loading…
Cancel
Save