From 7f89772c86923649914fa331c15c29504e2b54ba Mon Sep 17 00:00:00 2001 From: Gustavo Maximiliano Cortez Date: Tue, 2 Dec 2014 18:53:14 -0300 Subject: [PATCH] Fix notification and validation messages when creating and importing a profile. --- css/src/main.css | 2 -- js/controllers/createProfile.js | 13 +++++++++++-- js/controllers/importProfile.js | 1 - views/createProfile.html | 28 +++++++++++++--------------- views/importProfile.html | 13 ++++++++----- 5 files changed, 32 insertions(+), 25 deletions(-) diff --git a/css/src/main.css b/css/src/main.css index bddec8dd0..277388a39 100644 --- a/css/src/main.css +++ b/css/src/main.css @@ -379,7 +379,6 @@ a:hover { height: 41px; position: relative; font-size: 12px; - width: 70%; padding: 0.9rem 0.7rem 0.7rem 3rem; border-radius: 4px; background: #F2F5F8; @@ -388,7 +387,6 @@ a:hover { } .box-notification .box-icon { - margin-right: 77px; position: absolute; top: 0; left: 0; diff --git a/js/controllers/createProfile.js b/js/controllers/createProfile.js index 9ddcec3db..7fdacb716 100644 --- a/js/controllers/createProfile.js +++ b/js/controllers/createProfile.js @@ -1,6 +1,6 @@ 'use strict'; -angular.module('copayApp.controllers').controller('CreateProfileController', function($scope, $rootScope, $location, notification, pluginManager, identityService) { +angular.module('copayApp.controllers').controller('CreateProfileController', function($scope, $rootScope, $location, $timeout, notification, pluginManager, identityService) { identityService.goWalletHome(); $scope.createProfile = function(form) { @@ -17,7 +17,16 @@ angular.module('copayApp.controllers').controller('CreateProfileController', fun if (msg.indexOf('EEXIST')>=0 || msg.indexOf('BADC')>=0 ) { msg = 'This profile already exists' } - $scope.error = msg; + $timeout(function() { + form.email.$setViewValue(''); + form.email.$render(); + form.password.$setViewValue(''); + form.password.$render(); + form.repeatpassword.$setViewValue(''); + form.repeatpassword.$render(); + form.$setPristine(); + $scope.error = msg; + },1); } }); } diff --git a/js/controllers/importProfile.js b/js/controllers/importProfile.js index c83013104..28c69fbe3 100644 --- a/js/controllers/importProfile.js +++ b/js/controllers/importProfile.js @@ -29,7 +29,6 @@ angular.module('copayApp.controllers').controller('ImportProfileController', } else { $scope.error = 'Unknown error'; } - $rootScope.$digest(); } }); }; diff --git a/views/createProfile.html b/views/createProfile.html index dd034d5ff..5e9bd3d52 100644 --- a/views/createProfile.html +++ b/views/createProfile.html @@ -18,7 +18,7 @@
-

Create Profile

+

Create Profile

@@ -28,15 +28,14 @@
-
- - +
+ Not valid - +
-
+ tooltip-html-unsafe="Password strength: {{passwordStrength}}
Tip: Use lower and uppercase, numbers and symbols" tooltip-trigger="focus" required tooltip-placement="top">
- -
- - + {{'Passwords must match'|translate}} -
+
-
+