diff options
author | JvD_Ericsson <jeff.van.dam@est.tech> | 2023-05-04 13:27:26 +0100 |
---|---|---|
committer | Michael Morris <michael.morris@est.tech> | 2023-05-18 10:41:07 +0000 |
commit | bc7dd3ad94acace55a2910abc22cc5cb64e0862d (patch) | |
tree | 43948e332fa27ea7cecc70ba19388bb63e1069d0 /catalog-ui/src/app/ng2/pages/properties-assignment/tosca-function/tosca-get-function | |
parent | 38eaf2ddd678a837e2bfed25d5b4b45d72fce338 (diff) |
UI support for default custom function names with get_input structure
Issue-ID: SDC-4493
Signed-off-by: JvD_Ericsson <jeff.van.dam@est.tech>
Change-Id: Iba3eda9bb5d57aabbe86045b6150564e17a0ff3e
Diffstat (limited to 'catalog-ui/src/app/ng2/pages/properties-assignment/tosca-function/tosca-get-function')
2 files changed, 7 insertions, 7 deletions
diff --git a/catalog-ui/src/app/ng2/pages/properties-assignment/tosca-function/tosca-get-function/tosca-get-function.component.html b/catalog-ui/src/app/ng2/pages/properties-assignment/tosca-function/tosca-get-function/tosca-get-function.component.html index 387bb5cbcb..4a9e110982 100644 --- a/catalog-ui/src/app/ng2/pages/properties-assignment/tosca-function/tosca-get-function/tosca-get-function.component.html +++ b/catalog-ui/src/app/ng2/pages/properties-assignment/tosca-function/tosca-get-function/tosca-get-function.component.html @@ -17,7 +17,7 @@ ~ ============LICENSE_END========================================================= --> -<div class="tosca-function"> +<div> <form class="w-sdc-form" [formGroup]="formGroup"> <div class="i-sdc-form-item" *ngIf="showPropertySourceDropdown()"> <label class="i-sdc-form-label required">{{'TOSCA_FUNCTION_PROPERTY_SOURCE_LABEL' | translate}}</label> 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 284c559c55..1b0a1a34ee 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 @@ -100,7 +100,6 @@ export class ToscaGetFunctionComponent implements OnInit, OnChanges { this.initToscaGetFunction().subscribe(() => { this.isInitialized = true; }); - } ngOnChanges(_changes: SimpleChanges): void { @@ -410,7 +409,8 @@ export class ToscaGetFunctionComponent implements OnInit, OnChanges { if (this.property.type === PROPERTY_TYPES.ANY) { return true; } - let validPropertyType = property.type === PROPERTY_TYPES.LIST ? property.schemaType : property.type; + let validPropertyType = property.type; + let validPropertyTypeSchema = property.schemaType; if (this.typeHasSchema(this.property.type)) { if ((this.property instanceof PropertyDeclareAPIModel && (<PropertyDeclareAPIModel> this.property).input instanceof DerivedFEProperty) || this.compositionMap) { let childObject : DerivedFEProperty = (<DerivedFEProperty>(<PropertyDeclareAPIModel> this.property).input); @@ -421,13 +421,13 @@ export class ToscaGetFunctionComponent implements OnInit, OnChanges { } return validPropertyType === childObject.type; }else{ - return validPropertyType === this.property.schema.property.type; + return validPropertyType === this.property.schemaType; } } if (!property.schema || !property.schema.property) { return false; } - return validPropertyType === this.property.type && this.property.schema.property.type === property.schema.property.type; + return validPropertyType === this.property.type && this.property.schemaType === validPropertyTypeSchema; } if (this.property.schema.property.isDataType && this.property instanceof PropertyDeclareAPIModel && (<PropertyDeclareAPIModel>this.property).propertiesName){ let typeToMatch = (<PropertyDeclareAPIModel> this.property).input.type; @@ -438,7 +438,7 @@ export class ToscaGetFunctionComponent implements OnInit, OnChanges { return validPropertyType === typeToMatch; } - return validPropertyType === this.property.type; + return validPropertyType === this.property.type || (validPropertyType === PROPERTY_TYPES.LIST && validPropertyTypeSchema === this.property.type); } private getType(propertyPath:string[], type: string): string { @@ -499,7 +499,7 @@ export class ToscaGetFunctionComponent implements OnInit, OnChanges { this.toscaIndexFlag = false; this.toscaIndex.reset(); const selectedProperty: PropertyDropdownValue = this.selectedProperty.value; - if (selectedProperty.isList) { + if (selectedProperty.isList && this.property.type != PROPERTY_TYPES.LIST) { this.toscaIndexFlag = true; } } |