Merge pull request #2317 from mabashian/sort-search-results

Sort tagsearch results
This commit is contained in:
Michael Abashian 2016-06-13 16:25:30 -04:00 committed by GitHub
commit 99ea3c63fb
2 changed files with 6 additions and 3 deletions

View File

@ -36,10 +36,12 @@ export default ['$scope', 'Refresh', 'tagSearchService',
var iterator = $scope.iterator;
var pageSize = $scope
.$parent[iterator + "_page_size"];
var searchParams = $scope
.$parent[iterator + "SearchParams"];
var set = $scope.set;
var listScope = $scope.$parent;
var url = tagSearchService
.updateFilteredUrl($scope.endpoint, tags, pageSize);
.updateFilteredUrl($scope.endpoint, tags, pageSize, searchParams);
$scope.$parent[iterator + "_active_search"] = true;
Refresh({

View File

@ -125,7 +125,7 @@ export default ['Rest', '$q', 'GetBasePath', 'Wait', 'ProcessErrors', '$log', fu
};
// returns the url with filter params
this.updateFilteredUrl = function(basePath, tags, pageSize) {
this.updateFilteredUrl = function(basePath, tags, pageSize, searchParams) {
// remove the chain directive from all the urls that might have
// been added previously
tags = (tags || []).map(function(val) {
@ -171,7 +171,8 @@ export default ['Rest', '$q', 'GetBasePath', 'Wait', 'ProcessErrors', '$log', fu
return returnedUrl +
(tags || []).map(function (t) {
return t.url;
}).join("&") + "&page_size=" + pageSize;
}).join("&") + "&page_size=" + pageSize +
((searchParams) ? "&" + searchParams : "");
};
// given the field and input filters, create the tag object