GUAC-1176: Provide user with help text during login. Style continuation dialog differently. Add continue button.

This commit is contained in:
Michael Jumper
2015-06-08 01:19:57 -07:00
parent 7826039d1f
commit de6c5fd4da
8 changed files with 58 additions and 9 deletions

View File

@@ -36,6 +36,14 @@ angular.module('index').controller('indexController', ['$scope', '$injector',
*/
$scope.guacNotification = guacNotification;
/**
* The message to display to the user as instructions for the login
* process.
*
* @type String
*/
$scope.loginHelpText = null;
/**
* The credentials that the authentication service is has already accepted,
* pending additional credentials, if any. If the user is logged in, or no
@@ -120,23 +128,26 @@ angular.module('index').controller('indexController', ['$scope', '$injector',
};
// Display login screen if a whole new set of credentials is needed
$scope.$on('guacInvalidCredentials', function loginInvalid(event, parameters, expected) {
$scope.$on('guacInvalidCredentials', function loginInvalid(event, parameters, error) {
$scope.page.title = 'APP.NAME';
$scope.page.bodyClassName = '';
$scope.loginHelpText = null;
$scope.acceptedCredentials = {};
$scope.expectedCredentials = expected;
$scope.expectedCredentials = error.expected;
});
// Prompt for remaining credentials if provided credentials were not enough
$scope.$on('guacInsufficientCredentials', function loginInsufficient(event, parameters, expected) {
$scope.$on('guacInsufficientCredentials', function loginInsufficient(event, parameters, error) {
$scope.page.title = 'APP.NAME';
$scope.page.bodyClassName = '';
$scope.loginHelpText = error.message;
$scope.acceptedCredentials = parameters;
$scope.expectedCredentials = expected;
$scope.expectedCredentials = error.expected;
});
// Clear login screen if login was successful
$scope.$on('guacLogin', function loginSuccessful() {
$scope.loginHelpText = null;
$scope.acceptedCredentials = null;
$scope.expectedCredentials = null;
});