mirror of
https://github.com/ansible/awx.git
synced 2026-01-23 23:41:23 -03:30
Merge pull request #4172 from kensible/4151-azure-ctint
Added Azure form to authentication section
This commit is contained in:
commit
1d9c52572d
@ -10,6 +10,7 @@ export default [
|
||||
'$stateParams',
|
||||
'$timeout',
|
||||
'$q',
|
||||
'configurationAzureForm',
|
||||
'configurationGithubForm',
|
||||
'configurationGithubOrgForm',
|
||||
'configurationGithubTeamForm',
|
||||
@ -28,6 +29,7 @@ export default [
|
||||
$stateParams,
|
||||
$timeout,
|
||||
$q,
|
||||
configurationAzureForm,
|
||||
configurationGithubForm,
|
||||
configurationGithubOrgForm,
|
||||
configurationGithubTeamForm,
|
||||
@ -45,8 +47,8 @@ export default [
|
||||
|
||||
var generator = GenerateForm;
|
||||
var formTracker = $scope.$parent.vm.formTracker;
|
||||
var dropdownValue = 'github';
|
||||
var activeAuthForm = 'github';
|
||||
var dropdownValue = 'azure';
|
||||
var activeAuthForm = 'azure';
|
||||
|
||||
// Default active form
|
||||
if ($stateParams.currentTab === '' || $stateParams.currentTab === 'auth') {
|
||||
@ -92,9 +94,10 @@ export default [
|
||||
};
|
||||
|
||||
var dropdownOptions = [
|
||||
{label: 'GitHub', value: 'github'},
|
||||
{label: 'GitHub Org', value: 'github_org'},
|
||||
{label: 'GitHub Team', value: 'github_team'},
|
||||
{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'},
|
||||
@ -107,27 +110,30 @@ export default [
|
||||
});
|
||||
|
||||
var authForms = [{
|
||||
formDef: configurationGithubForm,
|
||||
id: 'auth-github-form'
|
||||
}, {
|
||||
formDef: configurationGithubOrgForm,
|
||||
id: 'auth-github-org-form'
|
||||
}, {
|
||||
formDef: configurationGithubTeamForm,
|
||||
id: 'auth-github-team-form'
|
||||
}, {
|
||||
formDef: configurationGoogleForm,
|
||||
id: 'auth-google-form'
|
||||
}, {
|
||||
formDef: configurationLdapForm,
|
||||
id: 'auth-ldap-form'
|
||||
}, {
|
||||
formDef: configurationRadiusForm,
|
||||
id: 'auth-radius-form'
|
||||
}, {
|
||||
formDef: configurationSamlForm,
|
||||
id: 'auth-saml-form'
|
||||
}, ];
|
||||
formDef: configurationAzureForm,
|
||||
id: 'auth-azure-form'
|
||||
}, {
|
||||
formDef: configurationGithubForm,
|
||||
id: 'auth-github-form'
|
||||
}, {
|
||||
formDef: configurationGithubOrgForm,
|
||||
id: 'auth-github-org-form'
|
||||
}, {
|
||||
formDef: configurationGithubTeamForm,
|
||||
id: 'auth-github-team-form'
|
||||
}, {
|
||||
formDef: configurationGoogleForm,
|
||||
id: 'auth-google-form'
|
||||
}, {
|
||||
formDef: configurationLdapForm,
|
||||
id: 'auth-ldap-form'
|
||||
}, {
|
||||
formDef: configurationRadiusForm,
|
||||
id: 'auth-radius-form'
|
||||
}, {
|
||||
formDef: configurationSamlForm,
|
||||
id: 'auth-saml-form'
|
||||
}, ];
|
||||
|
||||
var forms = _.pluck(authForms, 'formDef');
|
||||
|
||||
|
||||
@ -12,6 +12,11 @@
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<div ng-show="authVm.activeAuthForm === 'azure'">
|
||||
<div id="auth-azure-form">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div ng-show="authVm.activeAuthForm === 'github'">
|
||||
<div id="auth-github-form">
|
||||
|
||||
|
||||
@ -0,0 +1,53 @@
|
||||
/*************************************************
|
||||
* Copyright (c) 2016 Ansible, Inc.
|
||||
*
|
||||
* All Rights Reserved
|
||||
*************************************************/
|
||||
|
||||
export default function() {
|
||||
return {
|
||||
name: 'configuration_azure_template',
|
||||
showActions: true,
|
||||
showHeader: false,
|
||||
|
||||
fields: {
|
||||
SOCIAL_AUTH_AZUREAD_OAUTH2_KEY: {
|
||||
type: 'text',
|
||||
reset: 'SOCIAL_AUTH_AZUREAD_OAUTH2_KEY'
|
||||
},
|
||||
SOCIAL_AUTH_AZUREAD_OAUTH2_SECRET: {
|
||||
type: 'text',
|
||||
reset: 'SOCIAL_AUTH_AZUREAD_OAUTH2_SECRET'
|
||||
},
|
||||
SOCIAL_AUTH_AZUREAD_OAUTH2_ORGANIZATION_MAP: {
|
||||
type: 'textarea',
|
||||
reset: 'SOCIAL_AUTH_AZUREAD_OAUTH2_ORGANIZATION_MAP',
|
||||
rows: 6,
|
||||
codeMirror: true,
|
||||
class: 'Form-textAreaLabel Form-formGroup--fullWidth'
|
||||
},
|
||||
SOCIAL_AUTH_AZUREAD_OAUTH2_TEAM_MAP: {
|
||||
type: 'textarea',
|
||||
reset: 'SOCIAL_AUTH_AZUREAD_OAUTH2_TEAM_MAP',
|
||||
rows: 6,
|
||||
codeMirror: true,
|
||||
class: 'Form-textAreaLabel Form-formGroup--fullWidth'
|
||||
}
|
||||
},
|
||||
|
||||
buttons: {
|
||||
reset: {
|
||||
ngClick: 'vm.resetAllConfirm()',
|
||||
label: 'Reset All',
|
||||
class: 'Form-button--left Form-cancelButton'
|
||||
},
|
||||
cancel: {
|
||||
ngClick: 'vm.formCancel()',
|
||||
},
|
||||
save: {
|
||||
ngClick: 'vm.formSave()',
|
||||
ngDisabled: true
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
@ -9,6 +9,7 @@ export default [
|
||||
'ConfigurationService', 'ConfigurationUtils', 'CreateDialog', 'CreateSelect2', 'ParseTypeChange', 'ProcessErrors',
|
||||
'Wait', 'configDataResolve',
|
||||
//Form definitions
|
||||
'configurationAzureForm',
|
||||
'configurationGithubForm',
|
||||
'configurationGithubOrgForm',
|
||||
'configurationGithubTeamForm',
|
||||
@ -24,6 +25,7 @@ export default [
|
||||
ConfigurationService, ConfigurationUtils, CreateDialog, CreateSelect2, ParseTypeChange, ProcessErrors,
|
||||
Wait, configDataResolve,
|
||||
//Form definitions
|
||||
configurationAzureForm,
|
||||
configurationGithubForm,
|
||||
configurationGithubOrgForm,
|
||||
configurationGithubTeamForm,
|
||||
@ -38,6 +40,7 @@ export default [
|
||||
var vm = this;
|
||||
|
||||
var formDefs = {
|
||||
'azure': configurationAzureForm,
|
||||
'github': configurationGithubForm,
|
||||
'github_org': configurationGithubOrgForm,
|
||||
'github_team': configurationGithubTeamForm,
|
||||
@ -180,9 +183,9 @@ export default [
|
||||
|
||||
function active(setForm) {
|
||||
if (setForm === 'auth') {
|
||||
// Default to 'github' on first load
|
||||
// Default to 'azure' on first load
|
||||
if (formTracker.currentAuth === '') {
|
||||
formTracker.setCurrentAuth('github');
|
||||
formTracker.setCurrentAuth('azure');
|
||||
} else {
|
||||
// If returning to auth tab reset current form to previously viewed
|
||||
formTracker.setCurrentAuth(formTracker.currentAuth);
|
||||
|
||||
@ -11,6 +11,7 @@ import configurationController from './configuration.controller.js';
|
||||
|
||||
// Import forms
|
||||
//authorization sub-forms
|
||||
import configurationAzureForm from './auth-form/sub-forms/auth-azure.form.js';
|
||||
import configurationGithubForm from './auth-form/sub-forms/auth-github.form.js';
|
||||
import configurationGithubOrgForm from './auth-form/sub-forms/auth-github-org.form';
|
||||
import configurationGithubTeamForm from './auth-form/sub-forms/auth-github-team.form';
|
||||
@ -27,6 +28,7 @@ export default
|
||||
angular.module('configuration', [])
|
||||
.controller('ConfigurationController', configurationController)
|
||||
//auth forms
|
||||
.factory('configurationAzureForm', configurationAzureForm)
|
||||
.factory('configurationGithubForm', configurationGithubForm)
|
||||
.factory('configurationGithubOrgForm', configurationGithubOrgForm)
|
||||
.factory('configurationGithubTeamForm', configurationGithubTeamForm)
|
||||
@ -34,9 +36,11 @@ angular.module('configuration', [])
|
||||
.factory('configurationLdapForm', configurationLdapForm)
|
||||
.factory('configurationRadiusForm', configurationRadiusForm)
|
||||
.factory('configurationSamlForm', configurationSamlForm)
|
||||
//other forms
|
||||
.factory('ConfigurationJobsForm', configurationJobsForm)
|
||||
.factory('ConfigurationSystemForm', configurationSystemForm)
|
||||
.factory('ConfigurationUiForm', configurationUiForm)
|
||||
//helpers and services
|
||||
.factory('ConfigurationUtils', ConfigurationUtils)
|
||||
.service('ConfigurationService', configurationService)
|
||||
.run(['$stateExtender', function($stateExtender) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user