<commit_before>let builder = require('focus').component.builder;
let React = require('react');
let type = require('focus').component.types;
let requestStore = require('focus').network.builtInStore();
let assign = require('object-assign');
let ProgressBar = require('../../common/progress-bar').component;
let Icon = require('../../common/icon').component;
let LoadingBarMixin = {
  /** @inheriteddoc */
  getInitialState() {
    return this._getStateFromStore();
  },
  /** @inheriteddoc */
  componentWillMount() {
    requestStore.addUpdateRequestListener(this._handleRequestsUpdate);
    requestStore.addClearRequestsListener(this._handleClearRequests);
  },
  /** @inheriteddoc */
  componentWillUnMount: function cartridgeWillUnMount(){
    requestStore.removeUpdateRequestListener(this._handleRequestsUpdate);
    requestStore.removeClearRequestsListener(this._handleClearRequests);
  },
  _getStateFromStore: function getCartridgeStateFromStore(){
    return requestStore.getRequests();
  },
  _handleRequestsUpdate: function _handlePushMessage(messageId){
    this.setState(this._getStateFromStore());
  },
  _handleClearRequests(){
    this.setState({requests: {}});
  },
  /** @inheriteddoc */
  render: function renderProgressBar() {
    var completed  = +((this.state.total - this.state.pending)/this.state.total)*100;
    var visible = false;
    if(completed < 100){
      visible = true;
    }
    return (
      <div data-focus='loading-bar'>
        {visible && <ProgressBar completed={completed} />}
        <ul className='fa-ul'>
          <li><Icon name='circle-o-notch' other='fa-li fa-spin'/> pending {this.state.pending}</li>
          <li><Icon name='circle-thin' other='fa-li'/> cancelled {this.state.cancelled}</li>
          <li><Icon name='check' other='fa-li'/> success {this.state.success}</li>
          <li><Icon name='ban' other='fa-li'/>error {this.state.error}</li>
          <li><Icon name='plus-square-o' other='fa-li'/>total {this.state.total}</li>
        </ul>
      </div>
    );
  }
};

module.exports = builder(LoadingBarMixin);<commit_msg>[loading-bar] Add comment for completion<commit_after>let builder = require('focus').component.builder;
let React = require('react');
let type = require('focus').component.types;
let requestStore = require('focus').network.builtInStore();
let assign = require('object-assign');
let ProgressBar = require('../../common/progress-bar').component;
let Icon = require('../../common/icon').component;
let LoadingBarMixin = {
  /** @inheriteddoc */
  getInitialState() {
    return this._getStateFromStore();
  },
  /** @inheriteddoc */
  componentWillMount() {
    requestStore.addUpdateRequestListener(this._handleRequestsUpdate);
    requestStore.addClearRequestsListener(this._handleClearRequests);
  },
  /** @inheriteddoc */
  componentWillUnMount: function cartridgeWillUnMount(){
    requestStore.removeUpdateRequestListener(this._handleRequestsUpdate);
    requestStore.removeClearRequestsListener(this._handleClearRequests);
  },
  _getStateFromStore: function getCartridgeStateFromStore(){
    return requestStore.getRequests();
  },
  _handleRequestsUpdate: function _handlePushMessage(messageId){
    this.setState(this._getStateFromStore());
  },
  _handleClearRequests(){
    this.setState({requests: {}});
  },
  /** @inheriteddoc */
  render: function renderProgressBar() {
    var completed  = +((this.state.total - this.state.pending)/this.state.total)*100;
    var visible = false;
    if(completed < 100){
      visible = true;
    }
    //Else empty the loading list?
    return (
      <div data-focus='loading-bar'>
        {visible && <ProgressBar completed={completed} />}
        <ul className='fa-ul'>
          <li><Icon name='circle-o-notch' other='fa-li fa-spin'/> pending {this.state.pending}</li>
          <li><Icon name='circle-thin' other='fa-li'/> cancelled {this.state.cancelled}</li>
          <li><Icon name='check' other='fa-li'/> success {this.state.success}</li>
          <li><Icon name='ban' other='fa-li'/>error {this.state.error}</li>
          <li><Icon name='plus-square-o' other='fa-li'/>total {this.state.total}</li>
        </ul>
      </div>
    );
  }
};

module.exports = builder(LoadingBarMixin);
{'fraction_non_alphanumeric': 0.1641438032166509, 'fraction_numerical': 0.002838221381267739, 'mean_word_length': 3.9929161747343564, 'pattern_counts': {'":': 0, '<': 45, '<?xml version=': 0, '>': 43, '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': '6937451', 'n_tokens_mistral': 1259, 'n_tokens_neox': 1254, 'n_words': 206}