Skip to content

Commit

Permalink
feat: Display or Hide Tenant selector in Login view
Browse files Browse the repository at this point in the history
  • Loading branch information
Jose Alberto Hernandez authored and alberto-art3ch committed May 24, 2024
1 parent e20a672 commit 4972007
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 1 deletion.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,18 @@ MIFOS_WAIT_TIME_FOR_CATCHUP=30
```


Setting for display or hide the Tenant selector in the Login view (mainly for Production environments and for security reasons), Default true
```
MIFOS_DISPLAY_TENANT_SELECTOR=false
```


Setting for display or hide the Backend info (url) in the footer part (mainly for security reasons), Default true
```
MIFOS_DISPLAY_BACKEND_INFO=false
```


For more information look the env.sample file in the root directory of the project

## Want to help? [![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](https://github.com/openMF/web-app/issues)
Expand Down
2 changes: 1 addition & 1 deletion src/app/login/login.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ <h1 class="mat-display-1 cover-title">{{ 'APP_NAME' | translate}}</h1>
</div>

<!-- Tenant Identifier Name -->
<div fxLayout="row" fxLayoutAlign="center center" fxFlex="1 0 auto" *ngIf="!environment.production">
<div fxLayout="row" fxLayoutAlign="center center" fxFlex="1 0 auto" *ngIf="displayTenantSelector()">
<mifosx-tenant-selector></mifosx-tenant-selector>
</div>

Expand Down
4 changes: 4 additions & 0 deletions src/app/login/login.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,8 @@ export class LoginComponent implements OnInit, OnDestroy {
window.location.reload();
}

displayTenantSelector(): boolean {
return environment.displayTenantSelector === 'false' ? false : true;
}

}
3 changes: 3 additions & 0 deletions src/assets/env.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
// Display or not the BackEnd Info
window['env']['displayBackEndInfo'] = '';

// Display or not the Tenant Selector
window['env']['displayTenantSelector'] = '';

// Time in seconds for Notifications, default 60 seconds
window['env']['waitTimeForNotifications'] = '';

Expand Down
3 changes: 3 additions & 0 deletions src/assets/env.template.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
// Display or not the BackEnd Info
window['env']['displayBackEndInfo'] = '$MIFOS_DISPLAY_BACKEND_INFO';

// Display or not the Tenant Selector
window['env']['displayTenantSelector'] = '$MIFOS_DISPLAY_TENANT_SELECTOR';

// Time in seconds for Notifications, default 60 seconds
window['env']['waitTimeForNotifications'] = '$MIFOS_WAIT_TIME_FOR_NOTIFICATIONS';

Expand Down
1 change: 1 addition & 0 deletions src/environments/environment.prod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export const environment = {
defaultCharDelimiter: window['env']['defaultCharDelimiter'] || ',',

displayBackEndInfo: window['env']['displayBackEndInfo'] || 'true',
displayTenantSelector: window['env']['displayTenantSelector'] || 'true',
// Time in seconds, default 60 seconds
waitTimeForNotifications: window['env']['waitTimeForNotifications'] || 60,
// Time in seconds, default 30 seconds
Expand Down
1 change: 1 addition & 0 deletions src/environments/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export const environment = {
defaultCharDelimiter: window['env']['defaultCharDelimiter'] || ',',

displayBackEndInfo: window['env']['displayBackEndInfo'] || 'true',
displayTenantSelector: window['env']['displayTenantSelector'] || 'true',
// Time in seconds, default 60 seconds
waitTimeForNotifications: window['env']['waitTimeForNotifications'] || 60,
// Time in seconds, default 30 seconds
Expand Down

0 comments on commit 4972007

Please sign in to comment.