diff options
author | Ittay Stern <ittay.stern@att.com> | 2020-01-21 12:20:37 +0200 |
---|---|---|
committer | Ittay Stern <ittay.stern@att.com> | 2020-01-21 15:48:40 +0200 |
commit | 6b1e53d593a958254481f2043f6da8c6c96d4a0b (patch) | |
tree | 69f66ce6d3961c66fec2fc55618a426776715604 /vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/configuration | |
parent | b96cada06214d609d32a38ca89d71cc53169324c (diff) |
originalName may be model's "entry name", customizationId or invariantId
The classic originalName is the "entry name". So two more options
were added through SharedTreeService::modelByIdentifier()
function.
Issue-ID: VID-724
Change-Id: I9f192d2b24c9c1659a95baabd21252bed392e9da
Signed-off-by: Ittay Stern <ittay.stern@att.com>
Diffstat (limited to 'vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/configuration')
2 files changed, 8 insertions, 5 deletions
diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/configuration/configuration.model.info.spec.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/configuration/configuration.model.info.spec.ts index 6b67de6aa..d1d6817bf 100644 --- a/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/configuration/configuration.model.info.spec.ts +++ b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/configuration/configuration.model.info.spec.ts @@ -1,11 +1,12 @@ import {HttpClientTestingModule} from "@angular/common/http/testing"; -import {TestBed} from "@angular/core/testing"; +import {getTestBed, TestBed} from "@angular/core/testing"; import {MockNgRedux, NgReduxTestingModule} from "@angular-redux/store/testing"; import {DynamicInputsService} from "../../dynamicInputs.service"; import {ConfigurationModelInfo} from "./configuration.model.info"; import {SharedTreeService} from "../../shared.tree.service"; describe('Vnf Model Info', () => { + let injector; let _dynamicInputsService : DynamicInputsService; let _sharedTreeService : SharedTreeService; @@ -18,6 +19,9 @@ describe('Vnf Model Info', () => { DynamicInputsService] }); await TestBed.compileComponents(); + + injector = getTestBed(); + _sharedTreeService = injector.get(SharedTreeService); })().then(done).catch(done.fail)); test('ConfigurationModelInfo should be defined', () => { diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/configuration/configuration.model.info.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/configuration/configuration.model.info.ts index 0d1a9aade..d9702b4c4 100644 --- a/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/configuration/configuration.model.info.ts +++ b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/configuration/configuration.model.info.ts @@ -31,10 +31,9 @@ export class ConfigurationModelInfo implements ILevelNodeInfo{ * @param serviceHierarchy - serviceHierarchy ************************************************************/ getModel = (configurationModelId : string, serviceHierarchy) : any =>{ - if(!_.isNil(serviceHierarchy)){ - if(!_.isNil(serviceHierarchy[this.name]) && !_.isNil(serviceHierarchy[this.name][configurationModelId])){ - return serviceHierarchy[this.name][configurationModelId]; - } + const model = this._sharedTreeService.modelByIdentifier(serviceHierarchy, this.name, configurationModelId); + if (!_.isNil(model)) { + return model; } return {}; }; |