<commit_before>
var ListItemAdd = React.createClass({
    mixins: [FluxMixin],

    componentDidMount: function () {
        var _this = this;
        var keyups = Rx.Observable.fromEvent(this.refs.titleInput, 'keyup')
            .pluck('target', 'value')
            .filter(function (text) {
                return text.length > 2;
            })
            .debounce(500)
            .distinctUntilChanged()
            .subscribe(function (data) {
                _this.props.onTitleEntered(data);
            });
    },

    isValid() {
        return this.state.title !== '' &&
            this.state.description !== '' &&
            this.state.link !== '';
    },

    getInitialState: function () {
        return {
            title: '',
            description: '',
            link: '',
            image_thumb_url: '/assets/add_placeholder.jpg',
            image_large_url: '',
            hasChanged: false
        };
    },

    descriptionChange: function (text) {
        this.setState({
            hasChanged: true,
            description: text
        });
    },

    linkChange: function (event) {
        this.setState({
            hasChanged: true,
            link: event.target.value
        });
    },

    titleChange: function (event) {
        this.setState({
            hasChanged: true,
            title: event.target.value
        });
    },

    imageUrlChange: function (event) {
        this.setState({
            hasChanged: true,
            image_thumb_url: event.target.value
        });
    },

    handleImagePicked: function (image_thumb_url, image_large_url) {
        this.setState({
            hasChanged: true,
            image_thumb_url: image_thumb_url,
            image_large_url: image_large_url,
        });
    },

    handleAddItemClick: function (event) {
        event.preventDefault();
        if (!this.isValid()) {
            toastr.warning('Please fill out all required fields.');
            return;
        }

        this.getFlux().actions.listItem.add(this.state);
        this.seState({
            title: '',
            description: '',
            link: '',
            image_thumb_url: '',
            image_large_url: '',
            hasChanged: false<commit_msg>Remove link field from validation.<commit_after>
var ListItemAdd = React.createClass({
    mixins: [FluxMixin],

    componentDidMount: function () {
        var _this = this;
        var keyups = Rx.Observable.fromEvent(this.refs.titleInput, 'keyup')
            .pluck('target', 'value')
            .filter(function (text) {
                return text.length > 2;
            })
            .debounce(500)
            .distinctUntilChanged()
            .subscribe(function (data) {
                _this.props.onTitleEntered(data);
            });
    },

    isValid() {
        return this.state.title !== '' &&
            this.state.image_thumb_url !== '' &&
            this.state.description !== '';
    },

    getInitialState: function () {
        return {
            title: '',
            description: '',
            link: '',
            image_thumb_url: '/assets/add_placeholder.jpg',
            image_large_url: '',
            hasChanged: false
        };
    },

    descriptionChange: function (text) {
        this.setState({
            hasChanged: true,
            description: text
        });
    },

    linkChange: function (event) {
        this.setState({
            hasChanged: true,
            link: event.target.value
        });
    },

    titleChange: function (event) {
        this.setState({
            hasChanged: true,
            title: event.target.value
        });
    },

    imageUrlChange: function (event) {
        this.setState({
            hasChanged: true,
            image_thumb_url: event.target.value
        });
    },

    handleImagePicked: function (image_thumb_url, image_large_url) {
        this.setState({
            hasChanged: true,
            image_thumb_url: image_thumb_url,
            image_large_url: image_large_url,
        });
    },

    handleAddItemClick: function (event) {
        event.preventDefault();
        if (!this.isValid()) {
            toastr.warning('Please fill out all required fields.');
            return;
        }

        this.getFlux().actions.listItem.add(this.state);
        this.setState({
            title: '',
            description: '',
            link: '',
            image_thumb_url: '',
            image_large_url: '',
            hasChanged: false
{'fraction_non_alphanumeric': 0.12099093120990931, 'fraction_numerical': 0.0017695200176952002, 'mean_word_length': 1.5461711711711712, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '672733', 'n_tokens_mistral': 1226, 'n_tokens_neox': 1208, 'n_words': 219}