mirror of
https://github.com/ansible/awx.git
synced 2026-05-08 09:57:35 -02:30
Credentials
Fixed form validation issues when adding a cloud credential. The email address field was being required even though it wasn't visible.
This commit is contained in:
@@ -225,6 +225,7 @@ function CredentialsAdd($scope, $rootScope, $compile, $location, $log, $routePar
|
|||||||
|
|
||||||
// Reset defaults
|
// Reset defaults
|
||||||
$scope.formReset = function () {
|
$scope.formReset = function () {
|
||||||
|
//DebugForm({ scope: $scope, form: CredentialForm });
|
||||||
generator.reset();
|
generator.reset();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -140,7 +140,7 @@ angular.module('CredentialFormDefinition', [])
|
|||||||
ngShow: "kind.value && kind.value !== 'aws' && " +
|
ngShow: "kind.value && kind.value !== 'aws' && " +
|
||||||
"kind.value !== 'gce' && kind.value!=='azure'",
|
"kind.value !== 'gce' && kind.value!=='azure'",
|
||||||
awRequiredWhen: {
|
awRequiredWhen: {
|
||||||
variable: 'aws_required',
|
variable: 'username_required',
|
||||||
init: false
|
init: false
|
||||||
},
|
},
|
||||||
autocomplete: false
|
autocomplete: false
|
||||||
@@ -150,7 +150,7 @@ angular.module('CredentialFormDefinition', [])
|
|||||||
type: 'email',
|
type: 'email',
|
||||||
ngShow: "kind.value === 'gce'",
|
ngShow: "kind.value === 'gce'",
|
||||||
awRequiredWhen: {
|
awRequiredWhen: {
|
||||||
variable: 'username_required',
|
variable: 'email_required',
|
||||||
init: false
|
init: false
|
||||||
},
|
},
|
||||||
autocomplete: false
|
autocomplete: false
|
||||||
|
|||||||
@@ -22,10 +22,11 @@ angular.module('CredentialsHelper', ['Utilities'])
|
|||||||
// Put things in a default state
|
// Put things in a default state
|
||||||
scope.usernameLabel = 'Username';
|
scope.usernameLabel = 'Username';
|
||||||
scope.aws_required = false;
|
scope.aws_required = false;
|
||||||
|
scope.email_required = false;
|
||||||
scope.rackspace_required = false;
|
scope.rackspace_required = false;
|
||||||
scope.sshKeyDataLabel = 'SSH Private Key';
|
scope.sshKeyDataLabel = 'SSH Private Key';
|
||||||
scope.username_required = false; // JT-- added username_required b/c mutliple 'kinds' need username to be required (GCE)
|
scope.username_required = false; // JT-- added username_required b/c mutliple 'kinds' need username to be required (GCE)
|
||||||
scope.key_required = false; // JT -- doing the same for key and project
|
scope.key_required = false; // JT -- doing the same for key and project
|
||||||
scope.project_required = false;
|
scope.project_required = false;
|
||||||
scope.subscription_required = false;
|
scope.subscription_required = false;
|
||||||
|
|
||||||
@@ -46,9 +47,9 @@ angular.module('CredentialsHelper', ['Utilities'])
|
|||||||
scope.sshKeyDataLabel = 'SCM Private Key';
|
scope.sshKeyDataLabel = 'SCM Private Key';
|
||||||
break;
|
break;
|
||||||
case 'gce':
|
case 'gce':
|
||||||
scope.usernameLabel = 'Email Address';
|
scope.usernameLabel = 'Service Account Email Address';
|
||||||
scope.sshKeyDataLabel = 'RSA Private Key';
|
scope.sshKeyDataLabel = 'RSA Private Key';
|
||||||
scope.username_required = true;
|
scope.email_required = true;
|
||||||
scope.key_required = true;
|
scope.key_required = true;
|
||||||
scope.project_required = true;
|
scope.project_required = true;
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user