<commit_before>import React from 'react';
import {ListItem} from 'material-ui/List';
import IconButton from 'material-ui/IconButton';
import MoreVertIcon from 'material-ui/svg-icons/navigation/more-vert';
import BoardActions from './actions/BoardActions';
import getMuiTheme from 'material-ui/styles/getMuiTheme';
import LabelIcon from 'material-ui/svg-icons/action/label';
import LabelOutlineIcon from 'material-ui/svg-icons/action/label-outline';
import {grey400} from 'material-ui/styles/colors';

export default class StoryCard extends React.Component {
  constructor(props) {
    super(props);
    this.state={};
  }

  onClickColorIconHandler = (event) => {
    BoardActions.toggleTasksForStoryId(this.props.story_id);
    event.stopPropagation();
  }

  onClickHandler = () => {
    BoardActions.setSelectedStoryId(this.props.story_id);
  }

  onClickIconHandler = (event) => {
    event.stopPropagation();
    BoardActions.openStoryShowDialog(this.props.story_id);
  }


  // This is needed for testing the a component without the whole app context
  static childContextTypes = {
    muiTheme: React.PropTypes.object
  }

  getChildContext() {
    return {
      muiTheme: getMuiTheme()
    };
  }

  render() {
    var leftIcon = <LabelOutlineIcon color={this.props.color} onClick={this.onClickColorIconHandler}/>;
    if (this.props.active) {
      leftIcon = <LabelIcon color={this.props.color} onClick={this.onClickColorIconHandler}/>;
    }
    var rightIcon = (<IconButton tooltip="Show story" onClick={this.onClickIconHandler}>
        <MoreVertIcon color={grey400} />
      </IconButton>);

    return <ListItem
      primaryText={this.props.name}
      onClick={this.onClickHandler}
      leftIcon={leftIcon}
      rightIconButton={rightIcon}
    />;
  }

}<commit_msg>add an add-task-button next to the story<commit_after>import React from 'react';
import {ListItem} from 'material-ui/List';
import IconButton from 'material-ui/IconButton';
import MoreVertIcon from 'material-ui/svg-icons/navigation/more-vert';
import BoardActions from './actions/BoardActions';
import getMuiTheme from 'material-ui/styles/getMuiTheme';
import LabelIcon from 'material-ui/svg-icons/action/label';
import AddIcon from 'material-ui/svg-icons/content/add';
import LabelOutlineIcon from 'material-ui/svg-icons/action/label-outline';
import {grey400} from 'material-ui/styles/colors';

export default class StoryCard extends React.Component {
  constructor(props) {
    super(props);
    this.state={};
  }

  onClickColorIconHandler = (event) => {
    BoardActions.toggleTasksForStoryId(this.props.story_id);
    event.stopPropagation();
  }

  onClickHandler = () => {
    BoardActions.setSelectedStoryId(this.props.story_id);
  }

  onClickIconHandler = (event) => {
    event.stopPropagation();
    BoardActions.openStoryShowDialog(this.props.story_id);
  }

  onClickAddTaskHandler = (event) => {
    event.stopPropagation();
    BoardActions.showTaskDialog();
  }

  // This is needed for testing the a component without the whole app context
  static childContextTypes = {
    muiTheme: React.PropTypes.object
  }

  getChildContext() {
    return {
      muiTheme: getMuiTheme()
    };
  }

  render() {
    var leftIcon = <LabelOutlineIcon color={this.props.color} onClick={this.onClickColorIconHandler}/>;
    if (this.props.active) {
      leftIcon = <LabelIcon color={this.props.color} onClick={this.onClickColorIconHandler}/>;
    }
    var rightIcon = (
      <div>
      <IconButton tooltip="Add task" onClick={this.onClickAddTaskHandler}>
        <AddIcon color={grey400} />
      </IconButton>
      <IconButton tooltip="Show story" onClick={this.onClickIconHandler}>
        <MoreVertIcon color={grey400} />
      </IconButton>
      </div>);

    return <ListItem
      primaryText={this.props.name}
      onClick={this.onClickHandler}
      leftIcon={leftIcon}
      rightIconButton={rightIcon}
    />;
  }

}
{'fraction_non_alphanumeric': 0.12582781456953643, 'fraction_numerical': 0.0038206826286296485, 'mean_word_length': 3.902621722846442, 'pattern_counts': {'":': 0, '<': 20, '<?xml version=': 0, '>': 27, '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': '2333503', 'n_tokens_mistral': 1224, 'n_tokens_neox': 1198, 'n_words': 229}