appDS2.controller("aaiSubscriberController", ["COMPONENT", "FIELD", "PARAMETER", "DataService", "PropertyService", "$scope", "$http", "$timeout", "$location", "$log", "$route", "$uibModal", "VIDCONFIGURATION", "UtilityService", "vidService", "AaiService", "MsoService", "OwningEntityService", "AsdcService","featureFlags", "$q", "_",\r
function (COMPONENT, FIELD, PARAMETER, DataService, PropertyService, $scope, $http, $timeout, $location, $log, $route, $uibModal, VIDCONFIGURATION, UtilityService, vidService, AaiService, MsoService, OwningEntityService, AsdcService, featureFlags, $q, _) {\r
\r
+ $scope.showReportWindow = function() {\r
+ let GuiMessage;\r
+\r
+ if ($scope.errorMsg !== undefined && $scope.errorMsg !== null) {\r
+ GuiMessage = $scope.errorMsg;\r
+ } else {\r
+ GuiMessage = $scope.status;\r
+ }\r
+\r
+ const modalWindow = $uibModal.open({\r
+ templateUrl: 'app/vid/scripts/modals/report-modal/report-modal.html',\r
+ controller: 'reportModalController',\r
+ controllerAs: 'vm',\r
+ resolve: {\r
+ errorMsg: function () {\r
+ return GuiMessage;\r
+ }\r
+ }\r
+ });\r
+ };\r
+\r
$scope.showVnfDetails = function (vnf) {\r
console.log("showVnfDetails");\r
DataService.setVnfInstanceId(COMPONENT.VNF_INSTANCE_ID);\r
componentId: COMPONENT.VNF,\r
callbackFunction: callbackFunction\r
});\r
- }\r
+ };\r
$scope.popup = new Object();\r
\r
\r
\r
$scope.getServiceTypes = function (globalCustomerId) {\r
DataService.setGlobalCustomerId(globalCustomerId);\r
- DataService.setServiceIdList($scope.customerList)\r
+ DataService.setServiceIdList($scope.customerList);\r
\r
if (globalCustomerId !== "" && globalCustomerId !== undefined) {\r
window.location.href = COMPONENT.SERVICE_TYPE_LIST_PATH + $scope.serviceTypeList;\r
}\r
- }\r
+ };\r
\r
$scope.refreshServiceTypes = function (globalCustomerId) {\r
DataService.setGlobalCustomerId(globalCustomerId);\r
\r
$scope.getServiceTypesList();\r
- }\r
+ };\r
\r
$scope.subId = "";\r
$scope.createSubscriberName = "";\r
$scope.subList = [];\r
$scope.getAaiServiceModels = function (selectedServicetype, subName) {\r
DataService.setGlobalCustomerId(selectedServicetype);\r
- DataService.setServiceIdList($scope.serviceTypeList)\r
+ DataService.setServiceIdList($scope.serviceTypeList);\r
DataService.setSubscriberName(subName);\r
\r
DataService.setSubscribers($scope.custSubList);\r
callbackFunction: function (response) {\r
}\r
});\r
- }\r
+ };\r
$scope.cancelCreateSIType = function () {\r
\r
window.location.href = COMPONENT.SERVICE_MODLES_INSTANCES_SUBSCRIBERS_PATH;\r
\r
- }\r
+ };\r
\r
$scope.fetchServices = function () {\r
var serviceIdList = [];\r
$scope.errorMsg = FIELD.ERROR.AAI_FETCHING_CUST_DATA + response.status;\r
$scope.errorDetails = response.data;\r
});\r
- }\r
+ };\r
\r
$scope.getPermitted = function (item) {\r
return item.isPermitted || item[FIELD.ID.IS_PERMITTED];\r
\r
- }\r
+ };\r
\r
\r
$scope.getSubDetails = function () {\r
$scope.enableCloseButton(false);\r
$scope.resetProgress();\r
$scope.setProgress(2); // Show "a little" progress\r
- }\r
+ };\r
\r
function getRelatedInstanceGroupsByVnfId(genericVnf) {\r
var model = vidService.getModel();\r
if (model && model.vnfs && !_.isEmpty(model.vnfs)) {\r
Object.keys(model.vnfs).forEach(function (key) {\r
var vnf = model.vnfs[key];\r
- if (vnf.vfcInstanceGroups && !_.isEmpty(vnf.vfcInstanceGroups)) {\r
- if (vnf.uuid === genericVnf.modelVersionId) {\r
+ if (vnf.vfcInstanceGroups && !_.isEmpty(vnf.vfcInstanceGroups) && vnf.uuid === genericVnf.modelVersionId) {\r
AaiService.getInstanceGroupsByVNFInstanceId(genericVnf.nodeId,\r
function (response) { //success\r
handleGetRelatedInstanceGroupsResponseForVnf(response, genericVnf);\r
}\r
)\r
}\r
- }\r
- })\r
+ });\r
}\r
}\r
\r
return resolveIfIsPermitted()\r
.then(function() {\r
return getAsdcModelByVersionId(modelVersionId);\r
- })\r
+ });\r
}\r
}\r
\r
$scope.isPermitted = first.isPermitted;\r
deferred.resolve(first.isPermitted);\r
} else {\r
- deferred.reject("some error while resolveIfIsPermitted")\r
+ deferred.reject("some error while resolveIfIsPermitted");\r
}\r
});\r
\r
// the response is erroneous\r
console.log("aaiSubscriber getAsdcModel BAD RESPONSE");\r
errorCallback(response);\r
- return $q.reject()\r
+ return $q.reject();\r
}\r
}, errorCallback);\r
\r
if (item[FIELD.ID.SERVICE_INSTANCES] != null) {\r
item[FIELD.ID.SERVICE_INSTANCES][FIELD.ID.SERVICE_INSTANCE].forEach(function (service) {\r
if (service[FIELD.ID.SERVICE_INSTANCE_ID] === serviceId) {\r
- orchStatus = service['orchestration-status']\r
+ orchStatus = service['orchestration-status'];\r
}\r
- })\r
+ });\r
}\r
});\r
return orchStatus;\r
}, function (response) {\r
//TODO\r
});\r
- }\r
+ };\r
\r
$scope.isConfigurationDataAvailiable = function (configuration) {\r
$log.debug(configuration);\r
return configuration.configData && (!configuration.configData.errorDescription);\r
- }\r
+ };\r
+\r
+ $scope.allowConfigurationActions = function (configuration) {\r
+ $log.debug(configuration);\r
+ return configuration.nodeStatus &&\r
+ _.some(\r
+ [FIELD.STATUS.AAI_ACTIVE, FIELD.STATUS.AAI_INACTIVE, FIELD.STATUS.AAI_CREATED],\r
+ function (s) {\r
+ return s.toLowerCase() === configuration.nodeStatus.toLowerCase();\r
+ });\r
+ };\r
\r
$scope.isActivateDeactivateEnabled = function(btnType) {\r
if ($scope.serviceOrchestrationStatus) {\r
return featureFlags.isOn(COMPONENT.FEATURE_FLAGS.FLAG_SHOW_VERIFY_SERVICE);\r
}\r
\r
+ $scope.isShowErrorReport = function() {\r
+ return featureFlags.isOn(COMPONENT.FEATURE_FLAGS.FLAG_CREATE_ERROR_REPORTS);\r
+ }\r
+\r
$scope.isEnableVerifyService = function () {\r
//Button should only be enabled when the service type is A la carte\r
if (DataService.getALaCarte()) {\r
};\r
\r
$scope.isShowAssignmentsEnabled = function () {\r
- if (featureFlags.isOn(COMPONENT.FEATURE_FLAGS.FLAG_SHOW_ASSIGNMENTS)) {\r
- if ($scope.serviceOrchestrationStatus) {\r
+ if (featureFlags.isOn(COMPONENT.FEATURE_FLAGS.FLAG_SHOW_ASSIGNMENTS) && $scope.serviceOrchestrationStatus) {\r
return $scope.serviceOrchestrationStatus.toLowerCase() === 'assigned';\r
}\r
- }\r
return false;\r
};\r
\r
\r
$scope.isResumeShown = function (status) {\r
var vfModuleStatus = status.toLowerCase();\r
- var serviceStatus = $scope.serviceOrchestrationStatus && $scope.serviceOrchestrationStatus.toLowerCase();\r
- return _.includes(['pendingactivation', 'assigned'], vfModuleStatus) && !$scope.isActivateDeactivateEnabled("activate");\r
+ var vfModuleStatusHasAllowedResume = ['pendingactivation', 'assigned'];\r
+ if (featureFlags.isOn(COMPONENT.FEATURE_FLAGS.FLAG_VF_MODULE_RESUME_STATUS_CREATE)) {\r
+ vfModuleStatusHasAllowedResume.push('created');\r
+ }\r
+ return _.includes(vfModuleStatusHasAllowedResume, vfModuleStatus) && !$scope.isActivateDeactivateEnabled("activate");\r
};\r
\r
$scope.handleInitialResponseInventoryItems = function (response) {\r
if( !$scope.hasFabricConfigurations ) {\r
portMirroringConfigurationIds.push(configObject[FIELD.ID.CONFIGURATION_ID]);\r
$scope.service.instance[FIELD.ID.CONFIGURATIONS].push(config);\r
- $scope.allowConfigurationActions = [FIELD.STATUS.AAI_ACTIVE, FIELD.STATUS.AAI_INACTIVE, FIELD.STATUS.AAI_CREATED].indexOf(config.nodeStatus) != -1;\r
} else {\r
if (config.nodeStatus.toLowerCase() !== FIELD.STATUS.ASSIGNED.toLowerCase()) {\r
$scope.allConfigurationsAssigned = false;\r