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 -->
<div class="form-section">
<!-- Tenant Selector -->
@if (displayTenantSelector()) {
@if (showTenantSelector) {
<div class="tenant-section">
<mifosx-tenant-selector></mifosx-tenant-selector>
</div>
+15 -3
View File
@@ -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 {