final PropertyDataDefinition currentProperty = oldProperties.get(newProperty.getName());
currentProperty.setValue(newPropertyValueEither);
currentProperty.setToscaFunction(newProperty.getToscaFunction());
+ currentProperty.setPropertyConstraints(newProperty.getPropertyConstraints());
validatePropertyValueWithConstraints(currentProperty, policyOwnerComponent);
}
return policy;
inputPath: string;
toscaPresentation: ToscaPresentationData;
metadata: Metadata;
+ propertyConstraints: any;
/**
* @deprecated Use toscaFunction instead
*/
constructor(property?: PropertyBEModel) {
if (property) {
this.constraints = property.constraints;
+ this.propertyConstraints = property.propertyConstraints;
this.defaultValue = property.defaultValue;
this.description = property.description;
this.fromDerived = property.fromDerived;
constructor(property?:PropertyModel) {
super(property);
if (property) {
- this.constraints = property.constraints;
+ if (property.propertyConstraints) {
+ this.constraints = new Array();
+ property.propertyConstraints.forEach((constraint: any) => {
+ this.constraints.push(JSON.parse(constraint));
+ });
+ }
+ this.propertyConstraints = property.propertyConstraints;
this.source = property.source;
this.valueUniqueUid = property.valueUniqueUid;
this.path = property.path;
<label class="i-sdc-form-label">Constraints</label>
<ng-container>
<app-constraints [property-constraints]="editPropertyModel.property.constraints"
- [is-view-only]="editPropertyModel.property.propertyView? !editPropertyModel.property.propertyView :(isViewOnly || componentMetadata.isService)"
+ [is-view-only]="editPropertyModel.property.propertyView? !editPropertyModel.property.propertyView : (isViewOnly || componentMetadata.isService)"
[property-type]="editPropertyModel.property.type"
(on-constraint-change)="onConstraintChange($event)">
</app-constraints>