Skip to content

Commit

Permalink
Revert "Fixes elastic#14908 (elastic#15003)"
Browse files Browse the repository at this point in the history
This reverts commit 57d64bf.
  • Loading branch information
stacey-gammon committed Nov 18, 2017
1 parent 337def1 commit b5f5025
Showing 1 changed file with 12 additions and 16 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import _ from 'lodash';

import { SortableProperties } from 'ui_framework/services';
import { Pager } from 'ui/pager';
Expand Down Expand Up @@ -49,19 +48,6 @@ export class VisualizeListingTable extends Component {
);
this.items = [];
this.pager = new Pager(this.items.length, 20, 1);

this.debouncedFetch = _.debounce(filter => {
this.props.fetchItems(filter)
.then(items => {
this.setState({
isFetchingItems: false,
selectedRowIds: [],
filter,
});
this.items = items;
this.calculateItemsOnPage();
});
}, 200);
}

calculateItemsOnPage = () => {
Expand Down Expand Up @@ -89,8 +75,18 @@ export class VisualizeListingTable extends Component {
};

fetchItems = (filter) => {
this.setState({ isFetchingItems: true, filter });
this.debouncedFetch(filter);
this.setState({ isFetchingItems: true });

this.props.fetchItems(filter)
.then(items => {
this.setState({
isFetchingItems: false,
selectedRowIds: [],
filter,
});
this.items = items;
this.calculateItemsOnPage();
});
};

componentDidMount() {
Expand Down

0 comments on commit b5f5025

Please sign in to comment.