summaryrefslogtreecommitdiffstats
path: root/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models
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
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')
-rw-r--r--POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Dictionary/DecisionRainyDayDictionary.html22
-rw-r--r--POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController/DecisionPolicyController.js27
-rw-r--r--POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplates/DecisionPolicyTemplate.html93
-rw-r--r--POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/policy_Dictionary.html1
4 files changed, 136 insertions, 7 deletions
diff --git a/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Dictionary/DecisionRainyDayDictionary.html b/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Dictionary/DecisionRainyDayDictionary.html
new file mode 100644
index 000000000..a81111518
--- /dev/null
+++ b/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Dictionary/DecisionRainyDayDictionary.html
@@ -0,0 +1,22 @@
+<!--/*-
+ * ============LICENSE_START=======================================================
+ * ECOMP Policy Engine
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */-->
+<div ng-app ng-controller = "decisionRainyDayDictGridController">
+ <div ui-grid = "decisionRainyDayDictionaryGrid" ui-grid-pagination ui-grid-selection ui-grid-resize-columns ui-grid-exporter class= "grid"></div>
+</div> \ No newline at end of file
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 }];
diff --git a/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplates/DecisionPolicyTemplate.html b/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplates/DecisionPolicyTemplate.html
index 637ecff03..49fc70df4 100644
--- a/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplates/DecisionPolicyTemplate.html
+++ b/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplates/DecisionPolicyTemplate.html
@@ -31,13 +31,102 @@
ng-click="providerListener(temp.policy.ruleProvider);">
<option>Custom</option>
<option>AAF</option>
+ <option>Rainy_Day</option>
<option>GUARD_YAML</option>
<option>GUARD_BL_YAML<option>
</select>
</div>
</div>
</div>
-
+ <div ng-if="temp.policy.ruleProvider == 'Rainy_Day'">
+ <div class="well">
+ <div class="form-group row">
+ <div class="form-group row">
+ <div class="form-group col-sm-1">
+ <label>Service Type:<sup><b>*</b></sup></label>
+ </div>
+ <div class="form-group col-sm-2">
+ <input type="text" class="form-control"
+ ng-disabled="temp.policy.readOnly" ng-model="temp.policy.rainyday.serviceType"
+ placeholder="Service Type" />
+ </div>
+ <div class="form-group col-sm-1">
+ <label>VNF Type:<sup><b>*</b></sup></label>
+ </div>
+ <div class="form-group col-sm-2">
+ <input type="text" class="form-control"
+ ng-disabled="temp.policy.readOnly" ng-model="temp.policy.rainyday.vnfType"
+ placeholder="VNF Type" />
+ </div>
+ <div class="form-group col-sm-1">
+ <label>Building Block ID:<sup><b>*</b></sup></label>
+ </div>
+ <div class="form-group col-sm-2">
+ <input type="text" class="form-control"
+ ng-disabled="temp.policy.readOnly" ng-model="temp.policy.rainyday.bbid"
+ placeholder="Building Block ID" />
+ </div>
+ <div class="form-group col-sm-1">
+ <label>Work Step:<sup><b>*</b></sup></label>
+ </div>
+ <div class="form-group col-sm-2">
+ <input type="text" class="form-control"
+ ng-disabled="temp.policy.readOnly" ng-model="temp.policy.rainyday.workstep"
+ placeholder="Work Step" />
+ </div>
+ </div>
+ <div class="form-group row">
+ <div class="form-group col-sm-3">
+ <label>Desired Automated Treatments:</label>
+ <button type="button" class="btn btn-default"
+ ng-disabled="temp.policy.readOnly"
+ ng-click="addNewTreatment()">
+ <i class="fa fa-plus"></i>
+ </button>
+ </div>
+ </div>
+ <div class="form-group row">
+ <div data-ng-repeat="treatmentTableChoice in temp.policy.rainyday.treatmentTableChoices">
+ <div class="form-group row" style="margin-left: 2%">
+ <div class="form-group col-sm-1">
+ <label>Error Code:<sup><b>*</b></sup></label>
+ </div>
+ <div class="form-group col-sm-3">
+ <input type="text" class="form-control"
+ ng-disabled="temp.policy.readOnly"
+ ng-model="treatmentTableChoice.errorcode"
+ placeholder="Error Code" />
+ </div>
+ <div class="form-group col-sm-1">
+ <label>Desired Treatment:<sup><b>*</b></sup></label>
+ </div>
+ <div class="form-group col-sm-3">
+ <select class="form-control" id="mySelect"
+ ng-disabled="temp.policy.readOnly"
+ ng-model="treatmentTableChoice.treatment"
+ placeholder="Desired Treatment">
+<!-- <option value="">{{tableChoice.desiredtreatment}}</option> -->
+ <option>Rollback</option>
+ <option>Manual Handling</option>
+ <option>Abort</option>
+ <option>Auto Rollback</option>
+ <option>Retry</option>
+ <option>Skip</option>
+ </select>
+ </div>
+ <div class="form-group col-sm-1">
+ <button type="button" class="btn btn-default"
+ ng-disabled="temp.policy.readOnly"
+ ng-click="removeTreatment()">
+ <i class="fa fa-minus"></i>
+ </button>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
<div ng-if="temp.policy.ruleProvider == 'GUARD_BL_YAML'">
<div class="well">
<div class="form-group row">
@@ -344,4 +433,4 @@
<button type="button" class="btn btn-default" ng-click="refresh();">Close</button>
</div>
</form>
-</div>
+</div> \ No newline at end of file
diff --git a/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/policy_Dictionary.html b/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/policy_Dictionary.html
index 2eaf98cd9..7d7793617 100644
--- a/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/policy_Dictionary.html
+++ b/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/policy_Dictionary.html
@@ -79,6 +79,7 @@
<div ng-if="option2 == 'BRMS Controller'" ng-include = "'app/policyApp/policy-models/Dictionary/BRMSControllerDictionary.html'"></div>
<!--Decision Policy Dictionary's-->
<div ng-if="option2 == 'Settings Dictionary'" ng-include = "'app/policyApp/policy-models/Dictionary/DecisionSettingsDictionary.html'"></div>
+ <div ng-if="option2 == 'Rainy Day Allowed Treatments'" ng-include = "'app/policyApp/policy-models/Dictionary/DecisionRainyDayDictionary.html'"></div>
<!--Descriptive Scope Dictionary-->
<div ng-if="option2 == 'Descriptive Scope'" ng-include = "'app/policyApp/policy-models/Dictionary/DescriptiveScopeDictionary.html'"></div>
<!--Enforcer Policy Dictionary-->