FIX: use CheckboxGroup for admin badges form (#28239)

A recent change in FormKit has changed the syntax of this specific component. It's also better to use `<CheckboxGroup />` for this use case too.

Im mixed on writing tests for labels, it's a lot of tests to write for a rather low value.

This commit also slightly tweaks the width of the icon picker, from medium to small.
This commit is contained in:
Joffrey JAFFEUX 2024-08-06 10:45:09 +02:00 committed by GitHub
parent e145735c1d
commit ad8c5e7f80
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -83,6 +83,7 @@
@showTitle={{false}} @showTitle={{false}}
@name="icon" @name="icon"
@onSet={{this.onSetIcon}} @onSet={{this.onSetIcon}}
@format="small"
as |field| as |field|
> >
<field.Icon /> <field.Icon />
@ -248,44 +249,46 @@
</field.Menu> </field.Menu>
</form.Field> </form.Field>
<form.Field <form.CheckboxGroup as |group|>
@title={{i18n "admin.badges.allow_title_label"}} <group.Field
@showTitle={{false}} @title={{i18n "admin.badges.allow_title"}}
@name="allow_title" @showTitle={{false}}
as |field| @name="allow_title"
> as |field|
<field.Checkbox>{{i18n "admin.badges.allow_title"}}</field.Checkbox> >
</form.Field> <field.Checkbox />
</group.Field>
<form.Field <group.Field
@title={{i18n "admin.badges.multiple_grant_label"}} @title={{i18n "admin.badges.multiple_grant"}}
@showTitle={{false}} @showTitle={{false}}
@name="multiple_grant" @name="multiple_grant"
@disabled={{this.readOnly}} @disabled={{this.readOnly}}
as |field| as |field|
> >
<field.Checkbox>{{i18n "admin.badges.multiple_grant"}}</field.Checkbox> <field.Checkbox />
</form.Field> </group.Field>
<form.Field <group.Field
@title={{i18n "admin.badges.listable_label"}} @title={{i18n "admin.badges.listable"}}
@showTitle={{false}} @showTitle={{false}}
@name="listable" @name="listable"
@disabled={{this.readOnly}} @disabled={{this.readOnly}}
as |field| as |field|
> >
<field.Checkbox>{{i18n "admin.badges.listable"}}</field.Checkbox> <field.Checkbox />
</form.Field> </group.Field>
<form.Field <group.Field
@title={{i18n "admin.badges.show_posts_label"}} @title={{i18n "admin.badges.show_posts"}}
@showTitle={{false}} @showTitle={{false}}
@name="show_posts" @name="show_posts"
@disabled={{this.readOnly}} @disabled={{this.readOnly}}
as |field| as |field|
> >
<field.Checkbox>{{i18n "admin.badges.show_posts"}}</field.Checkbox> <field.Checkbox />
</form.Field> </group.Field>
</form.CheckboxGroup>
</form.Section> </form.Section>
<PluginOutlet <PluginOutlet