File tree 5 files changed +2
-19
lines changed
components/PreferencesAccountForm
pages/PreferencesPages/AccountPage
5 files changed +2
-19
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,6 @@ export interface UserResponse {
15
15
readonly username : string
16
16
readonly email : string
17
17
readonly created_at : string
18
- readonly name : string
19
18
}
20
19
21
20
/**
@@ -100,5 +99,4 @@ export interface WorkspaceAutostopRequest {
100
99
export interface UpdateProfileRequest {
101
100
readonly username : string
102
101
readonly email : string
103
- readonly name : string
104
102
}
Original file line number Diff line number Diff line change @@ -8,13 +8,11 @@ import { LoadingButton } from "../LoadingButton/LoadingButton"
8
8
import { Stack } from "../Stack/Stack"
9
9
10
10
interface AccountFormValues {
11
- name : string
12
11
email : string
13
12
username : string
14
13
}
15
14
16
15
export const Language = {
17
- nameLabel : "Name" ,
18
16
usernameLabel : "Username" ,
19
17
emailLabel : "Email" ,
20
18
emailInvalid : "Please enter a valid email address." ,
@@ -24,7 +22,6 @@ export const Language = {
24
22
25
23
const validationSchema = Yup . object ( {
26
24
email : Yup . string ( ) . trim ( ) . email ( Language . emailInvalid ) . required ( Language . emailRequired ) ,
27
- name : Yup . string ( ) . optional ( ) ,
28
25
username : Yup . string ( ) . trim ( ) ,
29
26
} )
30
27
@@ -55,14 +52,6 @@ export const AccountForm: React.FC<AccountFormProps> = ({
55
52
< >
56
53
< form onSubmit = { form . handleSubmit } >
57
54
< Stack >
58
- < TextField
59
- { ...getFieldHelpers ( "name" ) }
60
- autoFocus
61
- autoComplete = "name"
62
- fullWidth
63
- label = { Language . nameLabel }
64
- variant = "outlined"
65
- />
66
55
< TextField
67
56
{ ...getFieldHelpers ( "email" ) }
68
57
onChange = { onChangeTrimmed ( form ) }
Original file line number Diff line number Diff line change @@ -17,14 +17,12 @@ const renderPage = () => {
17
17
}
18
18
19
19
const newData = {
20
- name : "User" ,
21
20
email : "user@coder.com" ,
22
21
username : "user" ,
23
22
}
24
23
25
24
const fillAndSubmitForm = async ( ) => {
26
- await waitFor ( ( ) => screen . findByLabelText ( "Name" ) )
27
- fireEvent . change ( screen . getByLabelText ( "Name" ) , { target : { value : newData . name } } )
25
+ await waitFor ( ( ) => screen . findByLabelText ( "Email" ) )
28
26
fireEvent . change ( screen . getByLabelText ( "Email" ) , { target : { value : newData . email } } )
29
27
fireEvent . change ( screen . getByLabelText ( "Username" ) , { target : { value : newData . username } } )
30
28
fireEvent . click ( screen . getByText ( AccountForm . Language . updatePreferences ) )
Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ export const AccountPage: React.FC = () => {
30
30
error = { hasUnknownError ? Language . unknownError : undefined }
31
31
formErrors = { formErrors }
32
32
isLoading = { authState . matches ( "signedIn.profile.updatingProfile" ) }
33
- initialValues = { { name : me . name , username : me . username , email : me . email } }
33
+ initialValues = { { username : me . username , email : me . email } }
34
34
onSubmit = { ( data ) => {
35
35
authSend ( {
36
36
type : "UPDATE_PROFILE" ,
Original file line number Diff line number Diff line change @@ -21,7 +21,6 @@ export const MockBuildInfo: BuildInfoResponse = {
21
21
}
22
22
23
23
export const MockUser : UserResponse = {
24
- name : "Test User" ,
25
24
id : "test-user" ,
26
25
username : "TestUser" ,
27
26
email : "test@coder.com" ,
@@ -30,7 +29,6 @@ export const MockUser: UserResponse = {
30
29
31
30
export const MockUser2 : UserResponse = {
32
31
id : "test-user-2" ,
33
- name : "Test User 2" ,
34
32
username : "TestUser2" ,
35
33
email : "test2@coder.com" ,
36
34
created_at : "" ,
You can’t perform that action at this time.
0 commit comments