diff --git a/awx/ui/static/js/controllers/Users.js b/awx/ui/static/js/controllers/Users.js index 31f5e3ff3c..92308bf14b 100644 --- a/awx/ui/static/js/controllers/Users.js +++ b/awx/ui/static/js/controllers/Users.js @@ -308,6 +308,7 @@ function UsersEdit ($scope, $rootScope, $compile, $location, $log, $routeParams, for (var fld in master) { scope[fld] = master[fld]; } + scope['password_confirm'] = scope['password']; }; // Password change diff --git a/awx/ui/static/js/forms/Users.js b/awx/ui/static/js/forms/Users.js index 85006ea0d6..0b014366b6 100644 --- a/awx/ui/static/js/forms/Users.js +++ b/awx/ui/static/js/forms/Users.js @@ -70,7 +70,8 @@ angular.module('UserFormDefinition', []) label: 'Password', type: 'password', ngShow: 'ldap_user == false', - awRequiredWhen: { variable: "not_ldap_user", init: true }, + addRequired: true, + editRequired: false, ngChange: "clearPWConfirm('password_confirm')", autocomplete: false, chkPass: true diff --git a/awx/ui/static/js/helpers/Users.js b/awx/ui/static/js/helpers/Users.js index 1513adc5ac..fc825bd651 100644 --- a/awx/ui/static/js/helpers/Users.js +++ b/awx/ui/static/js/helpers/Users.js @@ -22,8 +22,9 @@ angular.module('UserHelper', [ 'UserFormDefinition' ]) UserForm.fields['organization'].readonly = false; UserForm.fields['username'].awRequiredWhen = { variable: "not_ldap_user", init: true }; UserForm.fields['username'].readonly = false; - UserForm.fields['password'].awRequiredWhen = { variable: "not_ldap_user", init: true }, - UserForm.fields['password'].readonly = false; - + //UserForm.fields['password'].awRequiredWhen = { variable: "not_ldap_user", init: true }, + //UserForm.fields['password'].readonly = false; + UserForm.fields['password'].editRequired = false; + UserForm.fields['password'].addRrequired = true; } }]); \ No newline at end of file diff --git a/awx/ui/static/lib/ansible/form-generator.js b/awx/ui/static/lib/ansible/form-generator.js index b391cb7833..c7acd0817d 100644 --- a/awx/ui/static/lib/ansible/form-generator.js +++ b/awx/ui/static/lib/ansible/form-generator.js @@ -198,30 +198,34 @@ angular.module('FormGenerator', ['GeneratorHelpers', 'ngCookies', 'Utilities']) for (var fld in this.form.fields) { if (this.form.fields[fld].type == 'checkbox_group') { for (var i=0; i < this.form.fields[fld].fields.length; i++) { - this.scope[this.form.fields[fld].fields[i].name] = ''; - this.scope[this.form.fields[fld].fields[i].name + '_api_error'] = ''; + this.scope[this.form.fields[fld].fields[i].name] = ''; + this.scope[this.form.fields[fld].fields[i].name + '_api_error'] = ''; } } else { - this.scope[fld] = ''; - this.scope[fld + '_api_error'] = ''; + this.scope[fld] = ''; + this.scope[fld + '_api_error'] = ''; } if (this.form.fields[fld].sourceModel) { - this.scope[this.form.fields[fld].sourceModel + '_' + this.form.fields[fld].sourceField] = ''; - this.scope[this.form.fields[fld].sourceModel + '_' + this.form.fields[fld].sourceField + '_api_error'] = ''; + this.scope[this.form.fields[fld].sourceModel + '_' + this.form.fields[fld].sourceField] = ''; + this.scope[this.form.fields[fld].sourceModel + '_' + this.form.fields[fld].sourceField + '_api_error'] = ''; } if ( this.form.fields[fld].type == 'lookup' && this.scope[this.form.name + '_form'][this.form.fields[fld].sourceModel + '_' + this.form.fields[fld].sourceField] ) { - this.scope[this.form.name + '_form'][this.form.fields[fld].sourceModel + '_' + this.form.fields[fld].sourceField].$setPristine(); + this.scope[this.form.name + '_form'][this.form.fields[fld].sourceModel + '_' + this.form.fields[fld].sourceField].$setPristine(); } if (this.scope[this.form.name + '_form'][fld]) { - this.scope[this.form.name + '_form'][fld].$setPristine(); + this.scope[this.form.name + '_form'][fld].$setPristine(); + } + if (this.form.fields[fld].chkPass && this.scope[this.form.name + '_form'][fld]) { + this.scope[this.form.name + '_form'][fld].$setValidity('complexity', true); + $('#progbar').css({ width: 0 }); + } + if (this.form.fields[fld].awPassMatch && this.scope[this.form.name + '_form'][fld]) { + this.scope[this.form.name + '_form'][fld].$setValidity('awpassmatch', true); } - //if (this.scope.fields[fld].awPassMatch) { - // this.scope[this.form.name + '_form'][fld].$setValidity('awpassmatch', true); - //} if (this.form.fields[fld].ask) { - this.scope[fld + '_ask'] = false; + this.scope[fld + '_ask'] = false; } } if (this.mode == 'add') {