<commit_before>angular.module('ontrack.extension.ldap', [
])
    .config(function ($stateProvider) {
        // Artifactory configurations
        $stateProvider.state('ldap-mapping', {
            url: '/extension/ldap/ldap-mapping',
            templateUrl: 'app/extension/ldap/ldap-mapping.tpl.html',
            controller: 'LDAPMappingCtrl'
        });
    })
    .controller('LDAPMappingCtrl', function ($scope, $http, ot, otFormService, otAlertService) {
        var view = ot.view();
        view.title = 'LDAP Mappings';
        view.description = 'Mapping from LDAP groups to Ontrack groups.';
    })
;<commit_msg>#86 LDAP mapping page - creating a mapping<commit_after>angular.module('ontrack.extension.ldap', [])
    .config(function ($stateProvider) {
        // Artifactory configurations
        $stateProvider.state('ldap-mapping', {
            url: '/extension/ldap/ldap-mapping',
            templateUrl: 'app/extension/ldap/ldap-mapping.tpl.html',
            controller: 'LDAPMappingCtrl'
        });
    })
    .controller('LDAPMappingCtrl', function ($scope, $http, ot, otFormService, otAlertService) {
        var view = ot.view();
        view.title = 'LDAP Mappings';
        view.description = 'Mapping from LDAP groups to Ontrack groups.';

        // Loading the mappings
        function loadMappings() {
            ot.pageCall($http.get('extension/ldap/ldap-mapping')).then(function (mappingResources) {
                $scope.mappingResources = mappingResources;
                // Commands
                view.commands = [
                    {
                        id: 'ldap-mapping-create',
                        name: "Create mapping",
                        cls: 'ot-command-new',
                        action: function () {
                            otFormService.create($scope.mappingResources._create, "Mapping creation").then(loadMappings);
                        }
                    },
                    ot.viewApiCommand(mappingResources._self),
                    ot.viewCloseCommand('/admin-accounts')
                ];
            });
        }

        loadMappings();
    })
;
{'fraction_non_alphanumeric': 0.1245916938870742, 'fraction_numerical': 0.0009332711152589828, 'mean_word_length': 1.8210526315789475, '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': '5552239', 'n_tokens_mistral': 567, 'n_tokens_neox': 550, 'n_words': 98}