feat (clients): add client's address page

fixes: #258
This commit is contained in:
Jivjyot Singh
2019-12-01 23:20:51 +03:00
committed by Abhay Chawla
parent 636ccb74b0
commit d18097107a
13 changed files with 259 additions and 4 deletions
@@ -0,0 +1,38 @@
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
@Component({
selector: 'mifosx-address-tab',
templateUrl: './address-tab.component.html',
styleUrls: ['./address-tab.component.scss']
})
export class AddressTabComponent implements OnInit {
clientAddressData: any;
clientAddressFieldConfig: any;
clientAddressTemplate: any;
constructor(private route: ActivatedRoute) {
this.route.data.subscribe((data: {
clientAddressData: any,
clientAddressFieldConfig: any,
clientAddressTemplateData: any
}) => {
this.clientAddressData = data.clientAddressData;
this.clientAddressFieldConfig = data.clientAddressFieldConfig;
this.clientAddressTemplate = data.clientAddressTemplateData;
});
}
ngOnInit() {
}
isFieldEnabled(fieldName: any) {
return (this.clientAddressFieldConfig.find((fieldObj: any) => fieldObj.field === fieldName)).is_enabled;
}
getSelectedValue(fieldName: any, fieldId: any) {
return (this.clientAddressTemplate[fieldName].find((fieldObj: any) => fieldObj.id === fieldId));
}
}