Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d088bfb

Browse files
committed
fix(site): allow user to update their name
1 parent 1131772 commit d088bfb

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
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
export const WithError: Story = {
3031
args: {
3132
updateProfileError: mockApiError({
@@ -42,3 +43,9 @@ export const WithError: Story = {
4243
},
4344
},
4445
};
46+
47+
export const Editable: Story = {
48+
args: {
49+
editable: true,
50+
},
51+
};

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

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

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

2627
export interface AccountFormProps {
@@ -75,13 +76,11 @@ 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
/>

0 commit comments

Comments
 (0)