diff options
author | imamSidero <imam.hussain@est.tech> | 2023-05-25 17:23:11 +0100 |
---|---|---|
committer | Michael Morris <michael.morris@est.tech> | 2023-05-30 08:46:20 +0000 |
commit | 63f4c5920a6a3d07a79b0a546b72b5aebc189a68 (patch) | |
tree | 55034f0764b1d0709dd8b01c3ba06377bace000e /catalog-ui/src/app/ng2 | |
parent | 32d8a1dba11780a622b337e77830f9095f0767ee (diff) |
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 <imam.hussain@est.tech>
Change-Id: Idf5af079c50bf2b9a09f572af30ca9fc294a831e
Diffstat (limited to 'catalog-ui/src/app/ng2')
-rw-r--r-- | catalog-ui/src/app/ng2/pages/properties-assignment/tosca-function/tosca-get-function/tosca-get-function.component.ts | 11 |
1 files changed, 8 insertions, 3 deletions
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<ToscaIndexObject>; + 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 && (<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<PropertyDropdownValue> = []; const selectedProperty: PropertyDropdownValue = this.selectedProperty.value; - if (selectedProperty.isList) { + if (this.parentListTypeFlag && selectedProperty.isList) { toscaIndexFlag = true; if (selectedProperty.schemaType != null) { nestedToscaFlag = true; |