X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=POLICY-SDK-APP%2Fsrc%2Fmain%2Fwebapp%2Fapp%2FpolicyApp%2Fpolicy-models%2FEditor%2FPolicyTemplateController%2FDecisionPolicyController.js;h=e7858d7b5c4d65b6e08c4699de75d18bc305f1ea;hb=fc5c07705edc4dcb7083b39116a43844bb6a1490;hp=d0c72682b9724eafcf70f85be96b69d2bbb6357a;hpb=dda032f8bb161d54eb1f59de2b4a3efb774fc4d1;p=policy%2Fengine.git diff --git a/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController/DecisionPolicyController.js b/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController/DecisionPolicyController.js index d0c72682b..e7858d7b5 100644 --- a/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController/DecisionPolicyController.js +++ b/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController/DecisionPolicyController.js @@ -29,6 +29,7 @@ angular.module('abs').controller('decisionPolicyController', ['$scope', 'PolicyA $scope.policyNavigator.refresh(); } $scope.modal('createNewPolicy', true); + $scope.temp.policy = ""; }; $scope.modal = function(id, hide) { @@ -162,8 +163,14 @@ angular.module('abs').controller('decisionPolicyController', ['$scope', 'PolicyA if(!$scope.temp.policy.editPolicy && !$scope.temp.policy.readOnly){ $scope.temp.policy.attributes = []; - $scope.temp.policy.settings = []; - $scope.temp.policy.ruleAlgorithmschoices = []; + $scope.temp.policy.settings = []; + $scope.temp.policy.ruleAlgorithmschoices = []; + if(!$scope.temp.policy.yamlparams){ + $scope.temp.policy.yamlparams = {}; + } + if(!$scope.temp.policy.yamlparams.blackList){ + $scope.temp.policy.yamlparams.blackList = []; + } }else if($scope.temp.policy.ruleProvider=="Custom"){ if($scope.temp.policy.attributes.length == 0){ $scope.temp.policy.attributes = []; @@ -171,10 +178,14 @@ angular.module('abs').controller('decisionPolicyController', ['$scope', 'PolicyA if($scope.temp.policy.settings.length == 0){ $scope.temp.policy.settings = []; } - if($scope.temp.policy.ruleAlgorithmschoices.length == 0){ + if($scope.temp.policy.ruleAlgorithmschoices == null || $scope.temp.policy.ruleAlgorithmschoices.length == 0){ $scope.temp.policy.ruleAlgorithmschoices = []; } - } + }else if($scope.temp.policy.ruleProvider=="GUARD_BL_YAML"){ + if($scope.temp.policy.yamlparams.blackList.length==0){ + $scope.temp.policy.yamlparams.blackList = []; + } + } $scope.attributeDatas = [{"attributes" : $scope.temp.policy.attributes}]; $scope.addNewChoice = function() { var newItemNo = $scope.temp.policy.attributes.length+1; @@ -196,6 +207,14 @@ angular.module('abs').controller('decisionPolicyController', ['$scope', 'PolicyA $scope.temp.policy.settings.splice(lastItem); }; + $scope.addNewBL = function() { + $scope.temp.policy.yamlparams.blackList.push(''); + }; + $scope.removeBL = function() { + var lastItem = $scope.temp.policy.yamlparams.blackList.length-1; + $scope.temp.policy.yamlparams.blackList.splice(lastItem); + }; + $scope.ItemNo = 0; $scope.ruleAlgorithmDatas = [{"ruleAlgorithms" : $scope.temp.policy.ruleAlgorithmschoices }];