diff options
author | Alexey Sandler <alexey.sandler@intl.att.com> | 2019-08-22 15:16:48 +0300 |
---|---|---|
committer | Ittay Stern <ittay.stern@att.com> | 2019-08-25 14:33:34 +0300 |
commit | 453a7bdf940a5006513216f4cc1fcd89ef4bbd44 (patch) | |
tree | e99ca2cfffdcd35d408104a3051f69590cf9d4f9 /vid-app-common | |
parent | 87f850a6f3012aed165190bb861dcd0db8249dc6 (diff) |
Fix to vf-module-homing-data-action controller to retrieve the cloudRegionId
Issue-ID: VID-378
Change-Id: I6042e72c9ebb8508b822df276da1b8549501042c
Signed-off-by: Alexey Sandler <alexey.sandler@intl.att.com>
Signed-off-by: Ittay Stern <ittay.stern@att.com>
Diffstat (limited to 'vid-app-common')
2 files changed, 15 insertions, 9 deletions
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/modals/vf-module-homing-data-action/vf-module-homing-data-action.controller.js b/vid-app-common/src/main/webapp/app/vid/scripts/modals/vf-module-homing-data-action/vf-module-homing-data-action.controller.js index a7f7e9128..b6725b124 100644 --- a/vid-app-common/src/main/webapp/app/vid/scripts/modals/vf-module-homing-data-action/vf-module-homing-data-action.controller.js +++ b/vid-app-common/src/main/webapp/app/vid/scripts/modals/vf-module-homing-data-action/vf-module-homing-data-action.controller.js @@ -30,7 +30,7 @@ var vfModuleActionModalController = function(COMPONENT, FIELD, $scope, $uibModal $scope.vfModuleName = vfModule.name; $scope.volumeGroups = vfModule.volumeGroups; $scope.lcpAndTenant = null; - $scope.regionSelection = {lcpRegion: null, legacyRegion: null, tenant: null}; + $scope.regionSelection = {optionId: null, legacyRegion: null, tenant: null}; $scope.lcpRegionList = null; $scope.isHomingData = false; $scope.megaRegion = ['AAIAIC25']; @@ -60,12 +60,12 @@ var vfModuleActionModalController = function(COMPONENT, FIELD, $scope, $uibModal .then(function (res) { if (res && res.data) { $scope.regionSelection = { - lcpRegion: (res.data[COMPONENT.CLOUD_REGION_ID]) ? res.data[COMPONENT.CLOUD_REGION_ID] : null, + optionId: (res.data[COMPONENT.CLOUD_REGION_ID]) ? res.data[COMPONENT.CLOUD_REGION_ID] : null, legacyRegion: null, tenant: (res.data[COMPONENT.TENANT_ID]) ? res.data[COMPONENT.TENANT_ID] : null }; - $scope.isHomingData = $scope.regionSelection.lcpRegion !== null && res.data.tenant !== null; - $scope.isHomingData = $scope.isHomingData && (($scope.megaRegion).indexOf($scope.regionSelection.lcpRegion) === -1); + $scope.isHomingData = $scope.regionSelection.optionId !== null && res.data.tenant !== null; + $scope.isHomingData = $scope.isHomingData && !$scope.selectedLcpRegionIsMegaRegion(); } if (!$scope.isHomingData) { @@ -75,11 +75,11 @@ var vfModuleActionModalController = function(COMPONENT, FIELD, $scope, $uibModal .catch(function (error) { getLcpCloudRegionTenantList(); }); - }; + } function getLcpRegionId() { if(_.isEmpty($scope.regionSelection.legacyRegion)) { - return $scope.regionSelection.lcpRegion + return DataService.getCloudOwnerAndLcpCloudRegionFromOptionId($scope.regionSelection.optionId).cloudRegionId; } return $scope.regionSelection.legacyRegion; } @@ -144,6 +144,12 @@ var vfModuleActionModalController = function(COMPONENT, FIELD, $scope, $uibModal return AaiService.removeVendorFromCloudOwner(cloudOwner) }; + $scope.selectedLcpRegionIsMegaRegion = function() { + let cloudRegionId = + DataService.getCloudOwnerAndLcpCloudRegionFromOptionId($scope.regionSelection.optionId).cloudRegionId; + return ($scope.megaRegion).indexOf(cloudRegionId) > -1 + }; + $scope.cancel = function() { $uibModalInstance.dismiss('cancel'); }; diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/modals/vf-module-homing-data-action/vf-module-homing-data-action.html b/vid-app-common/src/main/webapp/app/vid/scripts/modals/vf-module-homing-data-action/vf-module-homing-data-action.html index 3fbe07e83..944352403 100644 --- a/vid-app-common/src/main/webapp/app/vid/scripts/modals/vf-module-homing-data-action/vf-module-homing-data-action.html +++ b/vid-app-common/src/main/webapp/app/vid/scripts/modals/vf-module-homing-data-action/vf-module-homing-data-action.html @@ -55,7 +55,7 @@ <div class="lcp-region field"> <label>LCP Region</label> <select name="lcp-region" required class="form-item wide" - data-tests-id="lcpRegion" data-ng-model="regionSelection.lcpRegion" + data-tests-id="lcpRegion" data-ng-model="regionSelection.optionId" data-ng-change="regionSelection.tenant = null; regionSelection.legacyRegion = null;"> <option class="lcp-region-placeholder" value="" selected>Select LCP Region</option> <option ng-repeat="option in lcpRegionList" value="{{option.cloudRegionOptionId}}" @@ -69,7 +69,7 @@ </select> </div> - <div class="legacy-region field" data-ng-if="(megaRegion).indexOf(regionSelection.lcpRegion) > -1"> + <div class="legacy-region field" data-ng-if="selectedLcpRegionIsMegaRegion()"> <label>Legacy Region</label> <input type="text" data-tests-id="lcpRegionText" required data-ng-model="regionSelection.legacyRegion" placeholder="Enter legacy region"> @@ -81,7 +81,7 @@ data-tests-id="tenant" data-ng-model="regionSelection.tenant"> <option class="tenant-placeholder" value="" selected>Select Tenant Name</option> <option ng-repeat="option in lcpAndTenant" class="tenantOption" value="{{option.tenantId}}" - data-ng-if="option.isPermitted && option.cloudRegionOptionId === regionSelection.lcpRegion">{{option.tenantName}} + data-ng-if="option.isPermitted && option.cloudRegionOptionId === regionSelection.optionId">{{option.tenantName}} </option> </select> </div> |