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

Fixes for some Activity Stream bugs involving the query param changes that I made previously.

This commit is contained in:
Michael Abashian 2016-12-08 11:25:09 -05:00
parent 949ccd41b2
commit f7d7e05877
2 changed files with 13 additions and 4 deletions

View File

@ -16,8 +16,8 @@ export default {
value: { value: {
// default params will not generate search tags // default params will not generate search tags
order_by: '-timestamp', order_by: '-timestamp',
or__object1_in: null, or__object1__in: null,
or__object2_in: null or__object2__in: null
} }
} }
}, },
@ -46,7 +46,16 @@ export default {
Dataset: ['StreamList', 'QuerySet', '$stateParams', 'GetBasePath', Dataset: ['StreamList', 'QuerySet', '$stateParams', 'GetBasePath',
function(list, qs, $stateParams, GetBasePath) { function(list, qs, $stateParams, GetBasePath) {
let path = GetBasePath(list.basePath) || GetBasePath(list.name); let path = GetBasePath(list.basePath) || GetBasePath(list.name);
return qs.search(path, $stateParams[`${list.iterator}_search`]); let stateParams = $stateParams[`${list.iterator}_search`];
// Sending or__object1__in=null will result in an api error response so lets strip
// these out. This should only be null when hitting the All Activity page.
if(stateParams.or__object1__in && stateParams.or__object1__in === null) {
delete stateParams.or__object1__in;
}
if(stateParams.or__object2__in && stateParams.or__object2__in === null) {
delete stateParams.or__object2__in;
}
return qs.search(path, stateParams);
} }
], ],
features: ['FeaturesService', 'ProcessErrors', '$state', '$rootScope', features: ['FeaturesService', 'ProcessErrors', '$state', '$rootScope',

View File

@ -39,7 +39,7 @@ export default ['templateUrl', function(templateUrl) {
$scope.changeStreamTarget = function(){ $scope.changeStreamTarget = function(){
if($scope.streamTarget && $scope.streamTarget === 'dashboard') { if($scope.streamTarget && $scope.streamTarget === 'dashboard') {
// Just navigate to the base activity stream // Just navigate to the base activity stream
$state.go('activityStream'); $state.go('activityStream', {target: null, activity_search: {page_size:"20", order_by: '-timestamp'}});
} }
else { else {
let search = _.merge($stateParams.activity_search, { let search = _.merge($stateParams.activity_search, {