Add license to policy-engine files
[policy/engine.git] / POLICY-SDK-APP / src / main / webapp / app / policyApp / policy-models / Editor / PolicyTemplates / BRMSParamPolicyTemplate.html
1 <!--
2   ============LICENSE_START==================================================
3   ONAP Policy Engine
4   ===========================================================================
5   Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
6   ===========================================================================
7   Licensed under the Apache License, Version 2.0 (the "License");
8   you may not use this file except in compliance with the License.
9   You may obtain a copy of the License at
10   
11        http://www.apache.org/licenses/LICENSE-2.0
12   
13   Unless required by applicable law or agreed to in writing, software
14   distributed under the License is distributed on an "AS IS" BASIS,
15   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16   See the License for the specific language governing permissions and
17   limitations under the License.
18   ============LICENSE_END====================================================
19   -->
20 <div ng-controller="brmsParamPolicyController"
21         ng-init="addDataToFields(temp.policy.ruleName);">
22         <form>
23                 <div class="well">
24                         <div class="form-group row">
25                                 <div class="form-group col-sm-6">
26                                         <label>Policy Name:<sup><b>*</b></sup></label> <input type="text"
27                                                 class="form-control" ng-disabled="temp.policy.readOnly"
28                                                 ng-readonly="temp.policy.editPolicy"
29                                                 ng-model="temp.policy.policyName" required pattern="\S+"
30                                                 title="Enter Policy Name without any spaces and special characters and will accept _." />
31                                 </div>
32                                 <div class="form-group col-sm-6">
33                                         <label>Description:</label> <input type="text" class="form-control"
34                                                 ng-disabled="temp.policy.readOnly"
35                                                 ng-model="temp.policy.policyDescription" 
36                                                 title="Description field will accept any type of data."/>
37                                 </div>
38                         </div>
39                         <div class="form-group row">
40                                 <div class="form-group col-sm-3">
41                                         <label>Risk Type:<sup><b>*</b></sup></label> <select
42                                                 class="form-control" ng-disabled="temp.policy.readOnly"
43                                                 ng-model="temp.policy.riskType"
44                                                 ng-options="option for option in riskTypeDictionaryDatas track by option"
45                                                 required pattern="\S+" title="Select the dropdown value driven from RiskType (Safe Policy)Dictionary."></select>
46                                 </div>
47                                 <div class="form-group col-sm-3">
48                                         <label>Risk Level:<sup><b>*</b></sup></label> <select
49                                                 class="form-control" ng-disabled="temp.policy.readOnly"
50                                                 ng-model="temp.policy.riskLevel"
51                                                 required pattern="\S+" title="Select the dropdown Risk level value.">
52                                                 <option>1</option>
53                                                 <option>2</option>
54                                                 <option>3</option>
55                                                 <option>4</option>
56                                                 <option>5</option></select>
57                                 </div>
58                                 <div class="form-group col-sm-3">
59                                         <label>Guard:<sup><b>*</b></sup></label> <select
60                                                 class="form-control" ng-disabled="temp.policy.readOnly"
61                                                 ng-model="temp.policy.guard"
62                                                 required pattern="\S+" title="Select the dropdown Guard value.">
63                                                 <option>True</option>
64                                                 <option>False</option></select>
65                                 </div>
66                         </div>
67                         <div class="form-group row">
68                                 <div class="form-group col-sm-3">
69                                         <label>Time to Live Date:</label> <input type="text" id="ttlDate"
70                                                 class="form-control" name="ttlDate" ng-disabled="temp.policy.readOnly"
71                                                 ng-model="temp.policy.ttlDate" title="Select the date from calender onclick on the field."/>
72                                 </div>
73                                 <div class="form-group col-sm-3">
74                                         <label>Controller:<sup></sup></label> <select
75                                                 class="form-control" ng-disabled="temp.policy.readOnly"
76                                                 ng-model="temp.policy.brmsController"
77                                                 ng-options="option for option in brmsControllerDatas track by option" title="Select the dropdown value driven from BRMS Controller (BRMS)Dictionary."></select>
78                                 </div>
79                                 <div class="form-group col-sm-3">
80                                         <label>Dependencies:<sup></sup></label> <select
81                                                 class="form-control" multiple ng-disabled="temp.policy.readOnly"
82                                                 ng-model="temp.policy.brmsDependency"
83                                                 ng-options="option for option in brmsDependencyDatas track by option" title="Select the dropdown value driven from BRMS Dependency (BRMS)Dictionary."></select>
84                                 </div>
85                         </div>
86                 </div>
87                 <div class="well">
88                         <div class="form-group row">
89                                 <div class="form-group col-sm-2">
90                                         <label>Rule Attributes:<sup><b></b></sup></label>
91                                         <button type="button" class="btn btn-default"
92                                                 ng-disabled="temp.policy.readOnly" ng-click="addNewChoice()" title="onClick Rule Attribute row is added.">
93                                                 <i class="fa fa-plus"></i>
94                                         </button>
95                                 </div>
96                         </div>
97                         <div class="form-group row">
98                                 <div data-ng-repeat="choice in temp.policy.attributes">
99                                         <div class="form-group row" style="margin-left: 2%">
100                                                 <div class="form-group col-sm-3">
101                                                         <input type="text" class="form-control"
102                                                                 ng-disabled="temp.policy.readOnly" ng-model="choice.key" title="Enter the Rule Attribute Key without any spaces and special characters"
103                                                                 placeholder="Attribute Key" />
104                                                 </div>
105                                                 <div class="form-group col-sm-3">
106                                                         <input type="text" class="form-control"
107                                                                 ng-disabled="temp.policy.readOnly" ng-model="choice.value" title="Enter the Rule Attribute Value without any spaces and special characters"
108                                                                 placeholder="Attribute Value" />
109                                                 </div>
110                                                 <div class="form-group col-sm-1">
111                                                         <button type="button" class="btn btn-default" ng-show="$last"
112                                                                 ng-disabled="temp.policy.readOnly" ng-click="removeChoice()" title="onClick will remove the last row">
113                                                                 <i class="fa fa-minus"></i>
114                                                         </button>
115                                                 </div>
116                                         </div>
117                                 </div>
118                         </div>
119                 </div>
120                 <div class="well">
121                         <div class="form-group row">
122                                 <div class="form-group col-sm-3">
123                                         <label>BRMS Template:<sup><b>*</b></sup></label> <select
124                                                 class="form-control" ng-disabled="temp.policy.readOnly"
125                                                 ng-model="temp.policy.ruleName"
126                                                 ng-options="option for option in brmsParamDictionaryDatas track by option"
127                                                 ng-click="addDataToFields(temp.policy.ruleName);" title="Select the dropdown value driven from BRMSParamTemplate (BRMS)Dictionary">
128                                                 <option value="">{{temp.policy.ruleName}}</option>
129                                         </select>
130                                 </div>
131                         </div>
132
133                         <div class="form-group row">
134                                 <div ng-repeat="(key, data) in temp.policy.dynamicLayoutMap">
135                                         <div class="form-group row" style="margin-left: 2%">
136                                                 <label class="control-label col-md-3">{{key}}:</label>
137                                                 <div class="form-group col-sm-6">
138                                                         <input type="text" class="form-control"
139                                                                 ng-disabled="temp.policy.readOnly"
140                                                                 ng-model="temp.policy.ruleData[key]" />
141                                                 </div>
142                                         </div>
143                                 </div>
144                         </div>
145                 </div>
146                 <div id="validate" style="width: 70%"></div>
147                 <div ng-hide="showbrmsrule">
148                 <div class="well">
149                         <h2 class="font-showcase-font-name"> Rule Preview: </h2>
150                         <div class="divider-container"><hr> </div>
151                         <textarea type="text" style="width: 100%; height: 800px" ng-bind="datarule" ng-disabled="true"></textarea>
152                         <button class="btn btn-default" herf="javascript:void(0)" ng-click="hideRule();" title="OnClick the BRMS Rule will be Hidden.">Hide Rule</button>
153                 </div>  
154                 </div>
155                 <br>
156                 <div class="modal-footer">
157                         <div>
158                                 <button class="btn btn-primary" herf="javascript:void(0)"
159                                         ng-disabled="temp.policy.readOnly"
160                                         ng-click="validatePolicy(temp.policy);" title="Validate the data entered in the Policy fields.">Validate</button>
161                                 <button class="btn btn-default" herf="javascript:void(0)"
162                                         ng-disabled="validateSuccess" ng-click="ShowRule(temp);" title="OnClick the BRMS Rule will be previewed.">Show
163                                         Rule</button>
164                                 <button class="btn btn-success" herf="javascript:void(0)"
165                                         ng-disabled="savebutton" ng-disabled="temp.policy.readOnly"
166                                         ng-click="saveBrmsParamPolicy(temp);" title="Save the Policy with validated data.">Save</button>
167                                 <button type="button" class="btn btn-default" ng-click="refresh();" title="Close the template.">Close</button>
168                         </div>
169                 </div>
170         </form>
171 </div>