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

This commit is contained in:
2026-10-09 15:00:37 +02:00
parent 9d6176f55b
commit e662230df7
32 changed files with 865 additions and 37 deletions
+279
View File
@@ -0,0 +1,279 @@
# ISO 3166 alpha-2 country codes
#
# This file is in the public domain, so clarified as of
# 2009-05-17 by Arthur David Olson.
#
# From Paul Eggert (2025-07-01):
# This file contains a table of two-letter country codes. Columns are
# separated by a single tab. Lines beginning with ‘#’ are comments.
# All text uses UTF-8 encoding. The columns of the table are as follows:
#
# 1. ISO 3166-1 alpha-2 country code, current as of
# ISO/TC 46 N1127 (2024-02-29). See: ISO/TC 46 Documents
# https://www.iso.org/committee/48750.html?view=documents
# 2. The usual English name for the coded region. This sometimes
# departs from ISO-listed names, sometimes so that sorted subsets
# of names are useful (e.g., “Samoa (American)” and “Samoa
# (western)” rather than “American Samoa” and “Samoa”),
# sometimes to avoid confusion among non-experts (e.g.,
# “Czech Republic” and “Turkey” rather than “Czechia” and “Türkiye”),
# and sometimes to omit needless detail or churn (e.g., “Netherlands”
# rather than “Netherlands (the)” or “Netherlands (Kingdom of the)”).
#
# The table is sorted by country code.
#
# This table is intended as an aid for users, to help them select time
# zone data appropriate for their practical needs. It is not intended
# to take or endorse any position on legal or territorial claims.
#
#country-
#code name of country, territory, area, or subdivision
AD Andorra
AE United Arab Emirates
AF Afghanistan
AG Antigua & Barbuda
AI Anguilla
AL Albania
AM Armenia
AO Angola
AQ Antarctica
AR Argentina
AS Samoa (American)
AT Austria
AU Australia
AW Aruba
AX Åland Islands
AZ Azerbaijan
BA Bosnia & Herzegovina
BB Barbados
BD Bangladesh
BE Belgium
BF Burkina Faso
BG Bulgaria
BH Bahrain
BI Burundi
BJ Benin
BL St Barthelemy
BM Bermuda
BN Brunei
BO Bolivia
BQ Caribbean NL
BR Brazil
BS Bahamas
BT Bhutan
BV Bouvet Island
BW Botswana
BY Belarus
BZ Belize
CA Canada
CC Cocos (Keeling) Islands
CD Congo (Dem. Rep.)
CF Central African Rep.
CG Congo (Rep.)
CH Switzerland
CI Côte d’Ivoire
CK Cook Islands
CL Chile
CM Cameroon
CN China
CO Colombia
CR Costa Rica
CU Cuba
CV Cape Verde
CW Curaçao
CX Christmas Island
CY Cyprus
CZ Czech Republic
DE Germany
DJ Djibouti
DK Denmark
DM Dominica
DO Dominican Republic
DZ Algeria
EC Ecuador
EE Estonia
EG Egypt
EH Western Sahara
ER Eritrea
ES Spain
ET Ethiopia
FI Finland
FJ Fiji
FK Falkland Islands
FM Micronesia
FO Faroe Islands
FR France
GA Gabon
GB Britain (UK)
GD Grenada
GE Georgia
GF French Guiana
GG Guernsey
GH Ghana
GI Gibraltar
GL Greenland
GM Gambia
GN Guinea
GP Guadeloupe
GQ Equatorial Guinea
GR Greece
GS South Georgia & the South Sandwich Islands
GT Guatemala
GU Guam
GW Guinea-Bissau
GY Guyana
HK Hong Kong
HM Heard Island & McDonald Islands
HN Honduras
HR Croatia
HT Haiti
HU Hungary
ID Indonesia
IE Ireland
IL Israel
IM Isle of Man
IN India
IO British Indian Ocean Territory
IQ Iraq
IR Iran
IS Iceland
IT Italy
JE Jersey
JM Jamaica
JO Jordan
JP Japan
KE Kenya
KG Kyrgyzstan
KH Cambodia
KI Kiribati
KM Comoros
KN St Kitts & Nevis
KP Korea (North)
KR Korea (South)
KW Kuwait
KY Cayman Islands
KZ Kazakhstan
LA Laos
LB Lebanon
LC St Lucia
LI Liechtenstein
LK Sri Lanka
LR Liberia
LS Lesotho
LT Lithuania
LU Luxembourg
LV Latvia
LY Libya
MA Morocco
MC Monaco
MD Moldova
ME Montenegro
MF St Martin (French)
MG Madagascar
MH Marshall Islands
MK North Macedonia
ML Mali
MM Myanmar (Burma)
MN Mongolia
MO Macau
MP Northern Mariana Islands
MQ Martinique
MR Mauritania
MS Montserrat
MT Malta
MU Mauritius
MV Maldives
MW Malawi
MX Mexico
MY Malaysia
MZ Mozambique
NA Namibia
NC New Caledonia
NE Niger
NF Norfolk Island
NG Nigeria
NI Nicaragua
NL Netherlands
NO Norway
NP Nepal
NR Nauru
NU Niue
NZ New Zealand
OM Oman
PA Panama
PE Peru
PF French Polynesia
PG Papua New Guinea
PH Philippines
PK Pakistan
PL Poland
PM St Pierre & Miquelon
PN Pitcairn
PR Puerto Rico
PS Palestine
PT Portugal
PW Palau
PY Paraguay
QA Qatar
RE Réunion
RO Romania
RS Serbia
RU Russia
RW Rwanda
SA Saudi Arabia
SB Solomon Islands
SC Seychelles
SD Sudan
SE Sweden
SG Singapore
SH St Helena
SI Slovenia
SJ Svalbard & Jan Mayen
SK Slovakia
SL Sierra Leone
SM San Marino
SN Senegal
SO Somalia
SR Suriname
SS South Sudan
ST Sao Tome & Principe
SV El Salvador
SX St Maarten (Dutch)
SY Syria
SZ Eswatini (Swaziland)
TC Turks & Caicos Is
TD Chad
TF French S. Terr.
TG Togo
TH Thailand
TJ Tajikistan
TK Tokelau
TL East Timor
TM Turkmenistan
TN Tunisia
TO Tonga
TR Turkey
TT Trinidad & Tobago
TV Tuvalu
TW Taiwan
TZ Tanzania
UA Ukraine
UG Uganda
UM US minor outlying islands
US United States
UY Uruguay
UZ Uzbekistan
VA Vatican City
VC St Vincent
VE Venezuela
VG Virgin Islands (UK)
VI Virgin Islands (US)
VN Vietnam
VU Vanuatu
WF Wallis & Futuna
WS Samoa (western)
YE Yemen
YT Mayotte
ZA South Africa
ZM Zambia
ZW Zimbabwe
@@ -0,0 +1,20 @@
import { useState } from 'react';
export type Country = { code: string; name: string; name_en: string };
export default function CountrySelect({ countries, value, onChange, id, disabled = false }: {
countries: Country[]; value: string; onChange: (value: string) => void; id: string; disabled?: boolean;
}) {
const [search, setSearch] = useState('');
const matches = countries.filter((country) => country.code === value ||
`${country.name} ${country.name_en} ${country.code}`.normalize('NFD').replace(/\p{Diacritic}/gu, '').toLowerCase()
.includes(search.normalize('NFD').replace(/\p{Diacritic}/gu, '').toLowerCase()));
return <div className="space-y-2">
<input disabled={disabled} className="w-full rounded border p-2" aria-label="Pesquisar país" value={search} onChange={(event) => setSearch(event.target.value)} placeholder="Pesquisar nome ou código do país" />
<select disabled={disabled} id={id} className="w-full rounded border p-2" value={value} onChange={(event) => onChange(event.target.value)}>
<option value="">Não informado</option>
{matches.map((country) => <option key={country.code} value={country.code}>{country.name} ({country.code})</option>)}
</select>
{matches.length === 0 && <p role="status">Nenhum país corresponde à pesquisa.</p>}
</div>;
}
@@ -19,7 +19,7 @@ const emptyTerritoryPath: TerritoryOption[] = [];
export function ProvinceSelect({
value,
onChange,
endpoint = '/api/v1/catalogs/jurisdictions',
endpoint = '/api/v1/investment/territory-options',
placeholder = 'Seleccione uma província',
className = control,
label = 'Província',
@@ -107,7 +107,7 @@ export function ProvinceSelect({
export function TerritoryFields({
initial = emptyTerritoryPath,
onChange,
endpoint = '/api/v1/catalogs/jurisdictions',
endpoint = '/api/v1/investment/territory-options',
}: {
initial?: TerritoryOption[];
onChange?: (path: TerritoryOption[]) => void;
@@ -174,7 +174,9 @@ export function TerritoryLevel({
const [error, setError] = useState('');
const [loading, setLoading] = useState(false);
const [retry, setRetry] = useState(0);
const [search, setSearch] = useState('');
const enabled = index === 0 || Boolean(parent);
useEffect(() => { setPage(1); setSearch(''); }, [parent, index]);
useEffect(() => {
setOptions([]);
setMore(false);
@@ -189,6 +191,7 @@ export function TerritoryLevel({
type: levels[index],
parent_id: parent,
page: String(page),
q: search,
});
const response = await fetch(`${endpoint}?${params}`, {
signal: controller.signal,
@@ -215,12 +218,13 @@ export function TerritoryLevel({
clearTimeout(timer);
controller.abort();
};
}, [index, parent, page, enabled, endpoint, retry]);
}, [index, parent, page, enabled, endpoint, retry, search]);
return (
<div className="space-y-2">
<label htmlFor={id} className="font-medium">
{labels[index]}
</label>
<input className={control} aria-label={`Pesquisar ${labels[index]}`} disabled={!enabled} maxLength={100} value={search} onChange={(event) => { setSearch(event.target.value); setPage(1); }} placeholder={`Pesquisar ${labels[index].toLowerCase()}`} />
<select
id={id}
aria-invalid={Boolean(fieldError)}
+82 -1
View File
@@ -8,15 +8,28 @@ export default function Leads({
leads,
filters,
owners,
originStatistics,
countries,
}: {
leads: Paginated<Lead>;
filters: { q?: string; status?: string; owner_user_id?: number };
filters: {
q?: string;
status?: string;
owner_user_id?: number;
origin?: string;
};
owners: Owner[];
countries: { code: string; name: string }[];
originStatistics: {
interests: { code: string | null; name: string; count: number }[];
desk: { code: string | null; name: string; count: number }[];
};
}) {
const form = useForm({
q: filters.q ?? '',
status: filters.status ?? '',
owner_user_id: String(filters.owner_user_id ?? ''),
origin: filters.origin ?? '',
});
return (
<Management title="CRM — Leads">
@@ -31,6 +44,74 @@ export default function Leads({
Acompanhamento do investidor — pedidos, tarefas e respostas do
Balcão
</Link>
<details
open={Boolean(filters.origin)}
className="rounded border p-3"
>
<summary>Solicitações por origem declarada</summary>
<p>
Conta pedidos por origem declarada, sem inferir
nacionalidade. Manifestações e pedidos do Balcão são
conjuntos separados; não representam uma contagem de
investidores únicos.
</p>
<form
className="my-3 flex flex-wrap gap-3"
onSubmit={(e) => {
e.preventDefault();
form.get('/management/crm/leads', {
preserveState: false,
});
}}
>
<label className="max-w-full">
Origem das estatísticas
<select
aria-label="Origem das estatísticas"
className={`${control} max-w-full`}
value={form.data.origin}
onChange={(e) =>
form.setData('origin', e.target.value)
}
>
<option value="">Todas as origens</option>
<option value="unknown">Não informado</option>
{countries.map((country) => (
<option key={country.code} value={country.code}>
{country.name}
</option>
))}
</select>
</label>
<button className={button} disabled={form.processing}>
Filtrar estatísticas
</button>
</form>
<p className="text-sm">
Este filtro aplica-se apenas às contagens de solicitações. A
lista de leads mantém os filtros abaixo.
</p>
{(['interests', 'desk'] as const).map((group) => (
<section key={group}>
<h2>
{group === 'interests'
? 'Manifestações recebidas'
: 'Pedidos do Balcão em acompanhamento'}
</h2>
{originStatistics[group].length ? (
<ul>
{originStatistics[group].map((row) => (
<li key={row.code ?? 'unknown'}>
{row.name}: {row.count}
</li>
))}
</ul>
) : (
<p>Sem pedidos neste conjunto.</p>
)}
</section>
))}
</details>
<form
className="flex flex-wrap gap-3"
onSubmit={(e) => {
+10 -1
View File
@@ -1,5 +1,5 @@
import { Link, useForm, usePage } from '@inertiajs/react';
import { useRef, useState } from 'react';
import { useEffect, useRef, useState } from 'react';
import { Frame, input, button, card } from '@/pages/investment/shared';
type Option = {
id: string;
@@ -66,6 +66,14 @@ export default function Panel({
organization_id: ['Organização representada', organizations],
journey_id: ['Percurso territorial existente', journeys],
} as const;
const derivedTitle = useRef('');
const contextTitle = journeys.find((item) => item.id === form.data.journey_id)?.name ?? submissions.find((item) => item.id === form.data.submission_id)?.name ?? companies.find((item) => item.id === form.data.company_id)?.name ?? '';
useEffect(() => {
if ((!form.data.title || form.data.title === derivedTitle.current) && contextTitle) {
form.setData('title', contextTitle.slice(0, 200));
derivedTitle.current = contextTitle.slice(0, 200);
}
}, [contextTitle, form.data.title]);
return (
<Frame title="Balcão Virtual — acompanhamento">
<nav className="flex flex-wrap gap-4">
@@ -102,6 +110,7 @@ export default function Panel({
</section>
<details className={card}>
<summary>Preparar acompanhamento de um projecto</summary>
<p>Selecione um percurso ou investimento da sua conta. O título é recuperado do registo existente quando disponível; pode corrigi-lo antes de guardar. A associação requer a sua autorização abaixo.</p>
<form
className="mt-4 space-y-3"
onSubmit={(e) => {
+7
View File
@@ -1,5 +1,6 @@
import { Link, useForm } from '@inertiajs/react';
import { Frame, card, input, button } from '@/pages/investment/shared';
import CountrySelect, { type Country } from '@/components/country-select';
import {
DocumentReview,
RequestOperations,
@@ -32,6 +33,7 @@ export default function RequestPage({
documents,
payments,
caseVersion,
countries,
}: {
request: {
id: string;
@@ -73,6 +75,7 @@ export default function RequestPage({
documents: DeskDocument[];
payments: DeskPayment[];
caseVersion: number;
countries: Country[];
events: {
id: string;
action: string;
@@ -165,6 +168,10 @@ export default function RequestPage({
form.put(`/balcao-virtual/pedidos/${request.id}`);
}}
>
<label className="block" htmlFor="declared-origin-country">País de origem declarado desta solicitação</label>
<CountrySelect id="declared-origin-country" countries={countries} value={form.data.payload.declared_origin_country_code ?? ''} disabled={!canEdit || form.processing || (request.status === 'returned' && !request.editable_fields.includes('declared_origin_country_code'))} onChange={(value) => form.setData('payload', { ...form.data.payload, declared_origin_country_code: value })} />
<p>A origem não é deduzida do IP nem do país de residência. Pedidos antigos sem declaração mantêm “não informado”.</p>
{form.errors['payload.declared_origin_country_code'] && <p role="alert">{form.errors['payload.declared_origin_country_code']}</p>}
{Object.entries(definition.fields)
.filter(
([, f]) =>
+12 -2
View File
@@ -98,6 +98,7 @@ export default function Catalogue({
{ id: number; title: string; location: string; url: string }[]
>([]);
const [truncated, setTruncated] = useState(false);
const [mapContext, setMapContext] = useState<{ id: string; title: string; kind: string; url: string }[]>([]);
const [error, setError] = useState('');
const [suggestions, setSuggestions] = useState<
{ title: string; slug: string }[]
@@ -152,6 +153,7 @@ export default function Catalogue({
setPoints(null);
setAreas([]);
setUnlocated([]);
setMapContext([]);
setTruncated(false);
setError('');
api(`/api/v1/investment/map?${params}`)
@@ -160,6 +162,7 @@ export default function Catalogue({
setPoints(data.features);
setAreas(data.areas ?? []);
setUnlocated(data.unlocated ?? []);
setMapContext(data.territorial_context ?? []);
setTruncated(Boolean(data.truncated));
}
})
@@ -227,6 +230,7 @@ export default function Catalogue({
const dimensionUrl = (dimension: string) => {
const params = new URLSearchParams(query());
params.set('dimension', dimension);
['cluster_id', 'corridor_id', 'zee_id', 'zfi_id', 'park_id', 'project_id'].forEach((key) => params.delete(key));
params.delete('page');
return `${catalogueUrl}?${params}`;
};
@@ -329,7 +333,7 @@ export default function Catalogue({
index={index}
parent={territoryPath[index - 1]?.id ?? ''}
selected={territoryPath[index]}
endpoint="/api/v1/catalogs/jurisdictions"
endpoint="/api/v1/investment/territory-options"
onChange={(value) => {
const path = [
...territoryPath.slice(0, index),
@@ -387,7 +391,7 @@ export default function Catalogue({
['zfi_id', 'zfi', 'ZFI'],
['park_id', 'industrial_park', 'Parque industrial'],
] as const
).map(([field, category, label]) => (
).filter(([field]) => !form.data.dimension || field === `${form.data.dimension}_id` || !!form.data[field]).map(([field, category, label]) => (
<Field key={field} label={label}>
<select
className={input}
@@ -425,6 +429,7 @@ export default function Catalogue({
'Projecto âncora',
] as const
)[index];
if (form.data.dimension && key !== `${form.data.dimension}_id` && !form.data[key]) return null;
return (
<Field key={group} label={label}>
<select
@@ -1086,6 +1091,11 @@ export default function Catalogue({
</div>
{error && <p role="alert">{error}</p>}
{!error && <Map points={points} areas={areas} />}
{['map', 'combined'].includes(view) && !error && mapContext.length > 0 && <section className={card} aria-label="Estruturas territoriais consultáveis">
<h2 className="text-xl font-bold">Estruturas territoriais e projetos</h2>
<p>Estas fichas continuam consultáveis independentemente de terem coordenadas. A lista não atribui implantação às oportunidades nem cria pontos no mapa. Até 30 fichas por conjunto; refine a localização para pesquisar.</p>
<ul>{mapContext.map((record) => <li key={record.id}><Link className="underline" href={record.url}>{record.kind}: {record.title}</Link></li>)}</ul>
</section>}
{truncated && (
<p role="alert">
O mapa atingiu o limite de 1.000 registos; refine os
+19 -5
View File
@@ -1,12 +1,15 @@
import { Link, router, useForm } from '@inertiajs/react';
import { Frame, Field, input, button, card } from './shared';
import PartnershipSourceLinks from '@/components/partnership-source-links';
import CountrySelect, { type Country } from '@/components/country-select';
type RecordData = { version: number; payload: Record<string, string> };
type Company = RecordData & { id: string };
const labels: Record<string, string> = {
phone: 'Telefone',
country: 'País',
country: 'País anteriormente registado',
residence_country_code: 'País de residência do investidor',
incorporation_country_code: 'País de constituição da entidade',
sector: 'Sector de interesse',
experience: 'Experiência relevante',
investment_capacity: 'Capacidade de investimento declarada',
@@ -19,9 +22,11 @@ const labels: Record<string, string> = {
export default function Profile({
account,
companies,
countries,
}: {
account: RecordData;
companies: Company[];
countries: Country[];
}) {
return (
<Frame title="Perfil de investimento e empresas">
@@ -39,9 +44,10 @@ export default function Profile({
<Editor
key={'account-' + account.version}
record={account}
countries={countries}
fields={[
'phone',
'country',
'residence_country_code',
'sector',
'experience',
'investment_capacity',
@@ -62,9 +68,10 @@ export default function Profile({
<Editor
key={company.version}
record={company}
countries={countries}
fields={[
'name',
'country',
'incorporation_country_code',
'registration',
'sector',
'role',
@@ -90,9 +97,10 @@ export default function Profile({
key={'new-' + companies.length}
record={{ version: 0, payload: {} }}
company
countries={countries}
fields={[
'name',
'country',
'incorporation_country_code',
'registration',
'sector',
'role',
@@ -108,16 +116,18 @@ function Editor({
record,
fields,
company = false,
countries,
}: {
record: RecordData & { id?: string };
fields: string[];
company?: boolean;
countries: Country[];
}) {
const isCompany = company || !!record.id;
const form = useForm({
version: record.version,
payload: Object.fromEntries(
fields.map((key) => [key, record.payload[key] ?? '']),
[...fields, 'country'].map((key) => [key, record.payload[key] ?? '']),
),
});
return (
@@ -136,8 +146,10 @@ 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>}
{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]}
@@ -159,6 +171,8 @@ function Editor({
})
}
/>
}
{form.errors[`payload.${key}`] && <p role="alert" className="text-red-700">{form.errors[`payload.${key}`]}</p>}
</Field>
))}
</div>
+15 -1
View File
@@ -4,11 +4,15 @@ import { Frame, Field, input, button, card } from './shared';
import type { References } from './shared';
import { Conversation } from './conversation';
import type { Message } from './conversation';
import CountrySelect, { type Country } from '@/components/country-select';
type Payload = {
full_name: string;
email: string;
phone: string;
country: string;
residence_country_code: string;
incorporation_country_code: string;
declared_origin_country_code: string;
organisation: string;
representative_role: string;
experience: string;
@@ -51,6 +55,7 @@ type Need = {
};
};
type Props = {
countries: Country[];
zone_origin?: {
zone_id: string;
zone_version: number;
@@ -119,12 +124,16 @@ function Editor({
revisions,
step,
setStep,
countries,
}: Props & { step: number; setStep: (step: number) => void }) {
const initial: Payload = {
full_name: '',
email: '',
phone: '',
country: '',
residence_country_code: '',
incorporation_country_code: '',
declared_origin_country_code: '',
organisation: '',
representative_role: '',
experience: '',
@@ -349,7 +358,12 @@ function Editor({
{text('full_name', 'Nome completo', true)}
{text('email', 'Email', true, 'email')}
{text('phone', 'Telefone')}
{text('country', 'País', true)}
{form.data.payload.country && <p>País anteriormente registado: {form.data.payload.country}. Não foi convertido em residência, constituição ou origem.</p>}
{(['residence_country_code', 'incorporation_country_code', 'declared_origin_country_code'] as const).map((key) => <Field key={key} label={{ residence_country_code: 'País de residência', incorporation_country_code: 'País de constituição da entidade', declared_origin_country_code: 'País de origem declarado desta solicitação' }[key]}>
<CountrySelect disabled={readonly} id={key} countries={countries} value={form.data.payload[key] ?? ''} onChange={(value) => form.setData('payload', { ...form.data.payload, [key]: value })} />
{form.errors[`payload.${key}`] && <p role="alert">{form.errors[`payload.${key}`]}</p>}
</Field>)}
<p>A origem da solicitação é uma declaração sua; não é deduzida da residência, da entidade ou do endereço IP.</p>
{option(
'profile_id',
'investor_profile',
@@ -10,6 +10,7 @@ export default function Install({
backupDate,
rollback,
actionUrl = "/management/opportunity-management-install",
imageProcessingAvailable,
}: {
installed: boolean;
ready: boolean;
@@ -20,6 +21,7 @@ export default function Install({
backupDate: string | null;
rollback: string;
actionUrl?: string;
imageProcessingAvailable?: boolean;
}) {
const form = useForm({ hash, confirm: false });
return (
@@ -34,6 +36,10 @@ export default function Install({
))}
</ul>
<p>Migração: {migration}</p>
{imageProcessingAvailable !== undefined && <section className="rounded border border-amber-500 p-3" aria-label="Limitações dos anexos">
<p>{imageProcessingAvailable ? 'GD/WebP disponível neste servidor; o processamento continua a exigir scan concluído do original.' : 'GD/WebP indisponível neste servidor: guardar imagens é possível; gerar miniaturas permanece pendente.'}</p>
<p>Instalar recursos não confirma scans. Documentos e imagens com scan pendente ficam sem download ou pré-visualização; preparação de rascunhos e localizações continua disponível. ClamD real mantém uma pendência separada.</p>
</section>}
<p>Backup/restauro: {backupDate ?? "Prova ainda por preparar"}</p>
<p>{rollback}</p>
<p>
@@ -129,6 +129,7 @@ export default function OpportunityResources({
resources,
existingLocations,
assessment,
imageProcessingAvailable,
}: {
opportunity: {
id: number;
@@ -140,6 +141,7 @@ export default function OpportunityResources({
resources: Record<Kind, Resource[]>;
existingLocations: { id: string; name: string; location_type: string }[];
assessment: string[];
imageProcessingAvailable: boolean;
}) {
const [kind, setKind] = useState<Kind>("locations");
const [editing, setEditing] = useState<Resource | null>(null);
@@ -281,6 +283,8 @@ export default function OpportunityResources({
"Guardar é independente de validar, submeter e publicar."}
{errors.etag && <p>{errors.etag}</p>}
</div>
{kind === 'images' && !imageProcessingAvailable && <p role="status" className="rounded border border-amber-500 p-3">Processamento de imagens indisponível: GD/WebP não está carregado no servidor. Pode guardar o original e os metadados; miniaturas e imagens para divulgação ficam pendentes.</p>}
{kind !== 'locations' && <p className="rounded border p-3">Pode guardar anexos para preparação. Cada ficheiro permanece sem download ou pré-visualização enquanto o seu scan não estiver concluído. ClamD pendente não impede guardar metadados, locais ou rascunhos; testes com scanner simulado não verificam os seus ficheiros.</p>}
<section>
<h2>Conferência e pendências</h2>
<ul>
@@ -610,7 +614,7 @@ export default function OpportunityResources({
<button
type="button"
className={button}
disabled={busy || unavailable}
disabled={busy || unavailable || !imageProcessingAvailable}
onClick={() => void execute("prepare")}
>
Preparar WebP e miniaturas