Skip to content

Conversation

@gkrajniak
Copy link
Collaborator

@gkrajniak gkrajniak commented Sep 18, 2025

Having the env setup

# OIDC
OIDC_CLIENT_ID_DEFAULT=default
BASE_DOMAINS_DEFAULT=localhost

DEVELOPMENT_INSTANCE=true
ENVIRONMENT='local'
PORT='3000'
FRONTEND_PORT='4300'

with the coming changes we are able to run http:\\localhost:FRONTEND_PORT

Summary by CodeRabbit

  • New Features

    • Welcome view now disables breadcrumbs by default.
  • Bug Fixes

    • More reliable organization detection from request domains (including localhost).
    • Authentication client mapping now consistently tied to the detected organization across base and subdomains.
  • Refactor

    • Domain parsing simplified to return a single organization value with an environment-defined base domain.
    • One service made DI-compatible.
  • Tests

    • Updated and added tests for organization parsing and non-subdomain scenarios.
  • Chores

    • Bumped portal-server-lib dependency version.

@gkrajniak gkrajniak requested a review from Sobyt483 September 18, 2025 12:59
@coderabbitai
Copy link

coderabbitai bot commented Sep 18, 2025

Walkthrough

Replaced getDomainAndOrganization with getOrganization (now returns a string) across portal-options, updated call sites and tests, read BASE_DOMAINS_DEFAULT from env for base-domain checks, switched auth clientId to getOrganization, added @Injectable to one service, adjusted welcomeNodeConfig, and bumped a dependency.

Changes

Cohort / File(s) Summary of Changes
Domain utility API change
src/portal-options/utils/domain.ts, src/portal-options/utils/domain.spec.ts
Renamed getDomainAndOrganizationgetOrganization. Return shape changed from an object ({ organization, baseDomain }) to a plain string. Logic and tests adjusted to use BASE_DOMAINS_DEFAULT from env and return an organization string.
Portal context & request providers
src/portal-options/pm-portal-context.service.ts, src/portal-options/pm-portal-context.service.spec.ts, src/portal-options/pm-request-context-provider.ts, src/portal-options/pm-request-context-provider.spec.ts
Replaced imports/calls of getDomainAndOrganization with getOrganization. Updated code to consume a string, read BASE_DOMAINS_DEFAULT from env for base-domain checks, adjust subdomain construction and template replacements. Tests and mocks updated accordingly.
Auth config provider
src/portal-options/auth-config-provider.ts, src/portal-options/auth-config-provider.spec.ts
Switched clientId derivation to use getOrganization(request) (string). PMAuthConfigProvider constructor simplified to accept only DiscoveryService. Tests updated to reflect the new helper and constructor usage.
Content configuration service providers
src/portal-options/service-providers/content-configuration-service-providers.service.ts, src/portal-options/service-providers/content-configuration-service-providers.service.spec.ts
Added @Injectable() import and decorator to the service class for DI. Added/adjusted a test asserting non-subdomain behavior returns welcomeNodeConfig. No core logic changes.
Welcome node config model
src/portal-options/service-providers/models/welcome-node-config.ts
Added showBreadcrumbs: false to the welcomeNodeConfig export within luigiConfigFragment.data.nodes[0].
Package dependency
package.json
Bumped @openmfp/portal-server-lib version from >=0.160.1 to >=0.160.2 in dependencies and peerDependencies.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes


📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Free

📥 Commits

Reviewing files that changed from the base of the PR and between 4cf35cf and 5d71a6b.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (1)
  • package.json (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • package.json

Note

🎁 Summarized by CodeRabbit Free

Your organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login.

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

@gkrajniak gkrajniak requested a review from nexus49 September 18, 2025 15:19
@gkrajniak gkrajniak self-assigned this Sep 19, 2025
…local-development

# Conflicts:
#	src/portal-options/auth-config-provider.spec.ts
#	src/portal-options/auth-config-provider.ts
#	src/portal-options/service-providers/content-configuration-service-providers.service.spec.ts
#	src/portal-options/service-providers/content-configuration-service-providers.service.ts
@gkrajniak gkrajniak merged commit b1781c7 into main Oct 14, 2025
7 checks passed
@gkrajniak gkrajniak deleted the feat/add-support-for-local-development branch October 14, 2025 08:36
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.

5 participants