Skip to content

Fix the design mode issues - #3050

Merged
Piumal1999 merged 4 commits into
wso2:mainfrom
Piumal1999:designmode
Jul 30, 2026
Merged

Fix the design mode issues#3050
Piumal1999 merged 4 commits into
wso2:mainfrom
Piumal1999:designmode

Conversation

@Piumal1999

@Piumal1999 Piumal1999 commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Purpose

$subject

Summary

Fix the broken design mode
Also Added a volume mount for the samples

Approach

TBD

Also fixed the coderabbit comments of #3045

@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

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

Next review available in: 45 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

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: 864f247d-b12d-49ea-9a7c-ab41d98714ae

📥 Commits

Reviewing files that changed from the base of the PR and between 37e8f84 and e8e9069.

📒 Files selected for processing (3)
  • portals/api-portal/docker-compose.yaml
  • portals/api-portal/src/config/configLoader.js
  • portals/api-portal/src/pages/applications/partials/applications-listing.hbs
📝 Walkthrough

Walkthrough

Changes

Design mode

Layer / File(s) Summary
Design-mode runtime isolation
portals/api-portal/src/config/configLoader.js, portals/api-portal/src/db/driver.js, portals/api-portal/src/server.js
Design mode generates a session secret when absent, bypasses real database adapters, skips default organization seeding, and uses /views/default as the startup landing path.
Design-mode UI rendering
portals/api-portal/src/helpers/handlebarsHelpers.js, portals/api-portal/src/defaultContent/..., portals/api-portal/src/pages/applications/..., portals/api-portal/src/defaultContent/styles/components.css
Templates use a design-mode helper to disable unavailable login, subscription, sidebar, and application navigation with shared styling.
Design-mode sample delivery
portals/api-portal/docker-compose.yaml, portals/api-portal/Makefile, portals/api-portal/.dockerignore
Development mounts samples into /app/samples, while standalone distributions stage samples under resources/samples and rewrite the compose mount.
Configuration and operator documentation
portals/api-portal/configs/config-template.toml, portals/api-portal/distribution/README.md, portals/api-portal/README.md, portals/api-portal/docs/administer/*
Documentation covers design-mode activation, authorization role mappings, environment-variable semantics, and qualified identity-provider configuration paths.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Operator
  participant API Portal
  participant configLoader
  participant dbDriver
  participant Handlebars
  Operator->>API Portal: Enable design mode and restart
  API Portal->>configLoader: Load design-mode configuration
  configLoader-->>API Portal: Provide session secret
  API Portal->>dbDriver: Request database adapter
  dbDriver-->>API Portal: Return design-mode stub
  API Portal->>Handlebars: Render portal pages
  Handlebars-->>Operator: Show preview with unavailable links disabled
Loading

Suggested reviewers: lasanthas, krishanx92, virajsalaka

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ⚠️ Warning The description only partially matches the template and omits most required sections like Goals, Tests, Security checks, and Samples. Fill in the missing template sections with goals, approach, user stories, documentation, tests, security checks, samples, related PRs, and test environment.
✅ Passed checks (3 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title is concise and clearly refers to the design mode fixes in this PR.
✨ 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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@portals/api-portal/distribution/README.md`:
- Line 120: Update the design-mode preview URL in the README text to use HTTPS
instead of HTTP, changing it to https://localhost:9543/views/default while
preserving the surrounding explanation.
- Line 118: Update the restart command in the API Portal README to use the
Compose service name devportal instead of the container name api-portal, while
keeping the docker compose up command unchanged.

In `@portals/api-portal/src/config/configLoader.js`:
- Around line 369-385: Update the designMode-enabled branch in the config
loading flow to generate an ephemeral sessionSecret only when it is absent, then
validate any resulting or operator-supplied value with requireHexSecret.
Preserve the existing encryptionKey validation for non-design mode and ensure
supplied design-mode secrets cannot bypass validation.

In `@portals/api-portal/src/pages/applications/partials/applications-listing.hbs`:
- Around line 38-40: Update the application listing controls and their handlers
to honor designMode, not only the card navigation in the app-card markup. Hide
or disable Create and Delete actions and prevent their /applications mutation
handlers from executing when designMode is enabled, while preserving existing
behavior outside design mode.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 9c774a5c-583a-4070-856f-0a8a54da0c5f

📥 Commits

Reviewing files that changed from the base of the PR and between ac83f4c and 37e8f84.

📒 Files selected for processing (18)
  • portals/api-portal/.dockerignore
  • portals/api-portal/Makefile
  • portals/api-portal/README.md
  • portals/api-portal/configs/config-template.toml
  • portals/api-portal/distribution/README.md
  • portals/api-portal/docker-compose.yaml
  • portals/api-portal/docs/administer/asgardeo-setup.md
  • portals/api-portal/docs/administer/authentication.md
  • portals/api-portal/src/config/configLoader.js
  • portals/api-portal/src/db/driver.js
  • portals/api-portal/src/defaultContent/pages/api-landing/partials/api-subscription-plans.hbs
  • portals/api-portal/src/defaultContent/pages/mcp-landing/partials/mcp-subscription-plans.hbs
  • portals/api-portal/src/defaultContent/partials/header.hbs
  • portals/api-portal/src/defaultContent/partials/sidebar.hbs
  • portals/api-portal/src/defaultContent/styles/components.css
  • portals/api-portal/src/helpers/handlebarsHelpers.js
  • portals/api-portal/src/pages/applications/partials/applications-listing.hbs
  • portals/api-portal/src/server.js

Comment thread portals/api-portal/distribution/README.md
Comment thread portals/api-portal/distribution/README.md
Comment thread portals/api-portal/src/config/configLoader.js
@Piumal1999
Piumal1999 merged commit ddd01b2 into wso2:main Jul 30, 2026
9 of 16 checks passed
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.

3 participants