Browse Source

feat(gui): show warning if paste not supported in cell

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/4514/head
Pranav C 2 years ago
parent
commit
6752669287
  1. 8
      packages/nc-gui/composables/useMultiSelect/index.ts
  2. 1
      packages/nc-gui/lang/en.json

8
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)

1
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."

Loading…
Cancel
Save