Custom tosca functions with valid_values and in_range operators not showing properly
[sdc.git] / catalog-ui / src / app / ng2 / pages / properties-assignment / tosca-function / tosca-function.component.ts
index 66ae3cc..412e29a 100644 (file)
@@ -167,9 +167,9 @@ export class ToscaFunctionComponent implements OnInit, OnChanges {
         }
 
         this.toscaFunctionForm.setValue(this.inToscaFunction ? this.inToscaFunction : this.property.toscaFunction);
-        let type = this.property.toscaFunction.type;
+        let type = this.property.toscaFunction.type ? this.property.toscaFunction.type : this.toscaFunctionForm.value.type;
         if (type == ToscaFunctionType.CUSTOM) {
-            let name = (this.property.toscaFunction as ToscaCustomFunction).name;
+            let name = (this.toscaFunctionForm.value as ToscaCustomFunction).name;
             let customToscaFunc = this.customToscaFunctions.find(custToscFunc => _.isEqual(custToscFunc.name, name))
             if (customToscaFunc) {
                 this.toscaFunctionTypeForm.setValue(name);