summaryrefslogtreecommitdiffstats
path: root/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController/DecisionPolicyController.js
diff options
context:
space:
mode:
authorRavindra Bakkamanthala <rb7147@att.com>2017-06-05 22:42:02 -0400
committerRavindra Bakkamanthala <rb7147@att.com>2017-06-07 14:47:34 -0400
commitfc5c07705edc4dcb7083b39116a43844bb6a1490 (patch)
treeab5c7258197fc776fef8106413704a5f0a829160 /POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController/DecisionPolicyController.js
parentd9007d680d19734d5dc106479784c420236cca4b (diff)
Fixed the Policy API issues and Bugfixes
Change-Id: I6e8b54442421b6ebd0ff88426fc6e5f3a36b0690 Signed-off-by: Ravindra Bakkamanthala <rb7147@att.com>
Diffstat (limited to 'POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController/DecisionPolicyController.js')
-rw-r--r--POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController/DecisionPolicyController.js26
1 files changed, 22 insertions, 4 deletions
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 ce27e04e0..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
@@ -163,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 = [];
@@ -172,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;
@@ -197,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 }];