diff --git a/awx/ui/client/src/activity-stream/activitystream.route.js b/awx/ui/client/src/activity-stream/activitystream.route.js index d4af2bd0aa..d7628b5756 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: null, - or__object2: null + or__object1_in: null, + or__object2_in: null } } }, 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 8e01af25e5..268b5b442f 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 @@ -26,7 +26,9 @@ export default ['templateUrl', function(templateUrl) { {label: 'Projects', value: 'project'}, {label: 'Schedules', value: 'schedule'}, {label: 'Teams', value: 'team'}, - {label: 'Users', value: 'user'} + {label: 'Templates', value: 'template'}, + {label: 'Users', value: 'user'}, + {label: 'Workflow Job Templates', value: 'workflow_job_template'} ]; CreateSelect2({ @@ -41,8 +43,8 @@ export default ['templateUrl', function(templateUrl) { } else { let search = _.merge($stateParams.activity_search, { - or__object1: $scope.streamTarget, - or__object2: $scope.streamTarget + or__object1__in: $scope.streamTarget && $scope.streamTarget === 'template' ? 'job_template,workflow_job_template' : $scope.streamTarget, + or__object2__in: $scope.streamTarget && $scope.streamTarget === 'template' ? 'job_template,workflow_job_template' : $scope.streamTarget }); // Attach the taget to the query parameters $state.go('activityStream', {target: $scope.streamTarget, activity_search: search}); diff --git a/awx/ui/client/src/bread-crumb/bread-crumb.directive.js b/awx/ui/client/src/bread-crumb/bread-crumb.directive.js index 36fe3901ee..5cc247d232 100644 --- a/awx/ui/client/src/bread-crumb/bread-crumb.directive.js +++ b/awx/ui/client/src/bread-crumb/bread-crumb.directive.js @@ -26,8 +26,8 @@ export default if(streamConfig.activityStreamTarget) { stateGoParams.target = streamConfig.activityStreamTarget; stateGoParams.activity_search = { - or__object1: streamConfig.activityStreamTarget, - or__object2: streamConfig.activityStreamTarget, + or__object1__in: streamConfig.activityStreamTarget === 'template' ? 'job_template,workflow_job_template' : streamConfig.activityStreamTarget, + or__object2__in: streamConfig.activityStreamTarget === 'template' ? 'job_template,workflow_job_template' : streamConfig.activityStreamTarget, order_by: '-timestamp', page_size: '20', }; diff --git a/awx/ui/client/src/helpers/ActivityStream.js b/awx/ui/client/src/helpers/ActivityStream.js index 215eb00b7e..7dc8c9ecc0 100644 --- a/awx/ui/client/src/helpers/ActivityStream.js +++ b/awx/ui/client/src/helpers/ActivityStream.js @@ -52,6 +52,12 @@ export default case 'host': rtnTitle = 'HOSTS'; break; + case 'template': + rtnTitle = 'TEMPLATES'; + break; + case 'workflow_job_template': + rtnTitle = 'WORKFLOW JOB TEMPLATES'; + break; } return rtnTitle; diff --git a/awx/ui/client/src/helpers/ApiModel.js b/awx/ui/client/src/helpers/ApiModel.js index ff1923ce0a..06544675c5 100644 --- a/awx/ui/client/src/helpers/ApiModel.js +++ b/awx/ui/client/src/helpers/ApiModel.js @@ -48,6 +48,9 @@ export default case 'inventory_script': basePathKey = 'inventory_scripts'; break; + case 'workflow_job_template': + basePathKey = 'workflow_job_templates'; + break; } return basePathKey; diff --git a/awx/ui/client/src/templates/list/templates-list.route.js b/awx/ui/client/src/templates/list/templates-list.route.js index 84c6108863..e615e52db1 100644 --- a/awx/ui/client/src/templates/list/templates-list.route.js +++ b/awx/ui/client/src/templates/list/templates-list.route.js @@ -11,6 +11,8 @@ export default { label: "TEMPLATES" }, data: { + activityStream: true, + activityStreamTarget: 'template', socket: { "groups": { "jobs": ["status_changed"] diff --git a/awx/ui/client/src/widgets/Stream.js b/awx/ui/client/src/widgets/Stream.js index ccd5ad0173..5c2a6892ec 100644 --- a/awx/ui/client/src/widgets/Stream.js +++ b/awx/ui/client/src/widgets/Stream.js @@ -283,11 +283,13 @@ angular.module('StreamWidget', ['RestServices', 'Utilities', 'StreamListDefiniti else { // We just have a type if ($state.params.target === 'inventory_script') { - defaultUrl += '?or__object1=custom_inventory_script&or__object2=custom_inventory_script'; + defaultUrl += '?or__object1__in=custom_inventory_script&or__object2__in=custom_inventory_script'; } else if ($state.params.target === 'management_job') { - defaultUrl += '?or__object1=job&or__object2=job'; + defaultUrl += '?or__object1__in=job&or__object2__in=job'; + } else if ($state.params.target === 'template') { + defaultUrl += '?or__object1__in=job_template,workflow_job_template&or__object2__in=job_template,workflow_job_template'; } else { - defaultUrl += '?or__object1=' + $state.params.target + '&or__object2=' + $state.params.target; + defaultUrl += '?or__object1__in=' + $state.params.target + '&or__object2__in=' + $state.params.target; } } }