diff --git a/awx/ui/client/features/output/index.controller.js b/awx/ui/client/features/output/index.controller.js index 04aa59aaf9..63d17d0e32 100644 --- a/awx/ui/client/features/output/index.controller.js +++ b/awx/ui/client/features/output/index.controller.js @@ -237,6 +237,12 @@ function handleSummaryEvent (data) { stream.setFinalCounter(data.final_counter); } +function reloadState (params) { + params.isPanelExpanded = vm.isPanelExpanded; + + return $state.transitionTo($state.current, params, { inherit: false, location: 'replace' }); +} + function OutputIndexController ( _$compile_, _$q_, @@ -250,6 +256,7 @@ function OutputIndexController ( _stream_, $filter, strings, + $stateParams, ) { $compile = _$compile_; $q = _$q_; @@ -269,7 +276,10 @@ function OutputIndexController ( vm.title = $filter('sanitize')(resource.model.get('name')); vm.strings = strings; vm.resource = resource; - vm.isPanelExpanded = false; + + const { isPanelExpanded } = $stateParams; + vm.reloadState = reloadState; + vm.isPanelExpanded = isPanelExpanded; vm.togglePanelExpand = togglePanelExpand; // Stdout Navigation @@ -325,6 +335,7 @@ OutputIndexController.$inject = [ 'OutputStreamService', '$filter', 'OutputStrings', + '$stateParams', ]; module.exports = OutputIndexController; diff --git a/awx/ui/client/features/output/index.js b/awx/ui/client/features/output/index.js index 6d990772ca..7f8813a28b 100644 --- a/awx/ui/client/features/output/index.js +++ b/awx/ui/client/features/output/index.js @@ -191,6 +191,7 @@ function JobsRun ($stateRegistry, $filter, strings) { ncyBreadcrumb, params: { handleErrors: true, + isPanelExpanded: false, }, data: { activityStream: false, diff --git a/awx/ui/client/features/output/index.view.html b/awx/ui/client/features/output/index.view.html index fa973ec40d..bdf7b307c5 100644 --- a/awx/ui/client/features/output/index.view.html +++ b/awx/ui/client/features/output/index.view.html @@ -1,7 +1,7 @@
- @@ -14,7 +14,7 @@ resource="vm.resource" expanded="vm.isPanelExpanded"> - +
diff --git a/awx/ui/client/features/output/search.component.js b/awx/ui/client/features/output/search.component.js index a6dcd3aa4a..73ff8c9a1f 100644 --- a/awx/ui/client/features/output/search.component.js +++ b/awx/ui/client/features/output/search.component.js @@ -1,6 +1,5 @@ const templateUrl = require('~features/output/search.partial.html'); -const searchReloadOptions = { inherit: false, location: 'replace' }; const searchKeyExamples = ['host_name:localhost', 'task:set', 'created:>=2000-01-01']; const searchKeyFields = ['changed', 'created', 'failed', 'host_name', 'stdout', 'task', 'role', 'playbook', 'play']; const searchKeyDocLink = 'https://docs.ansible.com/ansible-tower/3.3.0/html/userguide/search_sort.html'; @@ -40,7 +39,7 @@ function reloadQueryset (queryset, rejection = strings.get('search.REJECT_DEFAUL vm.message = ''; vm.tags = getSearchTags(queryset); - return $state.transitionTo($state.current, params, searchReloadOptions) + return vm.reload(params) .catch(() => { vm.tags = currentTags; vm.message = rejection; @@ -139,4 +138,7 @@ export default { templateUrl, controller: JobSearchController, controllerAs: 'vm', + bindings: { + reload: '=', + }, };