summaryrefslogtreecommitdiffstats
path: root/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController/DecisionPolicyController.js
diff options
context:
space:
mode:
authorPamela Dragosh <pdragosh@research.att.com>2018-09-11 16:10:03 +0000
committerGerrit Code Review <gerrit@onap.org>2018-09-11 16:10:03 +0000
commit7614ce4634486cea3898ff9328626f69196687cc (patch)
tree1ec221f65d65d238ef5b0f04ab9b378a2a8aad47 /POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController/DecisionPolicyController.js
parent08f30ef9c85266a769530a8f5179cb01a68a7612 (diff)
parente957a1d9a9fa6bd0f9f8348d1e864c09cfe2cb92 (diff)
Merge "New min/max Guard Policy"
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.js17
1 files changed, 10 insertions, 7 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 ba9e44868..0e53ce9de 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
@@ -238,10 +238,11 @@ angular.module('abs').controller('decisionPolicyController', [ '$scope', 'Policy
$scope.blackListEntries = [];
$scope.temp.policy.appendBlackListEntries = [];
$scope.blackListEntries = arrayUnique($scope.temp.policy.blackListEntries.concat($scope.temp.policy.yamlparams.blackList));
- } else if ($scope.temp.policy.ruleProvider == "GUARD_YAML") {
- if ($scope.temp.policy.yamlparams.targets.length == 0) {
- $scope.temp.policy.yamlparams.targets = [];
- }
+
+ }else if($scope.temp.policy.ruleProvider=="GUARD_YAML" || $scope.temp.policy.ruleProvider=="GUARD_MIN_MAX"){
+ if($scope.temp.policy.yamlparams.targets.length==0){
+ $scope.temp.policy.yamlparams.targets = [];
+ }
} else if ($scope.temp.policy.ruleProvider == "Rainy_Day") {
if ($scope.temp.policy.rainyday.treatmentTableChoices == null || $scope.temp.policy.rainyday.treatmentTableChoices.length == 0) {
$scope.temp.policy.rainyday.treatmentTableChoices = [];
@@ -286,9 +287,9 @@ angular.module('abs').controller('decisionPolicyController', [ '$scope', 'Policy
$scope.addNewBL = function() {
$scope.temp.policy.yamlparams.blackList.push('');
};
-
- $scope.removeBL = function(id) {
- $scope.temp.policy.yamlparams.blackList = $scope.temp.policy.yamlparams.blackList.filter(function(obj) {
+
+ $scope.removeBL = function(id) {
+ $scope.temp.policy.yamlparams.blackList = $scope.temp.policy.yamlparams.blackList.filter(function (obj){
return obj !== id;
});
};
@@ -296,9 +297,11 @@ angular.module('abs').controller('decisionPolicyController', [ '$scope', 'Policy
$scope.treatmentDatas = [ {
"treatmentValues" : $scope.temp.policy.rainyday.treatmentTableChoices
} ];
+
$scope.addNewTreatment = function() {
$scope.temp.policy.rainyday.treatmentTableChoices.push({});
};
+
$scope.removeTreatment = function() {
var lastItem = $scope.temp.policy.rainyday.treatmentTableChoices.length - 1;
$scope.temp.policy.rainyday.treatmentTableChoices.splice(lastItem);