Browse Source

fix: editing system key not supported

pull/7173/head
Ramesh Mane 12 months ago
parent
commit
fe1236166a
  1. 5
      packages/nc-gui/components/smartsheet/column/EditOrAdd.vue
  2. 3
      packages/nc-gui/components/smartsheet/header/Cell.vue
  3. 4
      packages/nc-gui/components/smartsheet/header/Menu.vue
  4. 4
      packages/nc-gui/lang/en.json

5
packages/nc-gui/components/smartsheet/column/EditOrAdd.vue

@ -1,6 +1,6 @@
<script lang="ts" setup>
import type { ColumnReqType, ColumnType } from 'nocodb-sdk'
import { UITypes, isLinksOrLTAR, isVirtualCol } from 'nocodb-sdk'
import { UITypes, isLinksOrLTAR, isSystemColumn, isVirtualCol } from 'nocodb-sdk'
import {
IsFormInj,
IsKanbanInj,
@ -159,6 +159,9 @@ onMounted(() => {
if (formState.value.pk) {
message.info(t('msg.info.editingPKnotSupported'))
emit('cancel')
} else if (isSystemColumn(formState.value)) {
message.info(t('msg.info.editingSystemKeynotSupported'))
emit('cancel')
}
}

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

@ -1,6 +1,5 @@
<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 {
@ -49,7 +48,7 @@ const closeAddColumnDropdown = () => {
}
const openHeaderMenu = () => {
if (isLocked.value || (isSystemColumn(column.value) && column.value.uidt !== UITypes.ID)) return
if (isLocked.value) return
if (!isForm.value && !isExpandedForm.value && isUIAllowed('fieldEdit') && !isMobileMode.value) {
editColumnDropdown.value = true

4
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, isSystemColumn } from 'nocodb-sdk'
import { RelationTypes, UITypes, isLinksOrLTAR } from 'nocodb-sdk'
import {
ActiveViewInj,
ColumnInj,
@ -292,7 +292,7 @@ const onInsertAfter = () => {
</div>
<template #overlay>
<a-menu class="shadow bg-white nc-column-options">
<a-menu-item @click="onEditPress" :disabled="isSystemColumn(column) && column?.uidt !== UITypes.ID">
<a-menu-item @click="onEditPress">
<div class="nc-column-edit nc-header-menu-item">
<component :is="iconMap.edit" class="text-gray-700 mx-0.65 my-0.75" />
<!-- Edit -->

4
packages/nc-gui/lang/en.json

@ -1209,7 +1209,9 @@
"goToPrevious": "Go to previous",
"goToNext": "Go to next",
"thankYou": "Thank you!",
"submittedFormData": "You have successfully submitted the form data."
"submittedFormData": "You have successfully submitted the form data.",
"editingSystemKeynotSupported": "Editing system key not supported"
},
"error": {
"nameRequired": "Name Required",

Loading…
Cancel
Save