Skip to content

fix(site): avoid showing disabled fields in group settings page #9154

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 17, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix(site): avoid showing disabled fields in group settings page
Previously we allowed interaction with the icon setter and showed
confusing help text under the disabled "Display Name" field.
  • Loading branch information
ammario committed Aug 17, 2023
commit 8a2c0d1e8a58702d9b5e64f35733c4f68cee6642
44 changes: 25 additions & 19 deletions site/src/pages/GroupsPage/SettingsGroupPageView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down