mirror of
https://github.com/dbeaver/cloudbeaver.git
synced 2026-09-24 16:04:36 +08:00
fix(plugin-data-viewer): CB-1180 new rows order
This commit is contained in:
+1
-1
@@ -54,7 +54,7 @@ export class ResultSetDataAction extends DatabaseDataAction<any, IDatabaseResult
|
||||
|
||||
insertRow(row: IResultSetRowKey, value: IResultSetValue[], shift = 0): void {
|
||||
if (this.result.data?.rows) {
|
||||
this.result.data.rows.splice(row.index + shift + 1, 0, value);
|
||||
this.result.data.rows.splice(row.index + shift, 0, value);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+2
@@ -176,6 +176,8 @@ export class ResultSetEditAction
|
||||
|
||||
if (!row) {
|
||||
row = this.data.getDefaultKey().row;
|
||||
} else if (!('key' in row)) {
|
||||
row = { ...row, index: row.index + 1 };
|
||||
}
|
||||
|
||||
if (!column) {
|
||||
|
||||
+1
-1
@@ -30,8 +30,8 @@ export class ResultSetViewAction extends DatabaseDataAction<any, IDatabaseResult
|
||||
|
||||
get rowKeys(): IResultSetRowKey[] {
|
||||
return [
|
||||
...this.data.rows.map((c, index) => ({ index })),
|
||||
...this.editor.addRows,
|
||||
...this.data.rows.map((c, index) => ({ index })),
|
||||
].sort((a, b) => a.index - b.index);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user