aboutsummaryrefslogtreecommitdiffstats
path: root/vid-app-common/src/main/webapp/app/vid/scripts/modals/vf-module-homing-data-action/vf-module-homing-data-action.controller.js
diff options
context:
space:
mode:
authorAlexey Sandler <alexey.sandler@intl.att.com>2019-08-22 15:16:48 +0300
committerIttay Stern <ittay.stern@att.com>2019-08-25 14:33:34 +0300
commit453a7bdf940a5006513216f4cc1fcd89ef4bbd44 (patch)
treee99ca2cfffdcd35d408104a3051f69590cf9d4f9 /vid-app-common/src/main/webapp/app/vid/scripts/modals/vf-module-homing-data-action/vf-module-homing-data-action.controller.js
parent87f850a6f3012aed165190bb861dcd0db8249dc6 (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/src/main/webapp/app/vid/scripts/modals/vf-module-homing-data-action/vf-module-homing-data-action.controller.js')
-rw-r--r--vid-app-common/src/main/webapp/app/vid/scripts/modals/vf-module-homing-data-action/vf-module-homing-data-action.controller.js18
1 files changed, 12 insertions, 6 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');
};