Skip to content

feat(apiproduct): show public URL in API Product overview tab#538

Draft
namansh70747 wants to merge 1 commit into
Kuadrant:mainfrom
namansh70747:gh-534-apiproduct-public-url
Draft

feat(apiproduct): show public URL in API Product overview tab#538
namansh70747 wants to merge 1 commit into
Kuadrant:mainfrom
namansh70747:gh-534-apiproduct-public-url

Conversation

@namansh70747

Copy link
Copy Markdown
Contributor

Description

Adds an Address field to the API Product overview tab so users can see and copy the product's public URL directly from the overview, instead of navigating to the underlying route.

Fixes #534

Opening as a draft because the source of the public URL is a design choice I'd like to confirm with @eguzki (see Open question below). The implementation here is complete and working for the UI-derivation approach; if a controller-populated status field is preferred, the change to swap the source is small.

Type of change

  • [feat] New feature

Changes made

  • Derive the public URL from the HTTPRoute referenced by spec.targetRef: its first non-empty spec.hostnames entry becomes https://<hostname>. The APIProduct itself carries no address field (confirmed against types.ts and the CRD), so resolving it from the linked route is the only source available without controller changes.
  • Reuse the cached-targetRef + useK8sWatchResource pattern already in APIProductPoliciesTab.tsx, so a transient watch reconnection (where spec is briefly absent) doesn't drop the linked route.
  • Reuse the ClipboardCopy pattern from APIKeyRevealModal.tsx for copy-to-clipboard.
  • When no route hostname is resolvable, the field renders "Not set", matching the other optional overview fields.

Open question for reviewers

Where should the public URL come from?

  1. Derived in the UI from the linked HTTPRoute's hostname (what this PR does — works today, no controller dependency), or
  2. A resolved address on APIProduct.status populated by the controller (like APIKey.status.apiHostname), if one is planned.

If (2) is the intended direction, I'll point the field at that status field instead — the rest of the UI stays the same.

Test plan

  • yarn lint passes (no changes after running)
  • yarn i18n passes (committed the generated Address key)
  • yarn tsc --noEmit reports no errors in src/
  • Tested manually in OpenShift Console (will verify once an APIProduct + HTTPRoute fixture is up)
  • Tested in both light and dark themes

Checklist

  • All user-facing strings use t() and are added to the locale file
  • No bare .pf-*/.co-* selectors or hex colors (reuses existing --pf-v6-global--Color--200 for the empty state)
  • No console.log statements left in
  • Commit includes Signed-off-by

🤖 Generated with Claude Code

Adds an Address field to the API Product overview tab so users can see and
copy the product's public URL without leaving the page (KuadrantGH-534).

The APIProduct carries no address field of its own, so the URL is derived
from the HTTPRoute referenced by spec.targetRef: its first non-empty
spec.hostnames entry becomes https://<hostname>. This reuses the
cached-targetRef + useK8sWatchResource pattern already in
APIProductPoliciesTab to survive transient watch reconnections, and the
ClipboardCopy pattern already used in APIKeyRevealModal for copy-to-clipboard.
When no route hostname is resolvable the field renders "Not set", matching the
other optional overview fields.

Refs Kuadrant#534

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Naman Sharma <namsh70747@gmail.com>
@coderabbitai

coderabbitai Bot commented Jun 4, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: ecfa6763-1361-43f7-9595-a19dce0964b3

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@R-Lawton

Copy link
Copy Markdown
Contributor

Is this ready for review?

@namansh70747

Copy link
Copy Markdown
Contributor Author

Is this ready for review?

Yes

@emmaaroche

Copy link
Copy Markdown
Member

Is this ready for review?

Yes

@namansh70747 please move PR from draft to ready for review, pr will also require conflicts to be fixed

@namansh70747

namansh70747 commented Jul 3, 2026

Copy link
Copy Markdown
Contributor Author

Is this ready for review?

Yes

@namansh70747 please move PR from draft to ready for review, pr will also require conflicts to be fixed

Yes, will move it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

API Product View: Public URL in Overview Tab

3 participants