Fix stage filter showing empty graph when env filter is active

When stage filter is set, skip passing environment IDs to the layout
API. This fetches all environments for the selected regions, then the
client-side stage filter shows only matching types. Previously, the
env filter would narrow results before the stage filter could act,
causing an empty graph.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
master
2026-03-28 23:27:10 +02:00
parent ddd4ee1fce
commit 2a77a27560

View File

@@ -521,11 +521,15 @@ export class TopologyGraphPageComponent {
const regions = this.context.selectedRegions();
const environments = this.context.selectedEnvironments();
const stage = this.context.stage();
const hasStageFilter = stage && stage !== 'all';
this.layoutService
.getLayout({
region: regions.length > 0 ? regions.join(',') : undefined,
environment: environments.length > 0 ? environments.join(',') : undefined,
// When stage filter is active, don't restrict by specific environments —
// fetch all envs for the selected regions so the stage filter can show all matching.
environment: !hasStageFilter && environments.length > 0 ? environments.join(',') : undefined,
})
.pipe(
take(1),