<commit_before>﻿(function (ng, app) {
    app.config(['$stateProvider', function($stateProvider) {
        $stateProvider.state('it-system.usage', {
            url: '/usage/{id:[0-9]+}',
            templateUrl: 'partials/it-system/usage-it-system.html',
            controller: 'system.UsageCtrl',
            resolve: {
                appTypes: [
                    '$http', function($http) {
                        return $http.get('api/apptype')
                            .then(function(result) {
                                return result.data.response;
                            });
                    }
                ],
                businessTypes: [
                    '$http', function($http) {
                        return $http.get('api/businesstype')
                            .then(function(result) {
                                return result.data.response;
                            });
                    }
                ],
                archiveTypes: [
                    '$http', function($http) {
                        return $http.get('api/archivetype')
                            .then(function(result) {
                                return result.data.response;
                            });
                    }
                ],
                sensitiveDataTypes: [
                    '$http', function($http) {
                        return $http.get('api/sensitivedatatype')
                            .then(function(result) {
                                return result.data.response;
                            });
                    }
                ],
                itSystemUsage: [
                    '$http', '$stateParams', function($http, $stateParams) {
                        return $http.get('api/itsystemusage/' + $stateParams.id)
                            .then(function(result) {
                                return result.data.response;
                            });
                    }
                ],
                interfaceAppType: [
                    '$http', function($http) {
                        return $http.get('api/apptype?interfaceAppType').then(function(result) {
                            return result.data.response;
                        });
                    }
                ],
                hasWriteAccess: [
                    '$http', '$stateParams', function($http, $stateParams) {
                        return $http.get('api/itsystemusage/' + $stateParams.id + "?hasWriteAccess")
                            .then(function(result) {
                                return result.data.response;
                            });
                    }
                ]
            }
        });
    }]);

    app.controller('system.UsageCtrl', ['$rootScope', '$scope', '$http', '$stateParams', 'notify', 'itSystemUsage', 'appTypes',
        'businessTypes', 'archiveTypes', 'sensitiveDataTypes', 'interfaceAppType', 'hasWriteAccess', 'autofocus',
        function ($rootScope, $scope, $http, $stateParams, notify, itSystemUsage, appTypes, businessTypes, archiveTypes, sensitiveDataTypes, interfaceAppType, hasWriteAccess, autofocus) {
            $rootScope.page.title = 'IT System - Anvendelse';

            autofocus();

            $scope.hasWriteAccess = hasWriteAccess;
            $scope.interfaceAppType = interfaceAppType;
            $scope.usageId = $stateParams.id;
            $scope.status = [{ id: true, name: 'Aktiv' }, { id: false, name: 'Inaktiv' }];
            $scope.appTypes = appTypes;
            $scope.businessTypes = businessTypes;
            $scope.archiveTypes = archiveTypes;
            $scope.sensitiveDataTypes = sensitiveDataTypes;
            $scope.usage = itSystemUsage;

            if (itSystemUsage.overviewItSystemId) {<commit_msg>Added select2 allowclear option to scope<commit_after>﻿(function (ng, app) {
    app.config(['$stateProvider', function($stateProvider) {
        $stateProvider.state('it-system.usage', {
            url: '/usage/{id:[0-9]+}',
            templateUrl: 'partials/it-system/usage-it-system.html',
            controller: 'system.UsageCtrl',
            resolve: {
                appTypes: [
                    '$http', function($http) {
                        return $http.get('api/apptype')
                            .then(function(result) {
                                return result.data.response;
                            });
                    }
                ],
                businessTypes: [
                    '$http', function($http) {
                        return $http.get('api/businesstype')
                            .then(function(result) {
                                return result.data.response;
                            });
                    }
                ],
                archiveTypes: [
                    '$http', function($http) {
                        return $http.get('api/archivetype')
                            .then(function(result) {
                                return result.data.response;
                            });
                    }
                ],
                sensitiveDataTypes: [
                    '$http', function($http) {
                        return $http.get('api/sensitivedatatype')
                            .then(function(result) {
                                return result.data.response;
                            });
                    }
                ],
                itSystemUsage: [
                    '$http', '$stateParams', function($http, $stateParams) {
                        return $http.get('api/itsystemusage/' + $stateParams.id)
                            .then(function(result) {
                                return result.data.response;
                            });
                    }
                ],
                interfaceAppType: [
                    '$http', function($http) {
                        return $http.get('api/apptype?interfaceAppType').then(function(result) {
                            return result.data.response;
                        });
                    }
                ],
                hasWriteAccess: [
                    '$http', '$stateParams', function($http, $stateParams) {
                        return $http.get('api/itsystemusage/' + $stateParams.id + "?hasWriteAccess")
                            .then(function(result) {
                                return result.data.response;
                            });
                    }
                ]
            }
        });
    }]);

    app.controller('system.UsageCtrl', ['$rootScope', '$scope', '$http', '$stateParams', 'notify', 'itSystemUsage', 'appTypes',
        'businessTypes', 'archiveTypes', 'sensitiveDataTypes', 'interfaceAppType', 'hasWriteAccess', 'autofocus',
        function ($rootScope, $scope, $http, $stateParams, notify, itSystemUsage, appTypes, businessTypes, archiveTypes, sensitiveDataTypes, interfaceAppType, hasWriteAccess, autofocus) {
            $rootScope.page.title = 'IT System - Anvendelse';

            autofocus();

            $scope.hasWriteAccess = hasWriteAccess;
            $scope.interfaceAppType = interfaceAppType;
            $scope.usageId = $stateParams.id;
            $scope.status = [{ id: true, name: 'Aktiv' }, { id: false, name: 'Inaktiv' }];
            $scope.appTypes = appTypes;
            $scope.businessTypes = businessTypes;
            $scope.archiveTypes = archiveTypes;
            $scope.sensitiveDataTypes = sensitiveDataTypes;
            $scope.usage = itSystemUsage;

            $scope.allowClearOption = {
                allowClear: true
            };

            if (itSystemUsage.overviewItSystemId) {
{'fraction_non_alphanumeric': 0.11619809130771215, 'fraction_numerical': 0.0006448284756254836, 'mean_word_length': 1.1505823627287854, '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': '5934354', 'n_tokens_mistral': 1861, 'n_tokens_neox': 1750, 'n_words': 278}