fix(web): type renderPort as Port[], hoist to module scope, show all ports - #177
Merged
rodriguecyber merged 1 commit intoAug 31, 2026
Conversation
…ports renderPort took `ports: any[]`, was redefined inside ContainerTable on every render even though it closes over nothing, and only ever showed ports[0] — a container publishing three ports rendered as if it published one, with no indication of the rest. Moved it to module scope next to the other helpers, typed the parameter with the existing `Port` type from types/api.ts, and joined every mapping instead of dropping all but the first. Also handles PublicPort being empty (a port that's exposed but not published), which previously rendered as a bare ":80" — it now renders just the private port. Closes Open-Source-Kigali#165
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ContainerTable.tsx'srenderPort:ports: any[], so a typo like.PublicPrtwould have compiled fine and renderedundefined:...at runtimeports[0], silently hiding every other published portFixes all three:
NEEDS_ADMIN.Porttype fromtypes/api.ts."8080:80, 8443:443") instead of dropping all but the first.PublicPortempty (exposed but not published) now renders just the private port instead of the previous bare":80".Left the port link's
ports[0]?.PublicPorthref untouched — that's owned by #157 per this issue's own cross-reference, and is a separable, larger decision (host-reachability question) that this PR shouldn't bundle in.Closes #165
Test plan
npm run lint --workspace=@docksight/web— clean (pre-existing warnings elsewhere are unrelated to this file)cd apps/web && npx tsc -b— clean-), one port, and several ports, plus a port with an emptyPublicPort