aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJvD_Ericsson <jeff.van.dam@est.tech>2023-06-27 11:43:59 +0100
committerMichael Morris <michael.morris@est.tech>2023-07-04 13:42:17 +0000
commitb0b217c4ad3252c4eb24d2fc0a5508e51eee0fba (patch)
tree04223c288e707b4d2e726f4b442cb4e864caa14a
parent2cecd886d08bd2f97426746aa19b581568c38954 (diff)
Do not collapse complex property when setting element value
Issue-ID: SDC-4555 Signed-off-by: JvD_Ericsson <jeff.van.dam@est.tech> Change-Id: Ia6d299e64480ec9c7aa72e18936344ff5bccf249
-rw-r--r--catalog-ui/src/app/ng2/pages/properties-assignment/services/properties.utils.ts7
1 files changed, 7 insertions, 0 deletions
diff --git a/catalog-ui/src/app/ng2/pages/properties-assignment/services/properties.utils.ts b/catalog-ui/src/app/ng2/pages/properties-assignment/services/properties.utils.ts
index 6a27622638..0255a42b48 100644
--- a/catalog-ui/src/app/ng2/pages/properties-assignment/services/properties.utils.ts
+++ b/catalog-ui/src/app/ng2/pages/properties-assignment/services/properties.utils.ts
@@ -143,6 +143,7 @@ export class PropertiesUtils {
* 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 => {
+ let index: number;
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
@@ -152,6 +153,9 @@ export class PropertiesUtils {
} 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]));
@@ -185,6 +189,9 @@ export class PropertiesUtils {
property.valueObj = JSON.stringify(property.getValueObj());
}
}
+ if (typeof index === "number" && property.flattenedChildren && property.flattenedChildren.length > 0) {
+ property.expandedChildPropertyId = property.flattenedChildren[index].propertiesName;
+ }
property.updateValueObjOrig();
};