From 273a84924f846f27fd7475c715ee708de2d8d144 Mon Sep 17 00:00:00 2001 From: Eylon Malin Date: Tue, 17 Dec 2019 12:07:32 +0200 Subject: vfModule.model.info getModel use vfModule constructor Fix bug of show wrong value in Component Info for VfModule with maxCountInstances Issue-ID: VID-726 Change-Id: I909218c9c7bb4121bcbfdb9f4f436571f1e83ebe Signed-off-by: Eylon Malin --- .../objectsToTree/models/vfModule/vfModule.model.info.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/vfModule/vfModule.model.info.ts') diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/vfModule/vfModule.model.info.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/vfModule/vfModule.model.info.ts index bb56b14d0..a82cd49d7 100644 --- a/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/vfModule/vfModule.model.info.ts +++ b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/vfModule/vfModule.model.info.ts @@ -67,10 +67,10 @@ export class VFModuleModelInfo implements ILevelNodeInfo { * @param instance * @param serviceHierarchy - serviceHierarchy ************************************************************/ - getModel = (vfModuleModelId: string, instance, serviceHierarchy): any => { + getModel = (vfModuleModelId: string, instance, serviceHierarchy): Partial => { if (!_.isNil(serviceHierarchy)) { if (!_.isNil(serviceHierarchy[this.name]) && !_.isNil(serviceHierarchy[this.name][vfModuleModelId])) { - return serviceHierarchy[this.name][vfModuleModelId]; + return new VfModule(serviceHierarchy[this.name][vfModuleModelId], this._featureFlagsService.getAllFlags()); } } return {}; @@ -414,12 +414,12 @@ export class VFModuleModelInfo implements ILevelNodeInfo { return (!_.isNil(instance) && !_.isNil(instance[deepDynamicName])) ? instance[deepDynamicName].position : null; } - getInfo(model, instance): ModelInformationItem[] { - const modelInformation = !_.isEmpty(model) && !_.isEmpty(model.properties) ? [ - ModelInformationItem.createInstance("Base module", model.properties.baseModule), - ModelInformationItem.createInstance("Min instances", !_.isNull(model.properties.minCountInstances) ? String(model.properties.minCountInstances) : null), + getInfo(model:Partial, instance): ModelInformationItem[] { + const modelInformation = !_.isEmpty(model) ? [ + ModelInformationItem.createInstance("Base module", model.baseModule), + ModelInformationItem.createInstance("Min instances", !_.isNull(model.min) ? String(model.min) : null), this._sharedTreeService.createMaximumToInstantiateModelInformationItem(model), - ModelInformationItem.createInstance("Initial instances count", !_.isNull(model.properties.initialCount) ? String(model.properties.initialCount) : null) + ModelInformationItem.createInstance("Initial instances count", !_.isNull(model.initial) ? String(model.initial) : null) ] : []; const instanceInfo = []; -- cgit 1.2.3-korg