Skip to content

Commit 4397a88

Browse files
IOhackerJaySoni1
authored andcommitted
WEB-457: Tenant aware feature
1 parent 9ded425 commit 4397a88

File tree

18 files changed

+64
-3
lines changed

18 files changed

+64
-3
lines changed

src/app/home/home.component.html

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@
1010
<div class="container">
1111
<mat-card>
1212
<mat-card-header>
13-
<mat-card-title class="title"> {{ 'labels.text.Welcome' | translate }}, {{ username }}! </mat-card-title>
13+
<mat-card-title class="title">
14+
{{ 'labels.text.Welcome' | translate }} {{ username }} {{ 'labels.text.To' | translate }}
15+
{{ tenant | titlecase }}!
16+
</mat-card-title>
1417
</mat-card-header>
1518

1619
<mat-card-content #searchActivity>
@@ -28,7 +31,7 @@
2831
</mat-autocomplete>
2932
</mat-card-content>
3033

31-
<img mat-card-image src="assets/images/mifos_lg-logo.png" alt="Mifos X" />
34+
<img mat-card-image src="assets/images/{{ tenant }}_home.png" alt="Mifos X" />
3235
</mat-card>
3336
</div>
3437

src/app/home/home.component.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import { WarningDialogComponent } from './warning-dialog/warning-dialog.componen
1616
import { AuthenticationService } from '../core/authentication/authentication.service';
1717
import { PopoverService } from '../configuration-wizard/popover/popover.service';
1818
import { ConfigurationWizardService } from '../configuration-wizard/configuration-wizard.service';
19+
import { SettingsService } from 'app/settings/settings.service';
1920

2021
/** Custom Components */
2122
import { NextStepDialogComponent } from '../configuration-wizard/next-step-dialog/next-step-dialog.component';
@@ -46,6 +47,8 @@ import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
4647
export class HomeComponent implements OnInit, AfterViewInit {
4748
/** Username of authenticated user. */
4849
username: string;
50+
/** Tenant name */
51+
tenant: string;
4952
/** Activity Form. */
5053
activityForm: any;
5154
/** Search Text. */
@@ -71,14 +74,16 @@ export class HomeComponent implements OnInit, AfterViewInit {
7174
* @param {MatDialog} dialog MatDialog.
7275
* @param {ConfigurationWizardService} configurationWizardService ConfigurationWizard Service.
7376
* @param {PopoverService} popoverService PopoverService.
77+
* @param {SettingsService} settingsService SettingsService.
7478
*/
7579
constructor(
7680
private authenticationService: AuthenticationService,
7781
private activatedRoute: ActivatedRoute,
7882
private router: Router,
7983
private dialog: MatDialog,
8084
private configurationWizardService: ConfigurationWizardService,
81-
private popoverService: PopoverService
85+
private popoverService: PopoverService,
86+
private settingsService: SettingsService
8287
) {}
8388

8489
/**
@@ -88,6 +93,7 @@ export class HomeComponent implements OnInit, AfterViewInit {
8893
ngOnInit() {
8994
const credentials = this.authenticationService.getCredentials();
9095
this.username = credentials.username;
96+
this.tenant = this.tenantIdentifier();
9197
this.setFilteredActivities();
9298
if (!this.authenticationService.hasDialogBeenShown()) {
9399
this.dialog.open(WarningDialogComponent);
@@ -193,4 +199,11 @@ export class HomeComponent implements OnInit, AfterViewInit {
193199
this.router.onSameUrlNavigation = 'reload';
194200
this.router.navigate(['/home']);
195201
}
202+
203+
tenantIdentifier() {
204+
if (!this.settingsService.tenantIdentifier || this.settingsService.tenantIdentifier === '') {
205+
return 'default';
206+
}
207+
return this.settingsService.tenantIdentifier;
208+
}
196209
}

src/app/shared/footer/footer.component.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22
<mat-divider class="divider align-center"></mat-divider>
33
<div class="layout-column m-b-20 content-wrapper footer-center">
44
<table class="versions">
5+
<tr>
6+
<td class="footer-content">Tenant</td>
7+
<td class="right footer-content">
8+
{{ tenant | titlecase }}
9+
</td>
10+
</tr>
511
<tr>
612
<td class="footer-content">Mifos</td>
713
<td class="right footer-content">

src/app/shared/footer/footer.component.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ export class FooterComponent implements OnInit, OnDestroy {
4545
server = '';
4646
/** Business Date */
4747
businessDate: Date = null;
48+
/** Tenant name */
49+
tenant: string;
4850

4951
isBusinessDateEnabled = false;
5052
isBusinessDateDefined = false;
@@ -87,6 +89,7 @@ export class FooterComponent implements OnInit, OnDestroy {
8789
});
8890
this.getConfigurations();
8991
this.server = this.settingsService.server;
92+
this.tenant = this.tenantIdentifier();
9093
this.versionService.getBackendInfo().subscribe((data: any) => {
9194
if (data.git && data.git.build && data.git.build.version) {
9295
const buildVersion: string = data.git.build.version.split('-');
@@ -97,6 +100,13 @@ export class FooterComponent implements OnInit, OnDestroy {
97100
}
98101
}
99102

103+
tenantIdentifier() {
104+
if (!this.settingsService.tenantIdentifier || this.settingsService.tenantIdentifier === '') {
105+
return 'default';
106+
}
107+
return this.settingsService.tenantIdentifier;
108+
}
109+
100110
ngOnDestroy() {
101111
if (this.displayBackEndInfo) {
102112
clearTimeout(this.timer);

src/assets/translations/cs-CS.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3338,6 +3338,8 @@
33383338
"Mandatory": "Povinné",
33393339
"Voluntary": "Dobrovolný",
33403340
"Write a note": "Napište poznámku",
3341+
"Tenant": "Nájemce: ",
3342+
"TO": "do",
33413343
"“Maker-Checker” principle requires every tasks": "Princip „Maker-Checker“ vyžaduje, aby každý úkol prováděli dva lidé, aby se snížila pravděpodobnost chyb a zneužití. Jedna osoba proces iniciuje a druhá jej dokončí.",
33423344
"Buy Down Fees": "Poplatky za odkup"
33433345
},

src/assets/translations/de-DE.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3337,6 +3337,8 @@
33373337
"Mandatory": "Obligatorisch",
33383338
"Voluntary": "Freiwillig",
33393339
"Write a note": "Schreib eine Notitz",
3340+
"Tenant": "Mieter",
3341+
"To": "zu",
33403342
"“Maker-Checker” principle requires every tasks": "Das „Maker-Checker“-Prinzip erfordert, dass jede Aufgabe von zwei Personen erledigt wird, um das Risiko von Fehlern und Missbrauch zu verringern. Eine Person leitet den Prozess ein und die zweite Person schließt ihn ab.",
33413343
"Buy Down Fees": "Kaufgebühren"
33423344
},

src/assets/translations/en-US.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3340,6 +3340,7 @@
33403340
"This shows all the notifications.": "This shows all the notifications.",
33413341
"This will navigate the user to the dashboard component.": "This will navigate the user to the dashboard component.",
33423342
"This will navigate the user to the searched activity.": "This will navigate the user to the searched activity.",
3343+
"To": "to",
33433344
"To add or remove a task from the Maker-Checker list": "To add or remove a task from the Maker-Checker list.",
33443345
"To create a new role": "To create a new role.",
33453346
"To create additional codes.": "To create additional codes.",
@@ -3444,6 +3445,8 @@
34443445
"Mandatory": "Mandatory",
34453446
"Voluntary": "Voluntary",
34463447
"Write a note": "Write a note",
3448+
"Tenant": "Tenant",
3449+
"To": "to",
34473450
"“Maker-Checker” principle requires every tasks": "The “Maker-Checker” principle requires every tasks to be completed by two people to reduce the chance of errors and misuse. One person initiates the process and the second completes it.",
34483451
"Buy Down Fees": "Buy Down Fees",
34493452
"Undo Write-off Description": "This action will reverse the write-off transaction and restore the loan to its previous active status. Please provide a note explaining the reason for this action."

src/assets/translations/es-CL.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3236,6 +3236,7 @@
32363236
"This will navigate the user to the dashboard component.": "Esto llevará al usuario al componente del tablero.",
32373237
"This will navigate the user to the searched activity.": "Esto llevará al usuario a la actividad buscada.",
32383238
"To add or remove a task from the Maker-Checker list": "Para agregar o eliminar una tarea de la lista de Maker-Checker.",
3239+
"To": "a",
32393240
"To create a new role": "Para crear un nuevo rol.",
32403241
"To create code,create": "Para crear código, haga clic en crear código e ingrese el nombre del código.",
32413242
"To define new mapping.": "Para definir un nuevo mapeo.",
@@ -3338,6 +3339,8 @@
33383339
"Mandatory": "Obligatorio",
33393340
"Voluntary": "Voluntario",
33403341
"Write a note": "Escribe una nota",
3342+
"Tenant": "Inquilino",
3343+
"To": "a",
33413344
"“Maker-Checker” principle requires every tasks": "El principio \"Maker-Checker\" requiere que dos personas completen cada tarea para reducir la posibilidad de errores y uso indebido. Una persona inicia el proceso y la segunda lo completa.",
33423345
"Buy Down Fees": "Tarifas de compra"
33433346
},

src/assets/translations/es-MX.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3237,6 +3237,7 @@
32373237
"This shows all the notifications.": "Esto muestra todas las notificaciones.",
32383238
"This will navigate the user to the dashboard component.": "Esto llevará al usuario al componente del tablero.",
32393239
"This will navigate the user to the searched activity.": "Esto llevará al usuario a la actividad buscada.",
3240+
"To": "a",
32403241
"To add or remove a task from the Maker-Checker list": "Para agregar o eliminar una tarea de la lista de Maker-Checker.",
32413242
"To create a new role": "Para crear un nuevo rol.",
32423243
"To create code,create": "Para crear código, haga clic en crear código e ingrese el nombre del código.",
@@ -3340,6 +3341,8 @@
33403341
"Mandatory": "Obligatorio",
33413342
"Voluntary": "Voluntario",
33423343
"Write a note": "Escribe una nota",
3344+
"Tenant": "Inquilino",
3345+
"To": "a",
33433346
"“Maker-Checker” principle requires every tasks": "El principio \"Maker-Checker\" requiere que dos personas completen cada tarea para reducir la posibilidad de errores y uso indebido. Una persona inicia el proceso y la segunda lo completa.",
33443347
"Buy Down Fees": "Tarifas de compra"
33453348
},

0 commit comments

Comments
 (0)