<commit_before>$(function() {
    function checkRoleInputs() {
        inputs = $('#roles-list .controls').find(':checkbox');
        inputs.attr('required', inputs.filter(':checked').length > 0 ? null : 'required');
    }

    $(document).on('click', '#btn-apigen', function (e) {
        el = $(this);

        $.get(el.attr('href'), function (data) {
            el.prev().text(data);
        })

        return false;
    });

    $(document).on('click', '#roles-list input', function (e) {
        checkRoleInputs();
    });

    $(document).on('click', '#btn-remove-profile', function (e) {
        var el = $(this),
            message = el.attr('data-message'),
            doAction = function() {
                $.ajax({
                    url: Routing.generate('oro_api_delete_profile', { id: el.attr('data-id') }),
                    type: 'DELETE',
                    success: function (data) {
                        OroApp.hashNavigation.prototype.setLocation(Routing.generate('oro_user_index'))
                    }
                });
            };

        if (!_.isUndefined(Backbone.BootstrapModal)) {
            confirm = new Backbone.BootstrapModal({
                title: 'Delete Confirmation',
                content: message
            });
            confirm.on('ok', doAction);
            confirm.open();
        } else if (window.confirm(message)) {
            doAction();
        }

        return false;
    });<commit_msg>BAP-559: Update for user delete button<commit_after>$(function() {
    function checkRoleInputs() {
        inputs = $('#roles-list .controls').find(':checkbox');
        inputs.attr('required', inputs.filter(':checked').length > 0 ? null : 'required');
    }

    $(document).on('click', '#btn-apigen', function (e) {
        el = $(this);

        $.get(el.attr('href'), function (data) {
            el.prev().text(data);
        })

        return false;
    });

    $(document).on('click', '#roles-list input', function (e) {
        checkRoleInputs();
    });

    $(document).on('click', '#btn-remove-profile', function (e) {
        var el = $(this),
            message = el.attr('data-message'),
            doAction = function() {
                $.ajax({
                    url: Routing.generate('oro_api_delete_profile', { id: el.attr('data-id') }),
                    type: 'DELETE',
                    success: function (data) {
                        if (OroApp.hashNavigationEnabled()) {
                            OroApp.Navigation.prototype.setLocation(Routing.generate('oro_user_index'))
                        } else {
                            window.location.href = Routing.generate('oro_user_index');
                        }
                    }
                });
            };

        if (!_.isUndefined(Backbone.BootstrapModal)) {
            confirm = new Backbone.BootstrapModal({
                title: 'Delete Confirmation',
                content: message
            });
            confirm.on('ok', doAction);
            confirm.open();
        } else if (window.confirm(message)) {
            doAction();
        }

        return false;
    });
{'fraction_non_alphanumeric': 0.15807777426493835, 'fraction_numerical': 0.0015807777426493834, 'mean_word_length': 1.6041152263374485, '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': '4126421', 'n_tokens_mistral': 855, 'n_tokens_neox': 824, 'n_words': 150}