Skip to content

WEB-713: Hide tenant dropdown when Fineract Platform Tenants is not defined#3138

Merged
IOhacker merged 1 commit intoopenMF:devfrom
DeathGun44:WEB-713/hide-tenant-dropdown-when-variable-undefined
Feb 14, 2026
Merged

WEB-713: Hide tenant dropdown when Fineract Platform Tenants is not defined#3138
IOhacker merged 1 commit intoopenMF:devfrom
DeathGun44:WEB-713/hide-tenant-dropdown-when-variable-undefined

Conversation

@DeathGun44
Copy link
Contributor

@DeathGun44 DeathGun44 commented Feb 13, 2026

Description

Hide the tenant dropdown on the login page when FINERACT_PLATFORM_TENANTS_IDENTIFIER is not defined. When the variable contains at least 1 explicit tenant, the dropdown is shown with those values.

Changes:

  • Replaced displayTenantSelector() method call with a showTenantSelector boolean property computed once in [ngOnInit()]— avoids recalculation on every Angular change detection cycle
  • Dropdown is hidden when the tenant list is empty or contains only the implicit 'default' fallback
  • The 'default' fallback in environment files is preserved, so login always works even without the env var

Screenshots

image image

Checklist

  • If you have multiple commits please combine them into one commit by squashing them.
  • Read and understood the contribution guidelines at web-app/.github/CONTRIBUTING.md.

Summary by CodeRabbit

  • Bug Fixes
    • Fixed tenant selector visibility on the login page. The selector now correctly evaluates OAuth enablement and environment configuration to determine when to display.

…ER is not defined

Signed-off-by: DeathGun44 <krishnamewara841@gmail.com>
@coderabbitai
Copy link

coderabbitai bot commented Feb 13, 2026

Note

.coderabbit.yaml has unrecognized properties

CodeRabbit is using all valid settings from your configuration. Unrecognized properties (listed below) have been ignored and may indicate typos or deprecated fields that can be removed.

⚠️ Parsing warnings (1)
Validation error: Unrecognized key(s) in object: 'pre_merge_checks'
⚙️ Configuration instructions
  • Please see the configuration documentation for more information.
  • You can also validate your configuration using the online YAML validator.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Walkthrough

The login component's tenant selector visibility logic is refactored from a method-based check to a property-based approach. A new calculateTenantSelectorVisibility() method centralizes the visibility determination during component initialization, replacing the previous displayTenantSelector() method call in the template.

Changes

Cohort / File(s) Summary
Login Component
src/app/login/login.component.html, src/app/login/login.component.ts
Refactored tenant selector visibility logic by replacing method calls with a boolean property. Introduced enhanced visibility calculation that checks OAuth status, environment configuration, and parses tenant IDs with filtering. Method moved from public to private and renamed to calculateTenantSelectorVisibility(), with initialization added to ngOnInit().

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Suggested reviewers

  • IOhacker
  • gkbishnoi07
🚥 Pre-merge checks | ✅ 3 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Merge Conflict Detection ⚠️ Warning ❌ Merge conflicts detected (36 files):

⚔️ src/app/clients/clients-view/client-actions/client-screen-reports/client-screen-reports.component.scss (content)
⚔️ src/app/clients/clients-view/clients-view.component.ts (content)
⚔️ src/app/clients/create-client/create-client.component.ts (content)
⚔️ src/app/core/utils/datatables.ts (content)
⚔️ src/app/login/login-form/login-form.component.scss (content)
⚔️ src/app/login/login.component.html (content)
⚔️ src/app/login/login.component.ts (content)
⚔️ src/app/organization/bulk-loan-reassignmnet/bulk-loan-reassignmnet.component.ts (content)
⚔️ src/app/organization/fund-mapping/fund-mapping.component.html (content)
⚔️ src/app/organization/fund-mapping/fund-mapping.component.ts (content)
⚔️ src/app/organization/loan-originators/edit-loan-originator/edit-loan-originator.component.ts (content)
⚔️ src/app/organization/loan-originators/view-loan-originator/view-loan-originator.component.html (content)
⚔️ src/app/organization/loan-provisioning-criteria/create-loan-provisioning-criteria/create-loan-provisioning-criteria.component.ts (content)
⚔️ src/app/organization/loan-provisioning-criteria/edit-loan-provisioning-criteria/edit-loan-provisioning-criteria.component.ts (content)
⚔️ src/app/products/loan-products/loan-product-stepper/loan-product-accounting-step/advanced-accounting-mapping-rule/advanced-accounting-mapping-rule.component.ts (content)
⚔️ src/app/products/manage-delinquency-buckets/delinquency-range/create-range/create-range.component.ts (content)
⚔️ src/app/profile/profile.component.scss (content)
⚔️ src/app/shared/form-dialog/form-group.service.ts (content)
⚔️ src/app/shared/form-dialog/formfield/formfield.component.html (content)
⚔️ src/app/system/codes/view-code/view-code.component.html (content)
⚔️ src/app/system/codes/view-code/view-code.component.ts (content)
⚔️ src/app/system/manage-jobs/workflow-jobs/workflow-jobs.component.html (content)
⚔️ src/app/tasks/checker-inbox-and-tasks-tabs/loan-disbursal/loan-disbursal.component.ts (content)
⚔️ src/assets/translations/cs-CS.json (content)
⚔️ src/assets/translations/de-DE.json (content)
⚔️ src/assets/translations/en-US.json (content)
⚔️ src/assets/translations/es-CL.json (content)
⚔️ src/assets/translations/es-MX.json (content)
⚔️ src/assets/translations/fr-FR.json (content)
⚔️ src/assets/translations/it-IT.json (content)
⚔️ src/assets/translations/ko-KO.json (content)
⚔️ src/assets/translations/lt-LT.json (content)
⚔️ src/assets/translations/lv-LV.json (content)
⚔️ src/assets/translations/ne-NE.json (content)
⚔️ src/assets/translations/pt-PT.json (content)
⚔️ src/assets/translations/sw-SW.json (content)

These conflicts must be resolved before merging into dev.
Resolve conflicts locally and push changes to this branch.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: hiding the tenant dropdown when environment tenant variables are not defined, which matches the core modifications in both the HTML template and TypeScript component.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
⚔️ Resolve merge conflicts (beta)
  • Auto-commit resolved conflicts to branch WEB-713/hide-tenant-dropdown-when-variable-undefined
  • Post resolved changes as copyable diffs in a comment

No actionable comments were generated in the recent review. 🎉

🧹 Recent nitpick comments
src/app/login/login.component.ts (1)

76-77: Consider initializing showTenantSelector to false instead of true.

If for any reason ngOnInit throws before reaching line 120 (e.g., an earlier statement fails), the default true would show the selector even when it shouldn't. Defaulting to false is the safer fallback — hiding the selector is preferable to showing it incorrectly.

Proposed fix
  /** Whether to show the tenant selector dropdown */
- showTenantSelector = true;
+ showTenantSelector = false;

Tip

Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord.


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.

Copy link
Contributor

@IOhacker IOhacker left a comment

Choose a reason for hiding this comment

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

LGTM

@IOhacker IOhacker merged commit 8abce7b into openMF:dev Feb 14, 2026
5 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.

2 participants