oportunidades 4
tests / ci (push) Canceled after 0s

This commit is contained in:
2026-10-10 07:03:59 +02:00
parent e662230df7
commit 6ddafc95ba
179 changed files with 22750 additions and 933 deletions
+52 -26
View File
@@ -127,7 +127,10 @@ function Editor({
const form = useForm({
version: record.version,
payload: Object.fromEntries(
[...fields, 'country'].map((key) => [key, record.payload[key] ?? '']),
[...fields, 'country'].map((key) => [
key,
record.payload[key] ?? '',
]),
),
});
return (
@@ -146,33 +149,56 @@ function Editor({
}}
>
<div className="grid gap-4 md:grid-cols-2">
{record.payload.country && <p>País anteriormente registado: {record.payload.country}. Conservado sem atribuir automaticamente residência, constituição ou origem da solicitação.</p>}
{record.payload.country && (
<p>
País anteriormente registado: {record.payload.country}.
Conservado sem atribuir automaticamente residência,
constituição ou origem da solicitação.
</p>
)}
{fields.map((key) => (
<Field key={key} label={labels[key]}>
{key.endsWith('_country_code') ? <CountrySelect id={key + (record.id ?? 'account')} countries={countries} value={form.data.payload[key]} onChange={(value) => form.setData('payload', { ...form.data.payload, [key]: value })} /> :
<input
className={input}
value={form.data.payload[key]}
required={
isCompany &&
['name', 'country', 'role'].includes(key)
}
maxLength={
key === 'description' || key === 'experience'
? 2000
: key === 'investment_capacity'
? 1000
: 200
}
onChange={(e) =>
form.setData('payload', {
...form.data.payload,
[key]: e.target.value,
})
}
/>
}
{form.errors[`payload.${key}`] && <p role="alert" className="text-red-700">{form.errors[`payload.${key}`]}</p>}
{key.endsWith('_country_code') ? (
<CountrySelect
id={key + (record.id ?? 'account')}
countries={countries}
value={form.data.payload[key]}
onChange={(value) =>
form.setData('payload', {
...form.data.payload,
[key]: value,
})
}
/>
) : (
<input
className={input}
value={form.data.payload[key]}
required={
isCompany &&
['name', 'country', 'role'].includes(key)
}
maxLength={
key === 'description' ||
key === 'experience'
? 2000
: key === 'investment_capacity'
? 1000
: 200
}
onChange={(e) =>
form.setData('payload', {
...form.data.payload,
[key]: e.target.value,
})
}
/>
)}
{form.errors[`payload.${key}`] && (
<p role="alert" className="text-red-700">
{form.errors[`payload.${key}`]}
</p>
)}
</Field>
))}
</div>