<commit_before>const React = require('react');

const CreateForm = require('../components/CreateForm');
const FlashMessages = require('../components/FlashMessages');
const Footer = require('../components/Footer');
const ItemsTable = require('../components/ItemsTable');
const ListHeader = require('../components/ListHeader');
const MobileNavigation = require('../components/MobileNavigation');
const PrimaryNavigation = require('../components/PrimaryNavigation');
const SecondaryNavigation = require('../components/SecondaryNavigation');

const CurrentListStore = require('../stores/CurrentListStore');

const { BlankState, Container, Button, Spinner } = require('elemental');

function showCreateForm() {
	return window.location.search === '?create' || Keystone.createFormErrors;
}

const ListView = React.createClass({
	getInitialState () {
		return {
			constrainTableWidth: true,
			showCreateForm: showCreateForm(),
			...this.getStateFromStore()
		};
	},
	componentDidMount () {
		CurrentListStore.addChangeListener(this.updateStateFromStore);
		if (!this.state.ready) {
			CurrentListStore.loadItems();
		}
	},
	componentWillUnmount () {
		CurrentListStore.removeChangeListener(this.updateStateFromStore);
	},
	updateStateFromStore () {
		this.setState(this.getStateFromStore());
	},
	toggleTableWidth () {
		this.setState({
			constrainTableWidth: !this.state.constrainTableWidth
		});
	},
	getStateFromStore () {
		var state = {
			columns: CurrentListStore.getActiveColumns(),
			items: CurrentListStore.getItems(),
			list: CurrentListStore.getList(),
			loading: CurrentListStore.isLoading(),
			ready: CurrentListStore.isReady(),
			search: CurrentListStore.getActiveSearch()
		};
		state.showBlankState = (state.ready && !state.loading && !state.items.results.length && !state.search) ? true : false;
		return state;<commit_msg>Fixing incorrect blank slate when no items match filters<commit_after>const React = require('react');

const CreateForm = require('../components/CreateForm');
const FlashMessages = require('../components/FlashMessages');
const Footer = require('../components/Footer');
const ItemsTable = require('../components/ItemsTable');
const ListHeader = require('../components/ListHeader');
const MobileNavigation = require('../components/MobileNavigation');
const PrimaryNavigation = require('../components/PrimaryNavigation');
const SecondaryNavigation = require('../components/SecondaryNavigation');

const CurrentListStore = require('../stores/CurrentListStore');

const { BlankState, Container, Button, Spinner } = require('elemental');

function showCreateForm() {
	return window.location.search === '?create' || Keystone.createFormErrors;
}

const ListView = React.createClass({
	getInitialState () {
		return {
			constrainTableWidth: true,
			showCreateForm: showCreateForm(),
			...this.getStateFromStore()
		};
	},
	componentDidMount () {
		CurrentListStore.addChangeListener(this.updateStateFromStore);
		if (!this.state.ready) {
			CurrentListStore.loadItems();
		}
	},
	componentWillUnmount () {
		CurrentListStore.removeChangeListener(this.updateStateFromStore);
	},
	updateStateFromStore () {
		this.setState(this.getStateFromStore());
	},
	toggleTableWidth () {
		this.setState({
			constrainTableWidth: !this.state.constrainTableWidth
		});
	},
	getStateFromStore () {
		var state = {
			columns: CurrentListStore.getActiveColumns(),
			filters: CurrentListStore.getActiveFilters(),
			items: CurrentListStore.getItems(),
			list: CurrentListStore.getList(),
			loading: CurrentListStore.isLoading(),
			ready: CurrentListStore.isReady(),
			search: CurrentListStore.getActiveSearch()
		};
		state.showBlankState = (state.ready && !state.loading && !state.items.results.length && !state.search && !state.filters.length) ? true : false;
		return state;
{'fraction_non_alphanumeric': 0.14312023151802158, 'fraction_numerical': 0.0, 'mean_word_length': 5.521440823327616, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2095522', 'n_tokens_mistral': 1140, 'n_tokens_neox': 1052, 'n_words': 188}