WEB-713: Hide tenant dropdown when FINERACT_PLATFORM_TENANTS_IDENTIFIER is not defined (#3138)

Signed-off-by: DeathGun44 <krishnamewara841@gmail.com>
This commit is contained in:
Krishna Mewara
2026-02-14 15:55:10 -06:00
committed by GitHub
parent 55981a7a1c
commit 8abce7b449
2 changed files with 16 additions and 4 deletions
+1 -1
View File
@@ -93,7 +93,7 @@
<!-- Form Section --> <!-- Form Section -->
<div class="form-section"> <div class="form-section">
<!-- Tenant Selector --> <!-- Tenant Selector -->
@if (displayTenantSelector()) { @if (showTenantSelector) {
<div class="tenant-section"> <div class="tenant-section">
<mifosx-tenant-selector></mifosx-tenant-selector> <mifosx-tenant-selector></mifosx-tenant-selector>
</div> </div>
+15 -3
View File
@@ -73,6 +73,8 @@ import { VersionService } from '../system/version.service';
] ]
}) })
export class LoginComponent implements OnInit, OnDestroy { export class LoginComponent implements OnInit, OnDestroy {
/** Whether to show the tenant selector dropdown */
showTenantSelector = true;
/** Show version info table if env allows */ /** Show version info table if env allows */
displayBackendInfo = environment.displayBackEndInfo !== 'false'; displayBackendInfo = environment.displayBackEndInfo !== 'false';
/** Production mode - minimal hero with branding only */ /** 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. * Subscribes to alert event of alert service and theme changes.
*/ */
ngOnInit() { ngOnInit() {
this.showTenantSelector = this.calculateTenantSelectorVisibility();
this.updateLogo(); this.updateLogo();
this.themeDarkEnabled = this.settingsService.themeDarkEnabled; this.themeDarkEnabled = this.settingsService.themeDarkEnabled;
// Subscribe to theme changes // Subscribe to theme changes
@@ -193,12 +196,21 @@ export class LoginComponent implements OnInit, OnDestroy {
window.location.reload(); window.location.reload();
} }
displayTenantSelector(): boolean { private calculateTenantSelectorVisibility(): boolean {
// Hide tenant selector when OAuth2 is enabled (tenant is determined by OAuth server)
if (environment.oauth.enabled) { if (environment.oauth.enabled) {
return false; 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 { allowServerSwitch(): boolean {