<commit_before>import Webiny from 'Webiny';
const Ui = Webiny.Ui.Components;

class MultiAction extends Webiny.Ui.Component {
    constructor(props) {
        super(props);

        this.bindMethods('onAction');
    }

    onAction() {
        if (!this.props.data.size) {
            return;
        }

        this.props.onAction(this.props.data, this.props.actions);
    }
}

MultiAction.defaultProps = {
    onAction: _.noop,
    renderer() {
        return (
            <Ui.Link onClick={this.onAction}>{this.props.label}</Ui.Link>
        );
    }
};

export default MultiAction;<commit_msg>MultiAction can now be executed even with an empty resultset, using "allowEmpty" prop.<commit_after>import Webiny from 'Webiny';
const Ui = Webiny.Ui.Components;

class MultiAction extends Webiny.Ui.Component {
    constructor(props) {
        super(props);

        this.bindMethods('onAction');
    }

    onAction() {
        if (!this.props.data.size && !this.props.allowEmpty) {
            return;
        }

        this.props.onAction(this.props.data, this.props.actions);
    }
}

MultiAction.defaultProps = {
    allowEmpty: false,
    onAction: _.noop,
    renderer() {
        return (
            <Ui.Link onClick={this.onAction}>{this.props.label}</Ui.Link>
        );
    }
};

export default MultiAction;
{'fraction_non_alphanumeric': 0.13125948406676782, 'fraction_numerical': 0.0, 'mean_word_length': 2.417098445595855, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '7149373', 'n_tokens_mistral': 412, 'n_tokens_neox': 410, 'n_words': 74}