GUACAMOLE-526: Update webapp to angular 1.6.9.

This commit is contained in:
James Muehlner
2018-04-25 22:25:02 -07:00
parent 03281667b4
commit b3eeb36b87
36 changed files with 301 additions and 159 deletions

View File

@@ -150,7 +150,7 @@ angular.module('settings').directive('guacSettingsPreferences', [function guacSe
// Save the user with the new password
userService.updateUserPassword(dataSource, username, $scope.oldPassword, $scope.newPassword)
.success(function passwordUpdated() {
.then(function passwordUpdated() {
// Clear the password fields
$scope.oldPassword = null;
@@ -167,7 +167,7 @@ angular.module('settings').directive('guacSettingsPreferences', [function guacSe
})
// Notify of any errors
.error(function passwordUpdateFailed(error) {
['catch'](function passwordUpdateFailed(error) {
guacNotification.showStatus({
className : 'error',
title : 'SETTINGS_PREFERENCES.DIALOG_HEADER_ERROR',
@@ -180,20 +180,25 @@ angular.module('settings').directive('guacSettingsPreferences', [function guacSe
// Retrieve defined languages
languageService.getLanguages()
.success(function languagesRetrieved(languages) {
$scope.languages = languages;
.then(function languagesRetrieved(languages) {
$scope.languages = Object.keys(languages).map(function(key) {
return {
key: key,
value: languages[key]
};
})
});
// Retrieve current permissions
permissionService.getEffectivePermissions(dataSource, username)
.success(function permissionsRetrieved(permissions) {
.then(function permissionsRetrieved(permissions) {
// Add action for changing password if permission is granted
$scope.canChangePassword = PermissionSet.hasUserPermission(permissions,
PermissionSet.ObjectPermissionType.UPDATE, username);
})
.error(function permissionsFailed(error) {
['catch'](function permissionsFailed(error) {
$scope.canChangePassword = false;
});