aboutsummaryrefslogtreecommitdiffstats
path: root/catalog-ui
diff options
context:
space:
mode:
authorMichael Lando <ml636r@att.com>2017-07-16 18:39:35 +0000
committerGerrit Code Review <gerrit@onap.org>2017-07-16 18:39:35 +0000
commitdec02e7cc74e1c401be51bd9d266575e1e008f5f (patch)
treedda1c4c7f6993340cacac6f4256a27d6b090d2ea /catalog-ui
parente092947029e4920ab96e9321e1c44be3777d8081 (diff)
parentadc29b887ccdfed63cd97e942ae6ac594d3bc44e (diff)
Merge "[sdc] - merged 1707_build into sdc LF"
Diffstat (limited to 'catalog-ui')
-rw-r--r--catalog-ui/src/app/ng2/pages/properties-assignment/properties.utils.ts16
1 files changed, 8 insertions, 8 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 a3507feb6f..f876af7f8a 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
@@ -56,21 +56,21 @@ export class PropertiesUtils {
if (newFEProp.getInputValues && newFEProp.getInputValues.length) { //if this prop (or any children) are declared, set isDeclared and disable checkbox on parents/children
newFEProp.getInputValues.forEach(propInputDetail => {
let inputPath = propInputDetail.inputPath;
- if (!isVF && !inputPath) { //TODO: this is a workaround until Marina adds inputPath
+ if (!inputPath) { //TODO: this is a workaround until Marina adds inputPath
let input = inputs.find(input => input.uniqueId == propInputDetail.inputId);
if (!input) { console.log("CANNOT FIND INPUT FOR " + propInputDetail.inputId); return; }
else inputPath = input.inputPath;
}
- if (isVF || inputPath == newFEProp.name) inputPath = undefined;
+ if (inputPath == newFEProp.name) inputPath = undefined; // if not complex we need to remove the inputPath from FEModel so we not look for a child
newFEProp.setAsDeclared(inputPath); //if a path is sent, its a child prop. this param is optional
this.propertiesService.disableRelatedProperties(newFEProp, inputPath);
});
- }
+ }
this.initValueObjectRef(newFEProp); //initialize valueObj.
propertyFeArray.push(newFEProp);
newFEProp.updateExpandedChildPropertyId(newFEProp.name); //display only the first level of children
this.dataTypeService.checkForCustomBehavior(newFEProp);
- }
+ }
});
instanceFePropertiesMap[instanceId] = propertyFeArray;
@@ -101,8 +101,8 @@ export class PropertiesUtils {
this.dataTypeService.getDerivedDataTypeProperties(dataTypeObj, tempProps, parentName);
return tempProps;
}
-
- /* Sets the valueObj of parent property and its children.
+
+ /* Sets the valueObj of parent property and its children.
* Note: This logic is different than assignflattenedchildrenvalues - here we merge values, there we pick either the parents value, props value, or default value - without merging.
*/
public initValueObjectRef = (property: PropertyFEModel): void => {
@@ -138,7 +138,7 @@ export class PropertiesUtils {
let propNameInObj = prop.propertiesName.substring(prop.propertiesName.indexOf(parentName) + parentName.length + 1).split('#').join('.'); //extract everything after parent name
prop.valueObj = _.get(parentValueJSON, propNameInObj, prop.value || prop.defaultValue); //assign value -first value of parent if exists. If not, prop.value if not, prop.defaultvalue
-
+
if ((prop.derivedDataType == DerivedPropertyType.SIMPLE || prop.isDeclared) && typeof prop.valueObj == 'object') { //Stringify objects that should be strings
prop.valueObj = JSON.stringify(prop.valueObj);
} else { //parse strings that should be objects
@@ -148,7 +148,7 @@ export class PropertiesUtils {
prop.valueObj = JSON.parse(prop.valueObj || '[]');
} else if (prop.derivedDataType == DerivedPropertyType.MAP && typeof prop.valueObj != 'object' && (!prop.isChildOfListOrMap || !prop.schema.property.isSimpleType)) { //dont parse values for children of map of simple
prop.valueObj = JSON.parse(prop.valueObj || '{}');
- }
+ }
if ((prop.derivedDataType == DerivedPropertyType.LIST || prop.derivedDataType == DerivedPropertyType.MAP) && typeof prop.valueObj == 'object' && Object.keys(prop.valueObj).length) {
let newProps: Array<DerivedFEProperty> = [];
Object.keys(prop.valueObj).forEach((key) => {