Issue-ID: SDC-4555
Signed-off-by: JvD_Ericsson <jeff.van.dam@est.tech>
Change-Id: Ia6d299e64480ec9c7aa72e18936344ff5bccf249
* 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 => {
* 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 => {
property.resetValueObjValidation();
if (property.isDeclared) { //if property is declared, it gets a simple input instead. List and map values and pseudo-children will be handled in property component
property.valueObj = property.value || property.defaultValue || null; // use null for empty value object
property.resetValueObjValidation();
if (property.isDeclared) { //if property is declared, it gets a simple input instead. List and map values and pseudo-children will be handled in property component
property.valueObj = property.value || property.defaultValue || null; // use null for empty value object
} else {
property.valueObj = property.getValueObj();
if (property.derivedDataType == DerivedPropertyType.LIST || property.derivedDataType == DerivedPropertyType.MAP) {
} else {
property.valueObj = property.getValueObj();
if (property.derivedDataType == DerivedPropertyType.LIST || property.derivedDataType == DerivedPropertyType.MAP) {
+ if (property.flattenedChildren && property.flattenedChildren.length > 0) {
+ index = property.flattenedChildren.indexOf(property.flattenedChildren.find(prop => prop.propertiesName == property.expandedChildPropertyId));
+ }
property.flattenedChildren = [];
Object.keys(property.valueObj).forEach((key) => {
property.flattenedChildren.push(...this.createListOrMapChildren(property, key, property.valueObj[key]));
property.flattenedChildren = [];
Object.keys(property.valueObj).forEach((key) => {
property.flattenedChildren.push(...this.createListOrMapChildren(property, key, property.valueObj[key]));
property.valueObj = JSON.stringify(property.getValueObj());
}
}
property.valueObj = JSON.stringify(property.getValueObj());
}
}
+ if (typeof index === "number" && property.flattenedChildren && property.flattenedChildren.length > 0) {
+ property.expandedChildPropertyId = property.flattenedChildren[index].propertiesName;
+ }
property.updateValueObjOrig();
};
property.updateValueObjOrig();
};