mirror of
https://github.com/coder/coder.git
synced 2025-07-13 21:36:50 +00:00
feat: add "Full Name" field to user creation (#13659)
Adds the ability to specify "Full Name" (a.k.a. Name) when creating users either via CLI or UI.
This commit is contained in:
@ -11,6 +11,7 @@ import { FormFooter } from "components/FormFooter/FormFooter";
|
||||
import { FullPageForm } from "components/FullPageForm/FullPageForm";
|
||||
import { Stack } from "components/Stack/Stack";
|
||||
import {
|
||||
displayNameValidator,
|
||||
getFormHelpers,
|
||||
nameValidator,
|
||||
onChangeTrimmed,
|
||||
@ -20,6 +21,7 @@ export const Language = {
|
||||
emailLabel: "Email",
|
||||
passwordLabel: "Password",
|
||||
usernameLabel: "Username",
|
||||
nameLabel: "Full name",
|
||||
emailInvalid: "Please enter a valid email address.",
|
||||
emailRequired: "Please enter an email address.",
|
||||
passwordRequired: "Please enter a password.",
|
||||
@ -78,6 +80,7 @@ const validationSchema = Yup.object({
|
||||
otherwise: (schema) => schema,
|
||||
}),
|
||||
username: nameValidator(Language.usernameLabel),
|
||||
name: displayNameValidator(Language.nameLabel),
|
||||
login_type: Yup.string().oneOf(Object.keys(authMethodLanguage)),
|
||||
});
|
||||
|
||||
@ -90,6 +93,7 @@ export const CreateUserForm: FC<
|
||||
email: "",
|
||||
password: "",
|
||||
username: "",
|
||||
name: "",
|
||||
organization_id: organizationId,
|
||||
disable_login: false,
|
||||
login_type: "",
|
||||
@ -124,6 +128,12 @@ export const CreateUserForm: FC<
|
||||
fullWidth
|
||||
label={Language.usernameLabel}
|
||||
/>
|
||||
<TextField
|
||||
{...getFieldHelpers("name")}
|
||||
autoComplete="name"
|
||||
fullWidth
|
||||
label={Language.nameLabel}
|
||||
/>
|
||||
<TextField
|
||||
{...getFieldHelpers("email")}
|
||||
onChange={onChangeTrimmed(form)}
|
||||
|
Reference in New Issue
Block a user