<commit_before>export default ['templateUrl', function(templateUrl) {
    return {
        restrict: 'E',
        scope: {
            hostFilter: '='
        },
        templateUrl: templateUrl('inventories-hosts/inventories/smart-inventory/smart-inventory-host-filter/host-filter-modal/host-filter-modal'),
        link: function(scope, element) {

            $('#host-filter-modal').on('hidden.bs.modal', function () {
                $('#host-filter-modal').off('hidden.bs.modal');
                $(element).remove();
            });

            scope.showModal = function() {
                $('#host-filter-modal').modal('show');
            };

            scope.destroyModal = function() {
                $('#host-filter-modal').modal('hide');
            };

        },
        controller: ['$scope', 'QuerySet', 'GetBasePath', 'HostsList', '$compile', 'generateList', function($scope, qs, GetBasePath, HostsList, $compile, GenerateList) {

            function init() {

                $scope.host_default_params = {
                    order_by: 'name',
                    page_size: 5
                };

                $scope.host_queryset = _.merge({
                    order_by: 'name',
                    page_size: 5
                }, $scope.hostFilter ? $scope.hostFilter : {});

                // Fire off the initial search
                qs.search(GetBasePath('hosts'), $scope.host_queryset)
                    .then(res => {
                        $scope.host_dataset = res.data;
                        $scope.hosts = $scope.host_dataset.results;

                        let hostList = _.cloneDeep(HostsList);
                        delete hostList.fields.toggleHost;
                        delete hostList.fields.active_failures;
                        delete hostList.fields.inventory;
                        delete hostList.fields.name.ngClick;
                        hostList.fields.name.class += " HostFilterModal-tableRow";
                        hostList.fields.name.noLink = true;
                        hostList.well = false;
                        let html = GenerateList.build({
                            list: hostList,
                            input_type: 'host-filter-modal-body'
                        });

                        $scope.list = hostList;

                        $('#host-filter-modal-body').append($compile(html)($scope));

                        $scope.showModal();
                    });
            }

            init();

            $scope.cancelForm = function() {
                $scope.destroyModal();
            };

            $scope.saveForm = function() {
                // Strip defaults out of the state params copy
                angular.forEach(Object.keys($scope.host_default_params), function(value) {
                    delete $scope.host_queryset[value];
                });

                $scope.hostFilter = angular.copy($scope.host_queryset);

                $scope.destroyModal();
            };

        }]
    };
}];<commit_msg>Hide view per page on smart inventory modal<commit_after>export default ['templateUrl', function(templateUrl) {
    return {
        restrict: 'E',
        scope: {
            hostFilter: '='
        },
        templateUrl: templateUrl('inventories-hosts/inventories/smart-inventory/smart-inventory-host-filter/host-filter-modal/host-filter-modal'),
        link: function(scope, element) {

            $('#host-filter-modal').on('hidden.bs.modal', function () {
                $('#host-filter-modal').off('hidden.bs.modal');
                $(element).remove();
            });

            scope.showModal = function() {
                $('#host-filter-modal').modal('show');
            };

            scope.destroyModal = function() {
                $('#host-filter-modal').modal('hide');
            };

        },
        controller: ['$scope', 'QuerySet', 'GetBasePath', 'HostsList', '$compile', 'generateList', function($scope, qs, GetBasePath, HostsList, $compile, GenerateList) {

            function init() {

                $scope.host_default_params = {
                    order_by: 'name',
                    page_size: 5
                };

                $scope.host_queryset = _.merge({
                    order_by: 'name',
                    page_size: 5
                }, $scope.hostFilter ? $scope.hostFilter : {});

                // Fire off the initial search
                qs.search(GetBasePath('hosts'), $scope.host_queryset)
                    .then(res => {
                        $scope.host_dataset = res.data;
                        $scope.hosts = $scope.host_dataset.results;

                        let hostList = _.cloneDeep(HostsList);
                        delete hostList.fields.toggleHost;
                        delete hostList.fields.active_failures;
                        delete hostList.fields.inventory;
                        delete hostList.fields.name.ngClick;
                        hostList.fields.name.class += " HostFilterModal-tableRow";
                        hostList.fields.name.noLink = true;
                        hostList.well = false;
                        let html = GenerateList.build({
                            list: hostList,
                            input_type: 'host-filter-modal-body',
                            hideViewPerPage: true
                        });

                        $scope.list = hostList;

                        $('#host-filter-modal-body').append($compile(html)($scope));

                        $scope.showModal();
                    });
            }

            init();

            $scope.cancelForm = function() {
                $scope.destroyModal();
            };

            $scope.saveForm = function() {
                // Strip defaults out of the state params copy
                angular.forEach(Object.keys($scope.host_default_params), function(value) {
                    delete $scope.host_queryset[value];
                });

                $scope.hostFilter = angular.copy($scope.host_queryset);

                $scope.destroyModal();
            };

        }]
    };
}];
{'fraction_non_alphanumeric': 0.12400841832604824, 'fraction_numerical': 0.0006475635421725757, 'mean_word_length': 1.2983630952380953, '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': '3147539', 'n_tokens_mistral': 1571, 'n_tokens_neox': 1454, 'n_words': 235}