aboutsummaryrefslogtreecommitdiffstats
path: root/vid-webpack-master/src/app/drawingBoard/service-planning/component-info/component-info.service.ts
diff options
context:
space:
mode:
authorIttay Stern <ittay.stern@att.com>2019-07-07 19:23:03 +0300
committerIttay Stern <ittay.stern@att.com>2019-07-08 16:13:43 +0300
commitf792671ae247a931f34d902e9276202b5016ef9a (patch)
tree6104971e8074c9a3d720836276ff18619719ec02 /vid-webpack-master/src/app/drawingBoard/service-planning/component-info/component-info.service.ts
parentfc62274e8d15964d63c62bf0e2f4abc040252ee9 (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/component-info.service.ts')
-rw-r--r--vid-webpack-master/src/app/drawingBoard/service-planning/component-info/component-info.service.ts31
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 );
}
}