aboutsummaryrefslogtreecommitdiffstats
path: root/vid-app-common/src/main/webapp/app/vid/scripts/services/detailsService.js
diff options
context:
space:
mode:
authorSonsino, Ofir (os0695) <os0695@intl.att.com>2018-08-06 16:14:59 +0300
committerSonsino, Ofir (os0695) <os0695@intl.att.com>2018-08-06 16:14:59 +0300
commitd350d5ac25c8df2846e4f0d9082cb4d364a17a83 (patch)
tree6e2afb18b785bb98dfa61509ae89749a221ad4e8 /vid-app-common/src/main/webapp/app/vid/scripts/services/detailsService.js
parentff76b5ed0aa91d5fdf9dc4f95e8b20f91ed9d072 (diff)
UI Feature flagging support
Change-Id: Ic2151dab6306c42364483e9064c01bab3dd7378b Issue-ID: VID-208 Signed-off-by: Sonsino, Ofir (os0695) <os0695@intl.att.com>
Diffstat (limited to 'vid-app-common/src/main/webapp/app/vid/scripts/services/detailsService.js')
-rwxr-xr-xvid-app-common/src/main/webapp/app/vid/scripts/services/detailsService.js142
1 files changed, 82 insertions, 60 deletions
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/services/detailsService.js b/vid-app-common/src/main/webapp/app/vid/scripts/services/detailsService.js
index 37220ffd1..044b5b91f 100755
--- a/vid-app-common/src/main/webapp/app/vid/scripts/services/detailsService.js
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/services/detailsService.js
@@ -20,79 +20,101 @@
"use strict";
-var DetailsService = function($log, DataService, ComponentService, COMPONENT,
- FIELD, UtilityService) {
+var DetailsService = function ($log, DataService, ComponentService, COMPONENT,
+ FIELD, UtilityService) {
var _this = this;
- var getSummaryList = function() {
- switch (_this.componentId) {
- case COMPONENT.NETWORK:
- case COMPONENT.SERVICE:
- case COMPONENT.VNF:
- case COMPONENT.VF_MODULE:
- case COMPONENT.VOLUME_GROUP:
- return [ {
- name : FIELD.NAME.SUBSCRIBER_NAME,
- value : DataService.getSubscriberName()
- }, {
- name : FIELD.NAME.SERVICE_INSTANCE_ID,
- value : DataService.getServiceInstanceId()
- }, {
- name : FIELD.NAME.SERVICE_TYPE,
- value : DataService.getServiceType()
- } ];
- }
+ var getSummaryList = function () {
+ var model = DataService.getModelInfo(COMPONENT.SERVICE);
+ switch (_this.componentId) {
+ case COMPONENT.NETWORK:
+ case COMPONENT.SERVICE:
+ case COMPONENT.VNF:
+ case COMPONENT.VF_MODULE:
+ case COMPONENT.VOLUME_GROUP:
+ return [{
+ name: FIELD.NAME.SUBSCRIBER_NAME,
+ value: DataService.getSubscriberName()
+ }, {
+ name: FIELD.NAME.SERVICE_INSTANCE_ID,
+ value: DataService.getServiceInstanceId()
+ }, {
+ name: FIELD.NAME.SERVICE_TYPE,
+ value: DataService.getServiceType()
+ }, {
+ name: FIELD.NAME.MODEL_NAME,
+ value: model.modelName
+ }, {
+ name: FIELD.NAME.MODEL_VERSION,
+ value: model.modelVersion
+ }];
+ }
};
- var getDetailsList = function() {
- switch (_this.componentId) {
- case COMPONENT.NETWORK:
- case COMPONENT.SERVICE:
- case COMPONENT.VNF:
- case COMPONENT.VF_MODULE:
- case COMPONENT.VOLUME_GROUP:
- return ComponentService.getDisplayNames(ComponentService
- .getInventoryParameterList(_this.componentId, DataService
- .getInventoryItem(), false));
- }
+ var getDetailsList = function () {
+ switch (_this.componentId) {
+ case COMPONENT.NETWORK:
+ case COMPONENT.SERVICE:
+ case COMPONENT.VNF:
+ case COMPONENT.VF_MODULE:
+ case COMPONENT.VOLUME_GROUP:
+ var model = DataService.getModelInfo(_this.componentId);
+ var metaData = ComponentService.getDisplayNames(ComponentService
+ .getInventoryParameterList(_this.componentId, DataService
+ .getInventoryItem(), false));
+ if (model && !UtilityService.isObjectEmpty(model.modelName) && !UtilityService.isObjectEmpty(model.modelVersion)) {
+ metaData = metaData.concat([
+ {
+ id: FIELD.NAME.MODEL_NAME,
+ name: FIELD.NAME.MODEL_NAME,
+ value: model.modelName
+ }, {
+ id: FIELD.NAME.MODEL_VERSION,
+ name: FIELD.NAME.MODEL_VERSION,
+ value: model.modelVersion
+ }
+ ]);
+ }
+ return metaData;
+ }
};
- var getMsoFilterString = function() {
+ var getMsoFilterString = function () {
- var instanceId = "";
+ var instanceId = "";
- switch (_this.componentId) {
- case COMPONENT.NETWORK:
- instanceId = DataService.getNetworkInstanceId();
- break;
- case COMPONENT.SERVICE:
- instanceId = DataService.getServiceInstanceId();
- break;
- case COMPONENT.VNF:
- instanceId = DataService.getVnfInstanceId();
- break;
- case COMPONENT.VF_MODULE:
- instanceId = DataService.getVfModuleInstanceId();
- break;
- case COMPONENT.VOLUME_GROUP:
- instanceId = DataService.getVolumeGroupInstanceId();
- }
+ switch (_this.componentId) {
+ case COMPONENT.NETWORK:
+ instanceId = DataService.getNetworkInstanceId();
+ break;
+ case COMPONENT.SERVICE:
+ instanceId = DataService.getServiceInstanceId();
+ break;
+ case COMPONENT.VNF:
+ instanceId = DataService.getVnfInstanceId();
+ break;
+ case COMPONENT.VF_MODULE:
+ instanceId = DataService.getVfModuleInstanceId();
+ break;
+ case COMPONENT.VOLUME_GROUP:
+ instanceId = DataService.getVolumeGroupInstanceId();
+ }
- return "filter=" + _this.componentId + "InstanceId:EQUALS:"
- + instanceId;
+ return "filter=" + _this.componentId + "InstanceId:EQUALS:"
+ + instanceId;
};
return {
- initializeComponent : function(componentId) {
- _this.componentId = ComponentService.initialize(componentId);
- },
- getComponentDisplayName : ComponentService.getComponentDisplayName,
- getSummaryList : getSummaryList,
- getDetailsList : getDetailsList,
- getMsoFilterString : getMsoFilterString
+ initializeComponent: function (componentId) {
+ _this.componentId = ComponentService.initialize(componentId);
+ },
+ getComponentDisplayName: ComponentService.getComponentDisplayName,
+ getSummaryList: getSummaryList,
+ getDetailsList: getDetailsList,
+ getMsoFilterString: getMsoFilterString
}
}
-appDS2.factory("DetailsService", [ "$log", "DataService", "ComponentService",
- "COMPONENT", "FIELD", "UtilityService", DetailsService ]);
+appDS2.factory("DetailsService", ["$log", "DataService", "ComponentService",
+ "COMPONENT", "FIELD", "UtilityService", DetailsService]);