X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=POLICY-SDK-APP%2Fsrc%2Fmain%2Fwebapp%2Fapp%2FpolicyApp%2Fcontroller%2FdictionaryController%2FFWSecurityZoneDictController.js;h=a5238eeb441fe5db95d4c0dab1156f56aa652c3e;hb=refs%2Fchanges%2F10%2F97710%2F5;hp=ecda8c27ab027c6e9ab066bea1c94c27eb775160;hpb=a330af579866dacbe595e2e4ad1dd29cd3c96945;p=policy%2Fengine.git diff --git a/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/FWSecurityZoneDictController.js b/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/FWSecurityZoneDictController.js index ecda8c27a..a5238eeb4 100644 --- a/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/FWSecurityZoneDictController.js +++ b/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/FWSecurityZoneDictController.js @@ -1,8 +1,8 @@ /*- * ============LICENSE_START======================================================= - * ECOMP Policy Engine + * ONAP Policy Engine * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017, 2019 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,44 +24,44 @@ app.controller('editfwSecurityZoneController' , function ($scope, $modalInstanc $scope.label='Edit Security Zone' $scope.disableCd=true; } - - /*getting user info from session*/ - var userid = null; - UserInfoServiceDS2.getFunctionalMenuStaticDetailSession() - .then(function (response) { - userid = response.userid; - }); - + + /*getting user info from session*/ + var userid = null; + UserInfoServiceDS2.getFunctionalMenuStaticDetailSession() + .then(function (response) { + userid = response.userid; + }); + $scope.editSecurityZone = message.securityZoneDictionaryData; $scope.saveSecurityZone = function(securityZoneDictionaryData) { - var regex = new RegExp("^[a-zA-Z0-9_]*$"); - if(!regex.test(securityZoneDictionaryData.zoneName)) { - Notification.error("Enter Valid Security Zone Name without spaces or special characters"); - }else{ - var uuu = "saveDictionary/fw_dictionary/save_securityZone"; - var postData={securityZoneDictionaryData: securityZoneDictionaryData, userid: userid}; - $.ajax({ - type : 'POST', - url : uuu, - dataType: 'json', - contentType: 'application/json', - data: JSON.stringify(postData), - success : function(data){ - $scope.$apply(function(){ - $scope.securityZoneDictionaryDatas=data.securityZoneDictionaryDatas;}); - if($scope.securityZoneDictionaryDatas == "Duplicate"){ - Notification.error("FW SecurityZone Dictionary exists with Same Zone Name.") - }else{ - console.log($scope.securityZoneDictionaryDatas); - $modalInstance.close({securityZoneDictionaryDatas:$scope.securityZoneDictionaryDatas}); - } - }, - error : function(data){ - alert("Error while saving."); - } - }); - } + var regex = new RegExp("^[a-zA-Z0-9_]*$"); + if(!regex.test(securityZoneDictionaryData.zoneName)) { + Notification.error("Enter Valid Security Zone Name without spaces or special characters"); + }else{ + var uuu = "saveDictionary/fw_dictionary/save_securityZone"; + var postData={securityZoneDictionaryData: securityZoneDictionaryData, userid: userid}; + $.ajax({ + type : 'POST', + url : uuu, + dataType: 'json', + contentType: 'application/json', + data: JSON.stringify(postData), + success : function(data){ + $scope.$apply(function(){ + $scope.securityZoneDictionaryDatas=data.securityZoneDictionaryDatas;}); + if($scope.securityZoneDictionaryDatas == "Duplicate"){ + Notification.error("FW SecurityZone Dictionary exists with Same Zone Name.") + }else{ + console.log($scope.securityZoneDictionaryDatas); + $modalInstance.close({securityZoneDictionaryDatas:$scope.securityZoneDictionaryDatas}); + } + }, + error : function(data){ + Notification.error("Error while saving."); + } + }); + } }; $scope.close = function() {