diff --git a/packages/nc-gui/composables/useMultiSelect/index.ts b/packages/nc-gui/composables/useMultiSelect/index.ts index abdc520926..628580bae2 100644 --- a/packages/nc-gui/composables/useMultiSelect/index.ts +++ b/packages/nc-gui/composables/useMultiSelect/index.ts @@ -1,6 +1,6 @@ import type { MaybeRef } from '@vueuse/core' -import type { ColumnType } from 'nocodb-sdk' -import { UITypes } from 'nocodb-sdk' +import type { ColumnType, LinkToAnotherRecordType } from 'nocodb-sdk' +import { isVirtualCol, RelationTypes, UITypes } from 'nocodb-sdk' import type { Cell } from './cellRange' import { CellRange } from './cellRange' import { copyTable, message, reactive, ref, unref, useCopy, useEventListener, useI18n } from '#imports' @@ -266,6 +266,9 @@ export function useMultiSelect( await copyValue() break case 86: + if(isVirtualCol(columnObj) && (columnObj.uidt !== UITypes.LinkToAnotherRecord || (columnObj.colOptions as LinkToAnotherRecordType)?.type !== RelationTypes.BELONGS_TO)) { + return message.info(t('msg.info.cannotPasteHere')) + } // const clipboardText = await getClipboardData() if (clipboardContext) { rowObj.row[columnObj.title!] = convertCellData({ @@ -301,6 +304,7 @@ export function useMultiSelect( } break } + } useEventListener(document, 'keydown', onKeyDown) diff --git a/packages/nc-gui/lang/en.json b/packages/nc-gui/lang/en.json index 8338c832e4..579789c6ec 100644 --- a/packages/nc-gui/lang/en.json +++ b/packages/nc-gui/lang/en.json @@ -497,6 +497,7 @@ } }, "info": { + "cannotPasteHere": "Cannot paste here", "roles": { "orgCreator": "Creator can create new projects and access any invited project.", "orgViewer": "Viewer is not allowed to create new projects but they can access any invited project."