aboutsummaryrefslogtreecommitdiffstats
path: root/vid-app-common/src/main/webapp/app
diff options
context:
space:
mode:
authorEylon Malin <eylon.malin@intl.att.com>2019-08-01 19:32:05 +0300
committerEylon Malin <eylon.malin@intl.att.com>2019-08-01 19:32:05 +0300
commit6126ea252a460c22e89bc8ad5ab68ec62e45fbe5 (patch)
treeaec0e7ea938ccabd02cad98b54a77312d2a17fd6 /vid-app-common/src/main/webapp/app
parent95ea3bac38467090417056254ef6e4b3165e27d7 (diff)
handling cloud owner and lcp region in create port mirroring configuration
Issue-ID: VID-482 Signed-off-by: Eylon Malin <eylon.malin@intl.att.com> Change-Id: Id7aed0f44927b27b69287f513d24552cf2afc003
Diffstat (limited to 'vid-app-common/src/main/webapp/app')
-rw-r--r--vid-app-common/src/main/webapp/app/vid/scripts/controller/AddNetworkNodeController.js6
-rw-r--r--vid-app-common/src/main/webapp/app/vid/scripts/controller/ServiceProxyConfigController.js4
-rwxr-xr-xvid-app-common/src/main/webapp/app/vid/scripts/services/creationService.js15
-rwxr-xr-xvid-app-common/src/main/webapp/app/vid/scripts/services/dataService.js8
-rw-r--r--vid-app-common/src/main/webapp/app/vid/scripts/services/deleteResumeService.js13
-rwxr-xr-xvid-app-common/src/main/webapp/app/vid/scripts/services/msoService.js3
-rw-r--r--vid-app-common/src/main/webapp/app/vid/scripts/view-models/addNetworkNode.htm6
7 files changed, 25 insertions, 30 deletions
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/controller/AddNetworkNodeController.js b/vid-app-common/src/main/webapp/app/vid/scripts/controller/AddNetworkNodeController.js
index 386d23622..4b0f8bb0c 100644
--- a/vid-app-common/src/main/webapp/app/vid/scripts/controller/AddNetworkNodeController.js
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/controller/AddNetworkNodeController.js
@@ -53,7 +53,11 @@ appDS2.controller("AddNetworkNodeController", ["COMPONENT", "FIELD", "PARAMETER"
CreationService.getParameters(handleGetParametersResponse);
$scope.setTenant = function(field) {
- $scope.nodeTemplateFields.tenant.optionList = _.filter($scope.tenantList, {'cloudRegionId': field.value, 'isPermitted': true});
+ var cloudOwnerAndLcpCloudRegion = DataService.getCloudOwnerAndLcpCloudRegionFromOptionId(field.value);
+ $scope.nodeTemplateFields.cloudRegionId = cloudOwnerAndLcpCloudRegion.cloudRegionId;
+ $scope.nodeTemplateFields.cloudOwner = cloudOwnerAndLcpCloudRegion.cloudOwner;
+ $scope.nodeTemplateFields.tenant.optionList = _.filter($scope.tenantList,
+ {'cloudRegionId': cloudOwnerAndLcpCloudRegion.cloudRegionId, 'isPermitted': true});
};
$scope.cancel = function() {
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/controller/ServiceProxyConfigController.js b/vid-app-common/src/main/webapp/app/vid/scripts/controller/ServiceProxyConfigController.js
index f775bed45..8e3b5b890 100644
--- a/vid-app-common/src/main/webapp/app/vid/scripts/controller/ServiceProxyConfigController.js
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/controller/ServiceProxyConfigController.js
@@ -292,7 +292,7 @@ appDS2.controller(
serviceType,
serviceProxy.sourceModelUuid,
serviceProxy.sourceModelInvariant,
- configNodeTemplateFields.lcpRegion.value,
+ configNodeTemplateFields.cloudRegionId,
configurationModel.properties.equip_vendor,
configurationModel.properties.equip_model
)
@@ -311,7 +311,7 @@ appDS2.controller(
serviceType,
serviceProxy.sourceModelUuid,
serviceProxy.sourceModelInvariant,
- configNodeTemplateFields.lcpRegion.value
+ configNodeTemplateFields.cloudRegionId
)
.then(function (response) {
var results = response.results || [];
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/services/creationService.js b/vid-app-common/src/main/webapp/app/vid/scripts/services/creationService.js
index 1949f5aa2..1a296ca5d 100755
--- a/vid-app-common/src/main/webapp/app/vid/scripts/services/creationService.js
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/services/creationService.js
@@ -779,13 +779,13 @@ var CreationService = function($log, AaiService, AsdcService, DataService,VIDCON
var cloudOwner;
var lcpRegionOptionId = getValueFromList(FIELD.ID.LCP_REGION, parameterList);
- var cloudOwnerAndLcpCloudRegion = getCloudOwnerAndLcpCloudRegionFromOptionId(lcpRegionOptionId);
+ var cloudOwnerAndLcpCloudRegion = DataService.getCloudOwnerAndLcpCloudRegionFromOptionId(lcpRegionOptionId);
if (cloudOwnerAndLcpCloudRegion.cloudRegionId === FIELD.KEY.LCP_REGION_TEXT) {
lcpRegion = getValueFromList(FIELD.ID.LCP_REGION_TEXT,
parameterList);
cloudOwner = undefined;
} else {
- var cloudOwnerAndLcpCloudRegion = getCloudOwnerAndLcpCloudRegionFromOptionId(lcpRegionOptionId);
+ var cloudOwnerAndLcpCloudRegion = DataService.getCloudOwnerAndLcpCloudRegionFromOptionId(lcpRegionOptionId);
lcpRegion = cloudOwnerAndLcpCloudRegion.cloudRegionId;
cloudOwner = cloudOwnerAndLcpCloudRegion.cloudOwner;
}
@@ -1155,15 +1155,6 @@ var CreationService = function($log, AaiService, AsdcService, DataService,VIDCON
return parameter;
};
- var getCloudOwnerAndLcpCloudRegionFromOptionId = function (cloudRegionOptionId) {
- var cloudRegionTenantList = DataService.getCloudRegionTenantList();
- var cloudRegionTenant = _.find(cloudRegionTenantList, {"cloudRegionOptionId": cloudRegionOptionId});
- return {
- cloudOwner: cloudRegionTenant.cloudOwner,
- cloudRegionId: cloudRegionTenant.cloudRegionId
- }
- };
-
var getTenantList = function(cloudRegionOptionId) {
var cloudRegionTenantList = DataService.getCloudRegionTenantList();
var parameter = "";
@@ -1257,7 +1248,7 @@ var CreationService = function($log, AaiService, AsdcService, DataService,VIDCON
.updateList([ FIELD.PARAMETER.TENANT_DISABLED ]);
}
- var cloudOwnerAndLcpCloudRegion = getCloudOwnerAndLcpCloudRegionFromOptionId(list[0].value);
+ var cloudOwnerAndLcpCloudRegion = DataService.getCloudOwnerAndLcpCloudRegionFromOptionId(list[0].value);
if (cloudOwnerAndLcpCloudRegion.cloudRegionId === FIELD.KEY.LCP_REGION_TEXT) {
parameterListControl
.updateList([ FIELD.PARAMETER.LCP_REGION_TEXT_VISIBLE ]);
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/services/dataService.js b/vid-app-common/src/main/webapp/app/vid/scripts/services/dataService.js
index 26adcf43b..84413f890 100755
--- a/vid-app-common/src/main/webapp/app/vid/scripts/services/dataService.js
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/services/dataService.js
@@ -37,6 +37,14 @@ var DataService = function($log, DataService) {
setCloudRegionTenantList : function(cloudRegionTenantList) {
_this.cloudRegionTenantList = cloudRegionTenantList;
},
+ getCloudOwnerAndLcpCloudRegionFromOptionId : function (cloudRegionOptionId) {
+ var cloudRegionTenantList = this.getCloudRegionTenantList();
+ var cloudRegionTenant = _.find(cloudRegionTenantList, {"cloudRegionOptionId": cloudRegionOptionId});
+ return {
+ cloudOwner: cloudRegionTenant.cloudOwner,
+ cloudRegionId: cloudRegionTenant.cloudRegionId
+ }
+ },
getGlobalCustomerId : function() {
return _this.globalCustomerId;
},
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/services/deleteResumeService.js b/vid-app-common/src/main/webapp/app/vid/scripts/services/deleteResumeService.js
index aac0ed468..559174ddf 100644
--- a/vid-app-common/src/main/webapp/app/vid/scripts/services/deleteResumeService.js
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/services/deleteResumeService.js
@@ -293,7 +293,7 @@ var DeleteResumeService = function($log, AaiService, AsdcService, DataService,
var cloudOwner;
var lcpRegionOptionId = getValueFromList(FIELD.ID.LCP_REGION, parameterList);
- var cloudOwnerAndLcpCloudRegion = getCloudOwnerAndLcpCloudRegionFromOptionId(lcpRegionOptionId);
+ var cloudOwnerAndLcpCloudRegion = DataService.getCloudOwnerAndLcpCloudRegionFromOptionId(lcpRegionOptionId);
if (cloudOwnerAndLcpCloudRegion.cloudRegionId === FIELD.KEY.LCP_REGION_TEXT) {
lcpRegion = getValueFromList(FIELD.ID.LCP_REGION_TEXT,
parameterList);
@@ -416,15 +416,6 @@ var DeleteResumeService = function($log, AaiService, AsdcService, DataService,
return parameter;
};
- var getCloudOwnerAndLcpCloudRegionFromOptionId = function (cloudRegionOptionId) {
- var cloudRegionTenantList = DataService.getCloudRegionTenantList();
- var cloudRegionTenant = _.find(cloudRegionTenantList, {"cloudRegionOptionId": cloudRegionOptionId});
- return {
- cloudOwner: cloudRegionTenant.cloudOwner,
- cloudRegionId: cloudRegionTenant.cloudRegionId
- }
- };
-
var getTenantList = function(cloudRegionOptionId) {
var parameter = "";
var cloudRegionTenantList = DataService.getCloudRegionTenantList();
@@ -478,7 +469,7 @@ var DeleteResumeService = function($log, AaiService, AsdcService, DataService,
.updateList([ FIELD.PARAMETER.TENANT_DISABLED ]);
}
- var cloudOwnerAndLcpCloudRegion = getCloudOwnerAndLcpCloudRegionFromOptionId(list[0].value);
+ var cloudOwnerAndLcpCloudRegion = DataService.getCloudOwnerAndLcpCloudRegionFromOptionId(list[0].value);
if (cloudOwnerAndLcpCloudRegion.cloudRegionId === FIELD.KEY.LCP_REGION_TEXT) {
parameterListControl
.updateList([ FIELD.PARAMETER.LCP_REGION_TEXT_VISIBLE ]);
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/services/msoService.js b/vid-app-common/src/main/webapp/app/vid/scripts/services/msoService.js
index d5baa1a21..3f902e86e 100755
--- a/vid-app-common/src/main/webapp/app/vid/scripts/services/msoService.js
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/services/msoService.js
@@ -341,7 +341,8 @@ var MsoService = function($http, $log, $q, PropertyService, AaiService, UtilityS
"modelCustomizationName": requestParams.configurationModelInfo.modelCustomizationName
},
"cloudConfiguration": {
- "lcpCloudRegionId": requestParams.portMirroringConfigFields.lcpRegion.value
+ "lcpCloudRegionId": requestParams.portMirroringConfigFields.cloudRegionId,
+ "cloudOwner" : requestParams.portMirroringConfigFields.cloudOwner
},
"requestInfo": {
"instanceName": requestParams.portMirroringConfigFields.instanceName.value,
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/view-models/addNetworkNode.htm b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/addNetworkNode.htm
index 8b3369007..e1dad409c 100644
--- a/vid-app-common/src/main/webapp/app/vid/scripts/view-models/addNetworkNode.htm
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/addNetworkNode.htm
@@ -40,12 +40,12 @@ limitations under the License.
<input data-tests-id="instanceNameInput" name="{{field.id}}" id="{{field.id}}" type="text" required ng-model="field.value" ng-pattern="regexInstanceName">
<span class="error" data-ng-show="!networkNodeForm.instanceName.$error.required && networkNodeForm.instanceName.$dirty && networkNodeForm.instanceName.$invalid">{{errorMsg}}</span>
</div>
- <select id="{{field.id}}" data-tests-id="regionDropDown" ng-if="key === 'lcpRegion'" required ng-model="field.value"
+ <select id="{{field.id}}" data-tests-id="lcpRegion" ng-if="key === 'lcpRegion'" required ng-model="field.value"
placeholder="Choose {{field.name}}"
data-ng-change="setTenant(field)">
<option value="" selected>LCP region</option>
<option data-ng-disabled="!option.isPermitted" ng-repeat="option in field.optionList"
- value="{{option.id}}" data-tests-id="{{'region-' + option.id}}">{{option.id}}</option>
+ value="{{option.id}}" data-tests-id="{{'region-' + option.id}}">{{option.name}}</option>
</select>
<select id="{{field.id}}" data-tests-id="tenantDropDown" ng-if="key === 'tenant'" required ng-model="field.value"
data-ng-options="option.tenantName for option in field.optionList" placeholder="Choose {{field.name}}"
@@ -59,4 +59,4 @@ limitations under the License.
<service-metadata title-txt="info" service-metadata-fields="serviceMetadataFields"></service-metadata>
</div>
</div>
-</div> \ No newline at end of file
+</div>