fix create user bug (#2317)

This commit is contained in:
Jenny 2022-03-28 15:05:33 -04:00 committed by GitHub
parent 3efffab55d
commit 0c628e2b7c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 4 deletions

View file

@ -409,7 +409,11 @@ export const UserForm = ({
<ActionGroup>
<Button
data-testid={!user?.id ? "create-user" : "save-user"}
isDisabled={!user?.id && !watchUsernameInput}
isDisabled={
!user?.id &&
!watchUsernameInput &&
!realm?.registrationEmailAsUsername
}
variant="primary"
type="submit"
>

View file

@ -152,9 +152,7 @@ const UsersTabs = () => {
<ImpersonateConfirm />
<DeleteConfirm />
<ViewHeader
titleKey={
userForm.getValues().username || user?.username || t("createUser")
}
titleKey={user?.id ? user.username! : t("createUser")}
divider={!id}
dropdownItems={[
<DropdownItem