feat: add support for runtime server url changes (#1271)

Fixes: #786
Fixes: #1229
This commit is contained in:
Karan Takalkar
2020-11-19 12:03:12 +05:30
committed by GitHub
parent 5f90bc00bd
commit 8271eb00ac
14 changed files with 145 additions and 11 deletions
@@ -120,7 +120,7 @@ export class ClientAddressStepComponent {
* @param {any} address Address
*/
getSelectedValue(fieldName: any, fieldId: any) {
return (this.clientTemplate.address[fieldName].find((fieldObj: any) => fieldObj.id === fieldId));
return (this.clientTemplate.address[0][fieldName].find((fieldObj: any) => fieldObj.id === fieldId));
}
/**
@@ -133,7 +133,7 @@ export class ClientAddressStepComponent {
controlName: 'addressTypeId',
label: 'Address Type',
value: address ? address.addressTypeId : '',
options: { label: 'name', value: 'id', data: this.clientTemplate.address.addressTypeIdOptions },
options: { label: 'name', value: 'id', data: this.clientTemplate.address[0].addressTypeIdOptions },
order: 1,
required: true
}) : null);
@@ -184,7 +184,7 @@ export class ClientAddressStepComponent {
controlName: 'stateProvinceId',
label: 'State / Province',
value: address ? address.stateProvinceId : '',
options: { label: 'name', value: 'id', data: this.clientTemplate.address.stateProvinceIdOptions },
options: { label: 'name', value: 'id', data: this.clientTemplate.address[0].stateProvinceIdOptions },
order: 8
}) : null);
formfields.push(this.isFieldEnabled('countyDistrict') ? new InputBase({
@@ -198,7 +198,7 @@ export class ClientAddressStepComponent {
controlName: 'countryId',
label: 'Country',
value: address ? address.countryId : '',
options: { label: 'name', value: 'id', data: this.clientTemplate.address.countryIdOptions },
options: { label: 'name', value: 'id', data: this.clientTemplate.address[0].countryIdOptions },
order: 10
}) : null);
formfields.push(this.isFieldEnabled('postalCode') ? new InputBase({
@@ -30,7 +30,7 @@ export class ClientPreviewStepComponent {
* @param {any} fieldId Field Id
*/
getSelectedValue(fieldName: any, fieldId: any) {
return (this.clientTemplate.address[fieldName].find((fieldObj: any) => fieldObj.id === fieldId));
return (this.clientTemplate.address[0][fieldName].find((fieldObj: any) => fieldObj.id === fieldId));
}
/**