aboutsummaryrefslogtreecommitdiffstats
path: root/catalog-ui/src/app/ng2/pages/properties-assignment/properties.utils.ts
diff options
context:
space:
mode:
authorTal Gitelman <tg851x@intl.att.com>2017-06-29 19:30:00 +0300
committerMichael Lando <ml636r@att.com>2017-06-29 21:32:19 +0300
commited7e1c3dfe332abc67ed943717db2ee94406f95e (patch)
treee0f2f39596656456272900f59aadc3dff6c6e828 /catalog-ui/src/app/ng2/pages/properties-assignment/properties.utils.ts
parent68ccc45de18f41cddb79de33a245bceb3b063ffb (diff)
[SDC] rebase code
Change-Id: I456ec65a233d277e6bae35e140f2e3da5765bae6 Signed-off-by: Tal Gitelman <tg851x@intl.att.com> Signed-off-by: Michael Lando <ml636r@att.com>
Diffstat (limited to 'catalog-ui/src/app/ng2/pages/properties-assignment/properties.utils.ts')
-rw-r--r--catalog-ui/src/app/ng2/pages/properties-assignment/properties.utils.ts18
1 files changed, 9 insertions, 9 deletions
diff --git a/catalog-ui/src/app/ng2/pages/properties-assignment/properties.utils.ts b/catalog-ui/src/app/ng2/pages/properties-assignment/properties.utils.ts
index 0eb8534595..bdfbc4c402 100644
--- a/catalog-ui/src/app/ng2/pages/properties-assignment/properties.utils.ts
+++ b/catalog-ui/src/app/ng2/pages/properties-assignment/properties.utils.ts
@@ -20,8 +20,8 @@ export class PropertiesUtils {
*/
public convertPropertiesMapToFEAndCreateChildren = (instancePropertiesMap:InstanceBePropertiesMap, inputs:Array<InputFEModel>): InstanceFePropertiesMap => {
let instanceFePropertiesMap:InstanceFePropertiesMap = new InstanceFePropertiesMap();
- angular.forEach(instancePropertiesMap, (properties:Array<PropertyBEModel>, instanceName:string) => {
- let instanceInputs: Array<InputFEModel> = inputs.filter(input => input.instanceName == instanceName.split('.').pop());
+ angular.forEach(instancePropertiesMap, (properties:Array<PropertyBEModel>, instanceId:string) => {
+ let instanceInputs: Array<InputFEModel> = inputs.filter(input => input.instanceUniqueId == instanceId);
let propertyFeArray: Array<PropertyFEModel> = [];
_.forEach(properties, (property: PropertyBEModel) => {
@@ -35,9 +35,9 @@ export class PropertiesUtils {
newFEProp.flattenedChildren = this.createFlattenedChildren(newFEProp.type, newFEProp.name);
}
if (instanceInputs.length) { //if this prop (or any children) are declared, set isDeclared and disable checkbox on parents/children
- instanceInputs.filter(input => input.propertyName == newFEProp.name).forEach((input) => {
- newFEProp.setAsDeclared(input.inputPath); //if a path was sent, its a child prop. this param is optional
- this.propertiesService.disableRelatedProperties(newFEProp, input.inputPath);
+ instanceInputs.filter(input => input.relatedProperty.name == newFEProp.name).forEach((input) => {
+ newFEProp.setAsDeclared(input.relatedProperty.nestedPath); //if a path was sent, its a child prop. this param is optional
+ this.propertiesService.disableRelatedProperties(newFEProp, input.relatedProperty.nestedPath);
});
}
this.initValueObjectRef(newFEProp); //initialize valueObj.
@@ -46,7 +46,7 @@ export class PropertiesUtils {
this.dataTypeService.checkForCustomBehavior(newFEProp);
}
});
- instanceFePropertiesMap[instanceName] = propertyFeArray;
+ instanceFePropertiesMap[instanceId] = propertyFeArray;
});
return instanceFePropertiesMap;
@@ -140,10 +140,10 @@ export class PropertiesUtils {
});
}
- public resetPropertyValue = (property: PropertyFEModel, newValue: string, inputPath?: string): void => {
+ public resetPropertyValue = (property: PropertyFEModel, newValue: string, nestedPath?: string): void => {
property.value = newValue;
- if (inputPath) {
- let newProp = property.flattenedChildren.find(prop => prop.propertiesName == inputPath);
+ if (nestedPath) {
+ let newProp = property.flattenedChildren.find(prop => prop.propertiesName == nestedPath);
newProp && this.assignFlattenedChildrenValues(JSON.parse(newValue), [newProp], property.name);
} else {
this.initValueObjectRef(property);