Skip to content

Commit ad79b73

Browse files
author
ci bot
committed
Merge branch 'qa-fixes-5526' into 'enterprise'
fix(ui): visual glitches in connections and test results See merge request dkinternal/testgen/dataops-testgen!502
2 parents e8516e0 + a4c557e commit ad79b73

2 files changed

Lines changed: 28 additions & 3 deletions

File tree

testgen/ui/components/frontend/js/pages/connections.js

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,21 @@ const Connections = (props) => {
4646
const updatedConnection = van.state(connection);
4747
const formState = van.state({dirty: false, valid: false});
4848

49+
// Build the wizard once on first appearance and keep the same instance
50+
// across reruns so internal state (currentStepIndex, form values) is not
51+
// reset. Re-creating it would send the user back to step 0 every time
52+
// Streamlit reruns (e.g. after PreviewTableGroupClicked).
53+
let wizardComponent;
54+
const buildWizard = () => TableGroupWizard({ emit,
55+
project_code: van.derive(() => getValue(props.setup_wizard)?.project_code),
56+
table_group: van.derive(() => getValue(props.setup_wizard)?.table_group),
57+
table_group_preview: van.derive(() => getValue(props.setup_wizard)?.table_group_preview),
58+
steps: van.derive(() => getValue(props.setup_wizard)?.steps),
59+
dialog: van.derive(() => getValue(props.setup_wizard)?.dialog),
60+
results: van.derive(() => getValue(props.setup_wizard)?.results),
61+
standard_cron_sample: van.derive(() => getValue(props.setup_wizard)?.standard_cron_sample),
62+
monitor_cron_sample: van.derive(() => getValue(props.setup_wizard)?.monitor_cron_sample),
63+
});
4964

5065
return div(
5166
{ id: wrapperId, 'data-testid': 'connections', class: 'flex-column fx-gap-4' },
@@ -110,9 +125,14 @@ const Connections = (props) => {
110125
},
111126
),
112127
() => {
113-
const wizardData = getValue(props.setup_wizard);
114-
if (!wizardData) return div();
115-
return TableGroupWizard(wizardData, emit);
128+
// Once built, always return the same instance so the wizard stays
129+
// mounted (its Dialog handles its own open/close via display:none).
130+
// Returning a fresh node on rerun would unmount and break VanJS
131+
// bindings inside the wizard.
132+
if (!getValue(props.setup_wizard) && !wizardComponent) {
133+
return '';
134+
}
135+
return wizardComponent ??= buildWizard();
116136
},
117137
);
118138
}

testgen/ui/static/js/components/table.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,11 @@ const Table = (options, rows) => {
104104
});
105105
});
106106
van.derive(() => {
107+
// Depend on `rows` so this derive re-runs whenever the rows array changes.
108+
// Without this, states added to `selectedRows` beyond its original length
109+
// (e.g., when a filter expansion grows the rows list) have no listener
110+
// registered here, and clicks on those new rows silently drop.
111+
getValue(rows);
107112
const selectedRows_ = [];
108113
for (let i = 0; i < selectedRows.length; i++) {
109114
if (selectedRows[i].val) {

0 commit comments

Comments
 (0)