1
0
mirror of https://github.com/ansible/awx.git synced 2024-11-01 16:51:11 +03:00

Pass any existing search params (including sort_by) to updateFilteredUrl in tagSearch.service.js so that those params will persist to the tag search results.

This commit is contained in:
Michael Abashian 2016-06-10 10:51:59 -04:00
parent 41e231852a
commit 48d029defb
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 iterator = $scope.iterator;
var pageSize = $scope var pageSize = $scope
.$parent[iterator + "_page_size"]; .$parent[iterator + "_page_size"];
var searchParams = $scope
.$parent[iterator + "SearchParams"];
var set = $scope.set; var set = $scope.set;
var listScope = $scope.$parent; var listScope = $scope.$parent;
var url = tagSearchService var url = tagSearchService
.updateFilteredUrl($scope.endpoint, tags, pageSize); .updateFilteredUrl($scope.endpoint, tags, pageSize, searchParams);
$scope.$parent[iterator + "_active_search"] = true; $scope.$parent[iterator + "_active_search"] = true;
Refresh({ Refresh({

View File

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