24994d3da2974ecb8cb868b25052bc1c4f243c6b
[policy/engine.git] / POLICY-SDK-APP / src / main / webapp / app / policyApp / policy-models / Editor / PolicyTemplates / BRMSParamPolicyTemplate.html
1 <div ng-controller="brmsParamPolicyController"
2         ng-init="addDataToFields(temp.policy.ruleName);">
3         <form>
4                 <div class="well">
5                         <div class="form-group row">
6                                 <div class="form-group col-sm-6">
7                                         <label>Policy Name:<sup><b>*</b></sup></label> <input type="text"
8                                                 class="form-control" ng-disabled="temp.policy.readOnly"
9                                                 ng-readonly="temp.policy.editPolicy"
10                                                 ng-model="temp.policy.policyName" required pattern="\S+"
11                                                 title="Enter Policy Name without any spaces and special characters and will accept _." />
12                                 </div>
13                                 <div class="form-group col-sm-6">
14                                         <label>Description:</label> <input type="text" class="form-control"
15                                                 ng-disabled="temp.policy.readOnly"
16                                                 ng-model="temp.policy.policyDescription" 
17                                                 title="Description field will accept any type of data."/>
18                                 </div>
19                         </div>
20                         <div class="form-group row">
21                                 <div class="form-group col-sm-3">
22                                         <label>Risk Type:<sup><b>*</b></sup></label> <select
23                                                 class="form-control" ng-disabled="temp.policy.readOnly"
24                                                 ng-model="temp.policy.riskType"
25                                                 ng-options="option for option in riskTypeDictionaryDatas track by option"
26                                                 required pattern="\S+" title="Select the dropdown value driven from RiskType (Safe Policy)Dictionary."></select>
27                                 </div>
28                                 <div class="form-group col-sm-3">
29                                         <label>Risk Level:<sup><b>*</b></sup></label> <select
30                                                 class="form-control" ng-disabled="temp.policy.readOnly"
31                                                 ng-model="temp.policy.riskLevel"
32                                                 required pattern="\S+" title="Select the dropdown Risk level value.">
33                                                 <option>1</option>
34                                                 <option>2</option>
35                                                 <option>3</option>
36                                                 <option>4</option>
37                                                 <option>5</option></select>
38                                 </div>
39                                 <div class="form-group col-sm-3">
40                                         <label>Guard:<sup><b>*</b></sup></label> <select
41                                                 class="form-control" ng-disabled="temp.policy.readOnly"
42                                                 ng-model="temp.policy.guard"
43                                                 required pattern="\S+" title="Select the dropdown Guard value.">
44                                                 <option>True</option>
45                                                 <option>False</option></select>
46                                 </div>
47                         </div>
48                         <div class="form-group row">
49                                 <div class="form-group col-sm-3">
50                                         <label>Time to Live Date:</label> <input type="text" id="ttlDate"
51                                                 class="form-control" name="ttlDate" ng-disabled="temp.policy.readOnly"
52                                                 ng-model="temp.policy.ttlDate" title="Select the date from calender onclick on the field."/>
53                                 </div>
54                                 <div class="form-group col-sm-3">
55                                         <label>Controller:<sup></sup></label> <select
56                                                 class="form-control" ng-disabled="temp.policy.readOnly"
57                                                 ng-model="temp.policy.brmsController"
58                                                 ng-options="option for option in brmsControllerDatas track by option" title="Select the dropdown value driven from BRMS Controller (BRMS)Dictionary."></select>
59                                 </div>
60                                 <div class="form-group col-sm-3">
61                                         <label>Dependencies:<sup></sup></label> <select
62                                                 class="form-control" multiple ng-disabled="temp.policy.readOnly"
63                                                 ng-model="temp.policy.brmsDependency"
64                                                 ng-options="option for option in brmsDependencyDatas track by option" title="Select the dropdown value driven from BRMS Dependency (BRMS)Dictionary."></select>
65                                 </div>
66                         </div>
67                 </div>
68                 <div class="well">
69                         <div class="form-group row">
70                                 <div class="form-group col-sm-2">
71                                         <label>Rule Attributes:<sup><b></b></sup></label>
72                                         <button type="button" class="btn btn-default"
73                                                 ng-disabled="temp.policy.readOnly" ng-click="addNewChoice()" title="onClick Rule Attribute row is added.">
74                                                 <i class="fa fa-plus"></i>
75                                         </button>
76                                 </div>
77                         </div>
78                         <div class="form-group row">
79                                 <div data-ng-repeat="choice in temp.policy.attributes">
80                                         <div class="form-group row" style="margin-left: 2%">
81                                                 <div class="form-group col-sm-3">
82                                                         <input type="text" class="form-control"
83                                                                 ng-disabled="temp.policy.readOnly" ng-model="choice.key" title="Enter the Rule Attribute Key without any spaces and special characters"
84                                                                 placeholder="Attribute Key" />
85                                                 </div>
86                                                 <div class="form-group col-sm-3">
87                                                         <input type="text" class="form-control"
88                                                                 ng-disabled="temp.policy.readOnly" ng-model="choice.value" title="Enter the Rule Attribute Value without any spaces and special characters"
89                                                                 placeholder="Attribute Value" />
90                                                 </div>
91                                                 <div class="form-group col-sm-1">
92                                                         <button type="button" class="btn btn-default" ng-show="$last"
93                                                                 ng-disabled="temp.policy.readOnly" ng-click="removeChoice()" title="onClick will remove the last row">
94                                                                 <i class="fa fa-minus"></i>
95                                                         </button>
96                                                 </div>
97                                         </div>
98                                 </div>
99                         </div>
100                 </div>
101                 <div class="well">
102                         <div class="form-group row">
103                                 <div class="form-group col-sm-3">
104                                         <label>BRMS Template:<sup><b>*</b></sup></label> <select
105                                                 class="form-control" ng-disabled="temp.policy.readOnly"
106                                                 ng-model="temp.policy.ruleName"
107                                                 ng-options="option for option in brmsParamDictionaryDatas track by option"
108                                                 ng-click="addDataToFields(temp.policy.ruleName);" title="Select the dropdown value driven from BRMSParamTemplate (BRMS)Dictionary">
109                                                 <option value="">{{temp.policy.ruleName}}</option>
110                                         </select>
111                                 </div>
112                         </div>
113
114                         <div class="form-group row">
115                                 <div ng-repeat="(key, data) in temp.policy.dynamicLayoutMap">
116                                         <div class="form-group row" style="margin-left: 2%">
117                                                 <label class="control-label col-md-3">{{key}}:</label>
118                                                 <div class="form-group col-sm-6">
119                                                         <input type="text" class="form-control"
120                                                                 ng-disabled="temp.policy.readOnly"
121                                                                 ng-model="temp.policy.ruleData[key]" />
122                                                 </div>
123                                         </div>
124                                 </div>
125                         </div>
126                 </div>
127                 <div id="validate" style="width: 70%"></div>
128                 <div ng-hide="showbrmsrule">
129                 <div class="well">
130                         <h2 class="font-showcase-font-name"> Rule Preview: </h2>
131                         <div class="divider-container"><hr> </div>
132                         <textarea type="text" style="width: 100%; height: 800px" ng-bind="datarule" ng-disabled="true"></textarea>
133                         <button class="btn btn-default" herf="javascript:void(0)" ng-click="hideRule();" title="OnClick the BRMS Rule will be Hidden.">Hide Rule</button>
134                 </div>  
135                 </div>
136                 <br>
137                 <div class="modal-footer">
138                         <div>
139                                 <button class="btn btn-primary" herf="javascript:void(0)"
140                                         ng-disabled="temp.policy.readOnly"
141                                         ng-click="validatePolicy(temp.policy);" title="Validate the data entered in the Policy fields.">Validate</button>
142                                 <button class="btn btn-default" herf="javascript:void(0)"
143                                         ng-disabled="validateSuccess" ng-click="ShowRule(temp);" title="OnClick the BRMS Rule will be previewed.">Show
144                                         Rule</button>
145                                 <button class="btn btn-success" herf="javascript:void(0)"
146                                         ng-disabled="savebutton" ng-disabled="temp.policy.readOnly"
147                                         ng-click="saveBrmsParamPolicy(temp);" title="Save the Policy with validated data.">Save</button>
148                                 <button type="button" class="btn btn-default" ng-click="refresh();" title="Close the template.">Close</button>
149                         </div>
150                 </div>
151         </form>
152 </div>