Browse Source

fix: disable editing system column

pull/7173/head
Ramesh Mane 12 months ago
parent
commit
14aee5df5c
  1. 1
      packages/nc-gui/components/smartsheet/grid/Table.vue
  2. 3
      packages/nc-gui/components/smartsheet/header/Cell.vue
  3. 2
      packages/nc-gui/components/smartsheet/header/Menu.vue

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

@ -1735,6 +1735,7 @@ onKeyStroke('ArrowDown', onDown)
class="nc-base-menu-item"
:disabled="isSystemColumn(fields[contextMenuTarget.col])"
@click="clearSelectedRangeOfCells()"
:disabled="!!isSystemColumn(fields[contextMenuTarget.col])"
>
<div v-e="['a:row:clear-range']" class="flex gap-2 items-center">
<GeneralIcon icon="closeBox" class="text-gray-500" />

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

@ -1,5 +1,6 @@
<script setup lang="ts">
import type { ColumnReqType, ColumnType } from 'nocodb-sdk'
import { UITypes, isSystemColumn } from 'nocodb-sdk'
import { ColumnInj, IsExpandedFormOpenInj, IsFormInj, IsKanbanInj, inject, provide, ref, toRef, useRoles } from '#imports'
interface Props {
@ -48,7 +49,7 @@ const closeAddColumnDropdown = () => {
}
const openHeaderMenu = () => {
if (isLocked.value) return
if (isLocked.value || (!!isSystemColumn(column.value) && column.value.uidt !== UITypes.ID)) return
if (!isForm.value && !isExpandedForm.value && isUIAllowed('fieldEdit') && !isMobileMode.value) {
editColumnDropdown.value = true

2
packages/nc-gui/components/smartsheet/header/Menu.vue

@ -1,6 +1,6 @@
<script lang="ts" setup>
import type { ColumnReqType } from 'nocodb-sdk'
import { RelationTypes, UITypes, isLinksOrLTAR } from 'nocodb-sdk'
import { RelationTypes, UITypes, isLinksOrLTAR, isSystemColumn } from 'nocodb-sdk'
import {
ActiveViewInj,
ColumnInj,

Loading…
Cancel
Save