Connecting a database no longer freezes the page: the columns field keeps one empty list
This commit is contained in:
+1
-2
@@ -103,13 +103,12 @@ test('conectar: open the hospital pipeline, preview a source, run it to success'
|
||||
await page.getByText('cacu', { exact: true }).click();
|
||||
await expect(page.locator('vflow')).toBeVisible();
|
||||
// a node's caption: its kind, then its name
|
||||
await page.locator('.node-caption', { hasText: 'Pacientes' }).click();
|
||||
await page.locator('.node-caption', { hasText: 'Fuente de datosPacientes' }).click();
|
||||
// drawn from a fixture, read back as a guided SQLite source: the dialog edits it
|
||||
await expect(page.getByRole('button', { name: 'Editar conexión' })).toBeVisible();
|
||||
await page.getByRole('button', { name: 'Vista previa' }).click();
|
||||
await expect(page.locator('.preview tr[mat-row]').first()).toBeVisible();
|
||||
// A map node shows the site's codes in platform terms (its ConceptMap), editable as rows.
|
||||
await page;
|
||||
await page
|
||||
.locator('.node-caption', { hasText: 'Traducir códigos' })
|
||||
.filter({ has: page.locator('.name', { hasText: /^Citología$/ }) })
|
||||
|
||||
@@ -33,6 +33,8 @@ export interface SourceDialogData {
|
||||
guided?: Guided | null;
|
||||
label?: string;
|
||||
}
|
||||
const NONE: string[] = [];
|
||||
|
||||
/** What it gives back: the dialog's answers (the node's dlt fields are made from them). */
|
||||
export interface SourceDialogResult {
|
||||
guided: Guided;
|
||||
@@ -203,17 +205,17 @@ export class SourceDialog {
|
||||
}
|
||||
}
|
||||
|
||||
/** The tables a database listed, for its table field. */
|
||||
/** A list answer (the columns picked), as a list. */
|
||||
protected listed(name: string): string[] {
|
||||
const v = this.value(name);
|
||||
return Array.isArray(v) ? (v as string[]) : [];
|
||||
return Array.isArray(v) ? (v as string[]) : NONE; // a new list each time renders forever
|
||||
}
|
||||
/** The columns to pick from: the first rows', and those already picked. */
|
||||
protected columnOptions(name: string): string[] {
|
||||
return [...new Set([...this.columns(), ...this.listed(name)])];
|
||||
}
|
||||
|
||||
/** The tables a database listed, for its table field. */
|
||||
protected tables(): string[] {
|
||||
return this.tableList();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user