Skip to content

Hide sandbox endpoint card when sandbox URL is omitted or empty (#3162) - #3182

Open
lahiruudayakumara wants to merge 1 commit into
wso2:mainfrom
lahiruudayakumara:fix/3162-empty-sandbox-endpoint-box
Open

Hide sandbox endpoint card when sandbox URL is omitted or empty (#3162)#3182
lahiruudayakumara wants to merge 1 commit into
wso2:mainfrom
lahiruudayakumara:fix/3162-empty-sandbox-endpoint-box

Conversation

@lahiruudayakumara

Copy link
Copy Markdown
Contributor

Purpose

When an API is created with only a Production endpoint and no Sandbox endpoint, the Developer Portal landing page displays an empty "Sandbox" endpoint card containing an empty link URL box. This PR fixes the template conditional logic so that endpoint cards are only rendered when a valid endpoint URL exists.

Resolves #3162

Goals

  • Prevent empty Sandbox or Production endpoint cards from appearing on the API overview landing page.
  • Ensure endpoint visibility checks in Handlebars templates use truthy boolean evaluations ({{#if ...}}).

Approach

  • Templates (api-default.hbs & mcp-default.hbs): Replaced {{#unless (eq resources.serverDetails.sandboxURL "")}} with {{#if resources.serverDetails.sandboxURL}} so the card container is only rendered when a non-empty Sandbox URL exists.
  • Helpers (handlebarsHelpers.js): Updated the custom Handlebars eq helper to treat null and undefined as equivalent to an empty string "" when comparing against empty values, preventing unintended false results during Handlebars string comparisons.

User stories

As an API consumer viewing an API overview page, I want to see endpoint details only for the environments (Production / Sandbox) that are configured for that API, without empty placeholder cards.

Documentation

N/A - Frontend template display fix. No changes to user-facing documentation or API contracts.

Automation tests

  • Unit tests

    Ran npm test across all Node.js unit tests in portals/api-portal (99/99 passed).

  • Integration tests

    Verified template rendering for APIs configured with single vs. multiple endpoints.

Security checks

Samples

N/A

Related PRs

N/A

Test environment

  • Node.js: 24.6.0
  • OS: macOS (ARM64)
  • Browsers: Chrome, Edge, Firefox

@coderabbitai

coderabbitai Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@lahiruudayakumara, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 39 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: bb3b6b91-f4ff-4b33-a409-559f3ee0eff1

📥 Commits

Reviewing files that changed from the base of the PR and between 2613ad3 and 6d00e9a.

📒 Files selected for processing (3)
  • portals/api-portal/src/defaultContent/pages/api-landing/partials/api-default.hbs
  • portals/api-portal/src/defaultContent/pages/mcp-landing/partials/mcp-default.hbs
  • portals/api-portal/src/helpers/handlebarsHelpers.js

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.

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.

[Bug]: Empty box shown when sandbox endpoint is not available

1 participant