From e59d8d560376a34e0eab902a673b5b3c3add5b0d Mon Sep 17 00:00:00 2001 From: Sara Weiss Date: Wed, 18 Sep 2019 13:55:55 +0300 Subject: add 'cloud region' optional field to change management Issue-ID: VID-596 Change-Id: Ieb89980f7e802fe2508950a0e1a23188145fd85e Signed-off-by: Sara Weiss --- .../new-change-management.controller.js | 31 +++++++++++++++++++--- 1 file changed, 27 insertions(+), 4 deletions(-) (limited to 'vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.controller.js') diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.controller.js b/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.controller.js index f70d6250e..5c29fb4ae 100644 --- a/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.controller.js +++ b/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.controller.js @@ -69,6 +69,10 @@ return (featureFlags.isOn(COMPONENT.FEATURE_FLAGS.FLAG_FLASH_CLOUD_REGION_AND_NF_ROLE_OPTIONAL_SEARCH)); }; + $scope.removeVendorFromCloudOwner = function(cloudOwner) { + return AaiService.removeVendorFromCloudOwner(cloudOwner) + }; + vm.isDisabledVNFmodelVersion = function (vnfTypePristine) { if ($scope.isNewFilterChangeManagmentEnabled()) { return !vm.isSearchedVNF; @@ -537,8 +541,19 @@ }); }; + function loadCloudRegions() { + AaiService.getLcpCloudRegionTenantList( + vm.changeManagement.subscriberId, + vm.changeManagement.serviceType["service-type"], + function (response) { + $scope.cloudRegionList = _.uniqBy(response, 'cloudRegionOptionId'); + }); + } + vm.serviceTypeChanged = function () { - if (!$scope.isNewFilterChangeManagmentEnabled()) { + if ($scope.isNewFilterChangeManagmentEnabled()) { + loadCloudRegions(); + } else { vm.searchVNFs(); } }; @@ -553,17 +568,22 @@ vm.vnfs = []; vm.vfModules = []; - let vnfRole = $scope.isNewFilterChangeManagmentEnabled() ? vm.changeManagement.vnfType : null; + + let vnfRole = null; let cloudRegion = null; + if ($scope.isNewFilterChangeManagmentEnabled()) { + vnfRole = vm.changeManagement.vnfType ? vm.changeManagement.vnfType : null; + cloudRegion = vm.changeManagement.cloudRegion ? vm.changeManagement.cloudRegion.cloudRegionId : null; + } + AaiService.getVnfsByCustomerIdAndServiceType( vm.changeManagement.subscriberId, vm.changeManagement.serviceType["service-type"], vnfRole, cloudRegion, - ). - then(function (response) { + ).then(function (response) { vm.isSearchedVNF = true; var vnfsData = response.data.results; if (vnfsData) { @@ -601,6 +621,9 @@ vm.vnfTypes.push(vnf.properties['nf-role']) }); } + if ($scope.isNewFilterChangeManagmentEnabled()) { + vm.loadVNFVersions(); + } } ); }; -- cgit 1.2.3-korg