mirror of
https://github.com/coder/coder.git
synced 2026-09-22 05:05:20 +08:00
fix(site): avoid showing disabled fields in group settings page (#9154)
Previously we allowed interaction with the icon setter and showed confusing help text under the disabled "Display Name" field.
This commit is contained in:
@@ -57,27 +57,33 @@ const UpdateGroupForm: FC<{
|
||||
autoFocus
|
||||
fullWidth
|
||||
label="Name"
|
||||
disabled={group.id === group.organization_id}
|
||||
/>
|
||||
<TextField
|
||||
{...getFieldHelpers(
|
||||
"display_name",
|
||||
"Optional: keep empty to default to the name.",
|
||||
)}
|
||||
onChange={onChangeTrimmed(form)}
|
||||
autoComplete="display_name"
|
||||
autoFocus
|
||||
fullWidth
|
||||
label="Display Name"
|
||||
disabled={isEveryoneGroup(group)}
|
||||
/>
|
||||
<LazyIconField
|
||||
{...getFieldHelpers("avatar_url")}
|
||||
onChange={onChangeTrimmed(form)}
|
||||
fullWidth
|
||||
label={t("form.fields.icon")}
|
||||
onPickEmoji={(value) => form.setFieldValue("avatar_url", value)}
|
||||
/>
|
||||
{isEveryoneGroup(group) ? (
|
||||
<></>
|
||||
) : (
|
||||
<>
|
||||
<TextField
|
||||
{...getFieldHelpers(
|
||||
"display_name",
|
||||
"Optional: keep empty to default to the name.",
|
||||
)}
|
||||
onChange={onChangeTrimmed(form)}
|
||||
autoComplete="display_name"
|
||||
autoFocus
|
||||
fullWidth
|
||||
label="Display Name"
|
||||
disabled={isEveryoneGroup(group)}
|
||||
/>
|
||||
<LazyIconField
|
||||
{...getFieldHelpers("avatar_url")}
|
||||
onChange={onChangeTrimmed(form)}
|
||||
fullWidth
|
||||
label={t("form.fields.icon")}
|
||||
onPickEmoji={(value) => form.setFieldValue("avatar_url", value)}
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
<TextField
|
||||
{...getFieldHelpers(
|
||||
"quota_allowance",
|
||||
|
||||
Reference in New Issue
Block a user