mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
[ML] Fix anomaly detector jobs list search delay (#124328)
This commit is contained in:
parent
28ba010233
commit
fd0e1aed0e
1 changed files with 4 additions and 19 deletions
|
@ -7,7 +7,6 @@
|
|||
|
||||
import React, { Component } from 'react';
|
||||
import { EuiFlexGroup, EuiFlexItem, EuiSpacer } from '@elastic/eui';
|
||||
import { debounce } from 'lodash';
|
||||
|
||||
import { ml } from '../../../../services/ml_api_service';
|
||||
import { checkForAutoStartDatafeed, filterJobs, loadFullJob } from '../utils';
|
||||
|
@ -35,11 +34,6 @@ import { AnomalyDetectionEmptyState } from '../anomaly_detection_empty_state';
|
|||
|
||||
let blockingJobsRefreshTimeout = null;
|
||||
|
||||
const filterJobsDebounce = debounce((jobsSummaryList, filterClauses, callback) => {
|
||||
const ss = filterJobs(jobsSummaryList, filterClauses);
|
||||
callback(ss);
|
||||
}, 500);
|
||||
|
||||
// 'isManagementTable' bool prop to determine when to configure table for use in Kibana management page
|
||||
export class JobsListView extends Component {
|
||||
constructor(props) {
|
||||
|
@ -291,19 +285,10 @@ export class JobsListView extends Component {
|
|||
return;
|
||||
}
|
||||
|
||||
if (this._isFiltersSet === true) {
|
||||
filterJobsDebounce(this.state.jobsSummaryList, filterClauses, (jobsSummaryList) => {
|
||||
this.setState({ filteredJobsSummaryList: jobsSummaryList, filterClauses }, () => {
|
||||
this.refreshSelectedJobs();
|
||||
});
|
||||
});
|
||||
} else {
|
||||
// first use after page load, do not debounce.
|
||||
const filteredJobsSummaryList = filterJobs(this.state.jobsSummaryList, filterClauses);
|
||||
this.setState({ filteredJobsSummaryList, filterClauses }, () => {
|
||||
this.refreshSelectedJobs();
|
||||
});
|
||||
}
|
||||
const filteredJobsSummaryList = filterJobs(this.state.jobsSummaryList, filterClauses);
|
||||
this.setState({ filteredJobsSummaryList, filterClauses }, () => {
|
||||
this.refreshSelectedJobs();
|
||||
});
|
||||
|
||||
this._isFiltersSet = true;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue