diff --git a/env.sample b/env.sample
index 82e71000e..170a60c38 100644
--- a/env.sample
+++ b/env.sample
@@ -13,6 +13,9 @@ FINERACT_PLATFORM_TENANT_IDENTIFIER=default
# Tenant Identifiers list delimited by comma
FINERACT_PLATFORM_TENANTS_IDENTIFIER=default
+# Tenant Logo URL - supports external URLs (e.g., https://example.com/logo.png) or local paths. Leave empty to use default tenant-specific logos
+TENANT_LOGO_URL=
+
MIFOS_DEFAULT_LANGUAGE=en-US
MIFOS_SUPPORTED_LANGUAGES=cs-CS,de-DE,en-US,es-MX,fr-FR,it-IT,ko-KO,lt-LT,lv-LV,ne-NE,pt-PT
diff --git a/src/app/login/login.component.html b/src/app/login/login.component.html
index 3b06593e1..13a26d1ac 100644
--- a/src/app/login/login.component.html
+++ b/src/app/login/login.component.html
@@ -50,7 +50,7 @@
-

+
diff --git a/src/app/login/login.component.ts b/src/app/login/login.component.ts
index 855d002cc..3a8627ce2 100644
--- a/src/app/login/login.component.ts
+++ b/src/app/login/login.component.ts
@@ -65,11 +65,13 @@ export class LoginComponent implements OnInit, OnDestroy {
twoFactorAuthenticationRequired = false;
/** Subscription to alerts. */
alert$: Subscription;
+ logoPath = 'assets/images/default_home.png';
/**
* Subscribes to alert event of alert service.
*/
ngOnInit() {
+ this.updateLogo();
this.alert$ = this.alertService.alertEvent.subscribe((alertEvent: Alert) => {
const alertType = alertEvent.type;
if (alertType === 'Password Expired') {
@@ -82,6 +84,8 @@ export class LoginComponent implements OnInit, OnDestroy {
this.resetPassword = false;
this.twoFactorAuthenticationRequired = false;
this.router.navigate(['/'], { replaceUrl: true });
+ } else if (alertType === 'Tenant Changed') {
+ this.updateLogo();
}
});
}
@@ -112,4 +116,21 @@ export class LoginComponent implements OnInit, OnDestroy {
allowServerSwitch(): boolean {
return environment.allowServerSwitch === 'false' ? false : true;
}
+
+ updateLogo(): void {
+ if (environment.tenantLogoUrl && environment.tenantLogoUrl.trim() !== '') {
+ this.logoPath = environment.tenantLogoUrl;
+ return;
+ }
+ const tenant = this.settingsService.tenantIdentifier;
+ if (tenant && tenant !== 'default') {
+ this.logoPath = `assets/images/${tenant}_home.png`;
+ } else {
+ this.logoPath = 'assets/images/default_home.png';
+ }
+ }
+
+ onLogoError(): void {
+ this.logoPath = 'assets/images/default_home.png';
+ }
}
diff --git a/src/app/shared/tenant-selector/tenant-selector.component.ts b/src/app/shared/tenant-selector/tenant-selector.component.ts
index 8ea9b9b7d..37d8ddc62 100644
--- a/src/app/shared/tenant-selector/tenant-selector.component.ts
+++ b/src/app/shared/tenant-selector/tenant-selector.component.ts
@@ -1,6 +1,7 @@
import { Component, OnInit, inject } from '@angular/core';
import { UntypedFormControl, ReactiveFormsModule } from '@angular/forms';
import { SettingsService } from 'app/settings/settings.service';
+import { AlertService } from 'app/core/alert/alert.service';
import { MatFormField, MatPrefix, MatLabel } from '@angular/material/form-field';
import { FaIconComponent } from '@fortawesome/angular-fontawesome';
import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
@@ -17,6 +18,7 @@ import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
})
export class TenantSelectorComponent implements OnInit {
private settingsService = inject(SettingsService);
+ private alertService = inject(AlertService);
/** Tenant selector form control. */
tenantSelector = new UntypedFormControl();
@@ -40,6 +42,7 @@ export class TenantSelectorComponent implements OnInit {
setTenantIdentifier(): void {
this.settingsService.setTenantIdentifier(this.tenantSelector.value);
+ this.alertService.alert({ type: 'Tenant Changed', message: this.tenantSelector.value });
}
allowSelection(): boolean {
diff --git a/src/assets/env.js b/src/assets/env.js
index f1df0cdff..7400f2b86 100644
--- a/src/assets/env.js
+++ b/src/assets/env.js
@@ -12,6 +12,8 @@
window["env"]["fineractPlatformTenantId"] = '';
window["env"]["fineractPlatformTenantIds"] = '';
+ window['env']['tenantLogoUrl'] = '';
+
// Language Environment variables
window["env"]["defaultLanguage"] = '';
window["env"]["supportedLanguages"] = '';
diff --git a/src/assets/env.template.js b/src/assets/env.template.js
index e2784b7fc..c7e375969 100644
--- a/src/assets/env.template.js
+++ b/src/assets/env.template.js
@@ -12,6 +12,8 @@
window['env']['fineractPlatformTenantId'] = '$FINERACT_PLATFORM_TENANT_IDENTIFIER';
window['env']['fineractPlatformTenantIds'] = '$FINERACT_PLATFORM_TENANTS_IDENTIFIER';
+ window['env']['tenantLogoUrl'] = '$TENANT_LOGO_URL';
+
// Language Environment variables
window['env']['defaultLanguage'] = '$MIFOS_DEFAULT_LANGUAGE';
window['env']['supportedLanguages'] = '$MIFOS_SUPPORTED_LANGUAGES';
diff --git a/src/environments/environment.prod.ts b/src/environments/environment.prod.ts
index 5927fa0f3..8bb7a37ac 100644
--- a/src/environments/environment.prod.ts
+++ b/src/environments/environment.prod.ts
@@ -52,6 +52,7 @@ export const environment = {
displayBackEndInfo: loadedEnv['displayBackEndInfo'] || 'true',
displayTenantSelector: loadedEnv['displayTenantSelector'] || 'true',
+ tenantLogoUrl: loadedEnv['tenantLogoUrl'] || 'assets/images/mifos_lg-logo.png',
// Time in seconds, default 60 seconds
waitTimeForNotifications: loadedEnv['waitTimeForNotifications'] || 60,
// Time in seconds, default 30 seconds
diff --git a/src/environments/environment.ts b/src/environments/environment.ts
index 78b8d25d8..c64c95606 100644
--- a/src/environments/environment.ts
+++ b/src/environments/environment.ts
@@ -56,6 +56,7 @@ export const environment = {
displayBackEndInfo: loadedEnv.displayBackEndInfo || 'true',
displayTenantSelector: loadedEnv.displayTenantSelector || 'true',
+ tenantLogoUrl: loadedEnv.tenantLogoUrl || 'assets/images/mifos_lg-logo.png',
// Time in seconds, default 60 seconds
waitTimeForNotifications: loadedEnv.waitTimeForNotifications || 60,
// Time in seconds, default 30 seconds
diff --git a/src/theme/_dark_content.scss b/src/theme/_dark_content.scss
index 98edc8c98..e80105cd0 100644
--- a/src/theme/_dark_content.scss
+++ b/src/theme/_dark_content.scss
@@ -271,7 +271,8 @@ body.dark-theme {
// Home page logo styling for dark mode
mifosx-home {
- [src*='mifos_lg-logo.png'] {
+ [src*='mifos_lg-logo.png'],
+ [src$='_home.png'] {
content: url('../assets/images/white-mifos.png');
}
}