<commit_before>import React, { PropTypes } from 'react';
import { bindActionCreators } from 'redux';
import { connect } from 'react-redux';
import { Link } from 'react-router';
import { fetchNeeds } from '../utils/fetchComponentData';

import * as AppActions from '../actions/appActions.js';

const needs = [
  AppActions.loadUniverseList,
  AppActions.setUniverseId,
  AppActions.setCategoryId
];

class MarketList extends React.Component {

  constructor(params) {
    super(params);
    this.needs = needs;
  }

  componentDidMount() {
    if (!this.props.state.getIn(['app', 'marketId']) || !this.props.state.getIn(['app', 'market'])) {
      fetchNeeds(this.needs, this.props);
    }
  }


  renderMarkets(marketData) {
    if (!this.props.state.getIn(['app', 'universeId'])) {
      return (
        <div className="appLoader">
        ...loading...
        </div>
      );
    } else {
      const universeId = this.props.state.getIn(['app', 'universeId']);
      return(
        <div className="universe-select">
          <div className="text-wrapper">
            <Link to={"/universe/"+marketData.parentId+"/category/"+marketData.parentId}>{marketData.name}</Link>
          </div>
          <div className="caret">
            &gt;
          </div>
        </div>
      )
    }
  }

  render() {
    //{universeList.toJS().market[categoryId].map(this.renderMarkets)}
    const universeList = this.props.state.getIn(['app', 'universeList'])
    const categoryId = this.props.params.categoryId
    // console.log(universeList.toJS());
    return (
      <div>
        {universeList.toJS().market[categoryId].map(this.renderMarkets)}
      </div>
    );
  }

}

MarketList.propTypes = {
  actions: PropTypes.object.isRequired,
  state: PropTypes.object.isRequired
};

MarketList.needs = needs;<commit_msg>segment link repaired<commit_after>import React, { PropTypes } from 'react';
import { bindActionCreators } from 'redux';
import { connect } from 'react-redux';
import { Link } from 'react-router';
import { fetchNeeds } from '../utils/fetchComponentData';

import * as AppActions from '../actions/appActions.js';

const needs = [
  AppActions.loadUniverseList,
  AppActions.setUniverseId,
  AppActions.setCategoryId
];

class MarketList extends React.Component {

  constructor(params) {
    super(params);
    this.needs = needs;
    this.renderMarkets = this.renderMarkets.bind(this);
  }

  componentDidMount() {
    if (!this.props.state.getIn(['app', 'marketId']) || !this.props.state.getIn(['app', 'market'])) {
      fetchNeeds(this.needs, this.props);
    }
  }


  renderMarkets(marketData) {
    if (!this.props.state.getIn(['app', 'universeId'])) {
      return (
        <div className="appLoader">
        ...loading...
        </div>
      );
    } else {
      const universeId = this.props.params.universeId
      return(
        <div className="universe-select">
          <div className="text-wrapper">
            <Link to={"/universe/"+universeId+"/category/"+marketData.parentId+"/market/"+marketData.id}>{marketData.name}</Link>
          </div>
          <div className="caret">
            &gt;
          </div>
        </div>
      )
    }
  }

  render() {
    //{universeList.toJS().market[categoryId].map(this.renderMarkets)}
    const universeList = this.props.state.getIn(['app', 'universeList'])
    const categoryId = this.props.params.categoryId
    // console.log(universeList.toJS());
    return (
      <div>
        {universeList.toJS().market[categoryId].map(this.renderMarkets)}
      </div>
    );
  }

}

MarketList.propTypes = {
  actions: PropTypes.object.isRequired,
  state: PropTypes.object.isRequired
};

MarketList.needs = needs;
{'fraction_non_alphanumeric': 0.16070460704607045, 'fraction_numerical': 0.0, 'mean_word_length': 2.909957627118644, 'pattern_counts': {'":': 0, '<': 27, '<?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': '4782000', 'n_tokens_mistral': 1176, 'n_tokens_neox': 1159, 'n_words': 192}