summaryrefslogtreecommitdiffstats
path: root/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController
diff options
context:
space:
mode:
authorMichael Mokry <mm117s@att.com>2017-07-07 16:00:59 -0500
committerMichael Mokry <mm117s@att.com>2017-07-10 18:58:00 +0000
commiteb654437ee2815028602daa943d0a939a5bee3cd (patch)
tree77ad3b26bcf60a80cbbf87dbd1b06f60de976c39 /POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController
parentbb927b5325d7b82cdc65bf25aa217ad7c56a46b3 (diff)
[POLICY-67] Add new Rainy Day Decision Policy
Change-Id: I8fb730e4363c885ccbe3a05ae971c5de5608d70c Signed-off-by: Michael Mokry <mm117s@att.com>
Diffstat (limited to 'POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController')
-rw-r--r--POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController/DecisionPolicyController.js27
1 files changed, 22 insertions, 5 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 e7858d7b5..4b5a990ef 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
@@ -80,8 +80,6 @@ angular.module('abs').controller('decisionPolicyController', ['$scope', 'PolicyA
console.log("failed");
});
-
-
function extend(obj, src) {
for (var key in src) {
if (src.hasOwnProperty(key)) obj[key] = src[key];
@@ -171,6 +169,13 @@ angular.module('abs').controller('decisionPolicyController', ['$scope', 'PolicyA
if(!$scope.temp.policy.yamlparams.blackList){
$scope.temp.policy.yamlparams.blackList = [];
}
+ if(!$scope.temp.policy.rainyday){
+ $scope.temp.policy.rainyday = {};
+ }
+ if(!$scope.temp.policy.rainyday.treatmentTableChoices){
+ $scope.temp.policy.rainyday.treatmentTableChoices = [];
+ }
+
}else if($scope.temp.policy.ruleProvider=="Custom"){
if($scope.temp.policy.attributes.length == 0){
$scope.temp.policy.attributes = [];
@@ -182,8 +187,12 @@ angular.module('abs').controller('decisionPolicyController', ['$scope', 'PolicyA
$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 = [];
+ if($scope.temp.policy.yamlparams.blackList.length==0){
+ $scope.temp.policy.yamlparams.blackList = [];
+ }
+ }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 = [];
}
}
$scope.attributeDatas = [{"attributes" : $scope.temp.policy.attributes}];
@@ -196,7 +205,6 @@ angular.module('abs').controller('decisionPolicyController', ['$scope', 'PolicyA
$scope.temp.policy.attributes.splice(lastItem);
};
-
$scope.settingsDatas = [{"settings" : $scope.temp.policy.settings}];
$scope.addNewSettingsChoice = function() {
var newItemNo = $scope.temp.policy.settings.length+1;
@@ -215,6 +223,15 @@ angular.module('abs').controller('decisionPolicyController', ['$scope', 'PolicyA
$scope.temp.policy.yamlparams.blackList.splice(lastItem);
};
+ $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);
+ };
+
$scope.ItemNo = 0;
$scope.ruleAlgorithmDatas = [{"ruleAlgorithms" : $scope.temp.policy.ruleAlgorithmschoices }];