From 62351f18ceec36a514d959c7066c109838005155 Mon Sep 17 00:00:00 2001 From: Michael Abashian Date: Mon, 11 Jul 2016 13:07:23 -0400 Subject: [PATCH 1/2] Fixed bug where created_by filter was lost when adding a search tag --- awx/ui/client/src/portal-mode/portal-mode-jobs.controller.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/awx/ui/client/src/portal-mode/portal-mode-jobs.controller.js b/awx/ui/client/src/portal-mode/portal-mode-jobs.controller.js index d6f6a7e42c..c9a1fa60e0 100644 --- a/awx/ui/client/src/portal-mode/portal-mode-jobs.controller.js +++ b/awx/ui/client/src/portal-mode/portal-mode-jobs.controller.js @@ -24,6 +24,11 @@ export function PortalModeJobsController($scope, $rootScope, GetBasePath, Genera $scope.activeFilter = 'user'; var init = function(sort){ + // We need to explicitly set the lists base path so that tag searching will keep the '?created_by' + // query param when it's present. If we don't do this, then tag search will just grab the base + // path for this list (/api/v1/jobs) and lose the created_by filter + list.basePath = defaultUrl; + view.inject(list, { id: 'portal-jobs', mode: 'edit', From 3f19f3c6d28c24b5a9baeae01996430d8d3a7b37 Mon Sep 17 00:00:00 2001 From: Michael Abashian Date: Mon, 11 Jul 2016 13:34:20 -0400 Subject: [PATCH 2/2] Deep clone the PortalJobsList so that we don't modify the base config --- awx/ui/client/src/portal-mode/portal-mode-jobs.controller.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/awx/ui/client/src/portal-mode/portal-mode-jobs.controller.js b/awx/ui/client/src/portal-mode/portal-mode-jobs.controller.js index c9a1fa60e0..3334a23940 100644 --- a/awx/ui/client/src/portal-mode/portal-mode-jobs.controller.js +++ b/awx/ui/client/src/portal-mode/portal-mode-jobs.controller.js @@ -7,7 +7,7 @@ export function PortalModeJobsController($scope, $rootScope, GetBasePath, GenerateList, PortalJobsList, SearchInit, PaginateInit){ - var list = PortalJobsList, + var list = _.cloneDeep(PortalJobsList), view = GenerateList, // show user jobs by default defaultUrl = GetBasePath('jobs') + '?created_by=' + $rootScope.current_user.id,