From: imamSidero Date: Fri, 17 Feb 2023 17:03:38 +0000 (+0000) Subject: Fix issue on adding values to complex properties in Property Assignment X-Git-Tag: 1.12.2~12 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=3eb6f41297cedc038d18582d31d65dab05b351b8;p=sdc.git Fix issue on adding values to complex properties in Property Assignment value field for complex types are restored and validation for the complex type is fixed Issue-ID: SDC-4400 Signed-off-by: Imam hussain Change-Id: I320b2f2bdb8c8e236e7cd232902a4a07d0c245c8 --- diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/datamodel/utils/PropertyValueConstraintValidationUtil.java b/catalog-be/src/main/java/org/openecomp/sdc/be/datamodel/utils/PropertyValueConstraintValidationUtil.java index a25a332b9e..6c820a1af2 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/datamodel/utils/PropertyValueConstraintValidationUtil.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/datamodel/utils/PropertyValueConstraintValidationUtil.java @@ -371,17 +371,19 @@ public class PropertyValueConstraintValidationUtil { final PropertyDefinition propertyCopyWithNewValue = copyPropertyWithNewValue(propertyDefinition, objectMapper.writeValueAsString(value),mapKey); propertyCopyWithNewValue.setToscaSubPath(mapKey); - if (ToscaType.isPrimitiveType(schemaType)) { - evaluateCollectionPrimitiveSchemaType(propertyCopyWithNewValue, schemaType); - } else if (ToscaType.isCollectionType(schemaType)) { - propertyCopyWithNewValue.setType(schemaType); - propertyCopyWithNewValue.setSchemaType(propertyDefinition.getSchemaProperty().getSchemaType()); - evaluateCollectionTypeProperties(propertyCopyWithNewValue); - } else { - propertyCopyWithNewValue.setType(schemaType); - completePropertyName.append(UNDERSCORE); - completePropertyName.append(propertyCopyWithNewValue.getName()); - evaluateComplexTypeProperties(propertyCopyWithNewValue); + if (isPropertyNotMappedAsInput(propertyCopyWithNewValue)) { + if (ToscaType.isPrimitiveType(schemaType)) { + evaluateCollectionPrimitiveSchemaType(propertyCopyWithNewValue, schemaType); + } else if (ToscaType.isCollectionType(schemaType)) { + propertyCopyWithNewValue.setType(schemaType); + propertyCopyWithNewValue.setSchemaType(propertyDefinition.getSchemaProperty().getSchemaType()); + evaluateCollectionTypeProperties(propertyCopyWithNewValue); + } else { + propertyCopyWithNewValue.setType(schemaType); + completePropertyName.append(UNDERSCORE); + completePropertyName.append(propertyCopyWithNewValue.getName()); + evaluateComplexTypeProperties(propertyCopyWithNewValue); + } } } catch (final Exception e) { logger.debug(e.getMessage(), e); diff --git a/catalog-ui/src/app/models/properties-inputs/derived-fe-property.ts b/catalog-ui/src/app/models/properties-inputs/derived-fe-property.ts index 02b2d0b30d..c2ea1ecbdf 100644 --- a/catalog-ui/src/app/models/properties-inputs/derived-fe-property.ts +++ b/catalog-ui/src/app/models/properties-inputs/derived-fe-property.ts @@ -119,7 +119,7 @@ export class DerivedFEProperty extends PropertyBEModel { } } - this.valueObj = ((this.type == PROPERTY_TYPES.JSON || this.type == PROPERTY_TYPES.MAP) && typeof value == 'object') ? JSON.stringify(value) : value; + this.valueObj = (this.type == PROPERTY_TYPES.JSON && typeof value == 'object') ? JSON.stringify(value) : value; if (value != null) { this.value = typeof value == 'object' ? JSON.stringify(value) : value; } diff --git a/catalog-ui/src/app/ng2/components/logic/properties-table/dynamic-property/dynamic-property.component.html b/catalog-ui/src/app/ng2/components/logic/properties-table/dynamic-property/dynamic-property.component.html index 959ed36625..8e7e3a1282 100644 --- a/catalog-ui/src/app/ng2/components/logic/properties-table/dynamic-property/dynamic-property.component.html +++ b/catalog-ui/src/app/ng2/components/logic/properties-table/dynamic-property/dynamic-property.component.html @@ -25,7 +25,7 @@
{{property.name}}
- +
{{property.name}}