mirror of
https://github.com/Tria-plc/emaui.git
synced 2026-08-26 19:12:50 +00:00
feat: replace vessel selection with text input for testing purposes in ConfigDrivenSection
This commit is contained in:
@@ -122,21 +122,33 @@ export function ConfigDrivenSection({
|
||||
onChange={(v) => onChange(field.key, v)}
|
||||
/>
|
||||
) : isVesselPicker ? (
|
||||
<Select
|
||||
// ponytail: swapped for a plain text input while testing —
|
||||
// vessels list is empty until the backend seed exists. Paste a
|
||||
// vessel id here to exercise the autofill; restore the Select
|
||||
// below once GET /vessels/mine returns real rows.
|
||||
// <Select
|
||||
// {...common}
|
||||
// placeholder="Select a registered vessel"
|
||||
// data={vessels.map((v) => ({ value: v.id, label: `${v.name} — ${v.registrationNumber}` }))}
|
||||
// value={(value as string) ?? null}
|
||||
// onChange={(v) => {
|
||||
// onChange(field.key, v);
|
||||
// const vessel = vessels.find((x) => x.id === v);
|
||||
// if (vessel) fillFromVessel(vessel, fields, onChange);
|
||||
// }}
|
||||
// searchable
|
||||
// clearable={!field.required}
|
||||
// />
|
||||
<TextInput
|
||||
{...common}
|
||||
placeholder="Select a registered vessel"
|
||||
data={vessels.map((v) => ({ value: v.id, label: `${v.name} — ${v.registrationNumber}` }))}
|
||||
value={(value as string) ?? null}
|
||||
onChange={(v) => {
|
||||
placeholder="Paste a vessel id (testing)"
|
||||
value={(value as string) ?? ''}
|
||||
onChange={(e) => {
|
||||
const v = e.currentTarget.value;
|
||||
onChange(field.key, v);
|
||||
const vessel = vessels.find((x) => x.id === v);
|
||||
// Selecting a different vessel replaces whatever the last
|
||||
// selection filled in — unlike the nationality/ID prefill,
|
||||
// this is a live user choice, not a one-time background fill.
|
||||
if (vessel) fillFromVessel(vessel, fields, onChange);
|
||||
}}
|
||||
searchable
|
||||
clearable={!field.required}
|
||||
/>
|
||||
) : field.type === 'SELECT' ? (
|
||||
<Select
|
||||
|
||||
Reference in New Issue
Block a user