<commit_before>/*************************************************
 * Copyright (c) 2016 Ansible, Inc.
 *
 * All Rights Reserved
 *************************************************/

export default [
    '$scope',
    '$state',
    '$stateParams',
    '$timeout',
    '$q',
    'configurationAzureForm',
    'configurationGithubForm',
    'configurationGithubOrgForm',
    'configurationGithubTeamForm',
    'configurationGoogleForm',
    'configurationLdapForm',
    'configurationRadiusForm',
    'configurationSamlForm',
    'ConfigurationService',
    'ConfigurationUtils',
    'CreateSelect2',
    'GenerateForm',
    'ParseTypeChange',
    function(
        $scope,
        $state,
        $stateParams,
        $timeout,
        $q,
        configurationAzureForm,
        configurationGithubForm,
        configurationGithubOrgForm,
        configurationGithubTeamForm,
        configurationGoogleForm,
        configurationLdapForm,
        configurationRadiusForm,
        configurationSamlForm,
        ConfigurationService,
        ConfigurationUtils,
        CreateSelect2,
        GenerateForm,
        ParseTypeChange
    ) {
        var authVm = this;

        var generator = GenerateForm;
        var formTracker = $scope.$parent.vm.formTracker;
        var dropdownValue = 'azure';
        var activeAuthForm = 'azure';

        // Default active form
        if ($stateParams.currentTab === '' || $stateParams.currentTab === 'auth') {
            formTracker.setCurrentAuth(activeAuthForm);
        }

        var activeForm = function() {
            if(!$scope.$parent[formTracker.currentFormName()].$dirty) {
                authVm.activeAuthForm = authVm.dropdownValue;
                formTracker.setCurrentAuth(authVm.activeAuthForm);
            } else {
                var msg = 'You have unsaved changes. Would you like to proceed <strong>without</strong> saving?';
                var title = 'Warning: Unsaved Changes';
                var buttons = [{
                    label: "Discard changes",
                    "class": "btn Form-cancelButton",
                    "id": "formmodal-cancel-button",
                    onClick: function() {
                        $scope.$parent.vm.populateFromApi();
                        $scope.$parent[formTracker.currentFormName()].$setPristine();
                        authVm.activeAuthForm = authVm.dropdownValue;
                        formTracker.setCurrentAuth(authVm.activeAuthForm);
                        $('#FormModal-dialog').dialog('close');
                    }
                }, {
                    label: "Save changes",
                    onClick: function() {
                        $scope.$parent.vm.formSave()
                        .then(function() {
                            $scope.$parent[formTracker.currentFormName()].$setPristine();
                            $scope.$parent.vm.populateFromApi();
                            authVm.activeAuthForm = authVm.dropdownValue;
                            formTracker.setCurrentAuth(authVm.activeAuthForm);
                            $('#FormModal-dialog').dialog('close');
                        });
                    },
                    "class": "btn btn-primary",
                    "id": "formmodal-save-button"
                }];
                $scope.$parent.vm.triggerModal(msg, title, buttons);
            }
            formTracker.setCurrentAuth(authVm.activeAuthForm);
        };

        var dropdownOptions = [
            {label: 'Azure', value: 'azure'},
			{label: 'Github', value: 'github'},
            {label: 'Github Org', value: 'github_org'},
            {label: 'Github Team', value: 'github_team'},
            {label: 'Google OAuth2', value: 'google_oauth'},
            {label: 'LDAP', value: 'ldap'},
            {label: 'RADIUS', value: 'radius'},
            {label: 'SAML', value: 'saml'}
        ];<commit_msg>Changed dropdown from Azure to Azure AD in CTinT<commit_after>/*************************************************
 * Copyright (c) 2016 Ansible, Inc.
 *
 * All Rights Reserved
 *************************************************/

export default [
    '$scope',
    '$state',
    '$stateParams',
    '$timeout',
    '$q',
    'configurationAzureForm',
    'configurationGithubForm',
    'configurationGithubOrgForm',
    'configurationGithubTeamForm',
    'configurationGoogleForm',
    'configurationLdapForm',
    'configurationRadiusForm',
    'configurationSamlForm',
    'ConfigurationService',
    'ConfigurationUtils',
    'CreateSelect2',
    'GenerateForm',
    'ParseTypeChange',
    function(
        $scope,
        $state,
        $stateParams,
        $timeout,
        $q,
        configurationAzureForm,
        configurationGithubForm,
        configurationGithubOrgForm,
        configurationGithubTeamForm,
        configurationGoogleForm,
        configurationLdapForm,
        configurationRadiusForm,
        configurationSamlForm,
        ConfigurationService,
        ConfigurationUtils,
        CreateSelect2,
        GenerateForm,
        ParseTypeChange
    ) {
        var authVm = this;

        var generator = GenerateForm;
        var formTracker = $scope.$parent.vm.formTracker;
        var dropdownValue = 'azure';
        var activeAuthForm = 'azure';

        // Default active form
        if ($stateParams.currentTab === '' || $stateParams.currentTab === 'auth') {
            formTracker.setCurrentAuth(activeAuthForm);
        }

        var activeForm = function() {
            if(!$scope.$parent[formTracker.currentFormName()].$dirty) {
                authVm.activeAuthForm = authVm.dropdownValue;
                formTracker.setCurrentAuth(authVm.activeAuthForm);
            } else {
                var msg = 'You have unsaved changes. Would you like to proceed <strong>without</strong> saving?';
                var title = 'Warning: Unsaved Changes';
                var buttons = [{
                    label: "Discard changes",
                    "class": "btn Form-cancelButton",
                    "id": "formmodal-cancel-button",
                    onClick: function() {
                        $scope.$parent.vm.populateFromApi();
                        $scope.$parent[formTracker.currentFormName()].$setPristine();
                        authVm.activeAuthForm = authVm.dropdownValue;
                        formTracker.setCurrentAuth(authVm.activeAuthForm);
                        $('#FormModal-dialog').dialog('close');
                    }
                }, {
                    label: "Save changes",
                    onClick: function() {
                        $scope.$parent.vm.formSave()
                        .then(function() {
                            $scope.$parent[formTracker.currentFormName()].$setPristine();
                            $scope.$parent.vm.populateFromApi();
                            authVm.activeAuthForm = authVm.dropdownValue;
                            formTracker.setCurrentAuth(authVm.activeAuthForm);
                            $('#FormModal-dialog').dialog('close');
                        });
                    },
                    "class": "btn btn-primary",
                    "id": "formmodal-save-button"
                }];
                $scope.$parent.vm.triggerModal(msg, title, buttons);
            }
            formTracker.setCurrentAuth(authVm.activeAuthForm);
        };

        var dropdownOptions = [
            {label: 'Azure AD', value: 'azure'},
			{label: 'Github', value: 'github'},
            {label: 'Github Org', value: 'github_org'},
            {label: 'Github Team', value: 'github_team'},
            {label: 'Google OAuth2', value: 'google_oauth'},
            {label: 'LDAP', value: 'ldap'},
            {label: 'RADIUS', value: 'radius'},
            {label: 'SAML', value: 'saml'}
        ];
{'fraction_non_alphanumeric': 0.13845762280478494, 'fraction_numerical': 0.0017816238228556885, 'mean_word_length': 1.7711565585331452, 'pattern_counts': {'":': 8, '<': 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': '3318135', 'n_tokens_mistral': 1999, 'n_tokens_neox': 1919, 'n_words': 357}