mirror of
https://github.com/ansible/awx.git
synced 2026-05-19 14:57:39 -02:30
Merge pull request #4172 from kensible/4151-azure-ctint
Added Azure form to authentication section
This commit is contained in:
@@ -10,6 +10,7 @@ export default [
|
|||||||
'$stateParams',
|
'$stateParams',
|
||||||
'$timeout',
|
'$timeout',
|
||||||
'$q',
|
'$q',
|
||||||
|
'configurationAzureForm',
|
||||||
'configurationGithubForm',
|
'configurationGithubForm',
|
||||||
'configurationGithubOrgForm',
|
'configurationGithubOrgForm',
|
||||||
'configurationGithubTeamForm',
|
'configurationGithubTeamForm',
|
||||||
@@ -28,6 +29,7 @@ export default [
|
|||||||
$stateParams,
|
$stateParams,
|
||||||
$timeout,
|
$timeout,
|
||||||
$q,
|
$q,
|
||||||
|
configurationAzureForm,
|
||||||
configurationGithubForm,
|
configurationGithubForm,
|
||||||
configurationGithubOrgForm,
|
configurationGithubOrgForm,
|
||||||
configurationGithubTeamForm,
|
configurationGithubTeamForm,
|
||||||
@@ -45,8 +47,8 @@ export default [
|
|||||||
|
|
||||||
var generator = GenerateForm;
|
var generator = GenerateForm;
|
||||||
var formTracker = $scope.$parent.vm.formTracker;
|
var formTracker = $scope.$parent.vm.formTracker;
|
||||||
var dropdownValue = 'github';
|
var dropdownValue = 'azure';
|
||||||
var activeAuthForm = 'github';
|
var activeAuthForm = 'azure';
|
||||||
|
|
||||||
// Default active form
|
// Default active form
|
||||||
if ($stateParams.currentTab === '' || $stateParams.currentTab === 'auth') {
|
if ($stateParams.currentTab === '' || $stateParams.currentTab === 'auth') {
|
||||||
@@ -92,9 +94,10 @@ export default [
|
|||||||
};
|
};
|
||||||
|
|
||||||
var dropdownOptions = [
|
var dropdownOptions = [
|
||||||
{label: 'GitHub', value: 'github'},
|
{label: 'Azure', value: 'azure'},
|
||||||
{label: 'GitHub Org', value: 'github_org'},
|
{label: 'Github', value: 'github'},
|
||||||
{label: 'GitHub Team', value: 'github_team'},
|
{label: 'Github Org', value: 'github_org'},
|
||||||
|
{label: 'Github Team', value: 'github_team'},
|
||||||
{label: 'Google OAuth2', value: 'google_oauth'},
|
{label: 'Google OAuth2', value: 'google_oauth'},
|
||||||
{label: 'LDAP', value: 'ldap'},
|
{label: 'LDAP', value: 'ldap'},
|
||||||
{label: 'RADIUS', value: 'radius'},
|
{label: 'RADIUS', value: 'radius'},
|
||||||
@@ -107,27 +110,30 @@ export default [
|
|||||||
});
|
});
|
||||||
|
|
||||||
var authForms = [{
|
var authForms = [{
|
||||||
formDef: configurationGithubForm,
|
formDef: configurationAzureForm,
|
||||||
id: 'auth-github-form'
|
id: 'auth-azure-form'
|
||||||
}, {
|
}, {
|
||||||
formDef: configurationGithubOrgForm,
|
formDef: configurationGithubForm,
|
||||||
id: 'auth-github-org-form'
|
id: 'auth-github-form'
|
||||||
}, {
|
}, {
|
||||||
formDef: configurationGithubTeamForm,
|
formDef: configurationGithubOrgForm,
|
||||||
id: 'auth-github-team-form'
|
id: 'auth-github-org-form'
|
||||||
}, {
|
}, {
|
||||||
formDef: configurationGoogleForm,
|
formDef: configurationGithubTeamForm,
|
||||||
id: 'auth-google-form'
|
id: 'auth-github-team-form'
|
||||||
}, {
|
}, {
|
||||||
formDef: configurationLdapForm,
|
formDef: configurationGoogleForm,
|
||||||
id: 'auth-ldap-form'
|
id: 'auth-google-form'
|
||||||
}, {
|
}, {
|
||||||
formDef: configurationRadiusForm,
|
formDef: configurationLdapForm,
|
||||||
id: 'auth-radius-form'
|
id: 'auth-ldap-form'
|
||||||
}, {
|
}, {
|
||||||
formDef: configurationSamlForm,
|
formDef: configurationRadiusForm,
|
||||||
id: 'auth-saml-form'
|
id: 'auth-radius-form'
|
||||||
}, ];
|
}, {
|
||||||
|
formDef: configurationSamlForm,
|
||||||
|
id: 'auth-saml-form'
|
||||||
|
}, ];
|
||||||
|
|
||||||
var forms = _.pluck(authForms, 'formDef');
|
var forms = _.pluck(authForms, 'formDef');
|
||||||
|
|
||||||
|
|||||||
@@ -12,6 +12,11 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-lg-12">
|
<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 ng-show="authVm.activeAuthForm === 'github'">
|
||||||
<div id="auth-github-form">
|
<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',
|
'ConfigurationService', 'ConfigurationUtils', 'CreateDialog', 'CreateSelect2', 'ParseTypeChange', 'ProcessErrors',
|
||||||
'Wait', 'configDataResolve',
|
'Wait', 'configDataResolve',
|
||||||
//Form definitions
|
//Form definitions
|
||||||
|
'configurationAzureForm',
|
||||||
'configurationGithubForm',
|
'configurationGithubForm',
|
||||||
'configurationGithubOrgForm',
|
'configurationGithubOrgForm',
|
||||||
'configurationGithubTeamForm',
|
'configurationGithubTeamForm',
|
||||||
@@ -24,6 +25,7 @@ export default [
|
|||||||
ConfigurationService, ConfigurationUtils, CreateDialog, CreateSelect2, ParseTypeChange, ProcessErrors,
|
ConfigurationService, ConfigurationUtils, CreateDialog, CreateSelect2, ParseTypeChange, ProcessErrors,
|
||||||
Wait, configDataResolve,
|
Wait, configDataResolve,
|
||||||
//Form definitions
|
//Form definitions
|
||||||
|
configurationAzureForm,
|
||||||
configurationGithubForm,
|
configurationGithubForm,
|
||||||
configurationGithubOrgForm,
|
configurationGithubOrgForm,
|
||||||
configurationGithubTeamForm,
|
configurationGithubTeamForm,
|
||||||
@@ -38,6 +40,7 @@ export default [
|
|||||||
var vm = this;
|
var vm = this;
|
||||||
|
|
||||||
var formDefs = {
|
var formDefs = {
|
||||||
|
'azure': configurationAzureForm,
|
||||||
'github': configurationGithubForm,
|
'github': configurationGithubForm,
|
||||||
'github_org': configurationGithubOrgForm,
|
'github_org': configurationGithubOrgForm,
|
||||||
'github_team': configurationGithubTeamForm,
|
'github_team': configurationGithubTeamForm,
|
||||||
@@ -180,9 +183,9 @@ export default [
|
|||||||
|
|
||||||
function active(setForm) {
|
function active(setForm) {
|
||||||
if (setForm === 'auth') {
|
if (setForm === 'auth') {
|
||||||
// Default to 'github' on first load
|
// Default to 'azure' on first load
|
||||||
if (formTracker.currentAuth === '') {
|
if (formTracker.currentAuth === '') {
|
||||||
formTracker.setCurrentAuth('github');
|
formTracker.setCurrentAuth('azure');
|
||||||
} else {
|
} else {
|
||||||
// If returning to auth tab reset current form to previously viewed
|
// If returning to auth tab reset current form to previously viewed
|
||||||
formTracker.setCurrentAuth(formTracker.currentAuth);
|
formTracker.setCurrentAuth(formTracker.currentAuth);
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import configurationController from './configuration.controller.js';
|
|||||||
|
|
||||||
// Import forms
|
// Import forms
|
||||||
//authorization sub-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 configurationGithubForm from './auth-form/sub-forms/auth-github.form.js';
|
||||||
import configurationGithubOrgForm from './auth-form/sub-forms/auth-github-org.form';
|
import configurationGithubOrgForm from './auth-form/sub-forms/auth-github-org.form';
|
||||||
import configurationGithubTeamForm from './auth-form/sub-forms/auth-github-team.form';
|
import configurationGithubTeamForm from './auth-form/sub-forms/auth-github-team.form';
|
||||||
@@ -27,6 +28,7 @@ export default
|
|||||||
angular.module('configuration', [])
|
angular.module('configuration', [])
|
||||||
.controller('ConfigurationController', configurationController)
|
.controller('ConfigurationController', configurationController)
|
||||||
//auth forms
|
//auth forms
|
||||||
|
.factory('configurationAzureForm', configurationAzureForm)
|
||||||
.factory('configurationGithubForm', configurationGithubForm)
|
.factory('configurationGithubForm', configurationGithubForm)
|
||||||
.factory('configurationGithubOrgForm', configurationGithubOrgForm)
|
.factory('configurationGithubOrgForm', configurationGithubOrgForm)
|
||||||
.factory('configurationGithubTeamForm', configurationGithubTeamForm)
|
.factory('configurationGithubTeamForm', configurationGithubTeamForm)
|
||||||
@@ -34,9 +36,11 @@ angular.module('configuration', [])
|
|||||||
.factory('configurationLdapForm', configurationLdapForm)
|
.factory('configurationLdapForm', configurationLdapForm)
|
||||||
.factory('configurationRadiusForm', configurationRadiusForm)
|
.factory('configurationRadiusForm', configurationRadiusForm)
|
||||||
.factory('configurationSamlForm', configurationSamlForm)
|
.factory('configurationSamlForm', configurationSamlForm)
|
||||||
|
//other forms
|
||||||
.factory('ConfigurationJobsForm', configurationJobsForm)
|
.factory('ConfigurationJobsForm', configurationJobsForm)
|
||||||
.factory('ConfigurationSystemForm', configurationSystemForm)
|
.factory('ConfigurationSystemForm', configurationSystemForm)
|
||||||
.factory('ConfigurationUiForm', configurationUiForm)
|
.factory('ConfigurationUiForm', configurationUiForm)
|
||||||
|
//helpers and services
|
||||||
.factory('ConfigurationUtils', ConfigurationUtils)
|
.factory('ConfigurationUtils', ConfigurationUtils)
|
||||||
.service('ConfigurationService', configurationService)
|
.service('ConfigurationService', configurationService)
|
||||||
.run(['$stateExtender', function($stateExtender) {
|
.run(['$stateExtender', function($stateExtender) {
|
||||||
|
|||||||
Reference in New Issue
Block a user