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 | |
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')
2 files changed, 17 insertions, 3 deletions
diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/objectToInstanceTree/objectToInstanceTree.service.spec.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/objectToInstanceTree/objectToInstanceTree.service.spec.ts index 1ba9a239c..69d530d90 100644 --- a/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/objectToInstanceTree/objectToInstanceTree.service.spec.ts +++ b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/objectToInstanceTree/objectToInstanceTree.service.spec.ts @@ -2466,7 +2466,6 @@ describe('Model Tree Generator service', () => { "tenantId": "229bcdc6eaeb4ca59d55221141d01f8e", "platformName": "xxx1", "lineOfBusiness": "ONAP", - "uuid": "network-instance-model-version-id", "routeTarget": { "globalRouteTarget": "mock-global-1", "routeTargetRole": "mock-role-x" @@ -2596,6 +2595,7 @@ describe('Model Tree Generator service', () => { "inMaint": true, "name": "2017-388_PASQUALE-vPE 0", "modelName": "2017-388_PASQUALE-vPE 0", + "modelTypeName": "vnfs", "type": "VF", "parentType": '', "isEcompGeneratedNaming": false, @@ -2623,6 +2623,7 @@ describe('Model Tree Generator service', () => { "parentType": '', "name": "2017-488_PASQUALE-vPE 0", "modelName": "2017-488_PASQUALE-vPE 0", + "modelTypeName": "vnfs", "type": "VF", "isEcompGeneratedNaming": false, "networkStoreKey": "2017-488_PASQUALE-vPE 0", @@ -2644,6 +2645,7 @@ describe('Model Tree Generator service', () => { "statusMessage": "Failed vfModel message", "name": "<Automatically Assigned>", "modelName": "2017488_pasqualevpe0..2017488PasqualeVpe..PASQUALE_base_vPE_BV..module-0", + "modelTypeName": "vfModules", "type": "VFmodule", "isEcompGeneratedNaming": false, "dynamicInputs": [], @@ -2668,6 +2670,7 @@ describe('Model Tree Generator service', () => { "id": "o65b26t2thj", "name": "2017488_PASQUALEvPE", "modelName": "2017-488_PASQUALE-vPE 0", + "modelTypeName": "vnfs", "type": "VF", "isEcompGeneratedNaming": false, "vnfStoreKey": "2017-488_PASQUALE-vPE 0", @@ -2684,6 +2687,7 @@ describe('Model Tree Generator service', () => { "missingData": false, "name": "yoav", "modelName": "2017488_pasqualevpe0..2017488PasqualeVpe..PASQUALE_vRE_BV..module-1", + "modelTypeName": "vfModules", "type": "VFmodule", "isEcompGeneratedNaming": false, "typeName": "M", @@ -2746,6 +2750,7 @@ describe('Model Tree Generator service', () => { "routeTargetRole": "mock-role-x", "statusMessage": "Network failed message", "modelName": "ExtVL 0", + "modelTypeName": "networks", "type": "VL", "isEcompGeneratedNaming": true, "networkStoreKey": "ExtVL 0", @@ -2765,6 +2770,7 @@ describe('Model Tree Generator service', () => { "id": "2mdxioxca9h", "name": "<Automatically Assigned>", "modelName": "ExtVL 0", + "modelTypeName": "networks", "type": "VL", "isEcompGeneratedNaming": true, "networkStoreKey": "ExtVL 0:0001", @@ -2779,6 +2785,7 @@ describe('Model Tree Generator service', () => { "id": "z7vd1gmpbs", "name": "ExtVL", "modelName": "ExtVL 0", + "modelTypeName": "networks", "type": "VL", "isEcompGeneratedNaming": true, "networkStoreKey": "ExtVL 0_1", 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; |