<commit_before>/* jslint node: true, esnext: true */

var React = require('react'), {Input, Button, Panel, Row} = require('react-bootstrap'), _ = require('lodash');

var Submitter = require('./Submitter.jsx'), Destination = require('./Destination.jsx'), Options = require('./Options.jsx'), Trace = require('./Trace.jsx');

var defaultOptions = {
  submitter: '',
  postal_code: '',
  dest: '',
  trset: '',
  queries: 4,
  timeout: 750,
  maxhops: 24,
  raw_protocol: 'ICMP',
  include_platform_traceroute: false,
  platform_protocol: 'Default',
  platform_limit_ms: 60000
};

module.exports = React.createClass({
  render: function() {
    let {trsets, messages, caller} = this.props, step;

    switch(this.state.step) {
      case 'Destination':
        step = <Destination options={this.state.options} caller={this} trsets={trsets} />;
        break;
      case 'Options':
        step = <Options options={this.state.options} defaultOptions={defaultOptions} caller={this} />;
        break;
      case 'Trace':
        step = <Trace currentStatus={this.props.currentStatus} messages={messages} caller={this} cancelTrace={caller.cancelTrace} toggleDebug={caller.toggleDebug} />;
        break;
      default:
        step = <Submitter options={this.state.options} caller={this} />;
    }

    return (
      <div className="container">
       <Row className="col-md-12">
        <form className='form-horizontal'>
          {step}
        </form>
      </Row>
    </div>
    );
  },
  stepCall: function(to, opts) {
    if (opts) {
      this.state.options = _.assign(this.state.options, opts);
    }
    this.setState({step: to});
    if (to === 'Trace') {<commit_msg>only copy option properties fixes #18<commit_after>/* jslint node: true, esnext: true */

var React = require('react'), {Input, Button, Panel, Row} = require('react-bootstrap'), _ = require('lodash');

var Submitter = require('./Submitter.jsx'), Destination = require('./Destination.jsx'), Options = require('./Options.jsx'), Trace = require('./Trace.jsx');

var defaultOptions = {
  submitter: '',
  postal_code: '',
  dest: '',
  trset: '',
  queries: 4,
  timeout: 750,
  maxhops: 24,
  raw_protocol: 'ICMP',
  include_platform_traceroute: false,
  platform_protocol: 'Default',
  platform_limit_ms: 60000
};

module.exports = React.createClass({
  render: function() {
    let {trsets, messages, caller} = this.props, step;

    switch(this.state.step) {
      case 'Destination':
        step = <Destination options={this.state.options} caller={this} trsets={trsets} />;
        break;
      case 'Options':
        step = <Options options={this.state.options} defaultOptions={defaultOptions} caller={this} />;
        break;
      case 'Trace':
        step = <Trace currentStatus={this.props.currentStatus} messages={messages} caller={this} cancelTrace={caller.cancelTrace} toggleDebug={caller.toggleDebug} />;
        break;
      default:
        step = <Submitter options={this.state.options} caller={this} />;
    }

    return (
      <div className="container">
       <Row className="col-md-12">
        <form className='form-horizontal'>
          {step}
        </form>
      </Row>
    </div>
    );
  },
  stepCall: function(to, opts) {
    if (opts) {
      Object.keys(this.state.options).forEach(i => {if (opts[i]) this.state.options[i] = opts[i];});
    }
    this.setState({step: to});
    if (to === 'Trace') {
{'fraction_non_alphanumeric': 0.16911332941867294, 'fraction_numerical': 0.008220786846741044, 'mean_word_length': 3.227047146401985, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 24, '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': '4496328', 'n_tokens_mistral': 1081, 'n_tokens_neox': 1056, 'n_words': 227}