diff options
author | Ittay Stern <ittay.stern@att.com> | 2019-07-07 19:23:03 +0300 |
---|---|---|
committer | Ittay Stern <ittay.stern@att.com> | 2019-07-08 16:13:43 +0300 |
commit | f792671ae247a931f34d902e9276202b5016ef9a (patch) | |
tree | 6104971e8074c9a3d720836276ff18619719ec02 /vid-webpack-master/src/app/drawingBoard/service-planning/component-info | |
parent | fc62274e8d15964d63c62bf0e2f4abc040252ee9 (diff) |
Merge from ecomp 718fd196 - Modern UI
Issue-ID: VID-378
Change-Id: I2736b98426e324ec3aa233b034229ba84d99839f
Signed-off-by: Ittay Stern <ittay.stern@att.com>
Diffstat (limited to 'vid-webpack-master/src/app/drawingBoard/service-planning/component-info')
5 files changed, 30 insertions, 31 deletions
diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/component-info/component-info-model.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/component-info/component-info-model.ts index 4c5bf6747..d06dfbe9a 100644 --- a/vid-webpack-master/src/app/drawingBoard/service-planning/component-info/component-info-model.ts +++ b/vid-webpack-master/src/app/drawingBoard/service-planning/component-info/component-info-model.ts @@ -7,11 +7,11 @@ export class ComponentInfoModel { title: string; - constructor(type: ComponentInfoType, modelInfoItems: ModelInformationItem[], additionalInfoItems: ModelInformationItem[], isInstance:boolean=true) { + constructor(type: ComponentInfoType, modelInfoItems: ModelInformationItem[], additionalInfoItems: ModelInformationItem[], isInstance:boolean = true) { this.type = type; this.modelInfoItems = modelInfoItems; this.additionalInfoItems = additionalInfoItems; - this.title=this.type+(isInstance ? " Instance" : ""); + this.title = this.type + (isInstance ? " Instance" : ""); } } @@ -22,5 +22,11 @@ export enum ComponentInfoType { NETWORK = "Network", VFMODULE = "VFModule", VNFGROUP = "Group", - VNFMEMBER = "VNF" + VNFMEMBER = "VNF", + CONFIGURATION = "Configuration", + COLLECTION_RESOURCE = "Collection Resource", + VRF = "VRF", + PNF = "PNF", + VPN = "VPN", + NCF = "Network Collection Function" } diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/component-info/component-info.component.scss b/vid-webpack-master/src/app/drawingBoard/service-planning/component-info/component-info.component.scss index 2d7735678..62e53ed0d 100644 --- a/vid-webpack-master/src/app/drawingBoard/service-planning/component-info/component-info.component.scss +++ b/vid-webpack-master/src/app/drawingBoard/service-planning/component-info/component-info.component.scss @@ -26,7 +26,6 @@ font-family: OpenSans-Regular; font-size: 12px; color: #5A5A5A; - text-transform: capitalize; } .model-item-value { @@ -34,6 +33,7 @@ font-size: 14px; color: #191919; line-height: 16px; + word-break: break-word; } } diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/component-info/component-info.component.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/component-info/component-info.component.ts index c69ab52e1..d9fa98555 100644 --- a/vid-webpack-master/src/app/drawingBoard/service-planning/component-info/component-info.component.ts +++ b/vid-webpack-master/src/app/drawingBoard/service-planning/component-info/component-info.component.ts @@ -7,8 +7,8 @@ import {ActivatedRoute} from "@angular/router"; @Component({ selector: 'component-info', templateUrl: './component-info.component.html', - styleUrls: ['./component-info.component.scss'], - changeDetection: ChangeDetectionStrategy.OnPush + styleUrls: ['./component-info.component.scss']//, + // changeDetection: ChangeDetectionStrategy.OnPush }) export class ComponentInfoComponent implements OnInit { componentInfoModel: ComponentInfoModel = null; diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/component-info/component-info.service.spec.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/component-info/component-info.service.spec.ts index 8b0da409b..6671e2e18 100644 --- a/vid-webpack-master/src/app/drawingBoard/service-planning/component-info/component-info.service.spec.ts +++ b/vid-webpack-master/src/app/drawingBoard/service-planning/component-info/component-info.service.spec.ts @@ -7,6 +7,7 @@ import {HttpClient, HttpHandler} from '@angular/common/http'; import {FeatureFlagsService} from '../../../shared/services/featureFlag/feature-flags.service'; import {ModelInformationItem} from "../../../shared/components/model-information/model-information.component"; import {ComponentInfoModel, ComponentInfoType} from "./component-info-model"; +import {SharedTreeService} from "../objectsToTree/shared.tree.service"; class MockAppStore<T> { getState() { @@ -58,6 +59,7 @@ beforeAll(done => (async () => { HttpHandler, FeatureFlagsService, ComponentInfoService, + SharedTreeService, {provide: NgRedux, useClass: MockAppStore}, MockNgRedux] }); @@ -77,12 +79,12 @@ describe('Service Info Data', () => { let actualServiceInfo = service.getInfoForService('1a80c596-27e5-4ca9-b5bb-e03a7fd4c0fd'); let expectedServiceInfo = [ ModelInformationItem.createInstance('Type', 'pnf'), - ModelInformationItem.createInstance('Model Version', '1.0'), - ModelInformationItem.createInstance('Model Customization ID', ''), + ModelInformationItem.createInstance('Model version', '1.0'), + ModelInformationItem.createInstance('Model customization ID', ''), ModelInformationItem.createInstance('Instance ID', '2f7130e8-27d6-4c01-8988-60ca67e8dae4'), - ModelInformationItem.createInstance('Subscriber Name', 'SILVIA ROBBINS'), - ModelInformationItem.createInstance('Service Type', 'TYLER SILVIA'), - ModelInformationItem.createInstance('Service Role', 'Testing'), + ModelInformationItem.createInstance('Subscriber name', 'SILVIA ROBBINS'), + ModelInformationItem.createInstance('Service type', 'TYLER SILVIA'), + ModelInformationItem.createInstance('Service role', 'Testing'), ]; expect(actualServiceInfo).toEqual(new ComponentInfoModel(ComponentInfoType.SERVICE, expectedServiceInfo, [])); 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 ); } } |