Fixed the Policy API issues and Bugfixes
[policy/engine.git] / POLICY-SDK-APP / src / main / webapp / app / policyApp / policy-models / Editor / PolicyTemplates / ActionPolicyTemplate.html
1 <div ng-controller="actionPolicyController">
2         <form>
3                 <div class="well">
4                         <div class="form-group row">
5                                 <div class="form-group col-sm-6">
6                                         <label>Policy Name:<sup><b>*</b></sup></label> <input type="text"
7                                                 class="form-control" ng-disabled="temp.policy.readOnly"
8                                                 ng-readonly="temp.policy.editPolicy"
9                                                 ng-model="temp.policy.policyName" required pattern="\S+"
10                                                 title="Enter the Policy Name without any spaces" />
11                                 </div>
12                                 <div class="form-group col-sm-6">
13                                         <label>Description:</label> <input type="text" class="form-control"
14                                                 ng-disabled="temp.policy.readOnly"
15                                                 ng-model="temp.policy.policyDescription" />
16                                 </div>
17                         </div>
18                         <div class="well">
19                                 <div class="form-group row">
20                                         <div class="form-group col-sm-2">
21                                                 <label>Component Attributes:</label><br>
22                                                 <button type="button" class="btn btn-default"
23                                                         ng-disabled="temp.policy.readOnly" ng-click="addNewChoice()">
24                                                         <i class="fa fa-plus"></i>
25                                                 </button>
26                                         </div>
27                                 </div>
28                                 <div class="form-group row">
29                                         <div data-ng-repeat="choice in temp.policy.attributes">
30                                                 <div class="form-group row" style="margin-left: 2%">
31                                                         <div class="form-group col-sm-3">
32                                                                 <select class="form-control" ng-disabled="temp.policy.readOnly"
33                                                                         ng-model="choice.key"
34                                                                         ng-options="option for option in attributeDictionaryDatas track by option">
35                                                                         <option value="">{{choice.key}}</option>
36                                                                 </select>
37                                                         </div>
38                                                         <div class="form-group col-sm-3">
39                                                                 <input type="text" class="form-control"
40                                                                         ng-disabled="temp.policy.readOnly" ng-model="choice.value"
41                                                                         placeholder="Attribute Value" />
42                                                         </div>
43                                                         <div class="form-group col-sm-1">
44                                                                 <button type="button" class="btn btn-default" ng-show="$last"
45                                                                         ng-disabled="temp.policy.readOnly" ng-click="removeChoice()">
46                                                                         <i class="fa fa-minus"></i>
47                                                                 </button>
48                                                         </div>
49                                                 </div>
50                                         </div>
51                                 </div>
52                         </div>
53                         <div class="well">
54                                 <label>Rule Algorithms:<sup><b></b></sup></label><br>
55                                 <div class="form-group row">
56                                         <div class="form-group col-sm-1">
57                                                 <button type="button" class="btn btn-default"
58                                                         ng-disabled="temp.policy.readOnly"
59                                                         ng-click="addNewRuleAlgorithm()">
60                                                         <i class="fa fa-plus"></i>
61                                                 </button>
62                                         </div>
63                                 </div>
64                                 <div class="form-group row">
65                                         <div
66                                                 data-ng-repeat="ruleAlgorithmschoice in temp.policy.ruleAlgorithmschoices">
67                                                 <div class="form-group row" style="margin-left: 2%">
68                                                 <div class="form-group col-sm-1">
69                                                         <label ng-model="ruleAlgorithmschoice.dynamicRuleAlgorithmLabels"
70                                                                 ng-disabled="temp.policy.readOnly"
71                                                                 name="dynamicRuleAlgorithmLabels">{{ruleAlgorithmschoice.id}}</label>
72                                                 </div>
73                                                 <div class="form-group col-sm-3">
74                                                         <select type="text" class="form-control"
75                                                                 ng-disabled="temp.policy.readOnly"
76                                                                 ng-model="ruleAlgorithmschoice.dynamicRuleAlgorithmField1"
77                                                                 ng-options="option for option in attributeDictionaryDatas track by option"
78                                                                 name="dynamicRuleAlgorithmField1">
79                                                                 <option value="">{{ruleAlgorithmschoice.dynamicRuleAlgorithmField1}}</option>
80                                                         </select>
81                                                 </div>
82                                                 <div class="form-group col-sm-3">
83                                                         <select type="text" class="form-control"
84                                                                 ng-disabled="temp.policy.readOnly"
85                                                                 ng-model="ruleAlgorithmschoice.dynamicRuleAlgorithmCombo"
86                                                                 ng-options="option for option in functionDefinitionDatas"
87                                                                 name="dynamicRuleAlgorithmCombo">
88                                                                 <option value="">{{ruleAlgorithmschoice.dynamicRuleAlgorithmCombo}}</option>
89                                                         </select>
90                                                 </div>
91                                                 <div class="form-group col-sm-3">
92                                                         <input type="text" class="form-control"
93                                                                 ng-disabled="temp.policy.readOnly"
94                                                                 ng-model="ruleAlgorithmschoice.dynamicRuleAlgorithmField2"
95                                                                 name="dynamicRuleAlgorithmField2" />
96                                                 </div>
97                                                 <div class="form-group col-sm-1">
98                                                         <button type="button" class="btn btn-default" ng-show="$last"
99                                                                 ng-disabled="temp.policy.readOnly"
100                                                                 ng-click="removeRuleAlgorithm()">
101                                                                 <i class="fa fa-minus"></i>
102                                                         </button>
103                                                 </div>
104                                                 </div>
105                                         </div>
106                                 </div>
107                         </div>
108                         <div class="well">
109                                 <div class="form-group row">
110                                         <div class="form-group col-sm-6">
111                                                 <label>Action Performer:<sup><b>*</b></sup></label><BR> <select
112                                                         class="form-control" ng-disabled="temp.policy.readOnly"
113                                                         ng-model="temp.policy.actionPerformer">
114                                                         <option>PEP</option>
115                                                         <option>PDP</option>
116                                                 </select>
117                                         </div>
118                                         <div class="form-group col-sm-6">
119                                                 <label>Action Attribute:<sup><b>*</b></sup></label><br> <select
120                                                         class="form-control"
121                                                         ng-disabled="temp.policy.readOnly"
122                                                         ng-model="temp.policy.actionAttributeValue"
123                                                         ng-options="option for option in actionPolicyDictionaryDatas track by option"></select>
124                                         </div>
125                                 </div>
126                         </div>
127                         <div id="validate" style="width: 70%"></div>
128                         <br>
129                         <div class="modal-footer">
130                                 <button class="btn btn-primary" herf="javascript:void(0)"
131                                         ng-disabled="temp.policy.readOnly"
132                                         ng-click="validatePolicy(temp.policy);">Validate</button>
133                                 <button class="btn btn-success" ng-disabled="savebutton"
134                                         herf="javascript:void(0)" ng-disabled="temp.policy.readOnly"
135                                         ng-click="saveActionPolicy(temp);">Save</button>
136                                 <button type="button" class="btn btn-default" ng-click="refresh();">Close</button>
137                         </div>
138         </form>
139 </div>