diff options
Diffstat (limited to 'catalog-ui/src/app/view-models/forms')
-rw-r--r-- | catalog-ui/src/app/view-models/forms/property-forms/component-property-form/property-form-view-model.ts | 16 |
1 files changed, 7 insertions, 9 deletions
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<PropertyModel> => { + private addOrUpdateProperty = (property: PropertyModel): Observable<PropertyModel> => { 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 = <PropertyModel>_.find(this.filteredProperties, {uniqueId: newProperty.uniqueId}); + let existProperty: PropertyModel = <PropertyModel>_.find(this.filteredProperties, {uniqueId: newProperty.uniqueId}); let propertyIndex = this.filteredProperties.indexOf(existProperty); this.filteredProperties[propertyIndex] = newProperty; return newProperty; |