From 214ef2680253cbcbe9ebd84d94ad93294f47b109 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maren=20S=C3=BCwer?= Date: Mon, 28 Jan 2019 14:54:01 +0100 Subject: [PATCH] make edit user saveable again --- scm-ui/src/users/components/UserForm.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/scm-ui/src/users/components/UserForm.js b/scm-ui/src/users/components/UserForm.js index ba1e2f6753..9e04160d3d 100644 --- a/scm-ui/src/users/components/UserForm.js +++ b/scm-ui/src/users/components/UserForm.js @@ -63,14 +63,19 @@ class UserForm extends React.Component { isValid = () => { const user = this.state.user; + + const createUserIsValid = !this.props.user + ? this.state.nameValidationError || + this.isFalsy(user.name) || + !this.state.passwordValid + : false; + return !( - this.state.nameValidationError || + createUserIsValid || 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) ); };