From 532cb373b22b5684cbe6ea003d749560f051be08 Mon Sep 17 00:00:00 2001 From: imamSidero Date: Thu, 9 Mar 2023 16:47:20 +0000 Subject: Fix issue on list and map property entries in composition view List and map entries are rendered correctly on composition view Issue-ID: SDC-4404 Signed-off-by: Imam hussain Change-Id: I3c640f51fceb96701296b5e561e45d65dcc599c3 --- .../app/directives/property-types/type-list/type-list-directive.html | 2 +- .../app/directives/property-types/type-list/type-list-directive.ts | 4 +++- .../app/directives/property-types/type-map/type-map-directive.html | 2 +- .../src/app/directives/property-types/type-map/type-map-directive.ts | 4 +++- .../component-property-form/property-form-view-model.ts | 4 ++-- .../property-forms/component-property-form/property-form-view.html | 2 ++ 6 files changed, 12 insertions(+), 6 deletions(-) (limited to 'catalog-ui/src/app') diff --git a/catalog-ui/src/app/directives/property-types/type-list/type-list-directive.html b/catalog-ui/src/app/directives/property-types/type-list/type-list-directive.html index e92e8b1a34..1455f2742f 100644 --- a/catalog-ui/src/app/directives/property-types/type-list/type-list-directive.html +++ b/catalog-ui/src/app/directives/property-types/type-list/type-list-directive.html @@ -28,7 +28,7 @@
-
+ Value diff --git a/catalog-ui/src/app/directives/property-types/type-list/type-list-directive.ts b/catalog-ui/src/app/directives/property-types/type-list/type-list-directive.ts index 23add5363e..0d54fc4343 100644 --- a/catalog-ui/src/app/directives/property-types/type-list/type-list-directive.ts +++ b/catalog-ui/src/app/directives/property-types/type-list/type-list-directive.ts @@ -46,6 +46,7 @@ export interface ITypeListScope extends ng.IScope { showToscaFunction: Array; constraints:string[]; types:DataTypesMap; + isService:boolean; getValidationPattern(type:string):RegExp; validateIntRange(value:string):boolean; @@ -83,7 +84,8 @@ export class TypeListDirective implements ng.IDirective { defaultValue: '@',//this list default value maxLength: '=', constraints: '=', - types: '=' + types: '=', + isService: '=' }; restrict = 'E'; 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 a2b742492d..f53f5cf205 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,7 +41,7 @@
- + Value diff --git a/catalog-ui/src/app/directives/property-types/type-map/type-map-directive.ts b/catalog-ui/src/app/directives/property-types/type-map/type-map-directive.ts index 456c66a710..f8fa6dd359 100644 --- a/catalog-ui/src/app/directives/property-types/type-map/type-map-directive.ts +++ b/catalog-ui/src/app/directives/property-types/type-map/type-map-directive.ts @@ -48,6 +48,7 @@ export interface ITypeMapScope extends ng.IScope { showAddBtn: boolean; showToscaFunction: boolean[]; types: DataTypesMap; + isService: boolean; getValidationPattern(type: string): RegExp; validateIntRange(value: string): boolean; @@ -75,7 +76,8 @@ export class TypeMapDirective implements ng.IDirective { constraints: '=', showAddBtn: '=?', parentProperty: '=', - types: '=' + types: '=', + isService: '=' }; restrict = 'E'; diff --git a/catalog-ui/src/app/view-models/forms/property-forms/component-property-form/property-form-view-model.ts b/catalog-ui/src/app/view-models/forms/property-forms/component-property-form/property-form-view-model.ts index 52e8c0018a..61a58c54dd 100644 --- a/catalog-ui/src/app/view-models/forms/property-forms/component-property-form/property-form-view-model.ts +++ b/catalog-ui/src/app/view-models/forms/property-forms/component-property-form/property-form-view-model.ts @@ -188,7 +188,7 @@ export class PropertyFormViewModel { private initForNotSimpleType = ():void => { const property = this.$scope.editPropertyModel.property; - this.$scope.isTypeDataType = this.isDataTypeForPropertyType(this.$scope.editPropertyModel.property); + this.$scope.isTypeDataType = this.DataTypesService.isDataTypeForPropertyType(this.$scope.editPropertyModel.property); if (property.isToscaFunction()) { this.initValueForGetFunction(); return; @@ -305,6 +305,7 @@ export class PropertyFormViewModel { } } this.initResource(); + this.initForNotSimpleType(); this.initComponentInstanceMap(); this.$scope.validateJson = (json:string):boolean => { @@ -320,7 +321,6 @@ export class PropertyFormViewModel { this.$scope.nonPrimitiveTypes = _.filter(Object.keys(this.$scope.dataTypes), (type:string)=> { return this.$scope.editPropertyModel.types.indexOf(type) == -1; }); - this.initForNotSimpleType(); this.$scope.isLoading = false; }); 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 2840e86523..b717d7a147 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 @@ -185,6 +185,7 @@ default-value="{{getDefaultValue()}}" max-length="maxLength" types="dataTypes" + is-service="!componentMetadata.isVfc" constraints="editPropertyModel.property.constraints && editPropertyModel.property.constraints[0].validValues">
@@ -200,6 +201,7 @@ default-value="{{getDefaultValue()}}" max-length="maxLength" types="dataTypes" + is-service="!componentMetadata.isVfc" constraints="editPropertyModel.property.constraints && editPropertyModel.property.constraints[0].validValues">
-- cgit 1.2.3-korg