diff options
author | Ittay Stern <ittay.stern@att.com> | 2020-02-02 18:09:40 +0200 |
---|---|---|
committer | Ittay Stern <ittay.stern@att.com> | 2020-02-03 19:32:49 +0200 |
commit | 0814238f615f3e3b855a53add72730b957f6c790 (patch) | |
tree | a9170ece7827b039de56534459bcfa0c76ebb7e5 /vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/objectToInstanceTree/objectToInstanceTree.service.ts | |
parent | 52670a9e0b450074dfbe0d151925d0133bc8442a (diff) |
NodeInfo::getModel expects the instance-model
Now callers (objectToInstanceTree, objectToModelTree, etc.) pass the hierarchy
itself, instead of providing only the service hierarchy and keys.
Issue-ID: VID-724
Change-Id: I80cde29887d86b2cc986d96b220ff769562f38b8
Signed-off-by: Ittay Stern <ittay.stern@att.com>
Diffstat (limited to 'vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/objectToInstanceTree/objectToInstanceTree.service.ts')
-rw-r--r-- | vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/objectToInstanceTree/objectToInstanceTree.service.ts | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/objectToInstanceTree/objectToInstanceTree.service.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/objectToInstanceTree/objectToInstanceTree.service.ts index 89d901f55..13dca560c 100644 --- a/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/objectToInstanceTree/objectToInstanceTree.service.ts +++ b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/objectToInstanceTree/objectToInstanceTree.service.ts @@ -8,10 +8,12 @@ import {ErrorMsgService} from "../../../../shared/components/error-msg/error-msg import {FeatureFlagsService, Features} from "../../../../shared/services/featureFlag/feature-flags.service"; import {NgRedux} from "@angular-redux/store"; import {AppState} from "../../../../shared/store/reducers"; +import {SharedTreeService} from "../shared.tree.service"; @Injectable() export class ObjectToInstanceTreeService { - constructor(private _objectToTreeService: ObjectToTreeService, private _errorMsgService: ErrorMsgService, private store: NgRedux<AppState>) { + constructor(private _objectToTreeService: ObjectToTreeService, private _errorMsgService: ErrorMsgService, + private store: NgRedux<AppState>, private _sharedTreeService: SharedTreeService) { this.numberOfFailed = 0; this.numberOfElements = 0; @@ -76,7 +78,11 @@ export class ObjectToInstanceTreeService { * @param parentType ****************************************************************/ getNodeInstance(modelName: string, parentModel: any, instance: any, serviceHierarchy, option: ILevelNodeInfo, serviceModelId: string, parentType ?: string) { - const model = option.getModel(modelName, instance, serviceHierarchy); + const instanceModel = this._sharedTreeService.modelByIdentifiers( + serviceHierarchy, option.name, + this._sharedTreeService.modelUniqueNameOrId(instance), modelName + ); + const model = option.getModel(instanceModel); let optionalNodes = option.createInstanceTreeNode(instance, model, parentModel, modelName, serviceModelId); this.increaseNumberOfFailed(optionalNodes); @@ -99,6 +105,7 @@ export class ObjectToInstanceTreeService { node.parentType = !_.isNil(parentType) ? parentType : ""; node.updatePoistionFunction = option.updatePosition; node.position = option.getNodePosition(instance, node.dynamicModelName); + node.modelTypeName = option.name; node.getModel = option.getModel.bind(option); node.getInfo = !_.isNil(option.getInfo) ? option.getInfo.bind(option) : ()=>{}; node.componentInfoType = option.componentInfoType; |