diff --git a/README.md b/README.md index 1f1f21e7c..e304dbb05 100644 --- a/README.md +++ b/README.md @@ -133,11 +133,17 @@ https://localhost:8443 ``` FINERACT_PLATFORM_TENANT_IDENTIFIER ``` -Fineract Tenant identifier to be used, It must be aligned with the Fineract `tenants` table. Default value: +Fineract Tenant identifier to be used by default, It must be aligned with the Fineract `tenants` table. Default value: ``` default ``` +``` +FINERACT_PLATFORM_TENANTS_IDENTIFIER +``` +Fineract Tenant identifier list to be used, Those must be aligned with the Fineract `tenants` table. + + Setting for Languages (i18n) still under development ``` MIFOS_DEFAULT_LANGUAGE=en-US diff --git a/env.sample b/env.sample index 72a105baf..87ff2572c 100644 --- a/env.sample +++ b/env.sample @@ -1,4 +1,5 @@ +# Fineract URLs list delimited by colon FINERACT_API_URLS=https://dev.mifos.io,https://demo.mifos.io,https://qa.mifos.io,https://staging.mifos.io,https://mobile.mifos.io,https://demo.fineract.dev,https://localhost:8443 FINERACT_API_URL=https://localhost:8443 @@ -9,6 +10,9 @@ FINERACT_API_VERSION=/v1 FINERACT_PLATFORM_TENANT_IDENTIFIER=default +# Tenant Identifiers list delimited by colon +FINERACT_PLATFORM_TENANTS_IDENTIFIER=default + MIFOS_DEFAULT_LANGUAGE=en-US MIFOS_SUPPORTED_LANGUAGES=en-US,fr-FR diff --git a/src/app/clients/create-client/create-client.component.ts b/src/app/clients/create-client/create-client.component.ts index 8caa47095..d78d4128f 100644 --- a/src/app/clients/create-client/create-client.component.ts +++ b/src/app/clients/create-client/create-client.component.ts @@ -100,12 +100,12 @@ export class CreateClientComponent { setDatatables(): void { this.datatables = []; - let legalFormTypeVal = 'Person'; + let legalFormTypeVal = 'person'; if (this.legalFormType === 2) { - legalFormTypeVal = 'Entity'; + legalFormTypeVal = 'entity'; } this.clientTemplate.datatables.forEach((datatable: any) => { - if (datatable.entitySubType === legalFormTypeVal) { + if (datatable.entitySubType.toLowerCase() === legalFormTypeVal) { this.datatables.push(datatable); } }); diff --git a/src/app/core/authentication/authentication.interceptor.ts b/src/app/core/authentication/authentication.interceptor.ts index b5a060209..44c460754 100644 --- a/src/app/core/authentication/authentication.interceptor.ts +++ b/src/app/core/authentication/authentication.interceptor.ts @@ -5,10 +5,11 @@ import { HttpEvent, HttpInterceptor, HttpHandler, HttpRequest } from '@angular/c /** rxjs Imports */ import { Observable } from 'rxjs'; -/** Environment Configuration */ +/** Custom Imports */ import { environment } from '../../../environments/environment'; +import { SettingsService } from 'app/settings/settings.service'; -/** Http request options headers. */ +/** Http request (default) options headers. */ const httpOptions = { headers: { 'Fineract-Platform-TenantId': environment.fineractPlatformTenantId @@ -26,12 +27,15 @@ const twoFactorAccessTokenHeader = 'Fineract-Platform-TFA-Token'; @Injectable() export class AuthenticationInterceptor implements HttpInterceptor { - constructor() {} + constructor(private settingsService: SettingsService) {} /** * Intercepts a Http request and sets the request headers. */ intercept(request: HttpRequest, next: HttpHandler): Observable> { + if (this.settingsService.tenantIdentifier) { + httpOptions.headers['Fineract-Platform-TenantId'] = this.settingsService.tenantIdentifier; + } request = request.clone({ setHeaders: httpOptions.headers }); return next.handle(request); } diff --git a/src/app/core/shell/sidenav/sidenav.component.html b/src/app/core/shell/sidenav/sidenav.component.html index 981fc814f..207d76a72 100644 --- a/src/app/core/shell/sidenav/sidenav.component.html +++ b/src/app/core/shell/sidenav/sidenav.component.html @@ -17,7 +17,7 @@ app-user-photo - {{ username }} + {{ tenantIdentifier }} / {{ username }}
+ +
+ +
+