diff --git a/frontend/scripts/check-frontend-boundaries.mjs b/frontend/scripts/check-frontend-boundaries.mjs index e619fa30..982a25b1 100644 --- a/frontend/scripts/check-frontend-boundaries.mjs +++ b/frontend/scripts/check-frontend-boundaries.mjs @@ -240,7 +240,7 @@ const ADOPTION_CEILINGS = [ }, { name: 'hand-rolled form-group blocks (F2: FormField/useForm)', - ceiling: 321, + ceiling: 253, include: (file) => file.startsWith('pages/') || file.startsWith('components/'), pattern: /form-group/g, }, diff --git a/frontend/src/components/DomainField.jsx b/frontend/src/components/DomainField.jsx index 1e992717..ac3c6a7a 100644 --- a/frontend/src/components/DomainField.jsx +++ b/frontend/src/components/DomainField.jsx @@ -44,7 +44,7 @@ function loadBases() { * record at this server (a tunnel route, an edge proxy). * * `onChange` receives the normalized hostname ('' while incomplete) and - * `{ mode, valid, base, label, dnsMode, https }` so the caller can pick the + * `{ mode, valid, empty, base, label, dnsMode, https }` so the caller can pick the * right API (give-subdomain vs create-domain) without re-deriving anything. */ export default function DomainField({ @@ -132,6 +132,7 @@ export default function DomainField({ const info = { mode: activeMode, valid: usable, + empty: !fqdn, base: activeMode === 'subdomain' ? base : null, label: activeMode === 'subdomain' ? label : null, dnsMode: activeMode === 'subdomain' ? baseRow?.dns_mode || null : null, diff --git a/frontend/src/components/ResourcePicker.jsx b/frontend/src/components/ResourcePicker.jsx index 20fd915c..708282c5 100644 --- a/frontend/src/components/ResourcePicker.jsx +++ b/frontend/src/components/ResourcePicker.jsx @@ -6,6 +6,7 @@ import { Button } from './ui/button'; import { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, } from './ui/command'; +import { useFieldProps } from './ui/field-context'; import { Popover, PopoverContent, PopoverTrigger } from './ui/popover'; import { useResourceOptions } from '../hooks/useResourceOptions'; import { normalizeResourceRef, resourceKey } from '../utils/resourceRefs'; @@ -34,6 +35,8 @@ export default function ResourcePicker({ id, }) { const { t } = useTranslation(); + // Inside a FormField the trigger reports required/invalid and points at the error. + const fieldProps = useFieldProps({ id }); const [open, setOpen] = useState(false); const [query, setQuery] = useState(''); const search = useResourceOptions({ @@ -108,7 +111,10 @@ export default function ResourcePicker({ }}> + {/* Create Queue Modal */} - setShowQueueModal(false)} title={t('app.queueOperations.createQueue', 'Create queue')}> -
-
- + + + -
-
- - setQueueForm({ ...queueForm, name: e.target.value })} required /> -
-
- - setQueueForm({ ...queueForm, description: e.target.value })} /> -
-
- -