diff options
author | 2019-07-09 14:23:37 +0000 | |
---|---|---|
committer | 2019-07-09 14:23:37 +0000 | |
commit | 58d22b526418ffeb89337fed9e20406da420bc6f (patch) | |
tree | 4357c9cfe1c92d57ac0a3f90167cade7af505b95 /vid-webpack-master/src/app/drawingBoard/service-planning/component-info/component-info.service.ts | |
parent | 302b02a847e7aa8ccf3ff4bc14ff8a9cf67511b0 (diff) | |
parent | 97d9f66df456ef4573047a90baa3cc3ee4bfb0b7 (diff) |
Merge changes Ib4430bf2,Icc0bdb9e,I2736b984
* changes:
Merge from ecomp 718fd196 - Ext. Services Simulator
Merge from ecomp 718fd196 - Integration Tests
Merge from ecomp 718fd196 - Modern UI
Diffstat (limited to 'vid-webpack-master/src/app/drawingBoard/service-planning/component-info/component-info.service.ts')
-rw-r--r-- | vid-webpack-master/src/app/drawingBoard/service-planning/component-info/component-info.service.ts | 31 |
1 files changed, 11 insertions, 20 deletions
diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/component-info/component-info.service.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/component-info/component-info.service.ts index 9318b3aa7..32610d993 100644 --- a/vid-webpack-master/src/app/drawingBoard/service-planning/component-info/component-info.service.ts +++ b/vid-webpack-master/src/app/drawingBoard/service-planning/component-info/component-info.service.ts @@ -6,36 +6,27 @@ import {Subject} from "rxjs"; import {ComponentInfoModel, ComponentInfoType} from "./component-info-model"; import {ModelInformationItem} from "../../../shared/components/model-information/model-information.component"; import * as _ from 'lodash'; +import {SharedTreeService} from "../objectsToTree/shared.tree.service"; @Injectable() export class ComponentInfoService { static triggerComponentInfoChange: Subject<ComponentInfoModel> = new Subject<ComponentInfoModel>(); - constructor( private _store: NgRedux<AppState>, private _aaiService : AaiService){ } + constructor( private _store: NgRedux<AppState>, private _aaiService : AaiService, private _sharedTreeService : SharedTreeService){ } getInfoForService(serviceModelId):ComponentInfoModel { if(_.isNil(this._store.getState().service.serviceHierarchy[serviceModelId])) return null; - let serviceHierarchy = this._store.getState().service.serviceHierarchy[serviceModelId].service; + const serviceHierarchy = this._store.getState().service.serviceHierarchy[serviceModelId].service; const serviceInstance = this._store.getState().service.serviceInstance[serviceModelId]; const modelInfoItems: ModelInformationItem[] = [ - ModelInformationItem.createInstance("Subscriber Name",this._aaiService.extractSubscriberNameBySubscriberId(serviceInstance.globalSubscriberId)), - ModelInformationItem.createInstance("Service Type",serviceInstance.subscriptionServiceType), - ModelInformationItem.createInstance("Service Role",serviceHierarchy.serviceRole), + ModelInformationItem.createInstance("Type", serviceHierarchy.serviceType), + ModelInformationItem.createInstance("Model version", serviceHierarchy.version ), + ModelInformationItem.createInstance("Model customization ID", serviceHierarchy.customizationUuid ), + ModelInformationItem.createInstance("Instance ID", serviceInstance.instanceId), + ModelInformationItem.createInstance("Subscriber name",this._aaiService.extractSubscriberNameBySubscriberId(serviceInstance.globalSubscriberId)), + ModelInformationItem.createInstance("Service type",serviceInstance.subscriptionServiceType), + ModelInformationItem.createInstance("Service role",serviceHierarchy.serviceRole), ]; - serviceHierarchy.type = serviceHierarchy.serviceType; - return this.addGeneralInfoItems(modelInfoItems, ComponentInfoType.SERVICE, serviceHierarchy, serviceInstance ); - } - - addGeneralInfoItems(modelInfoSpecificItems: ModelInformationItem[], type: ComponentInfoType, model, instance) { - let modelInfoItems: ModelInformationItem[] = [ - ModelInformationItem.createInstance("Type", (model && model.type) ? model.type : ((instance && instance.modelInfo) ? instance.modelInfo.modelType : null)), - ModelInformationItem.createInstance("Model Version", model ? model.version : null), - ModelInformationItem.createInstance("Model Customization ID", model ? model.customizationUuid : null), - ModelInformationItem.createInstance("Instance ID", instance ? instance.instanceId : null), - ModelInformationItem.createInstance("In Maintenance", instance? instance.inMaint : null), - ]; - modelInfoItems = modelInfoItems.concat(modelInfoSpecificItems); - const modelInfoItemsWithoutEmpty = _.filter(modelInfoItems, function(item){ return !item.values.every(_.isNil)}); - return new ComponentInfoModel(type, modelInfoItemsWithoutEmpty, []); + return this._sharedTreeService.getComponentInfoModelByModelInformationItems(modelInfoItems, ComponentInfoType.SERVICE, serviceInstance ); } } |