<commit_before>/**
 * Created by YouHan on 2016/11/1.
 */
import React, {PropTypes} from "react";
import {Button, Input, Table, InputNumber} from "antd";
import BlankRow from "./../../common/blankRow";
import {StoryStatus, ReleaseSelect} from "./../../common/constSelect";
import CommonSelect from "./../../common/commonSelect";


export default class StoryResult extends BlankRow {
  constructor(props) {
    super(props);
    
    this.singleSave = this.singleSave.bind(this);
    this.singleRemove = this.singleRemove.bind(this);
    this.updateChange = this.updateChange.bind(this);
    
    this.rowClick = this.rowClick.bind(this);
    this.rowChange = this.rowChange.bind(this);
    this.rowBlur = this.rowBlur.bind(this);
  }
  
  componentWillReceiveProps(nextProps) {
    this.data = nextProps.data || [];
    this.oriData = JSON.parse(JSON.stringify(nextProps.data || []));
  }
  
  singleSave(data) {
    this.props.save(data);
  }
  
  singleRemove(data) {
    if (data) {
      this.props.remove(data.id);
    }
  }
  
  updateChange(list) {
    this.props.dataUpdate(list);
  }
  
  
  render() {
    const columns = [{<commit_msg>fix story list blank row error<commit_after>/**
 * Created by YouHan on 2016/11/1.
 */
import React, {PropTypes} from "react";
import {Button, Input, Table, InputNumber} from "antd";
import BlankRow from "./../../common/blankRow";
import {StoryStatus, ReleaseSelect} from "./../../common/constSelect";
import CommonSelect from "./../../common/commonSelect";


export default class StoryResult extends BlankRow {
  constructor(props) {
    super(props);
    
    this.singleSave = this.singleSave.bind(this);
    this.singleRemove = this.singleRemove.bind(this);
    this.updateChange = this.updateChange.bind(this);
    
    this.rowClick = this.rowClick.bind(this);
    this.rowChange = this.rowChange.bind(this);
    this.rowBlur = this.rowBlur.bind(this);
    
    this.updateOriData = this.updateOriData.bind(this);
  }
  
  componentWillReceiveProps(nextProps) {
    this.data = nextProps.data || [];
    if (!this.oriData || this.oriData.length === 0) {
      this.updateOriData();
    }
  }
  
  updateOriData() {
    this.oriData = JSON.parse(JSON.stringify(this.data || []));
  }
  
  singleSave(data) {
    this.props.save(data);
    this.updateOriData();
  }
  
  singleRemove(data) {
    if (data) {
      this.props.remove(data.id);
      this.updateOriData();
    }
  }
  
  updateChange(list) {
    this.props.dataUpdate(list);
  }
  
  
  render() {
    const columns = [{
{'fraction_non_alphanumeric': 0.15548539857932123, 'fraction_numerical': 0.005919494869771113, 'mean_word_length': 3.07556270096463, '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': '7053007', 'n_tokens_mistral': 852, 'n_tokens_neox': 828, 'n_words': 149}