fix: harmonizar pesquisa e navegacao dos catalogos em QA

This commit is contained in:
2026-10-20 18:53:41 +02:00
parent 1350b4df73
commit fd341b627e
34 changed files with 2311 additions and 1310 deletions
@@ -24,7 +24,9 @@ export default function InvestmentMapPanel({
useEffect(() => {
const controller = new AbortController();
const params = new URLSearchParams(JSON.parse(key));
setPoints(null); setError(''); setMissing([]);
setPoints(null);
setError('');
setMissing([]);
setAreas([]);
fetch(`/api/v1/investment/map?${params}`, {
signal: controller.signal,
@@ -46,13 +48,21 @@ export default function InvestmentMapPanel({
);
})
.catch(() => {
if (!controller.signal.aborted) setError('Não foi possível concluir a pesquisa.');
if (!controller.signal.aborted)
setError('Não foi possível concluir a pesquisa.');
});
return () => controller.abort();
}, [key, retry]);
return (
<section className="space-y-3">
<SearchState loading={points === null && !error} error={error} total={(points?.length ?? 0) + missing.length} retry={() => setRetry(value => value + 1)} />
<SearchState
scope="Registos consultados pelo mapa"
countLabel="registos, incluindo os que não têm coordenadas"
loading={points === null && !error}
error={error}
total={(points?.length ?? 0) + missing.length}
retry={() => setRetry((value) => value + 1)}
/>
<InteractiveInvestmentMap points={points} areas={areas} />
<TerritoryGeometryPreview
territoryId={