Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit1adc19b

Browse files
fix(site): allow user to update their name (#13493)
1 parent4dfa901 commit1adc19b

File tree

3 files changed

+10
-13
lines changed

3 files changed

+10
-13
lines changed

‎site/src/pages/UserSettingsPage/AccountPage/AccountForm.stories.tsx‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ export const Loading: Story = {
2626
isLoading:true,
2727
},
2828
};
29+
2930
exportconstWithError:Story={
3031
args:{
3132
updateProfileError:mockApiError({
@@ -42,3 +43,9 @@ export const WithError: Story = {
4243
},
4344
},
4445
};
46+
47+
exportconstEditable:Story={
48+
args:{
49+
editable:true,
50+
},
51+
};

‎site/src/pages/UserSettingsPage/AccountPage/AccountForm.test.tsx‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,6 @@ describe("AccountForm", () => {
6363
// Then
6464
constel=awaitscreen.findByLabelText("Username");
6565
expect(el).toBeDisabled();
66-
constbtn=awaitscreen.findByRole("button",{
67-
name:/Updateaccount/i,
68-
});
69-
expect(btn).toBeDisabled();
7066
});
7167
});
7268
});

‎site/src/pages/UserSettingsPage/AccountPage/AccountForm.tsx‎

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ export const Language = {
2121

2222
constvalidationSchema=Yup.object({
2323
username:nameValidator(Language.usernameLabel),
24+
name:Yup.string(),
2425
});
2526

2627
exportinterfaceAccountFormProps{
@@ -75,24 +76,17 @@ export const AccountForm: FC<AccountFormProps> = ({
7576
/>
7677
<TextField
7778
{...getFieldHelpers("name")}
79+
fullWidth
7880
onBlur={(e)=>{
7981
e.target.value=e.target.value.trim();
8082
form.handleChange(e);
8183
}}
82-
aria-disabled={!editable}
83-
disabled={!editable}
84-
fullWidth
8584
label={Language.nameLabel}
8685
helperText='The human-readable name is optional and can be accessed in a template via the "data.coder_workspace_owner.me.full_name" property.'
8786
/>
8887

8988
<div>
90-
<LoadingButton
91-
loading={isLoading}
92-
disabled={!editable}
93-
type="submit"
94-
variant="contained"
95-
>
89+
<LoadingButtonloading={isLoading}type="submit"variant="contained">
9690
{Language.updateSettings}
9791
</LoadingButton>
9892
</div>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp