Add license to policy-engine files
[policy/engine.git] / POLICY-SDK-APP / src / main / webapp / app / policyApp / policy-models / Editor / PolicyTemplates / ActionPolicyTemplate.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="actionPolicyController">
21         <form>
22                 <div class="well">
23                         <div class="form-group row">
24                                 <div class="form-group col-sm-6">
25                                         <label>Policy Name:<sup><b>*</b></sup></label> <input type="text"
26                                                 class="form-control" ng-disabled="temp.policy.readOnly"
27                                                 ng-readonly="temp.policy.editPolicy"
28                                                 ng-model="temp.policy.policyName" required pattern="\S+"
29                                                 title="Enter Policy Name without any spaces and special characters and will accept _." />
30                                 </div>
31                                 <div class="form-group col-sm-6">
32                                         <label>Description:</label> <input type="text" class="form-control"
33                                                 ng-disabled="temp.policy.readOnly"
34                                                 ng-model="temp.policy.policyDescription" 
35                                                 title="Description field will accept any type of data."/>
36                                 </div>
37                         </div>
38                         <div class="well">
39                                 <div class="form-group row">
40                                         <div class="form-group col-sm-2">
41                                                 <label>Component Attributes:<sup><b>*</b></sup></label><br>
42                                                 <button type="button" class="btn btn-default"
43                                                         ng-disabled="temp.policy.readOnly" ng-click="addNewChoice()" title="onClick Component Attribute row is added.">
44                                                         <i class="fa fa-plus"></i>
45                                                 </button>
46                                         </div>
47                                 </div>
48                                 <div class="form-group row">
49                                         <div data-ng-repeat="choice in temp.policy.attributes">
50                                                 <div class="form-group row" style="margin-left: 2%">
51                                                         <div class="form-group col-sm-3">
52                                                                 <select class="form-control" ng-disabled="temp.policy.readOnly"
53                                                                         ng-model="choice.key"
54                                                                         ng-options="option for option in attributeDictionaryDatas track by option"
55                                                                         title="Select the dropdown value driven from Attribute (common)Dictionary.">
56                                                                         <option value="">{{choice.key}}</option>
57                                                                 </select>
58                                                         </div>
59                                                         <div class="form-group col-sm-3">
60                                                                 <input type="text" class="form-control"
61                                                                         ng-disabled="temp.policy.readOnly" ng-model="choice.value"
62                                                                         placeholder="Attribute Value" title="Enter the Attribute Value without any spaces and special characters"/>
63                                                         </div>
64                                                         <div class="form-group col-sm-1">
65                                                                 <button type="button" class="btn btn-default" ng-show="$last"
66                                                                         ng-disabled="temp.policy.readOnly" ng-click="removeChoice()" title="onClick will remove the last row">
67                                                                         <i class="fa fa-minus"></i>
68                                                                 </button>
69                                                         </div>
70                                                 </div>
71                                         </div>
72                                 </div>
73                         </div>
74                         <div class="well">
75                                 <label>Rule Algorithms:<sup><b></b></sup></label><br>
76                                 <div class="form-group row">
77                                         <div class="form-group col-sm-1">
78                                                 <button type="button" class="btn btn-default"
79                                                         ng-disabled="temp.policy.readOnly"
80                                                         ng-click="addNewRuleAlgorithm()" title="onClick Rule Algorithms row is added.">
81                                                         <i class="fa fa-plus"></i>
82                                                 </button>
83                                         </div>
84                                 </div>
85                                 <div class="form-group row">
86                                         <div
87                                                 data-ng-repeat="ruleAlgorithmschoice in temp.policy.ruleAlgorithmschoices">
88                                                 <div class="form-group row" style="margin-left: 2%">
89                                                 <div class="form-group col-sm-1">
90                                                         <label ng-model="ruleAlgorithmschoice.dynamicRuleAlgorithmLabels"
91                                                                 ng-disabled="temp.policy.readOnly"
92                                                                 name="dynamicRuleAlgorithmLabels">{{ruleAlgorithmschoice.id}}</label>
93                                                 </div>
94                                                 <div class="form-group col-sm-3">
95                                                         <select type="text" class="form-control"
96                                                                 ng-disabled="temp.policy.readOnly"
97                                                                 ng-model="ruleAlgorithmschoice.dynamicRuleAlgorithmField1"
98                                                                 ng-options="option for option in attributeDictionaryDatas track by option"
99                                                                 name="dynamicRuleAlgorithmField1" title="Select the dropdown value driven from Attribute (common)Dictionary.">
100                                                                 <option value="">{{ruleAlgorithmschoice.dynamicRuleAlgorithmField1}}</option>
101                                                         </select>
102                                                 </div>
103                                                 <div class="form-group col-sm-3">
104                                                         <select type="text" class="form-control"
105                                                                 ng-disabled="temp.policy.readOnly"
106                                                                 ng-model="ruleAlgorithmschoice.dynamicRuleAlgorithmCombo"
107                                                                 ng-options="option for option in functionDefinitionDatas"
108                                                                 name="dynamicRuleAlgorithmCombo" title="Select the dropdown value driven from FunctionDataType.">
109                                                                 <option value="">{{ruleAlgorithmschoice.dynamicRuleAlgorithmCombo}}</option>
110                                                         </select>
111                                                 </div>
112                                                 <div class="form-group col-sm-3">
113                                                         <input type="text" class="form-control"
114                                                                 ng-disabled="temp.policy.readOnly"
115                                                                 ng-model="ruleAlgorithmschoice.dynamicRuleAlgorithmField2"
116                                                                 name="dynamicRuleAlgorithmField2" title="Enter the Value without any spaces and special characters and for rule formation use A1, A2,..etc., based on above Rules."/>
117                                                 </div>
118                                                 <div class="form-group col-sm-1">
119                                                         <button type="button" class="btn btn-default" ng-show="$last"
120                                                                 ng-disabled="temp.policy.readOnly"
121                                                                 ng-click="removeRuleAlgorithm()" title="onClick will remove the last row">
122                                                                 <i class="fa fa-minus"></i>
123                                                         </button>
124                                                 </div>
125                                                 </div>
126                                         </div>
127                                 </div>
128                         </div>
129                         <div class="well">
130                                 <div class="form-group row">
131                                         <div class="form-group col-sm-6">
132                                                 <label>Action Performer:<sup><b>*</b></sup></label><BR> <select
133                                                         class="form-control" ng-disabled="temp.policy.readOnly"
134                                                         ng-model="temp.policy.actionPerformer" title="Select the Action Performer values from dropdown.">
135                                                         <option>PEP</option>
136                                                         <option>PDP</option>
137                                                 </select>
138                                         </div>
139                                         <div class="form-group col-sm-6">
140                                                 <label>Action Attribute:<sup><b>*</b></sup></label><br> <select
141                                                         class="form-control"
142                                                         ng-disabled="temp.policy.readOnly"
143                                                         ng-model="temp.policy.actionAttributeValue"
144                                                         ng-options="option for option in actionPolicyDictionaryDatas track by option" title="Select the dropdown value driven from Action (Action)Dictionary."></select>
145                                         </div>
146                                 </div>
147                         </div>
148                         <div id="validate" style="width: 70%"></div>
149                         <br>
150                         <div class="modal-footer">
151                                 <button class="btn btn-primary" herf="javascript:void(0)"
152                                         ng-disabled="temp.policy.readOnly"
153                                         ng-click="validatePolicy(temp.policy);" title="Validate the data entered in the Policy fields.">Validate</button>
154                                 <button class="btn btn-success" ng-disabled="savebutton"
155                                         herf="javascript:void(0)" ng-disabled="temp.policy.readOnly"
156                                         ng-click="saveActionPolicy(temp);" title="Save the Policy with validated data.">Save</button>
157                                 <button type="button" class="btn btn-default" ng-click="refresh();" title="Close the template.">Close</button>
158                         </div>
159         </form>
160 </div>