Browse Source

Merge pull request #6268 from sreehari2003/fix/locked

fix: removed edit option of cell in locked view
pull/6277/head
Raju Udava 1 year ago committed by GitHub
parent
commit
77372d20cd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      packages/nc-gui/components/smartsheet/grid/Table.vue
  2. 8
      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)

8
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 { ColumnInj, IsFormInj, IsKanbanInj, IsLockedInj, inject, provide, ref, toRef, useUIPermission } from '#imports'
interface Props { interface Props {
column: ColumnType column: ColumnType
@ -18,6 +18,8 @@ const isDropDownOpen = ref(false)
const isKanban = inject(IsKanbanInj, ref(false)) const isKanban = inject(IsKanbanInj, ref(false))
const isLocked = inject(IsLockedInj, ref(false))
const column = toRef(props, 'column') const column = toRef(props, 'column')
const { isUIAllowed } = useUIPermission() const { isUIAllowed } = useUIPermission()
@ -39,7 +41,7 @@ const closeAddColumnDropdown = () => {
} }
const openHeaderMenu = () => { const openHeaderMenu = () => {
if (!isForm.value && isUIAllowed('edit-column')) { if (!isLocked.value && !isForm.value && isUIAllowed('edit-column')) {
editColumnDropdown.value = true editColumnDropdown.value = true
} }
} }
@ -57,7 +59,7 @@ const openHeaderMenu = () => {
<div <div
v-if="column" v-if="column"
class="name pl-1 !truncate" class="name pl-1 !truncate"
:class="{ 'cursor-pointer pt-0.25': !isForm && isUIAllowed('edit-column') && !hideMenu }" :class="{ 'cursor-pointer pt-0.25': !isForm && isUIAllowed('edit-column') && !hideMenu && !isLocked }"
style="white-space: pre-line" style="white-space: pre-line"
:title="column.title" :title="column.title"
> >

Loading…
Cancel
Save