Merge pull request 'Hero-scherm: themagebonden Radio en Checkbox' (#20) from feature/hero-form-controls into master
Continuous Integration / config-sls (push) Successful in 7s
Continuous Integration / config-asf (push) Successful in 6s
Continuous Integration / changes (push) Successful in 10s
Continuous Integration / backend-build (push) Skipped
Continuous Integration / compile-sites (push) Skipped
Continuous Integration / backend-test (push) Skipped
Continuous Integration / vulnerability-scan (push) Skipped
Continuous Integration / frontend-prepare (push) Successful in 21s
Continuous Integration / frontend-build (push) Successful in 35s
Continuous Integration / frontend-lint (push) Successful in 38s
Continuous Integration / frontend-test (push) Successful in 2m20s
Continuous Integration / publish-sls-production (push) Skipped
Continuous Integration / deploy-sls-production (push) Skipped
Continuous Integration / publish-asf-test (push) Successful in 1m50s
Continuous Integration / publish-sls-test (push) Successful in 1m53s
Continuous Integration / deploy-sls-test (push) Successful in 49s
Continuous Integration / deploy-asf-test (push) Successful in 51s
Continuous Integration / smoke-sls-test (push) Successful in 12s
Continuous Integration / smoke-asf-test (push) Successful in 12s
Deploy (SCP) / deploy (push) Successful in 47s
Continuous Integration / config-sls (push) Successful in 7s
Continuous Integration / config-asf (push) Successful in 6s
Continuous Integration / changes (push) Successful in 10s
Continuous Integration / backend-build (push) Skipped
Continuous Integration / compile-sites (push) Skipped
Continuous Integration / backend-test (push) Skipped
Continuous Integration / vulnerability-scan (push) Skipped
Continuous Integration / frontend-prepare (push) Successful in 21s
Continuous Integration / frontend-build (push) Successful in 35s
Continuous Integration / frontend-lint (push) Successful in 38s
Continuous Integration / frontend-test (push) Successful in 2m20s
Continuous Integration / publish-sls-production (push) Skipped
Continuous Integration / deploy-sls-production (push) Skipped
Continuous Integration / publish-asf-test (push) Successful in 1m50s
Continuous Integration / publish-sls-test (push) Successful in 1m53s
Continuous Integration / deploy-sls-test (push) Successful in 49s
Continuous Integration / deploy-asf-test (push) Successful in 51s
Continuous Integration / smoke-sls-test (push) Successful in 12s
Continuous Integration / smoke-asf-test (push) Successful in 12s
Deploy (SCP) / deploy (push) Successful in 47s
This commit was merged in pull request #20.
This commit is contained in:
@@ -2,6 +2,8 @@ import { useRef, useState, type KeyboardEvent, type PointerEvent } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { Input } from '@/components/ui/input';
|
||||
import { CheckboxField } from '@/components/ui/checkbox';
|
||||
import { RadioField } from '@/components/ui/radio';
|
||||
import { Label } from '@/components/ui/label';
|
||||
import { Dialog, DialogContent, DialogHeader, DialogTitle } from '@/components/ui/dialog';
|
||||
import { mediaUrl } from '../lib/media';
|
||||
@@ -101,29 +103,24 @@ function FocusEditor({ image, onApply, onClose }: { image: HeroImageDto; onApply
|
||||
<fieldset className="flex flex-wrap gap-4">
|
||||
<legend className="sr-only">{t('hero.focus.targetLegend')}</legend>
|
||||
{(['general', 'wide', 'tall'] as const).map((value) => (
|
||||
<label key={value} className="flex items-center gap-2 text-sm">
|
||||
<input
|
||||
type="radio"
|
||||
name="focus-target"
|
||||
checked={target === value}
|
||||
onChange={() => setTarget(value)}
|
||||
data-testid={`focus-target-${value}`}
|
||||
/>
|
||||
{t(`hero.focus.target.${value}`)}
|
||||
</label>
|
||||
<RadioField
|
||||
key={value}
|
||||
name="focus-target"
|
||||
checked={target === value}
|
||||
onChange={() => setTarget(value)}
|
||||
data-testid={`focus-target-${value}`}
|
||||
label={t(`hero.focus.target.${value}`)}
|
||||
/>
|
||||
))}
|
||||
</fieldset>
|
||||
|
||||
{target !== 'general' && (
|
||||
<label className="flex items-center gap-2 text-sm">
|
||||
<input
|
||||
type="checkbox"
|
||||
checked={editable}
|
||||
onChange={(event) => toggleOverride(event.target.checked)}
|
||||
data-testid={`focus-override-${target}`}
|
||||
/>
|
||||
{t('hero.focus.override')}
|
||||
</label>
|
||||
<CheckboxField
|
||||
checked={editable}
|
||||
onChange={(event) => toggleOverride(event.target.checked)}
|
||||
data-testid={`focus-override-${target}`}
|
||||
label={t('hero.focus.override')}
|
||||
/>
|
||||
)}
|
||||
|
||||
<div className="grid gap-4 md:grid-cols-[2fr_1fr]">
|
||||
@@ -205,7 +202,7 @@ function FocusEditor({ image, onApply, onClose }: { image: HeroImageDto; onApply
|
||||
disabled={!editable}
|
||||
value={active.zoom}
|
||||
onChange={(event) => update({ ...active, zoom: Number(event.target.value) })}
|
||||
className="w-full"
|
||||
className="w-full accent-primary disabled:cursor-not-allowed disabled:opacity-50"
|
||||
data-testid="focus-zoom"
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -10,6 +10,8 @@ import { SortableContext, sortableKeyboardCoordinates, verticalListSortingStrate
|
||||
import { Badge } from '@/components/ui/badge';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { Input } from '@/components/ui/input';
|
||||
import { CheckboxField } from '@/components/ui/checkbox';
|
||||
import { RadioField } from '@/components/ui/radio';
|
||||
import { Label } from '@/components/ui/label';
|
||||
import { FieldError } from '@/components/ui/FieldError';
|
||||
import { FormErrorBanner } from '@/components/ui/FormErrorBanner';
|
||||
@@ -431,10 +433,7 @@ function HeroEditor({ hero }: { hero: HeroAdminDto }) {
|
||||
<legend className="text-sm font-medium">{t('hero.fields.display')}</legend>
|
||||
<div className="flex flex-wrap gap-4 text-sm">
|
||||
{(['single', 'slideshow'] as const).map((value) => (
|
||||
<label key={value} className="flex items-center gap-2">
|
||||
<input type="radio" value={value} data-testid={`hero-display-${value}`} {...register('display')} />
|
||||
{t(`hero.display.${value}`)}
|
||||
</label>
|
||||
<RadioField key={value} value={value} data-testid={`hero-display-${value}`} label={t(`hero.display.${value}`)} {...register('display')} />
|
||||
))}
|
||||
</div>
|
||||
</fieldset>
|
||||
@@ -548,10 +547,7 @@ function HeroEditor({ hero }: { hero: HeroAdminDto }) {
|
||||
<Input id={`hero-slide-${index}-alt`} maxLength={300} disabled={decorative} aria-describedby={`hero-slide-${index}-alt-hint`} data-testid={`hero-slide-${index}-alt`} {...register(`slides.${index}.alt` as const)} />
|
||||
<p id={`hero-slide-${index}-alt-hint`} className="text-xs text-muted-foreground">{t('hero.slides.altHint')}</p>
|
||||
<FieldError message={err(heroErrors.slides?.[index]?.alt?.message)} testId={`hero-slide-${index}-alt-error`} />
|
||||
<label className="flex items-center gap-2 text-sm">
|
||||
<input type="checkbox" className="size-4 rounded border-input" data-testid={`hero-slide-${index}-decorative`} {...register(`slides.${index}.decorative` as const)} />
|
||||
{t('hero.slides.decorative')}
|
||||
</label>
|
||||
<CheckboxField data-testid={`hero-slide-${index}-decorative`} label={t('hero.slides.decorative')} {...register(`slides.${index}.decorative` as const)} />
|
||||
</div>
|
||||
<div className="flex flex-wrap items-center gap-1">
|
||||
<SlideSwitch
|
||||
|
||||
Reference in New Issue
Block a user