Skip to content

Commit 87f1639

Browse files
EmanuelCR03Soporte
andauthored
WEB-313 Fix server selector (#2656)
Co-authored-by: Soporte <[email protected]>
1 parent 5e7fb67 commit 87f1639

File tree

7 files changed

+14
-8
lines changed

7 files changed

+14
-8
lines changed

src/app/login/login.component.html

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,7 @@ <h1 class="mat-display-1 cover-title">{{ 'APP_NAME' | translate }}</h1>
4343
<div class="layout-row-reverse">
4444
<mifosx-language-selector class="p-t-10 p-r-10 width-40"></mifosx-language-selector>
4545
<mifosx-theme-toggle class="p-t-10"></mifosx-theme-toggle>
46-
<mifosx-server-selector
47-
class="p-t-10"
48-
*ngIf="!environment.production && environment.allowServerSwitch"
49-
></mifosx-server-selector>
46+
<mifosx-server-selector class="p-t-10" *ngIf="allowServerSwitch()"></mifosx-server-selector>
5047
</div>
5148

5249
<!-- Logo with Organization Name -->

src/app/login/login.component.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,4 +110,8 @@ export class LoginComponent implements OnInit, OnDestroy {
110110
displayTenantSelector(): boolean {
111111
return environment.displayTenantSelector === 'false' ? false : true;
112112
}
113+
114+
allowServerSwitch(): boolean {
115+
return environment.allowServerSwitch === 'false' ? false : true;
116+
}
113117
}

src/assets/env.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@
2020
// Char delimiter to Export CSV options: ',' ';' '|' ' '
2121
window['env']['defaultCharDelimiter'] = '';
2222

23+
// Display or not the Server Selector
24+
window['env']['allowServerSwitch'] = '';
25+
2326
// Display or not the BackEnd Info
2427
window['env']['displayBackEndInfo'] = '';
2528

src/assets/env.template.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@
2020
// Char delimiter to Export CSV options: ',' ';' '|' ' '
2121
window['env']['defaultCharDelimiter'] = '$MIFOS_DEFAULT_CHAR_DELIMITER';
2222

23+
// Display or not the Server Selector
24+
window['env']['allowServerSwitch'] = '$MIFOS_ALLOW_SERVER_SWITCH_SELECTOR';
25+
2326
// Display or not the BackEnd Info
2427
window['env']['displayBackEndInfo'] = '$MIFOS_DISPLAY_BACKEND_INFO';
2528

src/environments/.env.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ export default {
44
'mifos_x': {
55
'version': '250828',
66
'hash': 'b92f79e2'
7-
},
8-
'allow_switching_backend_instance': true
7+
}
98
};
109
/* tslint:enable */

src/environments/environment.prod.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export const environment = {
2020
loadedEnv['fineractApiUrl'] ||
2121
(loadedEnv['fineractApiUrls']?.length > 0 ? loadedEnv['fineractApiUrls'].split(',')[0] : window.location.origin),
2222
oauthServerUrl: loadedEnv['oauthServerUrl'] || loadedEnv['fineractApiUrl'] + loadedEnv['apiProvider'],
23-
allowServerSwitch: env.allow_switching_backend_instance,
23+
allowServerSwitch: loadedEnv.allowServerSwitch || 'true',
2424
apiProvider: loadedEnv['apiProvider'] || '/fineract-provider/api',
2525
apiVersion: loadedEnv['apiVersion'] || '/v1',
2626
serverUrl: '',

src/environments/environment.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export const environment = {
2424
baseApiUrl:
2525
loadedEnv.fineractApiUrl ||
2626
(loadedEnv.fineractApiUrls?.length > 0 ? loadedEnv.fineractApiUrls.split(',')[0] : window.location.origin),
27-
allowServerSwitch: env.allow_switching_backend_instance,
27+
allowServerSwitch: loadedEnv.allowServerSwitch || 'true',
2828
apiProvider: loadedEnv.apiProvider || '/fineract-provider/api',
2929
apiVersion: loadedEnv.apiVersion || '/v1',
3030
serverUrl: '',

0 commit comments

Comments
 (0)