<commit_before>import * as React from "react";
import {OrdinaryPanelHeader} from "./PanelHeader";
import {State} from "../../state";
import * as selectors from "../../selectors";
import {connect, Dispatch} from "react-redux";
import {setCurrentConfig} from "../../actions";
import {SelectComponent} from "../common/SelectComponent";

interface IRunSettingsPanelProps {
    dispatch?: Dispatch<State>;
    configurationFiles?: string[];
    currentConfigurationName?: string;
    processName?: string;
}

function mapStateToProps(state: State): IRunSettingsPanelProps {
    return {
        configurationFiles: selectors.getConfigurationNames(state),
        currentConfigurationName: state.control.currentConfigurationName,
        processName: state.control.processName
    }
}

class RunSettingsPanel extends React.Component<IRunSettingsPanelProps, any> {
    componentWillReceiveProps(nextProps) {
        this.setState({
            processName: nextProps.processName
        })
    }

    public state = {
        processName: this.props.processName
    };

    render() {
        let options = [];
        for (let i in this.props.configurationFiles) {
            options.push(<option key={i}>{this.props.configurationFiles[i]}</option>)
        }

        const handleOnChangeConfiguration = (event: React.FormEvent<HTMLSelectElement>) => {
            this.props.dispatch(setCurrentConfig(event.currentTarget.value));
        };

        return (
            <div className="dedop-collapse vertical-third">
                <OrdinaryPanelHeader title="Run Settings" icon="pt-icon-properties"/>
                <div className="dedop-panel-content">
                    <table width='100%'>
                        <tbody>
                        <tr>
                            <td>
                                Configuration
                            </td>
                            <td>
                                <SelectComponent items={this.props.configurationFiles}
                                                 fill={true}
                                                 defaultValue="Select a configuration..."
                                                 selectedItem={this.props.currentConfigurationName}
                                                 onChange={handleOnChangeConfiguration}
                                />
                            </td>
                        </tr>
                        </tbody>
                    </table>
                </div>
            </div>
        )
    }
}

export default connect(mapStateToProps)(RunSettingsPanel);<commit_msg>fix after react update<commit_after>import * as React from "react";
import {OrdinaryPanelHeader} from "./PanelHeader";
import {State} from "../../state";
import * as selectors from "../../selectors";
import {connect, Dispatch} from "react-redux";
import {setCurrentConfig} from "../../actions";
import {SelectComponent} from "../common/SelectComponent";

interface IRunSettingsPanelProps {
    dispatch?: Dispatch<State>;
    configurationFiles?: string[];
    currentConfigurationName?: string;
    processName?: string;
}

function mapStateToProps(state: State): IRunSettingsPanelProps {
    return {
        configurationFiles: selectors.getConfigurationNames(state),
        currentConfigurationName: state.control.currentConfigurationName,
        processName: state.control.processName
    }
}

class RunSettingsPanel extends React.Component<IRunSettingsPanelProps, any> {
    componentWillReceiveProps(nextProps) {
        this.setState({
            processName: nextProps.processName
        })
    }

    public state = {
        processName: this.props.processName
    };

    render() {
        let options = [];
        for (let i in this.props.configurationFiles) {
            options.push(<option key={i}>{this.props.configurationFiles[i]}</option>)
        }

        const handleOnChangeConfiguration = (event: React.FormEvent<HTMLSelectElement>) => {
            this.props.dispatch(setCurrentConfig(event.currentTarget.value));
        };

        return (
            <div className="dedop-collapse vertical-third">
                <OrdinaryPanelHeader title="Run Settings" icon="pt-icon-properties"/>
                <div className="dedop-panel-content">
                    <table style={{width: '100%'}}>
                        <tbody>
                        <tr>
                            <td>
                                Configuration
                            </td>
                            <td>
                                <SelectComponent items={this.props.configurationFiles}
                                                 fill={true}
                                                 defaultValue="Select a configuration..."
                                                 selectedItem={this.props.currentConfigurationName}
                                                 onChange={handleOnChangeConfiguration}
                                />
                            </td>
                        </tr>
                        </tbody>
                    </table>
                </div>
            </div>
        )
    }
}

export default connect(mapStateToProps)(RunSettingsPanel);
{'fraction_non_alphanumeric': 0.10277355623100304, 'fraction_numerical': 0.0011398176291793312, 'mean_word_length': 1.577092511013216, 'pattern_counts': {'":': 0, '<': 45, '<?xml version=': 0, '>': 47, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 16, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '821314', 'n_tokens_mistral': 1177, 'n_tokens_neox': 1149, 'n_words': 233}