Merge pull request #3844 from jakemcdermott/fix-3578-part-1

Always disable search when processing events
This commit is contained in:
Jake McDermott 2019-10-18 15:07:41 -04:00 committed by GitHub
commit 97a635ef49
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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 });