Differentiate cloudRegions with same name and different owner 87/88287/1
authorIttay Stern <ittay.stern@att.com>
Wed, 22 May 2019 17:18:24 +0000 (20:18 +0300)
committerIttay Stern <ittay.stern@att.com>
Wed, 22 May 2019 17:19:58 +0000 (20:19 +0300)
Resolves defect:
Issue-ID: VID-482

Change-Id: I22c0b07173950c253a9272b8a96ab63e006efa49
Signed-off-by: Ittay Stern <ittay.stern@att.com>
vid-app-common/src/main/webapp/app/vid/scripts/services/aaiService.js
vid-app-common/src/main/webapp/app/vid/scripts/services/creationService.js
vid-app-common/src/main/webapp/app/vid/scripts/services/deleteResumeService.js

index 030faf5..4ffccb4 100755 (executable)
@@ -448,6 +448,9 @@ var AaiService = function ($http, $log, PropertyService, UtilityService, COMPONE
                     lcpCloudRegionTenants.push({
                         "cloudRegionId": aaiLcpCloudRegionTenants[i][COMPONENT.CLOUD_REGION_ID],
                         "cloudOwner": aaiLcpCloudRegionTenants[i][COMPONENT.CLOUD_OWNER],
+                        "cloudId":
+                            aaiLcpCloudRegionTenants[i][COMPONENT.CLOUD_REGION_ID] +
+                            '+' + aaiLcpCloudRegionTenants[i][COMPONENT.CLOUD_OWNER],
                         "tenantName": aaiLcpCloudRegionTenants[i][COMPONENT.TENANT_NAME],
                         "tenantId": aaiLcpCloudRegionTenants[i][COMPONENT.TENANT_ID],
                         "isPermitted": aaiLcpCloudRegionTenants[i][COMPONENT.IS_PERMITTED]});
index d5fd320..937b83e 100755 (executable)
@@ -547,7 +547,7 @@ var CreationService = function($log, AaiService, AsdcService, DataService,VIDCON
                 parameterList);
         }
         var cloudOwner = _.find(DataService.getCloudRegionTenantList(), function(region){
-            return region.cloudRegionId === lcpRegion;
+            return region.cloudId === lcpRegion;
         }).cloudOwner;
 
         var params = [];
@@ -1108,7 +1108,7 @@ var CreationService = function($log, AaiService, AsdcService, DataService,VIDCON
             parameter.optionList = new Array();
             for (var i = 0; i < cloudRegionTenantList.length; i++) {
                 for (var j = 0; j < parameter.optionList.length; j++) {
-                    if (parameter.optionList[j].id === cloudRegionTenantList[i].cloudRegionId) {
+                    if (parameter.optionList[j].id === cloudRegionTenantList[i].cloudId) {
                         parameter.optionList[j].isPermitted =
                             parameter.optionList[j].isPermitted || cloudRegionTenantList[i].isPermitted;
                         break;
@@ -1123,7 +1123,7 @@ var CreationService = function($log, AaiService, AsdcService, DataService,VIDCON
                     cloudRegionTenantList[i].cloudRegionId;
 
                 parameter.optionList.push({
-                    id : cloudRegionTenantList[i].cloudRegionId,
+                    id : cloudRegionTenantList[i].cloudId,
                     name: optionName,
                     isPermitted : cloudRegionTenantList[i].isPermitted
                 });
@@ -1132,14 +1132,14 @@ var CreationService = function($log, AaiService, AsdcService, DataService,VIDCON
         return parameter;
     };
 
-    var getTenantList = function(cloudRegionId) {
+    var getTenantList = function(cloudId) {
         var cloudRegionTenantList = DataService.getCloudRegionTenantList();
         var parameter = "";
         if ( UtilityService.hasContents (cloudRegionTenantList) ) {
             parameter = FIELD.PARAMETER.TENANT_ENABLED;
             parameter.optionList = new Array();
             for (var i = 0; i < cloudRegionTenantList.length; i++) {
-                if (cloudRegionTenantList[i].cloudRegionId === cloudRegionId) {
+                if (cloudRegionTenantList[i].cloudId === cloudId) {
                     parameter.optionList.push({
                         id : cloudRegionTenantList[i].tenantId,
                         name : cloudRegionTenantList[i].tenantName,
index 6163184..d65fd6f 100644 (file)
@@ -413,7 +413,7 @@ var DeleteResumeService = function($log, AaiService, AsdcService, DataService,
                        parameter.optionList = new Array();
                        for (var i = 0; i < cloudRegionTenantList.length; i++) {
                                for (var j = 0; j < parameter.optionList.length; j++) {
-                                       if (parameter.optionList[j].id === cloudRegionTenantList[i].cloudRegionId) {
+                                       if (parameter.optionList[j].id === cloudRegionTenantList[i].cloudId) {
                         parameter.optionList[j].isPermitted =
                             parameter.optionList[j].isPermitted || cloudRegionTenantList[i].isPermitted;
                         break;
@@ -428,7 +428,7 @@ var DeleteResumeService = function($log, AaiService, AsdcService, DataService,
                     cloudRegionTenantList[i].cloudRegionId;
 
                                parameter.optionList.push({
-                                       id : cloudRegionTenantList[i].cloudRegionId,
+                                       id : cloudRegionTenantList[i].cloudId,
                                        name: optionName,
           isPermitted : cloudRegionTenantList[i].isPermitted
 
@@ -438,14 +438,14 @@ var DeleteResumeService = function($log, AaiService, AsdcService, DataService,
                return parameter;
        };
        
-       var getTenantList = function(cloudRegionId) {
+       var getTenantList = function(cloudId) {
                var parameter = "";
                var cloudRegionTenantList = DataService.getCloudRegionTenantList();
                if ( UtilityService.hasContents (cloudRegionTenantList) ) {
                        var parameter = FIELD.PARAMETER.TENANT_ENABLED;
                        parameter.optionList = new Array();
                        for (var i = 0; i < cloudRegionTenantList.length; i++) {
-                               if (cloudRegionTenantList[i].cloudRegionId === cloudRegionId) {
+                               if (cloudRegionTenantList[i].cloudId === cloudId) {
                                        parameter.optionList.push({
                                                id : cloudRegionTenantList[i].tenantId,
                                                name : cloudRegionTenantList[i].tenantName,