From 3b0f73ff057ffaed763a8eb63faad0d7b31d9b90 Mon Sep 17 00:00:00 2001 From: Soni Jay Date: Wed, 17 Dec 2025 17:48:57 +0530 Subject: [PATCH 1/3] refactor: use inject() for DI in HomeComponent (eslint fix) --- src/app/home/home.component.html | 7 +- src/app/home/home.component.ts | 15 ++++ src/app/shared/footer/footer.component.html | 78 +++++++++--------- src/app/shared/footer/footer.component.ts | 10 +++ .../{mifos_lg-logo.png => default_home.png} | Bin 5 files changed, 69 insertions(+), 41 deletions(-) rename src/assets/images/{mifos_lg-logo.png => default_home.png} (100%) diff --git a/src/app/home/home.component.html b/src/app/home/home.component.html index 9f1fc3d9d1..b0f73ce920 100644 --- a/src/app/home/home.component.html +++ b/src/app/home/home.component.html @@ -10,7 +10,10 @@
- {{ 'labels.text.Welcome' | translate }}, {{ username }}! + + {{ 'labels.text.Welcome' | translate }} {{ username }} {{ 'labels.text.To' | translate }} + {{ tenant | titlecase }}! + @@ -30,7 +33,7 @@ - Mifos X + Mifos X
diff --git a/src/app/home/home.component.ts b/src/app/home/home.component.ts index 52b3750005..076eaf5541 100644 --- a/src/app/home/home.component.ts +++ b/src/app/home/home.component.ts @@ -16,6 +16,7 @@ import { WarningDialogComponent } from './warning-dialog/warning-dialog.componen import { AuthenticationService } from '../core/authentication/authentication.service'; import { PopoverService } from '../configuration-wizard/popover/popover.service'; import { ConfigurationWizardService } from '../configuration-wizard/configuration-wizard.service'; +import { SettingsService } from 'app/settings/settings.service'; /** Custom Components */ import { NextStepDialogComponent } from '../configuration-wizard/next-step-dialog/next-step-dialog.component'; @@ -50,9 +51,12 @@ export class HomeComponent implements OnInit, AfterViewInit { private dialog = inject(MatDialog); private configurationWizardService = inject(ConfigurationWizardService); private popoverService = inject(PopoverService); + private settingsService = inject(SettingsService); /** Username of authenticated user. */ username: string; + /** Tenant name */ + tenant: string; /** Activity Form. */ activityForm: any; /** Search Text. */ @@ -71,6 +75,9 @@ export class HomeComponent implements OnInit, AfterViewInit { /* Template for popover on search activity */ @ViewChild('templateSearchActivity', { static: false }) templateSearchActivity: TemplateRef; + // No constructor needed; dependencies are injected via inject(). + constructor() {} + /** * Sets the username of the authenticated user. * Set Form. @@ -78,6 +85,7 @@ export class HomeComponent implements OnInit, AfterViewInit { ngOnInit() { const credentials = this.authenticationService.getCredentials(); this.username = credentials.username; + this.tenant = this.tenantIdentifier(); this.setFilteredActivities(); if (!this.authenticationService.hasDialogBeenShown()) { this.dialog.open(WarningDialogComponent); @@ -183,4 +191,11 @@ export class HomeComponent implements OnInit, AfterViewInit { this.router.onSameUrlNavigation = 'reload'; this.router.navigate(['/home']); } + + tenantIdentifier() { + if (!this.settingsService.tenantIdentifier || this.settingsService.tenantIdentifier === '') { + return 'default'; + } + return this.settingsService.tenantIdentifier; + } } diff --git a/src/app/shared/footer/footer.component.html b/src/app/shared/footer/footer.component.html index 66c48c161a..ec59f71ba4 100644 --- a/src/app/shared/footer/footer.component.html +++ b/src/app/shared/footer/footer.component.html @@ -1,41 +1,41 @@ -@if (displayBackEndInfo) { -