Skip to content
Merged
Show file tree
Hide file tree
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
18 changes: 6 additions & 12 deletions src/components/Form/BooleanField/BooleanFieldRadio.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,31 +49,25 @@ export const BooleanFieldRadio = ({

return (
<FieldGroup name={name}>
<Label>{label}</Label>
<FieldGroup.Row>
<Label>{label}</Label>
<FieldGroup.Description description={description} />
</FieldGroup.Row>
<RadioGroup
disabled={disabled || readOnly}
name={name}
value={stringifyBoolean(value)}
onValueChange={handleValueChange}
>
<FieldGroup.Description description={description} />
<FieldGroup.Row>
<RadioGroup.Item id={`${name}-true`} value="true" />
<Label
aria-disabled={disabled || readOnly}
className="text-muted-foreground font-normal"
htmlFor={`${name}-true`}
>
<Label aria-disabled={disabled || readOnly} className="text-muted-foreground" htmlFor={`${name}-true`}>
{options?.true ?? t('form.radioLabels.true')}
</Label>
</FieldGroup.Row>
<FieldGroup.Row>
<RadioGroup.Item id={`${name}-false`} value="false" />
<Label
aria-disabled={disabled || readOnly}
className="text-muted-foreground font-normal"
htmlFor={`${name}-false`}
>
<Label aria-disabled={disabled || readOnly} className="text-muted-foreground" htmlFor={`${name}-false`}>
{options?.false ?? t('form.radioLabels.false')}
</Label>
</FieldGroup.Row>
Expand Down
2 changes: 2 additions & 0 deletions src/components/Form/Form.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,14 @@ type SimpleExampleFormSchemaType = typeof $SimpleExampleFormData;

const booleanFields: FormFields<Pick<ExampleFormData, 'booleanCheck' | 'booleanRadio'>> = {
booleanRadio: {
description: 'This is a boolean radio field',
disabled: DISABLED,
kind: 'boolean',
label: 'Radio',
variant: 'radio'
},
booleanCheck: {
description: 'This is a boolean check field',
disabled: DISABLED,
kind: 'boolean',
label: 'Checkbox',
Expand Down
2 changes: 1 addition & 1 deletion src/providers/CoreProvider/DestructiveActionDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export const DestructiveActionDialog = () => {

return (
<Dialog open={current !== null} onOpenChange={handleOpenChange}>
<Dialog.Content onOpenAutoFocus={(event) => event.preventDefault()}>
<Dialog.Content data-testid="destructive-action-dialog" onOpenAutoFocus={(event) => event.preventDefault()}>
<Dialog.Header>
<Dialog.Title>{display.title}</Dialog.Title>
<Dialog.Description>{display.description}</Dialog.Description>
Expand Down