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.
This commit is contained in:
Jake McDermott 2019-10-17 12:22:39 -04:00
parent 8e296bbf8c
commit 95c9e8e068
No known key found for this signature in database
GPG Key ID: 0E56ED990CDFCB4F
3 changed files with 15 additions and 7 deletions

View File

@ -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;
});
};

View File

@ -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') }}">
<span class="input-group-btn input-group-append">

View File

@ -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 });