<commit_before>import React,{Component} from 'react';
import {connect} from 'react-redux';
import {bindActionCreators} from 'redux';
import {folderItemAdd} from "../actions/index";

class FormNewFolderItem extends Component {

    constructor(props){
        super(props);
        this.state = {};
        this.formSubmit = this.formSubmit.bind(this);
    }

    formSubmit(e){
        const modal = document.querySelector(".component-modal");
        const form = modal.querySelector("form");
        const folder = form["folder"].value;
        const name = form["name"].value;
        const description = form["description"].value;
        this.props.folderItemAdd(folder,{
            name:name,
            description: description,
            type:"GET"
        });
        this.props.onComplete();
        e.preventDefault();
    }

    renderFolderOption(data,index){
        console.log(data.name,data.id);
        console.log(index == 0);
        return (
            <option value={data.id} key={data.name + "-" + data.id}>{data.name}</option>
        );
    }

    render() {
        return (
            <form name="newFolderItemForm" onSubmit={this.formSubmit}>
                <fieldset>
                    <label>Select folder</label>
                    <div className="select">
                        <select name="folder" className="action">
                            {this.props.folders.map(this.renderFolderOption)}
                        </select>
                    </div>
                </fieldset>
                <fieldset>
                    <label>Enter the item name</label>
                    <input type="text" name="name" />
                </fieldset>
                <fieldset>
                    <label>Enter the item description</label>
                    <input type="text" name="description" />
                </fieldset>
                <button hidden type="submit">SALVAR</button>
            </form>
        );
    }
}

function mapStateToProps({folders}){
    return {folders};
}

function mapDispatchToProps(dispatch){
    return bindActionCreators({folderItemAdd},dispatch);
}

export default connect (mapStateToProps,mapDispatchToProps)(FormNewFolderItem);
<commit_msg>save url and type parameters<commit_after>import React,{Component} from 'react';
import {connect} from 'react-redux';
import {bindActionCreators} from 'redux';
import {folderItemAdd} from "../actions/index";

class FormNewFolderItem extends Component {

    constructor(props){
        super(props);
        this.state = {};
        this.formSubmit = this.formSubmit.bind(this);
    }

    formSubmit(e){
        const editor = $(".component-editors .editor:visible");
        const modal = document.querySelector(".component-modal");
        const form = modal.querySelector("form");
        const folder = form["folder"].value;
        const name = form["name"].value;
        const description = form["description"].value;
        const type = editor.find("select.action").val();
        const url = editor.find(".input-url").val();
        this.props.folderItemAdd(folder,{
            name:name,
            description: description,
            type:type,
            url:url
        });
        this.props.onComplete();
        e.preventDefault();
    }

    renderFolderOption(data,index){
        console.log(data.name,data.id);
        console.log(index == 0);
        return (
            <option value={data.id} key={data.name + "-" + data.id}>{data.name}</option>
        );
    }

    render() {
        return (
            <form name="newFolderItemForm" onSubmit={this.formSubmit}>
                <fieldset>
                    <label>Select folder</label>
                    <div className="select">
                        <select name="folder" className="action">
                            {this.props.folders.map(this.renderFolderOption)}
                        </select>
                    </div>
                </fieldset>
                <fieldset>
                    <label>Enter the item name</label>
                    <input type="text" name="name"/>
                </fieldset>
                <fieldset>
                    <label>Enter the item description</label>
                    <input type="text" name="description" />
                </fieldset>
                <button hidden type="submit">SALVAR</button>
            </form>
        );
    }
}

function mapStateToProps({folders}){
    return {folders};
}

function mapDispatchToProps(dispatch){
    return bindActionCreators({folderItemAdd},dispatch);
}

export default connect (mapStateToProps,mapDispatchToProps)(FormNewFolderItem);

{'fraction_non_alphanumeric': 0.12955812955812956, 'fraction_numerical': 0.000429000429000429, 'mean_word_length': 1.885519801980198, 'pattern_counts': {'":': 0, '<': 51, '<?xml version=': 0, '>': 51, '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': '367940', 'n_tokens_mistral': 1225, 'n_tokens_neox': 1184, 'n_words': 231}