Skip to content

Fix pre-existing issues in gateway-api form components #692

Description

@R-Lawton

context

these issues existed in the original gateway-api-console-plugin and were carried over during the merge (#636, #690). they're not regressions — they were in the source code before the merge.

issues

port input validation

  • GatewayCreatePage.tsx: clearing the port field yields NaN (parseInt('', 10)) which shows in the form and YAML
  • FilterActions.tsx: mirror port field accepts non-numeric text and emits NaN

filter validation gaps

  • FilterActions.tsx: add/set rows with empty header values are silently dropped — gateway API permits empty header values
  • filterUtils.tsx: header-modifier validation accepts blank rows, empty filters can be saved

httproute form

  • HTTPRouteCreatePage.tsx: positional path splitting (pathSplit[5]) couples to URL shape — should use useParams()
  • HTTPRouteCreatePage.tsx: parent references without sectionName silently dropped, but sectionName is optional in gateway API spec
  • HTTPRouteRuleWizard.tsx: method dropdown omits HEAD, CONNECT, OPTIONS, TRACE — routes with those methods show no matching option

filterUtils typing

  • filterUtils.tsx: ~10 instances of any type without justification — should use exported filter type definitions
  • filterUtils.tsx: as HTTPRouteFilter[] cast masks shape mismatch, .filter(Boolean) is a no-op
  • filterUtils.tsx: getFilterSummary returns untranslated user-facing text

useHTTPRouteActions

  • useHTTPRouteActions.tsx: actions reported as loaded before model resolves — edit/delete flash for unauthorized users

types

  • types.ts: pathType/method widened to string instead of reusing literal unions from HTTPRouteResource

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requesttriage/acceptedReviewed, prioritised, and ready for work

Type

No type

Projects

Status
Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions