From a8d208b231237fc9f05f83c2b33fa207d58f1480 Mon Sep 17 00:00:00 2001 From: imamSidero Date: Wed, 11 Jan 2023 18:13:25 +0000 Subject: Provide tosca function as map primitive type entry values in composition view Providing the capability to add tosca function as the primitive type entry values of map in composition view Issue-ID: SDC-4319 Signed-off-by: Imam hussain Change-Id: I5cf67bc94ac5c72be6a962e07160329cd07d302c --- .../type-map/type-map-directive.html | 21 +++++- .../type-map/type-map-directive.less | 12 +++ .../property-types/type-map/type-map-directive.ts | 87 +++++++++++++++++++++- .../tosca-function/tosca-function.component.html | 2 + .../tosca-function/tosca-function.component.ts | 13 ++++ .../tosca-get-function.component.html | 2 +- .../tosca-get-function.component.ts | 16 ++-- .../base-property-form/property-form-base.less | 2 +- .../property-form-view.html | 4 +- .../select-datatype-modal.less | 2 +- 10 files changed, 145 insertions(+), 16 deletions(-) diff --git a/catalog-ui/src/app/directives/property-types/type-map/type-map-directive.html b/catalog-ui/src/app/directives/property-types/type-map/type-map-directive.html index d84ec821de..5c895115e5 100644 --- a/catalog-ui/src/app/directives/property-types/type-map/type-map-directive.html +++ b/catalog-ui/src/app/directives/property-types/type-map/type-map-directive.html @@ -41,9 +41,14 @@
- +
+ + Value + + {{'TOSCA_FUNCTION_LABEL' | translate}} +
+
+ + +
-
{{dropDownErrorMsg}}
+
{{dropDownErrorMsg}}
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 84018fd546..9fdc8c19aa 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 @@ -45,6 +45,8 @@ export class ToscaGetFunctionComponent implements OnInit, OnChanges { @Input() toscaGetFunction: ToscaGetFunction; @Input() componentInstanceMap: Map = new Map(); @Input() functionType: ToscaGetFunctionType; + @Input() compositionMap: boolean; + @Input() compositionMapKey: string; @Output() onValidFunction: EventEmitter = new EventEmitter(); @Output() onValidityChange: EventEmitter = new EventEmitter(); @@ -262,10 +264,10 @@ export class ToscaGetFunctionComponent implements OnInit, OnChanges { private propertyTypeToString() { 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; + if ((this.typeHasSchema(this.property.type) && this.property instanceof PropertyDeclareAPIModel && + ( this.property).input instanceof DerivedFEProperty) || this.compositionMap) { + if(this.isComplexType(this.property.schemaType) && !this.compositionMap){ + return ( this.property).input.type; }else{ return this.property.schema.property.type; } @@ -375,9 +377,9 @@ export class ToscaGetFunctionComponent implements OnInit, OnChanges { private hasSameType(property: PropertyBEModel | AttributeBEModel): boolean { if (this.typeHasSchema(this.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; + if ((this.property instanceof PropertyDeclareAPIModel && ( this.property).input instanceof DerivedFEProperty) || this.compositionMap) { + if(this.isComplexType(this.property.schemaType) && !this.compositionMap){ + return property.type === ( this.property).input.type; }else{ return property.type === this.property.schema.property.type; } diff --git a/catalog-ui/src/app/view-models/forms/property-forms/base-property-form/property-form-base.less b/catalog-ui/src/app/view-models/forms/property-forms/base-property-form/property-form-base.less index 8682dd79fe..1c1c0c9c52 100644 --- a/catalog-ui/src/app/view-models/forms/property-forms/base-property-form/property-form-base.less +++ b/catalog-ui/src/app/view-models/forms/property-forms/base-property-form/property-form-base.less @@ -1,6 +1,6 @@ .sdc-edit-property-container { .scrollbar-container{ - height: 415px; + height: 475px; width: 830px; .perfect-scrollbar; } diff --git a/catalog-ui/src/app/view-models/forms/property-forms/component-property-form/property-form-view.html b/catalog-ui/src/app/view-models/forms/property-forms/component-property-form/property-form-view.html index d605cb95e8..48a85e4fcc 100644 --- a/catalog-ui/src/app/view-models/forms/property-forms/component-property-form/property-form-view.html +++ b/catalog-ui/src/app/view-models/forms/property-forms/component-property-form/property-form-view.html @@ -146,7 +146,7 @@ Value + ng-change="onValueTypeChange()"/> Entries