fix(nc-gui): use new column helper in canvas copy paste

This commit is contained in:
Ramesh Mane
2025-03-05 14:51:13 +00:00
parent 82acf56f26
commit d717fe8f63
3 changed files with 23 additions and 8 deletions

View File

@@ -1,5 +1,6 @@
import {
type AIRecordType,
ColumnHelper,
type ColumnType,
type LinkToAnotherRecordType,
type TableType,
@@ -16,11 +17,21 @@ export const valueToCopy = (
isPg: (sourceId: string) => boolean
isMysql: (sourceId: string) => boolean
meta: TableType
metas: { [idOrTitle: string]: TableType | any }
},
) => {
const { isPg, isMysql, meta } = cb
const { isPg, isMysql, meta, metas } = cb
let textToCopy = (columnObj.title && rowObj.row[columnObj.title]) || ''
const parsedValue = ColumnHelper.parseValue(textToCopy, {
col: columnObj,
isMysql,
isPg,
meta,
metas,
rowId: isMm(columnObj) ? extractPkFromRow(rowObj.row, meta?.columns as ColumnType[]) : null,
})
if (columnObj.uidt === UITypes.Checkbox) {
textToCopy = !!textToCopy
}
@@ -152,7 +163,10 @@ export const valueToCopy = (
}
}
return textToCopy
// Todo: remove after testing
console.log('parsedValue', parsedValue, '\n', 'oldCopyText', textToCopy, columnObj.uidt)
return parsedValue
}
export const serializeRange = (