From 97cffb810fcf3d3f02d814827f24adc090cf8e2e Mon Sep 17 00:00:00 2001 From: Ittay Stern Date: Wed, 17 Jul 2019 13:26:12 +0300 Subject: Merge from ecomp 3374149f - AngularJS UI Issue-ID: VID-378 Change-Id: I6b3243b492009035c911f63b93258ea76938fcb9 Signed-off-by: Ittay Stern --- .../scripts/controller/aaiSubscriberController.js | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'vid-app-common/src/main/webapp/app/vid/scripts/controller/aaiSubscriberController.js') 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; -- cgit 1.2.3-korg