<commit_before>OrganizationList = React.createClass({
    mixins: [ReactMeteorData],
    userId: Meteor.userId(),
    getMeteorData() {
        return {
            organizations: Organizations.find().fetch(), users: Meteor.users.find().fetch()
        }
    },
    renderUsersWithNoTeam() {
        let noTeams = [];
        _.each(this.data.users, function(user){
            if(_.isEmpty(user.profile.teams)){
                noTeams.push(user);
            }
        });
        return noTeams.map((user) => {
            return <User key={user._id} user={user} />
        });
    },
    renderOrganizations() {
        return this.data.organizations.map((organization) => {
            return <Organization key={organization._id} organization={organization} />;
        });
    },
    render() {
        return (
            <div>
                {this.renderOrganizations()}
                {this.renderUsersWithNoTeam()}
                <OrganizationForm />
            </div>
        );
    }
});

Organization = React.createClass({
    getInitialState() {
        return { "creatingTeam" : false };
    },
    mixins: [ReactMeteorData],
    getMeteorData() {
        return {
            teams: Teams.find({orgId: this.props.organization._id}).fetch()
        }
    },
    creatingTeam(){
        this.setState({ "creatingTeam" : true })
    },
    toggleTeamForm(state){
        this.setState({ "creatingTeam" : state })
    },
    renderTeams(){
        return this.data.teams.map((team) => {
            return <Team key={team._id} team={team} />;
        });
    },
    render() {
        return (
            <div id="org" className="well well-lg">
                <h1>{this.props.organization.name}</h1><commit_msg>Show organization form only if there are none<commit_after>OrganizationList = React.createClass({
    mixins: [ReactMeteorData],
    userId: Meteor.userId(),
    getMeteorData() {
        return {
            organizations: Organizations.find().fetch(), users: Meteor.users.find().fetch()
        }
    },
    renderUsersWithNoTeam() {
        let noTeams = [];
        _.each(this.data.users, function(user){
            if(_.isEmpty(user.profile.teams)){
                noTeams.push(user);
            }
        });
        return noTeams.map((user) => {
            return <User key={user._id} user={user} />
        });
    },
    renderOrganizations() {
        if (this.data.organizations.length > 0) {
            return this.data.organizations.map((organization) => {
                return <Organization key={organization._id} organization={organization} />;
            });
        } else {
            return <OrganizationForm />
        }
    },
    render() {
        return (
            <div>
                {this.renderOrganizations()}
                {this.renderUsersWithNoTeam()}
            </div>
        );
    }
});

Organization = React.createClass({
    getInitialState() {
        return { "creatingTeam" : false };
    },
    mixins: [ReactMeteorData],
    getMeteorData() {
        return {
            teams: Teams.find({orgId: this.props.organization._id}).fetch()
        }
    },
    creatingTeam(){
        this.setState({ "creatingTeam" : true })
    },
    toggleTeamForm(state){
        this.setState({ "creatingTeam" : state })
    },
    renderTeams(){
        return this.data.teams.map((team) => {
            return <Team key={team._id} team={team} />;
        });
    },
    render() {
        return (
            <div id="org" className="well well-lg">
                <h1>{this.props.organization.name}</h1>
{'fraction_non_alphanumeric': 0.15011160714285715, 'fraction_numerical': 0.0013950892857142857, 'mean_word_length': 1.8250591016548463, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 28, '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': '1644763', 'n_tokens_mistral': 1047, 'n_tokens_neox': 1033, 'n_words': 159}