<commit_before>var FiltersUI = React.createClass(
{
    filterColumns: [],

    componentWillMount: function()
    {
        this.filterColumns.push(GameColumns[0]);
        this.filterColumns.push(GameColumns[3]);
        this.filterColumns.push(GameColumns[4]);
        this.filterColumns.push(GameColumns[5]);
        this.filterColumns.push(GameColumns[6]);
        this.filterColumns.push(GameColumns[7]);
        this.filterColumns.push(GameColumns[8]);
    },

    getInitialState: function()
    {
        var answer;

        if (localStorage.filters)
        {
            var filters = JSON.parse(localStorage.filters);
            answer = {};

            filters.forEach(function(filter)
            {
                answer[filter.columnKey] = filter;
            });
        }
        else
        {
            answer = this.createDefaults();
        }

        return answer;
    },

    render: function()
    {
        var rows = [];

        this.filterColumns.forEach(function(column)
        {
            rows.push(this.createRow(rows.length, column));
        }, this);

        var filterTable = React.DOM.table(
        {
            className: "filterTable",
        }, rows);

        var rows2 = [];
        rows2.push(React.DOM.tr(
        {
            key: 0,
        }, React.DOM.td(
        {
            colSpan: 2,
        }, filterTable)));

        // var restoreButton = React.DOM.button(
        // {
        // onClick: this.restoreActionPerformed,
        // }, "Restore Defaults");
        var unfilterButton = React.DOM.button(
        {
            onClick: this.unfilterActionPerformed,
        }, "Remove Filter");
        var filterButton = React.DOM.button(
        {
            onClick: this.filterActionPerformed,
        }, "Apply Filter");
        rows2.push(React.DOM.tr(
        {
            key: 1,
        }, // React.DOM.td({}, restoreButton),
        React.DOM.td({}, unfilterButton), React.DOM.td({}, filterButton)));

        return React.DOM.table(
        {
            className: "filtersUI",
        }, rows2);
    },

    createCell: function(key, column, value)
    {
        return React.DOM.td(
        {
            key: key,
            className: column.className,
            column: column.key,
        }, value);
    },

    createDefaults: function()
    {
        return (
        {
            boardGameRank: GameDatabase.newFilter("boardGameRank", false, 1, false, 20),
            yearPublished: GameDatabase.newFilter("yearPublished", false, 2000, false, 2015),
            geekRating: GameDatabase.newFilter("geekRating", true, 7.2, false, 10),
            minPlayers: GameDatabase.newFilter("minPlayers", true, 2, true, 3),
            maxPlayers: GameDatabase.newFilter("maxPlayers", true, 4, false, 6),
            minPlayTime: GameDatabase.newFilter("minPlayTime", true, 30, false, 120),
            maxPlayTime: GameDatabase.newFilter("maxPlayTime", false, 30, true, 120),
        });
    },

    createFilter: function(columnKey)
    {<commit_msg>Updated the default filter settings.<commit_after>var FiltersUI = React.createClass(
{
    filterColumns: [],

    componentWillMount: function()
    {
        this.filterColumns.push(GameColumns[0]);
        this.filterColumns.push(GameColumns[3]);
        this.filterColumns.push(GameColumns[4]);
        this.filterColumns.push(GameColumns[5]);
        this.filterColumns.push(GameColumns[6]);
        this.filterColumns.push(GameColumns[7]);
        this.filterColumns.push(GameColumns[8]);
    },

    getInitialState: function()
    {
        var answer;

        if (localStorage.filters)
        {
            var filters = JSON.parse(localStorage.filters);
            answer = {};

            filters.forEach(function(filter)
            {
                answer[filter.columnKey] = filter;
            });
        }
        else
        {
            answer = this.createDefaults();
        }

        return answer;
    },

    render: function()
    {
        var rows = [];

        this.filterColumns.forEach(function(column)
        {
            rows.push(this.createRow(rows.length, column));
        }, this);

        var filterTable = React.DOM.table(
        {
            className: "filterTable",
        }, rows);

        var rows2 = [];
        rows2.push(React.DOM.tr(
        {
            key: 0,
        }, React.DOM.td(
        {
            colSpan: 2,
        }, filterTable)));

        // var restoreButton = React.DOM.button(
        // {
        // onClick: this.restoreActionPerformed,
        // }, "Restore Defaults");
        var unfilterButton = React.DOM.button(
        {
            onClick: this.unfilterActionPerformed,
        }, "Remove Filter");
        var filterButton = React.DOM.button(
        {
            onClick: this.filterActionPerformed,
        }, "Apply Filter");
        rows2.push(React.DOM.tr(
        {
            key: 1,
        }, // React.DOM.td({}, restoreButton),
        React.DOM.td({}, unfilterButton), React.DOM.td({}, filterButton)));

        return React.DOM.table(
        {
            className: "filtersUI",
        }, rows2);
    },

    createCell: function(key, column, value)
    {
        return React.DOM.td(
        {
            key: key,
            className: column.className,
            column: column.key,
        }, value);
    },

    createDefaults: function()
    {
        return (
        {
            boardGameRank: GameDatabase.newFilter("boardGameRank", false, 1, false, 20),
            yearPublished: GameDatabase.newFilter("yearPublished", false, 2005, false, 2015),
            geekRating: GameDatabase.newFilter("geekRating", false, 7.2, false, 10),
            minPlayers: GameDatabase.newFilter("minPlayers", true, 2, true, 3),
            maxPlayers: GameDatabase.newFilter("maxPlayers", true, 4, false, 6),
            minPlayTime: GameDatabase.newFilter("minPlayTime", true, 30, false, 120),
            maxPlayTime: GameDatabase.newFilter("maxPlayTime", false, 30, true, 120),
        });
    },

    createFilter: function(columnKey)
    {
{'fraction_non_alphanumeric': 0.12934426229508197, 'fraction_numerical': 0.014098360655737704, 'mean_word_length': 1.8115207373271889, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '515947', 'n_tokens_mistral': 1777, 'n_tokens_neox': 1674, 'n_words': 302}