From 8abce7b449ffca964a26bc13a0eb21a50aa15ea6 Mon Sep 17 00:00:00 2001 From: Krishna Mewara <161239575+DeathGun44@users.noreply.github.com> Date: Sun, 15 Feb 2026 03:25:10 +0530 Subject: [PATCH] WEB-713: Hide tenant dropdown when FINERACT_PLATFORM_TENANTS_IDENTIFIER is not defined (#3138) Signed-off-by: DeathGun44 --- src/app/login/login.component.html | 2 +- src/app/login/login.component.ts | 18 +++++++++++++++--- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/app/login/login.component.html b/src/app/login/login.component.html index 3044102da..c056c7165 100644 --- a/src/app/login/login.component.html +++ b/src/app/login/login.component.html @@ -93,7 +93,7 @@
- @if (displayTenantSelector()) { + @if (showTenantSelector) {
diff --git a/src/app/login/login.component.ts b/src/app/login/login.component.ts index 60bbb5ea2..844085f7f 100644 --- a/src/app/login/login.component.ts +++ b/src/app/login/login.component.ts @@ -73,6 +73,8 @@ import { VersionService } from '../system/version.service'; ] }) export class LoginComponent implements OnInit, OnDestroy { + /** Whether to show the tenant selector dropdown */ + showTenantSelector = true; /** Show version info table if env allows */ displayBackendInfo = environment.displayBackEndInfo !== 'false'; /** Production mode - minimal hero with branding only */ @@ -115,6 +117,7 @@ export class LoginComponent implements OnInit, OnDestroy { * Subscribes to alert event of alert service and theme changes. */ ngOnInit() { + this.showTenantSelector = this.calculateTenantSelectorVisibility(); this.updateLogo(); this.themeDarkEnabled = this.settingsService.themeDarkEnabled; // Subscribe to theme changes @@ -193,12 +196,21 @@ export class LoginComponent implements OnInit, OnDestroy { window.location.reload(); } - displayTenantSelector(): boolean { - // Hide tenant selector when OAuth2 is enabled (tenant is determined by OAuth server) + private calculateTenantSelectorVisibility(): boolean { if (environment.oauth.enabled) { return false; } - return environment.displayTenantSelector === 'false' ? false : true; + if (environment.displayTenantSelector === 'false') { + return false; + } + const tenantIds = environment.fineractPlatformTenantIds + .split(',') + .map((id) => id.trim()) + .filter((id) => id.length > 0); + if (tenantIds.length === 0 || (tenantIds.length === 1 && tenantIds[0] === 'default')) { + return false; + } + return true; } allowServerSwitch(): boolean {