fix(frontend): filter duplicate draft/live connections in deploy modal (#12724)

* fix(frontend): filter duplicate draft/live connections in deploy modal

Connections with same app_id can exist as both draft and live, causing
both to appear selected simultaneously. Filter to draft-only and add
environment badge for clarity.

LFOSS-3373

* fix: remove connection environment badge

(cherry picked from commit 899f82de5b)
This commit is contained in:
Viktor Avelino
2026-04-16 14:29:24 -04:00
committed by Eric Hare
parent 5307f400bf
commit 7b06c2033c

View File

@ -78,16 +78,17 @@ export default function StepAttachFlows() {
return;
seededExistingConnections.current = true;
const existingConnections: ConnectionItem[] = configsData.configs.map(
(cfg) => ({
const existingConnections: ConnectionItem[] = configsData.configs
.filter((cfg) => cfg.environment !== "live")
.map((cfg) => ({
id: cfg.app_id,
connectionId: cfg.connection_id,
name: cfg.app_id,
environment: cfg.environment,
variableCount: 0,
isNew: false,
environmentVariables: {},
}),
);
}));
setConnections((prev) => {
// Avoid duplicates if user already created connections with the same id