Merge remote-tracking branch 'origin/devel' into devel

This commit is contained in:
Serge Rider
2020-10-12 14:53:58 +03:00
3 changed files with 15 additions and 1 deletions
@@ -143,11 +143,21 @@ export class UserFormController implements IInitializableController, IDestructib
};
private validate() {
if (!this.credentials.login) {
if (!this.credentials.login.trim()) {
this.notificationService.logError({ title: 'authentication_user_login_not_set' });
return;
}
if (this.rolesManagerService.roles.has(this.credentials.login)) {
this.notificationService.logError({ title: 'authentication_user_login_cant_be_used' });
return;
}
if (this.usersResource.has(this.credentials.login)) {
this.notificationService.logError({ title: 'authentication_user_login_already_exists' });
return;
}
if (!this.isRoleSelected()) {
this.notificationService.logError({ title: 'authentication_user_role_not_set' });
return;
@@ -25,4 +25,6 @@ export default [
['authentication_user_role_not_set', 'At least one role must be selected'],
['authentication_user_password_not_set', 'Password is required'],
['authentication_user_passwords_not_match', "Passwords don't match"],
['authentication_user_login_already_exists', 'A user with this name already exists'],
['authentication_user_login_cant_be_used', 'Sorry, that name cannot be used'],
];
@@ -25,4 +25,6 @@ export default [
['authentication_user_role_not_set', 'Должна быть выбрана минимум одна роль'],
['authentication_user_password_not_set', 'Пароль не задан'],
['authentication_user_passwords_not_match', 'Пароли не совпадают'],
['authentication_user_login_already_exists', 'Пользователь с таким именем уже существует'],
['authentication_user_login_cant_be_used', 'Данное имя нельзя использовать'],
];