GUACAMOLE-36: Migrate guacLogin and guacNotification to TranslatableMessage.

This commit is contained in:
Michael Jumper
2016-08-16 21:47:26 -07:00
parent 0671f18d40
commit 986ea4b206
13 changed files with 70 additions and 35 deletions

View File

@@ -36,7 +36,7 @@ angular.module('login').directive('guacLogin', [function guacLogin() {
* An optional instructional message to display within the login
* dialog.
*
* @type String
* @type TranslatableMessage
*/
helpText : '=',
@@ -72,7 +72,7 @@ angular.module('login').directive('guacLogin', [function guacLogin() {
/**
* A description of the error that occurred during login, if any.
*
* @type String
* @type TranslatableMessage
*/
$scope.loginError = null;
@@ -160,11 +160,13 @@ angular.module('login').directive('guacLogin', [function guacLogin() {
// Flag generic error for invalid login
if (error.type === Error.Type.INVALID_CREDENTIALS)
$scope.loginError = 'LOGIN.ERROR_INVALID_LOGIN';
$scope.loginError = {
'key' : 'LOGIN.ERROR_INVALID_LOGIN'
};
// Display error if anything else goes wrong
else
$scope.loginError = error.message;
$scope.loginError = error.translatableMessage;
// Clear all visible password fields
angular.forEach($scope.remainingFields, function clearEnteredValueIfPassword(field) {