mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-09 15:05:44 +01:00
treat empty user creation form as invalid
This commit is contained in:
@@ -52,6 +52,13 @@ class UserForm extends React.Component<Props, State> {
|
||||
}
|
||||
}
|
||||
|
||||
isFalsy(value) {
|
||||
if (!value) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
isValid = () => {
|
||||
const user = this.state.user;
|
||||
return !(
|
||||
@@ -60,8 +67,8 @@ class UserForm extends React.Component<Props, State> {
|
||||
this.state.mailValidationError ||
|
||||
this.state.validatePasswordError ||
|
||||
this.state.displayNameValidationError ||
|
||||
user.name === undefined ||
|
||||
user.displayName === undefined
|
||||
this.isFalsy(user.name) ||
|
||||
this.isFalsy(user.displayName)
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user