This commit is contained in:
Brian Cao 2024-02-28 10:19:27 -08:00
commit 3d6cdddd38
12 changed files with 772 additions and 25 deletions

View file

@ -42,17 +42,30 @@ export function LoginForm() {
<div className={styles.title}>umami</div>
<Form className={styles.form} onSubmit={handleSubmit} error={getMessage(error)}>
<FormRow label={formatMessage(labels.username)}>
<FormInput name="username" rules={{ required: formatMessage(labels.required) }}>
<FormInput
data-cy="input-username"
name="username"
rules={{ required: formatMessage(labels.required) }}
>
<TextField autoComplete="off" />
</FormInput>
</FormRow>
<FormRow label={formatMessage(labels.password)}>
<FormInput name="password" rules={{ required: formatMessage(labels.required) }}>
<FormInput
data-cy="input-password"
name="password"
rules={{ required: formatMessage(labels.required) }}
>
<PasswordField />
</FormInput>
</FormRow>
<FormButtons>
<SubmitButton className={styles.button} variant="primary" disabled={isPending}>
<SubmitButton
data-cy="button-submit"
className={styles.button}
variant="primary"
disabled={isPending}
>
{formatMessage(labels.login)}
</SubmitButton>
</FormButtons>

View file

@ -25,7 +25,7 @@ export function ProfileButton() {
return (
<PopupTrigger>
<Button variant="quiet">
<Button data-cy="button-profile" variant="quiet">
<Icon>
<Icons.Profile />
</Icon>
@ -41,7 +41,7 @@ export function ProfileButton() {
<Text>{formatMessage(labels.profile)}</Text>
</Item>
{!cloudMode && (
<Item key="logout" className={styles.item}>
<Item data-cy="item-logout" key="logout" className={styles.item}>
<Icon>
<Icons.Logout />
</Icon>

View file

@ -56,10 +56,10 @@ const schema = {
hostname: yup.string().matches(HOSTNAME_REGEX).max(100),
ip: yup.string().matches(IP_REGEX),
language: yup.string().max(35),
referrer: yup.string().max(500),
referrer: yup.string(),
screen: yup.string().max(11),
title: yup.string().max(500),
url: yup.string().max(500),
title: yup.string(),
url: yup.string(),
website: yup.string().uuid().required(),
name: yup.string().max(50),
})