Browse Source

fix: skip pasting ai and pk fields

Signed-off-by: mertmit <mertmit99@gmail.com>
pull/5847/head
mertmit 1 year ago
parent
commit
8677f0347a
  1. 20
      packages/nc-gui/composables/useMultiSelect/index.ts

20
packages/nc-gui/composables/useMultiSelect/index.ts

@ -535,6 +535,16 @@ export function useMultiSelect(
continue
}
// skip pasting auto increment columns
if (pasteCol.ai) {
continue
}
// skip pasting primary key columns
if (pasteCol.pk && !pasteRow.rowMeta.new) {
continue
}
propsToPaste.push(pasteCol.title!)
const pasteValue = convertCellData(
@ -594,6 +604,16 @@ export function useMultiSelect(
return message.info(t('msg.info.pasteNotSupported'))
}
// skip pasting auto increment columns
if (columnObj.ai) {
return message.info(t('msg.info.autoIncFieldNotEditable'))
}
// skip pasting primary key columns
if (columnObj.pk && !rowObj.rowMeta.new) {
return message.info(t('msg.info.editingPKnotSupported'))
}
const pasteValue = convertCellData(
{
value: clipboardData,

Loading…
Cancel
Save