diff --git a/frontend/src/app/components/dashboard/dashboard.component.ts b/frontend/src/app/components/dashboard/dashboard.component.ts index 0523da15a..80010533f 100644 --- a/frontend/src/app/components/dashboard/dashboard.component.ts +++ b/frontend/src/app/components/dashboard/dashboard.component.ts @@ -200,7 +200,7 @@ export class DashboardComponent implements OnInit, OnDestroy { } else { tableName = this.allTables[0]?.table; } - this.router.navigate([`/dashboard/${this.connectionID}/${tableName}`], { replaceUrl: true }); + this.router.navigate([`/dashboard/${this.connectionID}/${tableName}`], { replaceUrl: true, queryParamsHandling: 'preserve' }); this.selectedTableName = tableName; } }), @@ -271,7 +271,8 @@ export class DashboardComponent implements OnInit, OnDestroy { this.sortOrder = queryParams.sort_direction; const search = queryParams.search; - this.getRows(search); + const uncached = queryParams.uncached === 'true'; + this.getRows(search, uncached); console.log('getRows from setTable'); const selectedTableProperties = this.allTables.find((table: any) => table.table === this.selectedTableName); @@ -389,7 +390,7 @@ export class DashboardComponent implements OnInit, OnDestroy { }); } - getRows(search?: string) { + getRows(search?: string, uncached?: boolean) { console.log('getRows, filters:', this.filters); this._uiSettings.getUiSettings().subscribe((settings: UiSettings) => { this.uiSettings = settings?.connections[this.connectionID]; @@ -404,6 +405,7 @@ export class DashboardComponent implements OnInit, OnDestroy { sortOrder: this.sortOrder, filters: this.filters, search, + uncached, }); }); } diff --git a/frontend/src/app/components/dashboard/db-tables-data-source.ts b/frontend/src/app/components/dashboard/db-tables-data-source.ts index 59422650c..fad0e2476 100644 --- a/frontend/src/app/components/dashboard/db-tables-data-source.ts +++ b/frontend/src/app/components/dashboard/db-tables-data-source.ts @@ -31,6 +31,7 @@ interface RowsParams { comparators?: object; search?: string; isTablePageSwitched?: boolean; + uncached?: boolean; } export class TablesDataSource implements DataSource { @@ -118,6 +119,7 @@ export class TablesDataSource implements DataSource { comparators, search, isTablePageSwitched, + uncached, }: RowsParams) { this.loadingSubject.next(true); this.alert_primaryKeysInfo = null; @@ -135,6 +137,7 @@ export class TablesDataSource implements DataSource { filters, comparators, search, + uncached, }); if (fetchedTable) { diff --git a/frontend/src/app/components/edit-database-schema/edit-database-schema.component.html b/frontend/src/app/components/edit-database-schema/edit-database-schema.component.html index 61e30196a..0f57b441f 100644 --- a/frontend/src/app/components/edit-database-schema/edit-database-schema.component.html +++ b/frontend/src/app/components/edit-database-schema/edit-database-schema.component.html @@ -156,6 +156,7 @@

{{ message.text }}

- } + + + } + diff --git a/frontend/src/app/components/edit-database-schema/edit-database-schema.component.ts b/frontend/src/app/components/edit-database-schema/edit-database-schema.component.ts index e81c684c4..befb1310c 100644 --- a/frontend/src/app/components/edit-database-schema/edit-database-schema.component.ts +++ b/frontend/src/app/components/edit-database-schema/edit-database-schema.component.ts @@ -105,6 +105,7 @@ export class EditDatabaseSchemaComponent implements OnInit, AfterViewInit { } if (result && result.changes.length > 0) { const summary = result.changes.map(c => `**${c.changeType}** \`${c.targetTableName}\`${c.aiSummary ? ' — ' + c.aiSummary : ''}`).join('\n'); + this.applied.set(false); this.messages.update(msgs => [...msgs, { role: 'ai', text: `I've generated ${result.changes.length} change(s) for your database:\n\n${summary}\n\nReview the SQL below and approve or reject.`, @@ -145,10 +146,12 @@ export class EditDatabaseSchemaComponent implements OnInit, AfterViewInit { }]); } else { this.applied.set(true); - this.messages.update(msgs => [...msgs, { + this.messages.update(msgs => msgs.map(m => + m === batch ? { ...m, batchId: undefined } : m + ).concat({ role: 'ai', text: 'All changes applied successfully! Your tables have been created.', - }]); + })); this._loadDiagram('Updated Database Structure'); } } diff --git a/frontend/src/app/services/tables.service.ts b/frontend/src/app/services/tables.service.ts index 55f797430..5d49647dc 100644 --- a/frontend/src/app/services/tables.service.ts +++ b/frontend/src/app/services/tables.service.ts @@ -27,6 +27,7 @@ interface TableParams { filters?: object; comparators?: object; search?: string; + uncached?: boolean; } @Injectable({ @@ -121,6 +122,7 @@ export class TablesService { referencedColumn, filters, search, + uncached, }: TableParams) { let foreignKeyRowParamName = foreignKeyRowName === 'autocomplete' ? foreignKeyRowName : `f_${foreignKeyRowName}__eq`; @@ -140,6 +142,7 @@ export class TablesService { ...(referencedColumn ? { referencedColumn } : {}), ...(sortColumn ? { sort_by: sortColumn } : {}), ...(sortOrder ? { sort_order: sortOrder } : {}), + ...(uncached ? { _uncached: 'true' } : {}), }, }, )