From fd21299a0b6aedb7635ae920c5f865334a5adf65 Mon Sep 17 00:00:00 2001 From: Lyubov Voloshko Date: Tue, 5 May 2026 10:28:58 +0000 Subject: [PATCH] fix column ordering --- .../dashboard/db-table-view/db-table-view.component.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/frontend/src/app/components/dashboard/db-table-view/db-table-view.component.ts b/frontend/src/app/components/dashboard/db-table-view/db-table-view.component.ts index bad975c84..96ef14d4b 100644 --- a/frontend/src/app/components/dashboard/db-table-view/db-table-view.component.ts +++ b/frontend/src/app/components/dashboard/db-table-view/db-table-view.component.ts @@ -815,9 +815,15 @@ export class DbTableViewComponent implements OnInit, OnChanges { // Force Angular to detect changes and re-render the table immediately this.cdr.detectChanges(); + // Send selected columns first, then non-selected at the end + const orderedColumns = [ + ...this.tableData.columns.filter((col) => col.selected), + ...this.tableData.columns.filter((col) => !col.selected), + ]; + this._tables .updatePersonalTableViewSettings(this.connectionID, this.name, { - list_fields: this.tableData.columns.map((col) => col.title), + list_fields: orderedColumns.map((col) => col.title), }) .subscribe({ next: () => {