Fineract backend settings with environment variables
This commit is contained in:
committed by
Arnold Gálovics
parent
1b72136411
commit
14ceb4f3fd
@@ -1,4 +1,9 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { Alert } from 'app/core/alert/alert.model';
|
||||
import { AlertService } from 'app/core/alert/alert.service';
|
||||
import { SettingsService } from 'app/settings/settings.service';
|
||||
import { Subscription } from 'rxjs';
|
||||
import { SystemService } from '../system.service';
|
||||
|
||||
@Component({
|
||||
selector: 'mifosx-configurations',
|
||||
@@ -6,10 +11,31 @@ import { Component, OnInit } from '@angular/core';
|
||||
styleUrls: ['./configurations.component.scss']
|
||||
})
|
||||
export class ConfigurationsComponent implements OnInit {
|
||||
/** Subscription to alerts. */
|
||||
alert$: Subscription;
|
||||
|
||||
constructor() { }
|
||||
isBusinessDateEnabled = false;
|
||||
|
||||
constructor(private alertService: AlertService,
|
||||
private systemService: SystemService) { }
|
||||
|
||||
ngOnInit(): void {
|
||||
this.alert$ = this.alertService.alertEvent.subscribe((alertEvent: Alert) => {
|
||||
const alertType = alertEvent.type;
|
||||
if (alertType === SettingsService.businessDateType + ' Set Config') {
|
||||
this.isBusinessDateEnabled = (alertEvent.message === 'enabled') ? true : false;
|
||||
}
|
||||
});
|
||||
this.getConfigurations();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the Configuration and the Business Date data
|
||||
*/
|
||||
getConfigurations(): void {
|
||||
this.systemService.getConfigurationByName(SettingsService.businessDateConfigName)
|
||||
.subscribe((configurationData: any) => {
|
||||
this.isBusinessDateEnabled = configurationData.enabled;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user