From 63f4c5920a6a3d07a79b0a546b72b5aebc189a68 Mon Sep 17 00:00:00 2001 From: imamSidero Date: Thu, 25 May 2023 17:23:11 +0100 Subject: Bug fix on tosca function impact changes Providing the required inputs and dependency changes for tosca functionality Issue-ID: SDC-4510 Signed-off-by: Imam hussain Change-Id: Idf5af079c50bf2b9a09f572af30ca9fc294a831e --- .../tosca-get-function/tosca-get-function.component.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'catalog-ui/src/app/ng2/pages/properties-assignment/tosca-function') 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 7987ba26cf..cbbc2d98c0 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 @@ -63,6 +63,7 @@ export class ToscaGetFunctionComponent implements OnInit, OnChanges { dropdownValuesLabel: string; dropDownErrorMsg: string; indexListValues:Array; + parentListTypeFlag : boolean; private isInitialized: boolean = false; private componentMetadata: ComponentMetadata; @@ -77,6 +78,10 @@ export class ToscaGetFunctionComponent implements OnInit, OnChanges { ngOnInit(): void { this.componentMetadata = this.workspaceService.metadata; this.indexListValues = []; + if (this.property != null) { + this.parentListTypeFlag = (this.property.type != PROPERTY_TYPES.LIST && (!this.isComplexType(this.property.type) || (this.isComplexType(this.property.type) + && this.property instanceof PropertyDeclareAPIModel && ( this.property).input instanceof DerivedFEProperty && this.property.input.type != PROPERTY_TYPES.LIST))); + } this.formGroup.valueChanges.subscribe(() => { this.formValidation(); }); @@ -452,8 +457,8 @@ export class ToscaGetFunctionComponent implements OnInit, OnChanges { if (this.property.type === PROPERTY_TYPES.ANY) { return true; } - let validPropertyType = (this.property.type != PROPERTY_TYPES.LIST && property.type === PROPERTY_TYPES.LIST) ? property.schema.property.type : property.type; - if (this.property.type != PROPERTY_TYPES.LIST && property.type === PROPERTY_TYPES.LIST && this.isComplexType(validPropertyType)) { + let validPropertyType = (this.parentListTypeFlag && property.type === PROPERTY_TYPES.LIST) ? property.schema.property.type : property.type; + if (this.parentListTypeFlag && property.type === PROPERTY_TYPES.LIST && this.isComplexType(validPropertyType)) { let returnFlag : boolean = false; const dataTypeFound: DataTypeModel = this.dataTypeService.getDataTypeByModelAndTypeName(this.componentMetadata.model, validPropertyType); if (dataTypeFound && dataTypeFound.properties) { @@ -555,7 +560,7 @@ export class ToscaGetFunctionComponent implements OnInit, OnChanges { this.indexListValues = []; let subPropertyDropdownList : Array = []; const selectedProperty: PropertyDropdownValue = this.selectedProperty.value; - if (selectedProperty.isList) { + if (this.parentListTypeFlag && selectedProperty.isList) { toscaIndexFlag = true; if (selectedProperty.schemaType != null) { nestedToscaFlag = true; -- cgit 1.2.3-korg