summaryrefslogtreecommitdiffstats
path: root/catalog-ui/src/app/ng2/pages/properties-assignment/tosca-function/tosca-get-function/tosca-get-function.component.ts
diff options
context:
space:
mode:
authorimamSidero <imam.hussain@est.tech>2023-06-08 16:07:43 +0100
committerVasyl Razinkov <vasyl.razinkov@est.tech>2023-06-23 11:08:57 +0000
commitfc3869ca4c430cc29e46bb42125f5672230b83f0 (patch)
tree28877b9124f6c8ad7613b2ff5b82a43672706702 /catalog-ui/src/app/ng2/pages/properties-assignment/tosca-function/tosca-get-function/tosca-get-function.component.ts
parent595ae1e392757e4e4b14c6b138de02aacf0d3d5c (diff)
Provide tosca function capability to complex type fields in composition view
Tosca function capability is provided to all complex type fields in composition view Issue-ID: SDC-4528 Signed-off-by: Imam hussain <imam.hussain@est.tech> Change-Id: I3bd0c5b5a44b502d2d5b4a249ce6165db24db8d3
Diffstat (limited to 'catalog-ui/src/app/ng2/pages/properties-assignment/tosca-function/tosca-get-function/tosca-get-function.component.ts')
-rw-r--r--catalog-ui/src/app/ng2/pages/properties-assignment/tosca-function/tosca-get-function/tosca-get-function.component.ts7
1 files changed, 5 insertions, 2 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 a1ed8aa137..1fe467736d 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
@@ -486,7 +486,7 @@ export class ToscaGetFunctionComponent implements OnInit, OnChanges {
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);
- let childSchemaType = this.property.schemaType != null ? this.property.schemaType : childObject.type;
+ let childSchemaType = (this.property != null && this.property.schemaType != null) ? this.property.schemaType : childObject.type;
if(this.isComplexType(childSchemaType) && !this.compositionMap){
if (childObject.type == PROPERTY_TYPES.MAP && childObject.isChildOfListOrMap) {
return validPropertyType === PROPERTY_TYPES.STRING;
@@ -501,12 +501,15 @@ export class ToscaGetFunctionComponent implements OnInit, OnChanges {
}
return validPropertyType === this.property.type && this.property.schema.property.type === property.schema.property.type;
}
- if (this.property.schema.property.isDataType && this.property instanceof PropertyDeclareAPIModel && (<PropertyDeclareAPIModel>this.property).propertiesName){
+ if ((this.property.schema.property.isDataType || this.isComplexType(this.property.type)) && this.property instanceof PropertyDeclareAPIModel && (<PropertyDeclareAPIModel>this.property).propertiesName){
let typeToMatch = (<PropertyDeclareAPIModel> this.property).input.type;
let childObject : DerivedFEProperty = (<DerivedFEProperty>(<PropertyDeclareAPIModel> this.property).input);
if (childObject.type == PROPERTY_TYPES.MAP && childObject.isChildOfListOrMap) {
typeToMatch = PROPERTY_TYPES.STRING;
}
+ if ((typeToMatch === PROPERTY_TYPES.LIST || typeToMatch === PROPERTY_TYPES.MAP) && (<PropertyDeclareAPIModel> this.property).input.schema.property.type && this.compositionMap && !isNaN(Number(this.compositionMapKey))) {
+ typeToMatch = (<PropertyDeclareAPIModel> this.property).input.schema.property.type;
+ }
return validPropertyType === typeToMatch;
}