From f7d7e05877dd9427dccc88f6c12ccacc281b06a7 Mon Sep 17 00:00:00 2001 From: Michael Abashian Date: Thu, 8 Dec 2016 11:25:09 -0500 Subject: [PATCH] Fixes for some Activity Stream bugs involving the query param changes that I made previously. --- .../src/activity-stream/activitystream.route.js | 15 ++++++++++++--- .../stream-dropdown-nav.directive.js | 2 +- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/awx/ui/client/src/activity-stream/activitystream.route.js b/awx/ui/client/src/activity-stream/activitystream.route.js index d7628b5756..73877d5f1b 100644 --- a/awx/ui/client/src/activity-stream/activitystream.route.js +++ b/awx/ui/client/src/activity-stream/activitystream.route.js @@ -16,8 +16,8 @@ export default { value: { // default params will not generate search tags order_by: '-timestamp', - or__object1_in: null, - or__object2_in: null + or__object1__in: null, + or__object2__in: null } } }, @@ -46,7 +46,16 @@ export default { Dataset: ['StreamList', 'QuerySet', '$stateParams', 'GetBasePath', function(list, qs, $stateParams, GetBasePath) { 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', diff --git a/awx/ui/client/src/activity-stream/streamDropdownNav/stream-dropdown-nav.directive.js b/awx/ui/client/src/activity-stream/streamDropdownNav/stream-dropdown-nav.directive.js index 268b5b442f..cba0ecaddf 100644 --- a/awx/ui/client/src/activity-stream/streamDropdownNav/stream-dropdown-nav.directive.js +++ b/awx/ui/client/src/activity-stream/streamDropdownNav/stream-dropdown-nav.directive.js @@ -39,7 +39,7 @@ export default ['templateUrl', function(templateUrl) { $scope.changeStreamTarget = function(){ if($scope.streamTarget && $scope.streamTarget === 'dashboard') { // Just navigate to the base activity stream - $state.go('activityStream'); + $state.go('activityStream', {target: null, activity_search: {page_size:"20", order_by: '-timestamp'}}); } else { let search = _.merge($stateParams.activity_search, {