From a82ac17a702339bdb1af830a6581e3b30b3f5ec1 Mon Sep 17 00:00:00 2001 From: aribeiro Date: Wed, 14 Apr 2021 15:43:59 +0100 Subject: Fix add property to a VFC Added properties to a VFC were not being displayed on the UI Issue-ID: SDC-3559 Signed-off-by: aribeiro Change-Id: Iede582ada4a25ddfb8f5ca5936c71e5c2b25e50b --- .../component-services/topology-template.service.ts | 5 +++-- .../component-property-form/property-form-view-model.ts | 16 +++++++--------- .../workspace/tabs/properties/properties.less | 3 ++- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/catalog-ui/src/app/ng2/services/component-services/topology-template.service.ts b/catalog-ui/src/app/ng2/services/component-services/topology-template.service.ts index 992149976e..7b726e4172 100644 --- a/catalog-ui/src/app/ng2/services/component-services/topology-template.service.ts +++ b/catalog-ui/src/app/ng2/services/component-services/topology-template.service.ts @@ -374,8 +374,9 @@ export class TopologyTemplateService { // ------------------------------------------------ Properties API --------------------------------------------------// addProperty = (componentType: string, componentId: string, property: PropertyModel):Observable => { - return this.http.post(this.baseUrl + this.getServerTypeUrl(componentType) + componentId + '/properties', property.convertToServerObject()).map((response) => { - return new PropertyModel(response[Object.keys(response)[0]]); + return this.http.post(this.baseUrl + this.getServerTypeUrl(componentType) + componentId + '/properties', property.convertToServerObject()) + .map((response) => { + return new PropertyModel(response); }); } 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 609997ca19..c63dd8a208 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 @@ -260,7 +260,6 @@ export class PropertyFormViewModel { }; let onPropertySuccess = (propertyFromBE:PropertyModel):void => { - console.info('onPropertyResourceSuccess : ', propertyFromBE); this.$scope.isLoading = false; this.filteredProperties[this.$scope.currentPropertyIndex] = propertyFromBE; if (!doNotCloseModal) { @@ -410,19 +409,18 @@ export class PropertyFormViewModel { }); }; - private addOrUpdateProperty = (property:PropertyModel):Observable => { + private addOrUpdateProperty = (property: PropertyModel): Observable => { if (!property.uniqueId) { - let onSuccess = (property:PropertyModel):PropertyModel => { - let newProperty = new PropertyModel(property); + let onSuccess = (newProperty: PropertyModel): PropertyModel => { this.filteredProperties.push(newProperty); return newProperty; }; - return this.topologyTemplateService.addProperty(this.workspaceService.metadata.componentType, this.workspaceService.metadata.uniqueId, property).map(onSuccess); - } - else { - let onSuccess = (newProperty:PropertyModel):PropertyModel => { + return this.topologyTemplateService.addProperty(this.workspaceService.metadata.componentType, this.workspaceService.metadata.uniqueId, property) + .map(onSuccess); + } else { + let onSuccess = (newProperty: PropertyModel): PropertyModel => { // find exist instance property in parent component for update the new value ( find bu uniqueId ) - let existProperty:PropertyModel = _.find(this.filteredProperties, {uniqueId: newProperty.uniqueId}); + let existProperty: PropertyModel = _.find(this.filteredProperties, {uniqueId: newProperty.uniqueId}); let propertyIndex = this.filteredProperties.indexOf(existProperty); this.filteredProperties[propertyIndex] = newProperty; return newProperty; diff --git a/catalog-ui/src/app/view-models/workspace/tabs/properties/properties.less b/catalog-ui/src/app/view-models/workspace/tabs/properties/properties.less index 48c462e143..0797126cb8 100644 --- a/catalog-ui/src/app/view-models/workspace/tabs/properties/properties.less +++ b/catalog-ui/src/app/view-models/workspace/tabs/properties/properties.less @@ -60,7 +60,8 @@ } .table{ - height:490px; + height: 100%; + min-height: 500px; margin-bottom: 0; } -- cgit 1.2.3-korg