Skip to content

Commit

Permalink
Merge "Closes-Bug: #1610973 - Pagination issue in Control Node Routes…
Browse files Browse the repository at this point in the history
… page when filter routing instance Manual Test: 1.In serach Routes if we select Routing instance 'all', prefix empty and limit 50 pagination is working fine. 2.If we selct Routing Instance 'efault-domain:admin:net5:net5', prefix empty and limit 10 pagination is working fine. 3.If we selct Routing Instance 'efault-domain:admin:net6:net6', prefix '2.2.2.3/32' and limit 10 pagination is working fine. 4.If we selct Routing Instance 'all', prefix '0-10.204.217.42:4-0.0.0.0,255.255.255.255,0.0.0.0' and limit 10 pagination is working fine."
  • Loading branch information
Zuul authored and opencontrail-ci-admin committed Aug 10, 2016
2 parents e177d25 + ef828cf commit 3f928bf
Showing 1 changed file with 17 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ define([
//Remove all query references once it is moved to core
], function (_, Knockback, ContrailView, ContrailListModel, ControlNodeRoutesModel) {
var routingInstancesDropdownList = [{text:'All',value:'All'}],
backwardRouteStack = [], forwardRouteStack = [], filteredPrefix = '', routInstance = '';
backwardRouteStack = [], forwardRouteStack = [], filteredPrefix = '',
routInstance = '', showRouteStack;
var ControlNodeRoutesFormView = ContrailView.extend({
render: function (options) {
var self = this, viewConfig = self.attributes.viewConfig,
Expand Down Expand Up @@ -107,6 +108,7 @@ define([
ajaxConfig : routesRemoteConfig,
dataParser : function (response) {
var selValues = {};
showRouteStack = undefined;
backwardRouteStack = []; forwardRouteStack = [];
var parsedData = monitorInfraParsers.
parseRoutes(response,routesQueryString);
Expand Down Expand Up @@ -143,27 +145,28 @@ define([
}else{
prefix = showRoute[0].prefix;
}
if(checkNonExistRoute(backwardRouteStack, routingTable, prefix)){
if(showRouteStack === undefined){
showRouteStack = showRouteTable;
backwardRouteStack.push({
limit: routesQueryString.limit,
startRoutingTable: routingTable,
startRoutingInstance: routingInstance,
startPrefix: prefix,
prefix: filteredPrefix,
routingInst:routInstance
routingInst: routInstance
});
}
};
var checkNonExistRoute = function(existingStack,routeTable,prefix){
var nonExistRecord = false;
if(existingStack.length !== 0){
var lastRecord = existingStack[existingStack.length - 1];
if(lastRecord.startRoutingTable !== routeTable){
nonExistRecord = true;
}
return nonExistRecord;
}else{
return true;
if(!_.isEqual(showRouteStack, showRouteTable)){
showRouteStack = showRouteTable;
backwardRouteStack.push({
limit: routesQueryString.limit,
startRoutingTable: routingTable,
startRoutingInstance: routingInstance,
startPrefix: prefix,
prefix: filteredPrefix,
routingInst: routInstance
});
}
}
};
var forwardRoutes = function(model){
Expand Down

0 comments on commit 3f928bf

Please sign in to comment.