From e59d8d560376a34e0eab902a673b5b3c3add5b0d Mon Sep 17 00:00:00 2001 From: Sara Weiss Date: Wed, 18 Sep 2019 13:55:55 +0300 Subject: [PATCH] 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 ++++++++++++++++++--- .../new-change-management.css | 2 +- .../new-change-management.html | 24 +++++++++++++--- .../webapp/app/vid/scripts/services/aaiService.js | 32 ++++++++++++++-------- 4 files changed, 69 insertions(+), 20 deletions(-) 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(); + } } ); }; diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.css b/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.css index 19b5f2b92..031ffb4d4 100644 --- a/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.css +++ b/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.css @@ -138,7 +138,7 @@ } .nf-role-input { - width: 50% + width: 39% } /*LESS*/ diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.html b/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.html index 40bb92b7e..a839ef547 100644 --- a/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.html +++ b/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.html @@ -73,19 +73,35 @@
+
+ + +
+
-
- diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/services/aaiService.js b/vid-app-common/src/main/webapp/app/vid/scripts/services/aaiService.js index 994a3e4ac..0e1beefb6 100755 --- a/vid-app-common/src/main/webapp/app/vid/scripts/services/aaiService.js +++ b/vid-app-common/src/main/webapp/app/vid/scripts/services/aaiService.js @@ -86,6 +86,23 @@ var AaiService = function ($http, $log, PropertyService, UtilityService, COMPONE }).join("&"); } + function getConfigParams(vnfRole, cloudRegion) { + if (!featureFlags.isOn(COMPONENT.FEATURE_FLAGS.FLAG_FLASH_CLOUD_REGION_AND_NF_ROLE_OPTIONAL_SEARCH)) { + return null + } + + let data = { + vnfRole: vnfRole, + cloudRegion: cloudRegion, + }; + + let config = { + params: data + }; + + return config; + } + return { getSubscriberName: function (globalCustomerId, successCallbackFunction) { @@ -630,24 +647,17 @@ var AaiService = function ($http, $log, PropertyService, UtilityService, COMPONE }, getVnfsByCustomerIdAndServiceType: function (globalSubscriberId, serviceType, vnfRole, cloudRegion) { - var deferred = $q.defer(); + let deferred = $q.defer(); let url = globalSubscriberId + COMPONENT.FORWARD_SLASH + serviceType - if (featureFlags.isOn(COMPONENT.FEATURE_FLAGS.FLAG_FLASH_CLOUD_REGION_AND_NF_ROLE_OPTIONAL_SEARCH)){ - if (vnfRole) { - url + COMPONENT.FORWARD_SLASH + vnfRole - } - if (cloudRegion) { - url + COMPONENT.FORWARD_SLASH + cloudRegion; - } - } - + const path = COMPONENT.AAI_GET_VNF_BY_CUSTOMERID_AND_SERVICETYPE + url; + let config = getConfigParams(vnfRole, cloudRegion); if (UtilityService.hasContents(globalSubscriberId) && UtilityService.hasContents(serviceType)) { - $http.get(COMPONENT.AAI_GET_VNF_BY_CUSTOMERID_AND_SERVICETYPE + url) + $http.get(path, config) .success(function (response) { if (response) { deferred.resolve({data: response}); -- 2.16.6