mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-10 15:35:49 +01:00
merge
This commit is contained in:
@@ -62,16 +62,42 @@ class UserForm extends React.Component<Props, State> {
|
||||
return false;
|
||||
}
|
||||
|
||||
createUserComponentsAreInvalid = () => {
|
||||
const user = this.state.user;
|
||||
if (!this.props.user) {
|
||||
return (
|
||||
this.state.nameValidationError ||
|
||||
this.isFalsy(user.name) ||
|
||||
!this.state.passwordValid
|
||||
);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
editUserComponentsAreUnchanged = () => {
|
||||
const user = this.state.user;
|
||||
if (this.props.user) {
|
||||
return (
|
||||
this.props.user.displayName === user.displayName &&
|
||||
this.props.user.mail === user.mail &&
|
||||
this.props.user.admin === user.admin &&
|
||||
this.props.user.active === user.active
|
||||
);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
isValid = () => {
|
||||
const user = this.state.user;
|
||||
return !(
|
||||
this.state.nameValidationError ||
|
||||
this.createUserComponentsAreInvalid() ||
|
||||
this.editUserComponentsAreUnchanged() ||
|
||||
this.state.mailValidationError ||
|
||||
this.state.displayNameValidationError ||
|
||||
this.isFalsy(user.name) ||
|
||||
this.isFalsy(user.displayName) ||
|
||||
this.isFalsy(user.mail) ||
|
||||
!this.state.passwordValid
|
||||
this.isFalsy(user.mail)
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user