1
0
mirror of https://github.com/sismics/docs.git synced 2025-12-22 14:11:39 +00:00

Closes #169 feedback for username/group name already taken

This commit is contained in:
Benjamin Gamard
2018-01-04 16:18:06 +01:00
parent 4cc3fa4d89
commit cf44af0065
5 changed files with 20 additions and 2 deletions

View File

@@ -45,6 +45,13 @@ angular.module('docs').controller('SettingsGroupEdit', function($scope, $dialog,
// Go to edit this group to add members
$state.go('settings.group.edit', { name: group.name });
}
}, function (e) {
if (e.data.type === 'GroupAlreadyExists') {
var title = $translate.instant('settings.group.edit.edit_group_failed_title');
var msg = $translate.instant('settings.group.edit.edit_group_failed_message');
var btns = [{result: 'ok', label: $translate.instant('ok'), cssClass: 'btn-primary'}];
$dialog.messageBox(title, msg, btns);
}
});
};

View File

@@ -42,6 +42,13 @@ angular.module('docs').controller('SettingsUserEdit', function($scope, $dialog,
promise.then(function() {
$scope.loadUsers();
$state.go('settings.user');
}, function (e) {
if (e.data.type === 'AlreadyExistingUsername') {
var title = $translate.instant('settings.user.edit.edit_user_failed_title');
var msg = $translate.instant('settings.user.edit.edit_user_failed_message');
var btns = [{result: 'ok', label: $translate.instant('ok'), cssClass: 'btn-primary'}];
$dialog.messageBox(title, msg, btns);
}
});
};

View File

@@ -238,6 +238,8 @@
"edit": {
"delete_user_title": "Delete user",
"delete_user_message": "Do you really want to delete this user? All associated documents, files and tags will be deleted",
"edit_user_failed_title": "User already exists",
"edit_user_failed_message": "This username is already taken by another user",
"edit_user_title": "<small>Edit</small> \"{{ username }}\"",
"add_user_title": "<small>Add a</small> user",
"username": "Username",
@@ -276,6 +278,8 @@
"edit": {
"delete_group_title": "Delete group",
"delete_group_message": "Do you really want to delete this group?",
"edit_group_failed_title": "Group already exists",
"edit_group_failed_message": "This group name is already taken by another group",
"edit_group_title": "Edit <small>\"{{ name }}\"</small>",
"add_group_title": "<small>Add a</small> group",
"name": "Name",