From 95c9e8e06870effbabdf09be2b6573ef2b553d2c Mon Sep 17 00:00:00 2001 From: Jake McDermott Date: Thu, 17 Oct 2019 12:22:39 -0400 Subject: [PATCH] Always disable search when processing events When jobs are still processing events, the UI uses numerical ranges based on job_event.counter instead of page numbers. We can't apply search filters in this state because then there would be no way to distinguish between events that are missing due to being filtered out by search and events that are missing because they're still being processed. The UI must be able to distinguish between the two types of missing events because their absence is presented differently. Events that are filtered out by a search query have no visual representation, while events that are missing due to event processing or other causes are displayed as clickable "..." segments. --- awx/ui/client/features/output/search.component.js | 12 +++++++----- awx/ui/client/features/output/search.partial.html | 2 +- awx/ui/client/features/output/status.service.js | 8 +++++++- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/awx/ui/client/features/output/search.component.js b/awx/ui/client/features/output/search.component.js index 09ef3e52f2..cb8299be89 100644 --- a/awx/ui/client/features/output/search.component.js +++ b/awx/ui/client/features/output/search.component.js @@ -1,3 +1,4 @@ +/* eslint camelcase: 0 */ import { OUTPUT_SEARCH_DOCLINK, OUTPUT_SEARCH_FIELDS, @@ -17,7 +18,7 @@ function toggleSearchKey () { } function getCurrentQueryset () { - const { job_event_search } = $state.params; // eslint-disable-line camelcase + const { job_event_search } = $state.params; return qs.decodeArr(job_event_search); } @@ -114,12 +115,13 @@ function JobSearchController (_$state_, _qs_, _strings_, { subscribe }) { vm.key = false; vm.rejected = false; vm.disabled = true; - vm.running = false; + vm.isJobActive = false; vm.tags = getSearchTags(getCurrentQueryset()); - unsubscribe = subscribe(({ running }) => { - vm.disabled = running; - vm.running = running; + unsubscribe = subscribe(({ running, event_processing_finished }) => { + const isJobActive = running || !event_processing_finished; + vm.disabled = isJobActive; + vm.isJobActive = isJobActive; }); }; diff --git a/awx/ui/client/features/output/search.partial.html b/awx/ui/client/features/output/search.partial.html index 602270bd95..b6e6a7342f 100644 --- a/awx/ui/client/features/output/search.partial.html +++ b/awx/ui/client/features/output/search.partial.html @@ -7,7 +7,7 @@ ng-disabled="vm.disabled" ng-class="{ 'at-Input--rejected': vm.rejected }" ng-model="vm.value" - ng-attr-placeholder="{{ vm.running ? + ng-attr-placeholder="{{ vm.isJobActive ? vm.strings.get('search.PLACEHOLDER_RUNNING') : vm.strings.get('search.PLACEHOLDER_DEFAULT') }}"> diff --git a/awx/ui/client/features/output/status.service.js b/awx/ui/client/features/output/status.service.js index ad3bbd8886..f661d5b491 100644 --- a/awx/ui/client/features/output/status.service.js +++ b/awx/ui/client/features/output/status.service.js @@ -50,7 +50,8 @@ function JobStatusService (moment, message) { inventoryScm: { id: model.get('source_project_update'), status: model.get('summary_fields.inventory_source.status') - } + }, + event_processing_finished: model.get('event_processing_finished'), }; this.initHostStatusCounts({ model }); @@ -309,6 +310,10 @@ function JobStatusService (moment, message) { this.state.resultTraceback = traceback; }; + this.setEventProcessingFinished = val => { + this.state.event_processing_finished = val; + }; + this.setHostStatusCounts = counts => { counts = counts || {}; @@ -348,6 +353,7 @@ function JobStatusService (moment, message) { this.setArtifacts(model.get('artifacts')); this.setExecutionNode(model.get('execution_node')); this.setResultTraceback(model.get('result_traceback')); + this.setEventProcessingFinished(model.get('event_processing_finished')); this.initHostStatusCounts({ model }); this.initPlaybookCounts({ model });