Implicit attributes in get_attribute list
[sdc.git] / catalog-ui / src / app / ng2 / pages / properties-assignment / tosca-function / tosca-get-function / tosca-get-function.component.ts
index 1fe4677..67df3e4 100644 (file)
@@ -329,7 +329,7 @@ export class ToscaGetFunctionComponent implements OnInit, OnChanges {
            if (this.isSubProperty()){
             if ((this.property instanceof PropertyDeclareAPIModel && (<PropertyDeclareAPIModel> this.property).input instanceof DerivedFEProperty)
                 || this.compositionMap) {
-                if(this.isComplexType(this.property.schemaType) && !this.compositionMap){
+                if(this.isComplexType(this.property.schemaType)){
                     let mapChildProp : DerivedFEProperty = (<DerivedFEProperty> (<PropertyDeclareAPIModel> this.property).input);
                     let propertySchemaType = mapChildProp.type;
                     if (this.property.type == PROPERTY_TYPES.MAP || propertySchemaType == PROPERTY_TYPES.MAP) {
@@ -409,8 +409,10 @@ export class ToscaGetFunctionComponent implements OnInit, OnChanges {
     }
 
     private addPropertyToDropdown(propertyDropdownValue: PropertyDropdownValue, propertyList: Array<PropertyDropdownValue>): void {
-        propertyList.push(propertyDropdownValue);
-        propertyList.sort((a, b) => a.propertyLabel.localeCompare(b.propertyLabel));
+        if (!propertyList.find(prop => prop.propertyName === propertyDropdownValue.propertyName)) {
+            propertyList.push(propertyDropdownValue);
+            propertyList.sort((a, b) => a.propertyLabel.localeCompare(b.propertyLabel));
+        }
     }
 
     private addPropertiesToDropdown(properties: Array<PropertyBEModel | AttributeBEModel>, propertyList: Array<PropertyDropdownValue>): void {
@@ -487,7 +489,7 @@ export class ToscaGetFunctionComponent implements OnInit, OnChanges {
             if ((this.property instanceof PropertyDeclareAPIModel && (<PropertyDeclareAPIModel> this.property).input instanceof DerivedFEProperty) || this.compositionMap) {
                 let childObject : DerivedFEProperty = (<DerivedFEProperty>(<PropertyDeclareAPIModel> this.property).input);
                 let childSchemaType = (this.property != null && this.property.schemaType != null) ? this.property.schemaType : childObject.type;
-                if(this.isComplexType(childSchemaType) && !this.compositionMap){
+                if(this.isComplexType(childSchemaType)){
                     if (childObject.type == PROPERTY_TYPES.MAP && childObject.isChildOfListOrMap) {
                         return validPropertyType === PROPERTY_TYPES.STRING;
                     }