Skip to content

Commit eb38efe

Browse files
author
RAJA MARAGANI
committed
added a default rule type, otherwise getting knockout binding issues
reused EIRequestController for test rules.
1 parent 156d1e1 commit eb38efe

File tree

3 files changed

+14
-121
lines changed

3 files changed

+14
-121
lines changed

src/main/java/com/ericsson/ei/frontend/EIRequestsController.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -155,14 +155,12 @@ public ResponseEntity<String> getRequests(Model model, HttpServletRequest reques
155155
}
156156

157157
/**
158-
* Bridge all EI Http Requests with POST method. E.g. Making Create
159-
* Subscription Request.
158+
* Bridge all EI Http Requests with POST method.
160159
*
161160
*/
162161
@CrossOrigin
163-
@RequestMapping(value = "/subscriptions", method = RequestMethod.POST)
162+
@RequestMapping(value = { "/subscriptions", "/rules/rule-check/aggregation"}, method = RequestMethod.POST)
164163
public ResponseEntity<String> postRequests(Model model, HttpServletRequest request) {
165-
166164
String eiBackendAddressSuffix = request.getServletPath();
167165
String newRequestUrl = getEIBackendSubscriptionAddress() + eiBackendAddressSuffix;
168166
LOG.info("Got HTTP Request with method POST.\nUrlSuffix: " + eiBackendAddressSuffix

src/main/java/com/ericsson/ei/frontend/RulesController.java

Lines changed: 0 additions & 116 deletions
This file was deleted.

src/main/resources/static/js/testrules.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,17 @@ jQuery(document).ready(
7373
self.removeRule = function(name) {
7474
self.rulesBindingList.remove(name);
7575
self.dropdown.push(name.Type);
76+
if(self.rulesBindingList().length == 0){
77+
$.jGrowl("Deleted all rule types, but we need atleast one Rule type, Here add default rule type", {
78+
sticky : false,
79+
theme : 'Error'
80+
});
81+
self.rulesBindingList.push({
82+
"TemplateName" : "",
83+
"Type" : "EiffelArtifactCreatedEvent"
84+
85+
});
86+
}
7687
};
7788

7889
//This submit function for finding the aggregated object from the rules and events, This function internally call the ajax call
@@ -181,7 +192,7 @@ jQuery(document).ready(
181192
var rulesList = JSON.parse(fileContent);
182193
ko.cleanNode($("#testTulesDOMObject")[0]);
183194
ko.cleanNode($("#submitButton")[0]);
184-
195+
$("#testTulesDOMObject").css('min-height', $(".navbar-sidenav").height() - 180);
185196
vm.rulesBindingList.removeAll();
186197
$('.eventsListDisplay > div:gt(0)').remove();
187198
vm.rulesBindingList = ko.observableArray(rulesList);

0 commit comments

Comments
 (0)