<commit_before>// Copyright (c) 2015 Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.

import BrowserStore from 'stores/browser_store.jsx';

import {FormattedMessage} from 'react-intl';

import {browserHistory} from 'react-router';

import React from 'react';
import Link from 'react-router';

export default class SignupTeamComplete extends React.Component {
    constructor(props) {
        super(props);

        this.updateParent = this.updateParent.bind(this);
    }
    componentWillMount() {
        const data = JSON.parse(this.props.location.query.d);
        this.hash = this.props.location.query.h;

        var initialState = BrowserStore.getGlobalItem(this.hash);

        if (!initialState) {
            initialState = {};
            initialState.wizard = 'welcome';
            initialState.team = {};
            initialState.team.email = data.email;
            initialState.team.allowed_domains = '';
            initialState.invites = [];
            initialState.invites.push('');
            initialState.invites.push('');
            initialState.invites.push('');
            initialState.user = {};
            initialState.hash = this.hash;
            initialState.data = this.props.location.query.d;
        }

        this.setState(initialState);
    }
    componentDidMount() {
        browserHistory.push('/signup_team_complete/welcome');
    }
    updateParent(state, skipSet) {
        BrowserStore.setGlobalItem(this.hash, state);

        if (!skipSet) {
            this.setState(state);
            browserHistory.push('/signup_team_complete/' + state.wizard);
        }
    }
    render() {
        return (
            <div>
                <div className='signup-header'>
                    <Link to='/'>
                        <span className='fa fa-chevron-left'/>
                        <FormattedMessage id='web.header.back'/>
                    </Link>
                </div>
                <div className='col-sm-12'>
                    <div className='signup-team__container'>
                        <div id='signup-team-complete'>
                            {React.cloneElement(this.props.children, {
                                state: this.state,
                                updateParent: this.updateParent
                            })}
                        </div>
                    </div>
                </div>
            </div>
        );
    }
}

SignupTeamComplete.defaultProps = {
};
SignupTeamComplete.propTypes = {
    location: React.PropTypes.object,
    children: React.PropTypes.node
};
<commit_msg>Fixing Link being imported incorrectly. Fixes team creation.<commit_after>// Copyright (c) 2015 Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.

import BrowserStore from 'stores/browser_store.jsx';

import {FormattedMessage} from 'react-intl';

import {browserHistory} from 'react-router';

import React from 'react';
import {Link} from 'react-router';

export default class SignupTeamComplete extends React.Component {
    constructor(props) {
        super(props);

        this.updateParent = this.updateParent.bind(this);
    }
    componentWillMount() {
        const data = JSON.parse(this.props.location.query.d);
        this.hash = this.props.location.query.h;

        var initialState = BrowserStore.getGlobalItem(this.hash);

        if (!initialState) {
            initialState = {};
            initialState.wizard = 'welcome';
            initialState.team = {};
            initialState.team.email = data.email;
            initialState.team.allowed_domains = '';
            initialState.invites = [];
            initialState.invites.push('');
            initialState.invites.push('');
            initialState.invites.push('');
            initialState.user = {};
            initialState.hash = this.hash;
            initialState.data = this.props.location.query.d;
        }

        this.setState(initialState);
    }
    componentDidMount() {
        browserHistory.push('/signup_team_complete/welcome');
    }
    updateParent(state, skipSet) {
        BrowserStore.setGlobalItem(this.hash, state);

        if (!skipSet) {
            this.setState(state);
            browserHistory.push('/signup_team_complete/' + state.wizard);
        }
    }
    render() {
        return (
            <div>
                <div className='signup-header'>
                    <Link to='/'>
                        <span className='fa fa-chevron-left'/>
                        <FormattedMessage id='web.header.back'/>
                    </Link>
                </div>
                <div className='col-sm-12'>
                    <div className='signup-team__container'>
                        <div id='signup-team-complete'>
                            {React.cloneElement(this.props.children, {
                                state: this.state,
                                updateParent: this.updateParent
                            })}
                        </div>
                    </div>
                </div>
            </div>
        );
    }
}

SignupTeamComplete.defaultProps = {
};
SignupTeamComplete.propTypes = {
    location: React.PropTypes.object,
    children: React.PropTypes.node
};

{'fraction_non_alphanumeric': 0.11655629139072848, 'fraction_numerical': 0.002270577105014191, 'mean_word_length': 1.6859756097560976, 'pattern_counts': {'":': 0, '<': 31, '<?xml version=': 0, '>': 31, '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': '420918', 'n_tokens_mistral': 1420, 'n_tokens_neox': 1362, 'n_words': 243}