You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by al...@apache.org on 2013/11/27 16:49:14 UTC

git commit: AMBARI-3902. Admin page->users: password confirmation while adding new user should be computed property (Denys Buzhor via alexantonenko)

Updated Branches:
  refs/heads/trunk 0eb9fb9ac -> 2f06f26c0


AMBARI-3902. Admin page->users: password confirmation while adding new user should be computed property (Denys Buzhor via alexantonenko)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/2f06f26c
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/2f06f26c
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/2f06f26c

Branch: refs/heads/trunk
Commit: 2f06f26c0621c859b04641bca9721e65c1005e47
Parents: 0eb9fb9
Author: Alex Antonenko <hi...@gmail.com>
Authored: Wed Nov 27 17:49:13 2013 +0200
Committer: Alex Antonenko <hi...@gmail.com>
Committed: Wed Nov 27 17:49:13 2013 +0200

----------------------------------------------------------------------
 ambari-web/app/views/main/admin/user/create.js | 12 ++++++++++++
 1 file changed, 12 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/2f06f26c/ambari-web/app/views/main/admin/user/create.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/admin/user/create.js b/ambari-web/app/views/main/admin/user/create.js
index 8541bbe..d40559e 100644
--- a/ambari-web/app/views/main/admin/user/create.js
+++ b/ambari-web/app/views/main/admin/user/create.js
@@ -21,6 +21,8 @@ var App = require('app');
 App.MainAdminUserCreateView = Em.View.extend({
   templateName: require('templates/main/admin/user/create'),
   userId: false,
+  isPasswordDirty: false,
+
   create: function(event){
     var parent_controller=this.get("controller").controllers.mainAdminUserController;
     var form = this.get("userForm");
@@ -76,6 +78,16 @@ App.MainAdminUserCreateView = Em.View.extend({
     }
   },
 
+  passwordValidation: function() {
+    var passwordValue = this.get('userForm').getField('password').get('value');
+    if (passwordValue && !this.get('isPasswordDirty')) {
+      this.set('isPasswordDirty', true);
+    }
+    if (this.get('isPasswordDirty')) {
+      this.get('userForm').isValid();
+    }
+  }.observes('userForm.fields.@each.value'),
+
   didInsertElement: function(){
     this.get('userForm').propertyDidChange('object');
   }