diff --git a/webapp/packages/plugin-data-spreadsheet-new/src/DataGrid/DataGridContextMenu/DataGridContextMenuCellEditingService.ts b/webapp/packages/plugin-data-spreadsheet-new/src/DataGrid/DataGridContextMenu/DataGridContextMenuCellEditingService.ts index 3a39b9bfd5..6e97412423 100644 --- a/webapp/packages/plugin-data-spreadsheet-new/src/DataGrid/DataGridContextMenu/DataGridContextMenuCellEditingService.ts +++ b/webapp/packages/plugin-data-spreadsheet-new/src/DataGrid/DataGridContextMenu/DataGridContextMenuCellEditingService.ts @@ -128,7 +128,7 @@ export class DataGridContextMenuCellEditingService { onClick(context) { const source = context.data.model.source as unknown as ResultSetDataSource; const editor = source.getAction(context.data.resultIndex, ResultSetEditAction); - editor.duplicateRow(context.data.key.row); + editor.duplicateRow(context.data.key); }, }); this.dataGridContextMenuService.add(this.getMenuEditingToken(), { diff --git a/webapp/packages/plugin-data-viewer/src/DatabaseDataModel/Actions/ResultSet/ResultSetEditAction.ts b/webapp/packages/plugin-data-viewer/src/DatabaseDataModel/Actions/ResultSet/ResultSetEditAction.ts index 415e6c6c98..4082fc8495 100644 --- a/webapp/packages/plugin-data-viewer/src/DatabaseDataModel/Actions/ResultSet/ResultSetEditAction.ts +++ b/webapp/packages/plugin-data-viewer/src/DatabaseDataModel/Actions/ResultSet/ResultSetEditAction.ts @@ -206,32 +206,32 @@ export class ResultSetEditAction extends DatabaseEditAction(); for (const key of keys) { const serialized = ResultSetDataKeysUtils.serialize(key.row); if (!rowKeys.has(serialized)) { - rows.push(key.row); + result.push(key); rowKeys.add(serialized); } } - this.duplicateRow(...rows); + this.duplicateRow(...result); } - duplicateRow(...rows: IResultSetRowKey[]): void { - for (const row of rows) { - let value = this.data.getRowValue(row); + duplicateRow(...keys: IResultSetElementKey[]): void { + for (const key of keys) { + let value = this.data.getRowValue(key.row); - const editedValue = this.editorData.get(ResultSetDataKeysUtils.serialize(row)); + const editedValue = this.editorData.get(ResultSetDataKeysUtils.serialize(key.row)); if (editedValue) { value = editedValue.update; } - this.addRow(row, JSON.parse(JSON.stringify(value))); + this.addRow(key.row, JSON.parse(JSON.stringify(value)), key.column); } }