X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=POLICY-SDK-APP%2Fsrc%2Fmain%2Fwebapp%2Fapp%2FpolicyApp%2Fcontroller%2FpdpController.js;h=966a0913ed4232710bfbe0e4186a7434ff7b7f0f;hb=a61c10945456dde51397d354379257c7d0d01fb2;hp=0135172e93e22f3ac61874bac91167c94d8c9343;hpb=a330af579866dacbe595e2e4ad1dd29cd3c96945;p=policy%2Fengine.git diff --git a/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/pdpController.js b/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/pdpController.js index 0135172e9..966a0913e 100644 --- a/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/pdpController.js +++ b/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/pdpController.js @@ -1,6 +1,6 @@ /*- * ============LICENSE_START======================================================= - * ECOMP Policy Engine + * ONAP Policy Engine * ================================================================================ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. * ================================================================================ @@ -53,14 +53,7 @@ app.controller('pdpTabController', function ($scope, PolicyAppService, modalServ $scope.editPdpGroupId = true; } } - - PolicyAppService.getData('get_PDPGroupData').then(function(data){ - var j = data; - $scope.pdpdatas = JSON.parse(j.data); - console.log($scope.pdpdatas); - },function(error){ - console.log("failed"); - }); + getPDPGroups(); },function (error) { console.log("failed"); }); @@ -77,7 +70,6 @@ app.controller('pdpTabController', function ($scope, PolicyAppService, modalServ }; $scope.editPDPGroup = null; - var dialog = null; $scope.editPDPGroupFunctionPopup = function(pdpGroupData) { $scope.editPDPGroup = pdpGroupData; $( "#dialog" ).dialog({ @@ -87,8 +79,9 @@ app.controller('pdpTabController', function ($scope, PolicyAppService, modalServ $scope.editPDPGroupFunctionModalPopup = function(pdpGroupData) { $scope.editPDPGroup = pdpGroupData; + var modalInstance; if($scope.userRolesDatas[0] == 'super-guest' || $scope.userRolesDatas[0] == 'guest'){ - var modalInstance = $modal.open({ + modalInstance = $modal.open({ backdrop: 'static', keyboard: false, templateUrl: 'show_policies_pdp_group_popup.html', controller: 'editPDPGrouppopupController', @@ -102,7 +95,7 @@ app.controller('pdpTabController', function ($scope, PolicyAppService, modalServ } }); }else{ - var modalInstance = $modal.open({ + modalInstance = $modal.open({ backdrop: 'static', keyboard: false, templateUrl: 'edit_pdp_group_popup.html', controller: 'editPDPGrouppopupController', @@ -118,10 +111,20 @@ app.controller('pdpTabController', function ($scope, PolicyAppService, modalServ } modalInstance.result.then(function(response){ console.log('response', response); - $scope.pdpdatas=response.data; + getPDPGroups(); }); }; + function getPDPGroups(){ + PolicyAppService.getData('get_PDPGroupData').then(function(data){ + var j = data; + $scope.pdpdatas = JSON.parse(j.data); + console.log($scope.pdpdatas); + },function(error){ + console.log("failed"); + }); + } + $scope.addNewPDPGroupPopUpWindow = function(editPDPGroup) { $scope.editPDPGroup = null; var modalInstance = $modal.open({ @@ -161,9 +164,8 @@ app.controller('pdpTabController', function ($scope, PolicyAppService, modalServ dataType: 'json', contentType: 'application/json', data: JSON.stringify(postData), - success : function(data){ - $scope.$apply(function(){$scope.pdpdata=data.data;}); - $scope.pdpdatas=JSON.parse(data.data); + success : function(response){ + $scope.$apply(function(){$scope.pdpdatas=JSON.parse(response.data);}); }, error : function(data){ console.log(data);