From e19d8a4e5bda954e2af29855e0de48d789b12cdc Mon Sep 17 00:00:00 2001 From: Tankred Hase Date: Thu, 31 Jul 2014 19:08:21 +0200 Subject: [PATCH] [WO-462] Rework login workflow * Make keygen and import possibilities clearer in login-initial * Show spinner when generating key * Use mobile design (wide buttons) everywhere * Show info about key-sync in login-new-device (for mobile users) * remove info popovers in login screens * allow keyfile import even when keysync has been activated --- src/js/controller/login-initial.js | 24 +++++++----- src/sass/views/_login.scss | 52 +++++++++++++++----------- src/tpl/login-existing.html | 14 +------ src/tpl/login-initial.html | 52 +++++++++++++------------- src/tpl/login-new-device.html | 32 ++++------------ src/tpl/login-privatekey-download.html | 20 ++++++---- src/tpl/login-set-credentials.html | 2 +- test/unit/login-initial-ctrl-test.js | 30 ++++++++++----- 8 files changed, 114 insertions(+), 112 deletions(-) diff --git a/src/js/controller/login-initial.js b/src/js/controller/login-initial.js index 4751510..23f6eb1 100644 --- a/src/js/controller/login-initial.js +++ b/src/js/controller/login-initial.js @@ -9,7 +9,8 @@ define(function(require) { states = { IDLE: 1, - PROCESSING: 2, + SET_PASSPHRASE: 2, + PROCESSING: 3, DONE: 4 }; $scope.state.ui = states.IDLE; // initial state @@ -29,6 +30,17 @@ define(function(require) { $location.path('/login-new-device'); }; + $scope.setPassphrase = function() { + if (!$scope.state.agree) { + $scope.onError({ + message: termsMsg + }); + return; + } + + $scope.setState(states.SET_PASSPHRASE); + }; + /* * Taken from jQuery validate.password plug-in 1.0 * http://bassistance.de/jquery-plugins/jquery-plugin-validate.password/ @@ -90,20 +102,14 @@ define(function(require) { return; } - if (!$scope.state.agree) { - $scope.onError({ - message: termsMsg - }); - return; - } - $scope.setState(states.PROCESSING); + setTimeout(function() { emailDao.unlock({ passphrase: (passphrase) ? passphrase : undefined }, function(err) { if (err) { - $scope.setState(states.IDLE); + $scope.setState(states.SET_PASSPHRASE); $scope.onError(err); return; } diff --git a/src/sass/views/_login.scss b/src/sass/views/_login.scss index 63988b9..4c35d85 100644 --- a/src/sass/views/_login.scss +++ b/src/sass/views/_login.scss @@ -17,10 +17,14 @@ } @include respond-to(desktop) { - margin: 135px auto 75px; + margin: 115px auto 75px; } } + .working { + text-align: center; + } + .spinner { font-size: 150%; } @@ -38,10 +42,7 @@ color: $btn-color; margin-right: 10px; margin-bottom: 10px; - - @include respond-to(mobile) { - width: 100%; - } + width: 100%; } p, label { @@ -52,6 +53,18 @@ margin: 20px 0; } + fieldset { + margin: 30px 0 40px; + + legend { + color: $color-blue; + } + + p { + margin: 0; + } + } + input { margin-right: 10px; } @@ -98,17 +111,6 @@ .popover-info { display: none; // hide on mobile } - - @include respond-to(desktop) { - input[type="text"], - input[type="password"], - input[type="file"] { - width: auto; - } - .popover-info { - display: inline-block; - } - } } } @@ -122,19 +124,25 @@ .view-login-privatekey-download { .content { - max-width: 500px; - input.code { - margin-right: 0; - width: auto; + fieldset { + margin-top: 20px; + } + + .code { + max-width: 240px; + margin: 0 auto; + + input { + margin-right: 0; + width: auto; + } } } } .view-login-set-credentials { .content { - max-width: 450px; - b, a { text-decoration: none; } diff --git a/src/tpl/login-existing.html b/src/tpl/login-existing.html index d46c03a..84e8393 100644 --- a/src/tpl/login-existing.html +++ b/src/tpl/login-existing.html @@ -9,7 +9,6 @@
-
Forgot your passphrase?
@@ -17,15 +16,4 @@
- - - -
-
-
What is this?
-
-

A passphrase is like a password that protects your PGP key.

-

There is no way to access your messages without your passphrase.

-

If you have forgotten your passphrase, please request an account reset using the provided link. You will not be able to read previous messages after a reset.

-
-
\ No newline at end of file + \ No newline at end of file diff --git a/src/tpl/login-initial.html b/src/tpl/login-initial.html index de83e3e..0e09f82 100644 --- a/src/tpl/login-initial.html +++ b/src/tpl/login-initial.html @@ -1,21 +1,14 @@ -
+