aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/tosca/InterfacesOperationsConverter.java6
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/tosca/model/ToscaArtifactDefinition.java3
-rw-r--r--catalog-ui/src/app/ng2/pages/composition/interface-operatons/operation-creator/interface-operation-handler.component.ts17
3 files changed, 16 insertions, 10 deletions
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/InterfacesOperationsConverter.java b/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/InterfacesOperationsConverter.java
index 52e7562bbe..919a5bca00 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/InterfacesOperationsConverter.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/InterfacesOperationsConverter.java
@@ -38,7 +38,6 @@ import org.apache.commons.lang3.math.NumberUtils;
import org.openecomp.sdc.be.datatypes.elements.InputDataDefinition;
import org.openecomp.sdc.be.datatypes.elements.OperationDataDefinition;
import org.openecomp.sdc.be.datatypes.elements.OperationInputDefinition;
-import org.openecomp.sdc.be.datatypes.elements.PropertyDataDefinition;
import org.openecomp.sdc.be.model.Component;
import org.openecomp.sdc.be.model.ComponentInstance;
import org.openecomp.sdc.be.model.DataTypeDefinition;
@@ -313,8 +312,9 @@ public class InterfacesOperationsConverter {
final ToscaArtifactDefinition toscaArtifactDefinition) {
final var properties = operationEntry.getValue().getImplementation().getProperties();
if (CollectionUtils.isNotEmpty(properties)) {
- final Map<String, PropertyDataDefinition> propertiesMap = new HashMap<>();
- properties.forEach(propertyDefinition -> propertiesMap.put(propertyDefinition.getName(), propertyDefinition));
+ final Map<String, String> propertiesMap = new HashMap<>();
+ properties.stream().filter(propertyDataDefinition -> StringUtils.isNotEmpty(propertyDataDefinition.getValue()))
+ .forEach(propertyDataDefinition -> propertiesMap.put(propertyDataDefinition.getName(), propertyDataDefinition.getValue()));
toscaArtifactDefinition.setProperties(propertiesMap);
}
}
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/model/ToscaArtifactDefinition.java b/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/model/ToscaArtifactDefinition.java
index f49d0478b9..689dc91d23 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/model/ToscaArtifactDefinition.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/model/ToscaArtifactDefinition.java
@@ -23,7 +23,6 @@ package org.openecomp.sdc.be.tosca.model;
import java.util.Map;
import lombok.Getter;
import lombok.Setter;
-import org.openecomp.sdc.be.datatypes.elements.PropertyDataDefinition;
@Getter
@Setter
@@ -37,5 +36,5 @@ public class ToscaArtifactDefinition {
private String artifact_version;
private String checksum;
private String checksum_algorithm;
- private Map<String, PropertyDataDefinition> properties;
+ private Map<String, String> properties;
}
diff --git a/catalog-ui/src/app/ng2/pages/composition/interface-operatons/operation-creator/interface-operation-handler.component.ts b/catalog-ui/src/app/ng2/pages/composition/interface-operatons/operation-creator/interface-operation-handler.component.ts
index 0b0efde1bf..6e4ae45487 100644
--- a/catalog-ui/src/app/ng2/pages/composition/interface-operatons/operation-creator/interface-operation-handler.component.ts
+++ b/catalog-ui/src/app/ng2/pages/composition/interface-operatons/operation-creator/interface-operation-handler.component.ts
@@ -67,6 +67,7 @@ export class InterfaceOperationHandlerComponent {
toscaArtifactTypes: Array<DropdownValue> = [];
enableAddArtifactImplementation: boolean;
+ propertyValueValid: boolean = true;
ngOnInit() {
this.interfaceType = this.input.selectedInterface.displayType();
@@ -166,7 +167,9 @@ export class InterfaceOperationHandlerComponent {
propertyValueValidation = (propertyValue): void => {
this.onPropertyValueChange(propertyValue);
- this.readonly = !propertyValue.isValid;
+ this.propertyValueValid = propertyValue.isValid;
+ this.readonly = !this.propertyValueValid;
+ this.validateRequiredField();
}
onRemoveInput = (inputParam: InputOperationParameter): void => {
@@ -221,15 +224,19 @@ export class InterfaceOperationHandlerComponent {
validateRequiredField = () => {
this.readonly = true;
- let requiredFieldSelected = this.toscaArtifactTypeSelected && this.artifactName ? true : false;
- this.input.validityChangedCallback(requiredFieldSelected);
- if (requiredFieldSelected) {
+ const isRequiredFieldSelected = this.isRequiredFieldsSelected();
+ this.input.validityChangedCallback(isRequiredFieldSelected);
+ if (isRequiredFieldSelected && this.propertyValueValid) {
this.readonly = false;
}
}
+ private isRequiredFieldsSelected() {
+ return this.toscaArtifactTypeSelected && this.artifactName;
+ }
+
private checkFormValidForSubmit = (): boolean => {
- return this.operationToUpdate.name && this.isParamsValid();
+ return this.operationToUpdate.name && this.artifactName && this.isParamsValid();
}
private isParamsValid = (): boolean => {