<commit_before>import _ from 'lodash';
import React from 'react/addons';
import ItemCard from '../item-card';
import Backbone from 'backdash';
import Header from './header';
import Loading from 'react-loading';
import ProductStore from '../../../stores/product-store';
import ProductActions from '../../../actions/product-actions';

function getColumnState(items=[]) {
  return {
    items,
    isLoading: false,
    scrolling: false
  }
}

var ItemColumn = React.createClass({

  mixins: [Backbone.Events],

  propTypes: {
    status: React.PropTypes.string.isRequired,
    product: React.PropTypes.object.isRequired
  },

  getInitialState: function() {
    return getColumnState();
  },

  _onChange: function() {
    var state = _.cloneDeep(this.state);
    state.items = this.items.toJSON();
    state.isLoading = false;
    this.setState(state);
  },

  getItems: function(product) {
    if (this.items) {
      this.stopListening(this.items, 'change sync', this.items);
    }
    this.items = ProductStore.getItemsForProduct(product, this.props.status);
    this.listenTo(this.items, 'change sync', this._onChange);
    this.setState({ isLoading: true });
    ProductActions.getItems(this.items);
  },

  componentWillMount: function() {
    this.getItems(this.props.product);
  },

  componentWillReceiveProps: function(nextProps) {
    if (nextProps.product.id !== this.props.product.id) {
      this.setState({ isLoading: true });
      this.getItems(nextProps.product);
    }
  },

  render: function() {
    var limit = this.items.length;
    var classes = {
      column: true,
      [this.props.status]: true,
      scrolling: this.state.scrolling
    };

    return (
      <div className={React.addons.classSet(classes)} {...this.props}>
      {this.state.isLoading ?
        <div className="loading"><Loading type="bubbles" color="#ccc"/></div> :<commit_msg>removing scroll tracking from item-column component<commit_after>import _ from 'lodash';
import React from 'react/addons';
import ItemCard from '../item-card';
import Backbone from 'backdash';
import Header from './header';
import Loading from 'react-loading';
import ProductStore from '../../../stores/product-store';
import ProductActions from '../../../actions/product-actions';

function getColumnState(items=[]) {
  return {
    items,
    isLoading: false
  }
}

var ItemColumn = React.createClass({

  mixins: [Backbone.Events],

  propTypes: {
    status: React.PropTypes.string.isRequired,
    product: React.PropTypes.object.isRequired
  },

  getInitialState: function() {
    return getColumnState();
  },

  _onChange: function() {
    var state = _.cloneDeep(this.state);
    state.items = this.items.toJSON();
    state.isLoading = false;
    this.setState(state);
  },

  getItems: function(product, options={}) {
    if (this.items) {
      if (!options.refresh) {
        return;
      }
      this.stopListening(this.items);
    }
    this.items = ProductStore.getItemsForProduct(product, this.props.status);
    this.items.comparator = function(model) {
      return -new Date(model.get('last_modified'));
    };
    this.listenTo(this.items, 'change sync add remove', this._onChange);
    this.setState({ isLoading: true });
    ProductActions.getItems(this.items);
  },

  componentWillMount: function() {
    this.getItems(this.props.product);
  },

  componentDidMount: function() {
    this.getItems(this.props.product);
  },

  componentWillUnmount: function() {
    this.stopListening(this.items);
  },

  componentWillReceiveProps: function(nextProps) {
    if (nextProps.product.id !== this.props.product.id) {
      this.setState({ isLoading: true });
      this.getItems(nextProps.product, { refresh: true });
    }
  },

  render: function() {
    var classes = {
      column: true,
      [this.props.status]: true
    };

    return (
      <div className={React.addons.classSet(classes)} {...this.props}>
      {this.state.isLoading ?
        <div className="loading"><Loading type="bubbles" color="#ccc"/></div> :
{'fraction_non_alphanumeric': 0.15084493041749503, 'fraction_numerical': 0.0, 'mean_word_length': 3.3419633225458467, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '1998680', 'n_tokens_mistral': 1241, 'n_tokens_neox': 1225, 'n_words': 246}