<commit_before>'use strict';

import React from "react/addons";
var MapComponent = require('components/Map');
var Modal = require('components/Modal');
var CategoriesAction = require('actions/CategoriesActionCreators');
var GeoObjectsAction = require('actions/GeoObjectActionCreators');
var GeoListTable = require('reactable').Table;
require('styles/GeoDetails.less');

var GeoDetails = React.createClass({

    /**
     * Click handler for new category prompt
     * @param event
     */
    handlePromptNewCategory: function (event) {
        this.refs.addCategoryModalForm.show();
        event.preventDefault();
    },

    /**
     * Add new category form cancel button handler
     * @param event
     */
    onCancelNewCategory: function (event) {
        this.refs.addCategoryModalForm.hide();
        event.preventDefault();
    },

    /**
     * Create new category with raw data
     * @param event
     */
    onAddNewCategoryPrompt: function (event) {
        CategoriesAction.addOneCategory({
            name: this.refs.newCategoryName.getDOMNode().value
        });
        event.preventDefault();
    },

    /**
     * Click handler for new geo object
     * @param event
     */
    showGeoObjectFormObject: function (event) {
        CategoriesAction.addOneCategory({
            name: this.refs.addGeoObjectModalForm.show()
        });
        event.preventDefault();
    },

    /**
     * Create new geo object with raw data
     * @param event
     */
    onAddNewGeoObjectPrompt: function (event) {
        GeoObjectsAction.addOneObject({});
        event.preventDefault();
    },


    /**
     * Add new geo object form cancel button handler
     * @param event
     */
    onCancelNewGeoObject: function (event) {
        this.refs.addGeoObjectModalForm.hide();
        event.preventDefault();
    },

    render: function () {
        return (
            <div className="right_col">
                <div className="tabs">
                    <div className="tab">
                        <input type="radio" id="tab-map" name="tab-group-2" defaultChecked/>
                        <label htmlFor="tab-map">Карта</label>

                        <div className="content">
                            <MapComponent />
                        </div>
                    </div>
                    <div className="tab">
                        <input type="radio" id="tab-list" name="tab-group-2"/>
                        <label htmlFor="tab-list">Список</label>

                        <div className="content">
                            <p className="categoriesListControls">
                                <a onClick={this.handlePromptNewCategory} href="#">Новая категория</a>
                                <a onClick={this.showGeoObjectFormObject} href="#">Новый объект</a>
                            </p>

                            <GeoListTable className="geoTable" data={[

                            ]}/>

                        </div>
                    </div>

                </div>
                <Modal visible={true} closable={true} ref="addCategoryModalForm">
                    <header>
                        <h1>Новая категория</h1>
                    </header>
                    <table border="0" cellspacing="5" cellpadding="5">
                        <form className="modalForm">
                            <tr className="spaceUnder">
                                <td align="right" valign="top">Имя</td>
                                <td><input type="text" name="name" size="25" ref="newCategoryName"/></td>
                            </tr>
                            <tr>
                                <td align="right" colspan="2">
                                    <input type="button" value="Создать категорию" onClick={this.onAddNewCategoryPrompt}/>
                                    <input type="button" value="Отмена" onClick={this.onCancelNewCategory}/>
                                </td>
                            </tr>

                        </form>
                    </table>
                </Modal>
                <Modal visible={true} closable={true} ref="addGeoObjectModalForm">
                    <header>
                        <h1>Новый объект</h1>
                    </header>

                    <form name="newGeoObject">

                        <table border="0" cellspacing="5" cellpadding="5">

                            <tr className="spaceUnder">
                                <td align="right" valign="top">Имя</td>
                                <td><input type="text" name="name" size="25" ref="newGeoObjectName"/></td>
                            </tr>

                            <tr className="spaceUnder">
                                <td align="right" valign="top">Адрес</td>
                                <td><input type="text" name="address" size="25" ref="newGeoObjectAddress"/></td>
                            </tr>

                            <tr className="spaceUnder">
                                <td align="right" valign="top">Широта</td>
                                <td>
                                    <input type="text" name="latitude" size="25" ref="newGeoObjectLatitude"/>
                                </td>
                            </tr>

                            <tr className="spaceUnder">
                                <td align="right" valign="top">Долгота</td>
                                <td>
                                    <input type="text" name="longitude" size="25" ref="newGeoObjectLongitude"/><commit_msg>Commit data to storage via action<commit_after>'use strict';

import React from "react/addons";
var MapComponent = require('components/Map');
var Modal = require('components/Modal');
var CategoriesAction = require('actions/CategoriesActionCreators');
var GeoObjectsAction = require('actions/GeoObjectActionCreators');
var GeoListTable = require('reactable').Table;
require('styles/GeoDetails.less');

var GeoDetails = React.createClass({

    /**
     * Click handler for new category prompt
     * @param event
     */
    handlePromptNewCategory: function (event) {
        this.refs.addCategoryModalForm.show();
        event.preventDefault();
    },

    /**
     * Add new category form cancel button handler
     * @param event
     */
    onCancelNewCategory: function (event) {
        this.refs.addCategoryModalForm.hide();
        event.preventDefault();
    },

    /**
     * Create new category with raw data
     * @param event
     */
    onAddNewCategoryPrompt: function (event) {
        CategoriesAction.addOneCategory({
            name: this.refs.newCategoryName.getDOMNode().value
        });
        event.preventDefault();
    },

    /**
     * Click handler for new geo object
     * @param event
     */
    showGeoObjectFormObject: function (event) {
        CategoriesAction.addOneCategory({
            name: this.refs.addGeoObjectModalForm.show()
        });
        event.preventDefault();
    },

    /**
     * Create new geo object with raw data
     * @param event
     */
    onAddNewGeoObjectPrompt: function (event) {
        GeoObjectsAction.addOneObject({
            name: this.refs.newGeoObjectName.getDOMNode().value,
            addres: this.refs.newGeoObjectAddress.getDOMNode().value,
            latitude: this.refs.newGeoObjectLatitude.getDOMNode().value,
            longitude: this.refs.newGeoObjectLongitude.getDOMNode().value,
            category: this.refs.newGeoObjectCategory.getDOMNode().value
        });
        event.preventDefault();
    },


    /**
     * Add new geo object form cancel button handler
     * @param event
     */
    onCancelNewGeoObject: function (event) {
        this.refs.addGeoObjectModalForm.hide();
        event.preventDefault();
    },

    render: function () {
        return (
            <div className="right_col">
                <div className="tabs">
                    <div className="tab">
                        <input type="radio" id="tab-map" name="tab-group-2" defaultChecked/>
                        <label htmlFor="tab-map">Карта</label>

                        <div className="content">
                            <MapComponent />
                        </div>
                    </div>
                    <div className="tab">
                        <input type="radio" id="tab-list" name="tab-group-2"/>
                        <label htmlFor="tab-list">Список</label>

                        <div className="content">
                            <p className="categoriesListControls">
                                <a onClick={this.handlePromptNewCategory} href="#">Новая категория</a>
                                <a onClick={this.showGeoObjectFormObject} href="#">Новый объект</a>
                            </p>

                            <GeoListTable className="geoTable" data={[

                            ]}/>

                        </div>
                    </div>
                </div>
                <Modal visible={false} closable={true} ref="addCategoryModalForm">
                    <header>
                        <h1>Новая категория</h1>
                    </header>
                    <table border="0" cellspacing="5" cellpadding="5">
                        <form className="modalForm">
                            <tr className="spaceUnder">
                                <td align="right" valign="top">Имя</td>
                                <td><input type="text" name="name" size="25" ref="newCategoryName"/></td>
                            </tr>
                            <tr>
                                <td align="right" colspan="2">
                                    <input type="button" value="Создать категорию" onClick={this.onAddNewCategoryPrompt}/>
                                    <input type="button" value="Отмена" onClick={this.onCancelNewCategory}/>
                                </td>
                            </tr>

                        </form>
                    </table>
                </Modal>
                <Modal visible={false} closable={true} ref="addGeoObjectModalForm">
                    <header>
                        <h1>Новый объект</h1>
                    </header>
                    <form name="newGeoObject">

                        <table border="0" cellspacing="5" cellpadding="5">

                            <tr className="spaceUnder">
                                <td align="right" valign="top">Имя</td>
                                <td><input type="text" name="name" size="25" ref="newGeoObjectName"/></td>
                            </tr>

                            <tr className="spaceUnder">
                                <td align="right" valign="top">Адрес</td>
                                <td><input type="text" name="address" size="25" ref="newGeoObjectAddress"/></td>
                            </tr>

                            <tr className="spaceUnder">
                                <td align="right" valign="top">Широта</td>
                                <td>
                                    <input type="text" name="latitude" size="25" ref="newGeoObjectLatitude"/>
                                </td>
                            </tr>

                            <tr className="spaceUnder">
                                <td align="right" valign="top">Долгота</td>
                                <td>
                                    <input type="text" name="longitude" size="25" ref="newGeoObjectLongitude"/>
{'fraction_non_alphanumeric': 0.11943773715074163, 'fraction_numerical': 0.003966885132804415, 'mean_word_length': 1.3273128637367049, 'pattern_counts': {'":': 0, '<': 165, '<?xml version=': 0, '>': 165, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 24, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '942662', 'n_tokens_mistral': 2999, 'n_tokens_neox': 2824, 'n_words': 538}