diff options
author | Ittay Stern <ittay.stern@att.com> | 2019-07-17 13:26:12 +0300 |
---|---|---|
committer | Ittay Stern <ittay.stern@att.com> | 2019-07-18 02:00:08 +0000 |
commit | 97cffb810fcf3d3f02d814827f24adc090cf8e2e (patch) | |
tree | fee8c342942a667f3128d1925649d6f83064427b /vid-app-common/src/main/webapp/app/vid/scripts/controller | |
parent | db98c7976e57f8bacbcc93b802b4d05b1db7b8cf (diff) |
Merge from ecomp 3374149f - AngularJS UI
Issue-ID: VID-378
Change-Id: I6b3243b492009035c911f63b93258ea76938fcb9
Signed-off-by: Ittay Stern <ittay.stern@att.com>
Diffstat (limited to 'vid-app-common/src/main/webapp/app/vid/scripts/controller')
5 files changed, 54 insertions, 15 deletions
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/controller/InstantiationController.js b/vid-app-common/src/main/webapp/app/vid/scripts/controller/InstantiationController.js index 3c11594bf..6eed08033 100755 --- a/vid-app-common/src/main/webapp/app/vid/scripts/controller/InstantiationController.js +++ b/vid-app-common/src/main/webapp/app/vid/scripts/controller/InstantiationController.js @@ -74,7 +74,7 @@ };
- $scope.isCR = !_.isEmpty($scope.service.model.collectionResource) && featureFlags.isOn(COMPONENT.FEATURE_FLAGS.FLAG_COLLECTION_RESOURCE_SUPPORT);
+ $scope.isCR = !_.isEmpty($scope.service.model.collectionResources);
if ($scope.isCR)
prepareCr();
else
@@ -224,6 +224,13 @@ });
};
+ $scope.allowTransferToNewScreenAndShowButton = function (){
+ if(featureFlags.isOn(COMPONENT.FEATURE_FLAGS.FLAG_FLASH_REPLACE_VF_MODULE)) {
+ return $scope.isPermitted && !($scope.isMacro());
+ }
+ return false;
+ };
+
$scope.deleteService = function (serviceObject, serviceOrchestrationStatus) {
var serviceInstance = serviceObject.object;
@@ -1221,6 +1228,14 @@ $scope.resume = function (serviceObject, vfModule, vnfModel) {
populate_popup_vfModule(serviceObject, vfModule, vnfModel);
setCurrentVNFModelInfo(vnfModel);
+
+ var availableVolumeGroupList = [];
+ angular.forEach(vfModule.volumeGroups, function (volumeGroupInstance, key) {
+ availableVolumeGroupList.push({"instance": volumeGroupInstance});
+ });
+
+ DataService.setAvailableVolumeGroupList(availableVolumeGroupList);
+
DataService.setVfModuleInstanceName(vfModule.object[FIELD.ID.VF_MODULE_NAME]);
setCurrentServiceModelInfoFromScope();
@@ -1240,6 +1255,7 @@ else {
$scope.$broadcast(COMPONENT.DELETE_RESUME_COMPONENT, {
componentId: COMPONENT.VF_MODULE,
+ volumeGroups: vfModule.volumeGroups,
callbackFunction: deleteOrResumeCallback,
dialogMethod: COMPONENT.RESUME
});
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/controller/ServiceModelController.js b/vid-app-common/src/main/webapp/app/vid/scripts/controller/ServiceModelController.js index 62ef1a4f2..9cb905038 100755 --- a/vid-app-common/src/main/webapp/app/vid/scripts/controller/ServiceModelController.js +++ b/vid-app-common/src/main/webapp/app/vid/scripts/controller/ServiceModelController.js @@ -64,7 +64,8 @@ $scope.currentPageNum=1;
$scope.isSpinnerVisible = false;
$scope.isProgressVisible = false;
- if (sessionStorage.getItem("searchKey")!='undefined' && ($scope.rememberFilter)) {
+ var searchKey = sessionStorage.getItem("searchKey");
+ if (searchKey != 'undefined' && searchKey!=null && ($scope.rememberFilter)) {
var searchKey = JSON.parse(sessionStorage.getItem("searchKey"));
$scope.searchString = searchKey.searchString || '';
$scope.viewPerPage = searchKey.viewPerPage || defaultViewPerPage;
@@ -206,7 +207,7 @@ DataService.setShouldIncludeInAsyncInstantiationFlow(shouldTakeTheAsyncInstantiationFlow);
DataService.setALaCarte (true);
- DataService.setPnf(!angular.equals(serviceModel.pnfs, {}));
+ DataService.setPnf(!angular.equals(serviceModel.pnfs, {}));
$scope.createType = COMPONENT.A_LA_CARTE;
var broadcastType = COMPONENT.CREATE_COMPONENT;
if (AsdcService.isMacro(serviceModel) || DataService.getE2EService()) {
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/controller/aaiSubscriberController.js b/vid-app-common/src/main/webapp/app/vid/scripts/controller/aaiSubscriberController.js index 191251860..ed03e3aec 100755 --- a/vid-app-common/src/main/webapp/app/vid/scripts/controller/aaiSubscriberController.js +++ b/vid-app-common/src/main/webapp/app/vid/scripts/controller/aaiSubscriberController.js @@ -720,7 +720,17 @@ appDS2.controller("aaiSubscriberController", ["COMPONENT", "FIELD", "PARAMETER", $scope.isConfigurationDataAvailiable = function (configuration) {
$log.debug(configuration);
return configuration.configData && (!configuration.configData.errorDescription);
- }
+ };
+
+ $scope.allowConfigurationActions = function (configuration) {
+ $log.debug(configuration);
+ return configuration.nodeStatus &&
+ _.some(
+ [FIELD.STATUS.AAI_ACTIVE, FIELD.STATUS.AAI_INACTIVE, FIELD.STATUS.AAI_CREATED],
+ function (s) {
+ return s.toLowerCase() === configuration.nodeStatus.toLowerCase();
+ });
+ };
$scope.isActivateDeactivateEnabled = function(btnType) {
if ($scope.serviceOrchestrationStatus) {
@@ -800,8 +810,11 @@ appDS2.controller("aaiSubscriberController", ["COMPONENT", "FIELD", "PARAMETER", $scope.isResumeShown = function (status) {
var vfModuleStatus = status.toLowerCase();
- var serviceStatus = $scope.serviceOrchestrationStatus && $scope.serviceOrchestrationStatus.toLowerCase();
- return _.includes(['pendingactivation', 'assigned'], vfModuleStatus) && !$scope.isActivateDeactivateEnabled("activate");
+ var vfModuleStatusHasAllowedResume = ['pendingactivation', 'assigned'];
+ if (featureFlags.isOn(COMPONENT.FEATURE_FLAGS.FLAG_VF_MODULE_RESUME_STATUS_CREATE)) {
+ vfModuleStatusHasAllowedResume.push('created');
+ }
+ return _.includes(vfModuleStatusHasAllowedResume, vfModuleStatus) && !$scope.isActivateDeactivateEnabled("activate");
};
$scope.handleInitialResponseInventoryItems = function (response) {
@@ -1039,7 +1052,6 @@ appDS2.controller("aaiSubscriberController", ["COMPONENT", "FIELD", "PARAMETER", if( !$scope.hasFabricConfigurations ) {
portMirroringConfigurationIds.push(configObject[FIELD.ID.CONFIGURATION_ID]);
$scope.service.instance[FIELD.ID.CONFIGURATIONS].push(config);
- $scope.allowConfigurationActions = [FIELD.STATUS.AAI_ACTIVE, FIELD.STATUS.AAI_INACTIVE, FIELD.STATUS.AAI_CREATED].indexOf(config.nodeStatus) != -1;
} else {
if (config.nodeStatus.toLowerCase() !== FIELD.STATUS.ASSIGNED.toLowerCase()) {
$scope.allConfigurationsAssigned = false;
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/controller/deleteResumeDialogController.js b/vid-app-common/src/main/webapp/app/vid/scripts/controller/deleteResumeDialogController.js index d1a6ca5e4..d7b7bab33 100644 --- a/vid-app-common/src/main/webapp/app/vid/scripts/controller/deleteResumeDialogController.js +++ b/vid-app-common/src/main/webapp/app/vid/scripts/controller/deleteResumeDialogController.js @@ -20,8 +20,8 @@ "use strict"; -var deleteResumeDialogController = function( COMPONENT, FIELD, $scope, $http, $timeout, $log, - DeleteResumeService, CreationService, DataService, UtilityService) { +var deleteResumeDialogController = function( COMPONENT, FIELD, $scope, $http, $timeout, $log, DataService, + DeleteResumeService, CreationService, UtilityService) { $scope.isDialogVisible = false; $scope.summaryControl = {}; @@ -29,11 +29,12 @@ var deleteResumeDialogController = function( COMPONENT, FIELD, $scope, $http, $t var callbackFunction = undefined; var componentId = undefined; + var volumeGroups = undefined; $scope.dialogMethod = COMPONENT.DELETE; $scope.$on(COMPONENT.DELETE_RESUME_COMPONENT, function(event, request) { - $scope.isE2EService = false; + $scope.isE2EService = false; $scope.isDataVisible = false; $scope.isSpinnerVisible = false; $scope.isErrorVisible = false; @@ -44,7 +45,7 @@ var deleteResumeDialogController = function( COMPONENT, FIELD, $scope, $http, $t $scope.serviceStatus = request.serviceStatus; callbackFunction = request.callbackFunction; componentId = request.componentId; - + volumeGroups = request.volumeGroups ? request.volumeGroups : []; DeleteResumeService.initializeComponent(request.componentId); $scope.componentName = DeleteResumeService.getComponentDisplayName(); @@ -116,8 +117,17 @@ var deleteResumeDialogController = function( COMPONENT, FIELD, $scope, $http, $t CreationService.initializeComponent(componentId); CreationService.setInventoryInfo(); - var requestDetails = CreationService.getMsoRequestDetails($scope.userProvidedControl.getList()); + var parameterList = $scope.userProvidedControl.getList(); + + if (volumeGroups && volumeGroups.length > 0) { + var volumeGroupList = FIELD.PARAMETER.AVAILABLE_VOLUME_GROUP; + volumeGroupList.value = _.map(volumeGroups, function (volumeGroup) { + return volumeGroup.name; + }); + parameterList.push(volumeGroupList); + } + var requestDetails = CreationService.getMsoRequestDetails(parameterList); $scope.$broadcast(COMPONENT.MSO_CREATE_REQ, { url : CreationService.getMsoUrl(), @@ -147,5 +157,5 @@ var deleteResumeDialogController = function( COMPONENT, FIELD, $scope, $http, $t } appDS2.controller("deleteResumeDialogController", [ "COMPONENT", "FIELD", "$scope", "$http", - "$timeout", "$log", "DeleteResumeService","CreationService", "DataService", "UtilityService", + "$timeout", "$log", "DataService", "DeleteResumeService","CreationService", "UtilityService", deleteResumeDialogController]); diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/controller/testEnvironmentsController.js b/vid-app-common/src/main/webapp/app/vid/scripts/controller/testEnvironmentsController.js index c81dc8721..94486905a 100644 --- a/vid-app-common/src/main/webapp/app/vid/scripts/controller/testEnvironmentsController.js +++ b/vid-app-common/src/main/webapp/app/vid/scripts/controller/testEnvironmentsController.js @@ -101,11 +101,11 @@ }; vm.isEnvActive = function(testEnv) { - return testEnv.operationalEnvironmentStatus==='Activate'; + return testEnv.operationalEnvironmentStatus==='ACTIVE'; }; vm.getEnvStatus = function (testEnv) { - return this.isEnvActive(testEnv) ? "Active" : "Inactive"; + return testEnv.operationalEnvironmentStatus; }; vm.createNewTestEnvironment = function() { |