From db3e2ef238fa29e06cec3cb3f5b11fb407b161ce Mon Sep 17 00:00:00 2001 From: imamSidero Date: Wed, 21 Dec 2022 17:51:43 +0000 Subject: Provide tosca function to custom datatypes of list and map Providing the capability to add tosca function as the custom datatypes of list and map Issue-ID: SDC-4311 Signed-off-by: Imam hussain Change-Id: I7ec8943d8008440b091fc4eaa2aba49cdadcda8d --- .../tosca-get-function/tosca-get-function.component.ts | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'catalog-ui/src/app/ng2/pages/properties-assignment/tosca-function/tosca-get-function/tosca-get-function.component.ts') diff --git a/catalog-ui/src/app/ng2/pages/properties-assignment/tosca-function/tosca-get-function/tosca-get-function.component.ts b/catalog-ui/src/app/ng2/pages/properties-assignment/tosca-function/tosca-get-function/tosca-get-function.component.ts index 46541cf355..84018fd546 100644 --- a/catalog-ui/src/app/ng2/pages/properties-assignment/tosca-function/tosca-get-function/tosca-get-function.component.ts +++ b/catalog-ui/src/app/ng2/pages/properties-assignment/tosca-function/tosca-get-function/tosca-get-function.component.ts @@ -261,7 +261,15 @@ export class ToscaGetFunctionComponent implements OnInit, OnChanges { } private propertyTypeToString() { - if (this.isSubProperty() && this.property.type != PROPERTY_TYPES.MAP && this.property.type != PROPERTY_TYPES.LIST){ + if (this.isSubProperty()){ + if (this.typeHasSchema(this.property.type) && this.property instanceof PropertyDeclareAPIModel && + ( this.property).input instanceof DerivedFEProperty) { + if(this.isComplexType(this.property.schemaType)){ + return this.property.input.type; + }else{ + return this.property.schema.property.type; + } + } return this.getType((this.property).propertiesName.split("#").slice(1), this.property.type); } if (this.property.schemaType) { @@ -367,8 +375,12 @@ export class ToscaGetFunctionComponent implements OnInit, OnChanges { private hasSameType(property: PropertyBEModel | AttributeBEModel): boolean { if (this.typeHasSchema(this.property.type)) { - if ((this.property.type === PROPERTY_TYPES.MAP || this.property.type === PROPERTY_TYPES.LIST) && this.property instanceof PropertyDeclareAPIModel && ( this.property).input instanceof DerivedFEProperty) { - return property.type === this.property.schema.property.type; + if (this.property instanceof PropertyDeclareAPIModel && ( this.property).input instanceof DerivedFEProperty) { + if(this.isComplexType(this.property.schemaType)){ + return property.type === this.property.input.type; + }else{ + return property.type === this.property.schema.property.type; + } } if (!property.schema || !property.schema.property) { return false; -- cgit 1.2.3-korg