WEB-457 Tenant aware feature (#2854)

* refactor: use inject() for DI in HomeComponent (eslint fix)

* Tenant Fix

* fix: JSON syntax in translation file
This commit is contained in:
Soni Jay
2025-12-17 10:53:45 -06:00
committed by GitHub
parent 4220abcb56
commit 79d0608491
18 changed files with 95 additions and 41 deletions
+39 -39
View File
@@ -1,41 +1,41 @@
@if (displayBackEndInfo) {
<div class="layout-column m-b-20 f12" ngClass="{{ styleClass }}" id="footer">
<mat-divider class="divider align-center"></mat-divider>
<div class="layout-column m-b-20 content-wrapper footer-center">
<table class="versions">
<tr>
<td class="footer-content">Mifos</td>
<td class="right footer-content">
{{ versions.mifos }} - <b>{{ hash }}</b>
</td>
</tr>
<tr>
<td class="footer-content">{{ 'labels.text.Fineract' | translate }}</td>
<td class="right footer-content">
{{ versions.fineract.version }} - <b>{{ versions.fineract.hash }}</b>
</td>
</tr>
@if (displayBackEndInfo) {
<tr>
<td class="footer-content">{{ 'labels.inputs.Server' | translate }}</td>
<td class="right footer-content">
{{ server }}
</td>
</tr>
}
@if (isBusinessDateDefined) {
<tr>
<td class="footer-content">{{ 'labels.text.Current Business Date' | translate }}:</td>
<td class="center footer-content business-date">
<b>{{ businessDate | date: 'EEEE, MMMM dd, y' }}</b>
</td>
</tr>
}
</table>
</div>
<mat-divider class="divider align-center"></mat-divider>
<div class="layout-column m-b-20 f12" ngClass="{{ styleClass }}" id="footer" *ngIf="displayBackEndInfo">
<mat-divider class="divider align-center"></mat-divider>
<div class="layout-column m-b-20 content-wrapper footer-center">
<table class="versions">
<tr>
<td class="footer-content">Tenant</td>
<td class="right footer-content">
{{ tenant | titlecase }}
</td>
</tr>
<tr>
<td class="footer-content">Mifos</td>
<td class="right footer-content">
{{ versions.mifos }} - <b>{{ hash }}</b>
</td>
</tr>
<tr>
<td class="footer-content">{{ 'labels.text.Fineract' | translate }}</td>
<td class="right footer-content">
{{ versions.fineract.version }} - <b>{{ versions.fineract.hash }}</b>
</td>
</tr>
<tr *ngIf="displayBackEndInfo">
<td class="footer-content">{{ 'labels.inputs.Server' | translate }}</td>
<td class="right footer-content">
{{ server }}
</td>
</tr>
<tr *ngIf="isBusinessDateDefined">
<td class="footer-content">{{ 'labels.text.Current Business Date' | translate }}:</td>
<td class="center footer-content business-date">
<b>{{ businessDate | date: 'EEEE, MMMM dd, y' }}</b>
</td>
</tr>
</table>
</div>
<div class="layout-column m-b-20 copy-label">
<p class="footer-content align-center">{{ 'APP_NAME' | translate }} {{ 'labels.text.by' | translate }} Mifos</p>
</div>
}
<div class="layout-column m-b-20 copy-label">
<p class="footer-content align-center">{{ 'APP_NAME' | translate }} {{ 'labels.text.by' | translate }} Mifos</p>
</div>
+10
View File
@@ -52,6 +52,8 @@ export class FooterComponent implements OnInit, OnDestroy {
server = '';
/** Business Date */
businessDate: Date = null;
/** Tenant name */
tenant: string;
isBusinessDateEnabled = false;
isBusinessDateDefined = false;
@@ -87,6 +89,7 @@ export class FooterComponent implements OnInit, OnDestroy {
});
this.getConfigurations();
this.server = this.settingsService.server;
this.tenant = this.tenantIdentifier();
this.versionService.getBackendInfo().subscribe((data: any) => {
if (data.git && data.git.build && data.git.build.version) {
const buildVersion: string = data.git.build.version.split('-');
@@ -97,6 +100,13 @@ export class FooterComponent implements OnInit, OnDestroy {
}
}
tenantIdentifier() {
if (!this.settingsService.tenantIdentifier || this.settingsService.tenantIdentifier === '') {
return 'default';
}
return this.settingsService.tenantIdentifier;
}
ngOnDestroy() {
if (this.displayBackEndInfo) {
clearTimeout(this.timer);