diff options
Diffstat (limited to 'vid-webpack-master/src/app/drawingBoard/service-planning/available-models-tree')
2 files changed, 7 insertions, 9 deletions
diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/available-models-tree/available-models-tree.component.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/available-models-tree/available-models-tree.component.ts index e277cb28c..13147b7e5 100644 --- a/vid-webpack-master/src/app/drawingBoard/service-planning/available-models-tree/available-models-tree.component.ts +++ b/vid-webpack-master/src/app/drawingBoard/service-planning/available-models-tree/available-models-tree.component.ts @@ -166,11 +166,11 @@ export class AvailableModelsTreeComponent { if (this._sharedTreeService.selectedVNF) { this.store.dispatch(createVFModuleInstance(vfModule, node.data.name, this.serviceModelId, null, this._sharedTreeService.selectedVNF)); DrawingBoardTreeComponent.triggerreCalculateIsDirty.next(this.serviceModelId); - } else if (this._availableModelsTreeService.getOptionalVNFs(this.serviceModelId, node.parent.data.name).length === 1) { + } else if (this._availableModelsTreeService.getOptionalVNFs(this.serviceModelId, node.parent.data.modelUniqueId).length === 1) { let existVnf = this._store.getState().service.serviceInstance[this.serviceModelId].vnfs; if(!_.isNil(existVnf)){ for(let vnfKey in existVnf){ - const modelUniqueId = existVnf[vnfKey]['modelInfo'].modelCustomizationId || existVnf[vnfKey]['modelInfo'].modelInvariantId; + const modelUniqueId = this._sharedTreeService.modelUniqueId(existVnf[vnfKey]); if(modelUniqueId === node.parent.data.id){ this.store.dispatch(createVFModuleInstance(vfModule, node.data.name, this.serviceModelId, null, vnfKey)); DrawingBoardTreeComponent.triggerreCalculateIsDirty.next(this.serviceModelId); diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/available-models-tree/available-models-tree.service.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/available-models-tree/available-models-tree.service.ts index 39a3c5070..c9a89cf6f 100644 --- a/vid-webpack-master/src/app/drawingBoard/service-planning/available-models-tree/available-models-tree.service.ts +++ b/vid-webpack-master/src/app/drawingBoard/service-planning/available-models-tree/available-models-tree.service.ts @@ -4,11 +4,11 @@ import {NgRedux} from "@angular-redux/store"; import {AppState} from "../../../shared/store/reducers"; import {MessageBoxData} from "../../../shared/components/messageBox/messageBox.data"; import {MessageBoxService} from "../../../shared/components/messageBox/messageBox.service"; -import * as _ from "lodash"; -import { SdcUiCommon} from "onap-ui-angular"; +import {SdcUiCommon} from "onap-ui-angular"; import {SharedTreeService} from "../objectsToTree/shared.tree.service"; import {VrfModel} from "../../../shared/models/vrfModel"; import {clearAllGenericModalhelper} from "../../../shared/storeUtil/utils/global/global.actions"; +import * as _ from "lodash"; export class AvailableNodeIcons { addIcon: boolean; @@ -25,7 +25,7 @@ export class AvailableNodeIcons { export class AvailableModelsTreeService { constructor(private _defaultDataGeneratorService: DefaultDataGeneratorService, private store: NgRedux<AppState>, - public _shareTreeService : SharedTreeService) { + public _sharedTreeService : SharedTreeService) { } @@ -45,19 +45,17 @@ export class AvailableModelsTreeService { return false; } - getOptionalVNFs(serviceUUID: string, vnfOriginalModelName : string) : any[] { + getOptionalVNFs(serviceUUID: string, vnfModelUniqueId: string) : any[] { let result = []; if(!_.isNil(this.store.getState().service.serviceInstance) && !_.isNil(this.store.getState().service.serviceInstance[serviceUUID])){ const serviceVNFsInstances = this.store.getState().service.serviceInstance[serviceUUID].vnfs; for(let vnfKey in serviceVNFsInstances){ - if(serviceVNFsInstances[vnfKey].originalName === vnfOriginalModelName){ + if (this._sharedTreeService.modelUniqueId(serviceVNFsInstances[vnfKey]) === vnfModelUniqueId) { serviceVNFsInstances[vnfKey].vnfStoreKey = vnfKey; result.push(serviceVNFsInstances[vnfKey]); } } } - - return result; } |