change(ui) - validation based on ee
This commit is contained in:
parent
4f1a686787
commit
34947d8ef7
2 changed files with 4 additions and 4 deletions
|
|
@ -94,7 +94,7 @@ function UserForm(props: Props) {
|
|||
</label>
|
||||
</div>
|
||||
|
||||
{ !isEnterprise && (
|
||||
{ isEnterprise && (
|
||||
<div className="form-group">
|
||||
<label htmlFor="role">{ 'Role' }</label>
|
||||
<Select
|
||||
|
|
@ -115,7 +115,7 @@ function UserForm(props: Props) {
|
|||
<div className="flex items-center mr-auto">
|
||||
<Button
|
||||
onClick={ onSave }
|
||||
disabled={ !user.valid() || isSaving }
|
||||
disabled={ !user.valid(isEnterprise) || isSaving }
|
||||
loading={ isSaving }
|
||||
primary
|
||||
marginRight
|
||||
|
|
|
|||
|
|
@ -95,8 +95,8 @@ export default class User implements IUser {
|
|||
}
|
||||
}
|
||||
|
||||
valid() {
|
||||
return validateName(this.name, { empty: false }) && validateEmail(this.email) && !!this.roleId;
|
||||
valid(isEnterprise: boolean = false) {
|
||||
return validateName(this.name, { empty: false }) && validateEmail(this.email) && (isEnterprise ? !!this.roleId : true);
|
||||
}
|
||||
|
||||
exists() {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue