fix: correct V13 and public presentation patterns in isolated QA
This commit is contained in:
@@ -272,7 +272,7 @@ export default function BusinessMarketplace({
|
||||
zone: 'Regime de zona',
|
||||
sector: 'Setor associado',
|
||||
activity:
|
||||
'Subsector ou atividade',
|
||||
'Subsector ou actividade',
|
||||
} as Record<string, string>
|
||||
)[id] ?? id,
|
||||
})),
|
||||
@@ -299,7 +299,7 @@ export default function BusinessMarketplace({
|
||||
],
|
||||
[
|
||||
'subsector_id',
|
||||
'Subsector ou atividade',
|
||||
'Subsector ou actividade',
|
||||
classificationOptions.targets
|
||||
.activity ?? [],
|
||||
],
|
||||
@@ -361,7 +361,10 @@ export default function BusinessMarketplace({
|
||||
)}
|
||||
<ul className="grid gap-4 md:grid-cols-2">
|
||||
{results.data.map((record) => (
|
||||
<li className={card} key={record.id}>
|
||||
<li
|
||||
className={`${card} flex min-w-0 flex-col gap-3 [overflow-wrap:anywhere]`}
|
||||
key={record.id}
|
||||
>
|
||||
<p>
|
||||
{businessModalities[record.modality] ??
|
||||
'Modalidade por indicar'}
|
||||
@@ -400,6 +403,17 @@ export default function BusinessMarketplace({
|
||||
{record.objective}
|
||||
</p>
|
||||
)}
|
||||
<nav
|
||||
aria-label={`Acções de ${record.title}`}
|
||||
className="mt-auto flex flex-wrap gap-3"
|
||||
>
|
||||
<Link
|
||||
className="underline"
|
||||
href={`/negocios/${record.slug}${returnQuery ? `?${returnQuery}` : ''}`}
|
||||
>
|
||||
Consultar ficha
|
||||
</Link>
|
||||
</nav>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
|
||||
@@ -1175,7 +1175,6 @@ export default function Catalogue({
|
||||
className="catalogue-territorial-link"
|
||||
>
|
||||
<span className="text-sm">
|
||||
{d.content.code} ·{' '}
|
||||
{d.cluster_id
|
||||
? 'Cluster'
|
||||
: d.corridor_id
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import PublicReference from '@/components/public-reference';
|
||||
import { publicReference } from '@/lib/public-presentation';
|
||||
import { ProactiveSummary } from '@/components/proactive-investment';
|
||||
import DemographicContext from '@/components/demographic-context';
|
||||
import EducationalGuides from '@/components/educational-guides';
|
||||
@@ -186,9 +188,13 @@ export default function Detail({
|
||||
/>
|
||||
<DemographicContext
|
||||
key={c.primary_territory_path?.at(-1)?.id}
|
||||
territoryId={c.primary_territory_path
|
||||
?.filter((t) => ['province', 'district'].includes(t.location_type))
|
||||
.at(-1)?.id}
|
||||
territoryId={
|
||||
c.primary_territory_path
|
||||
?.filter((t) =>
|
||||
['province', 'district'].includes(t.location_type),
|
||||
)
|
||||
.at(-1)?.id
|
||||
}
|
||||
/>
|
||||
{c.primary_territory_path &&
|
||||
c.primary_territory_path.length > 0 && (
|
||||
@@ -282,7 +288,15 @@ export default function Detail({
|
||||
{z.association_type === 'official'
|
||||
? 'Associação documental validada'
|
||||
: 'Relação ' + z.association_type}{' '}
|
||||
· Fonte: {z.source_reference}
|
||||
{publicReference(z.source_reference) && (
|
||||
<>
|
||||
{' '}
|
||||
· Fonte:{' '}
|
||||
<PublicReference
|
||||
value={z.source_reference}
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
</p>
|
||||
))}
|
||||
<p>
|
||||
@@ -335,7 +349,7 @@ export default function Detail({
|
||||
['Modelo de negócio', c.profile.business_model],
|
||||
['Requisitos', c.profile.requirements],
|
||||
['Riscos', c.profile.risks],
|
||||
['Fonte', c.profile.source_reference],
|
||||
['Fonte', publicReference(c.profile.source_reference)],
|
||||
].map(([label, text]) => (
|
||||
<div key={label}>
|
||||
<h3 className="font-bold">{label}</h3>
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { publicReference } from '@/lib/public-presentation';
|
||||
import { useState } from 'react';
|
||||
import { api, button, card } from './shared';
|
||||
|
||||
@@ -81,7 +82,7 @@ export default function ZoneMap({ id }: { id: string }) {
|
||||
<g key={f.id}>
|
||||
<title>
|
||||
{f.properties.purpose} ·{' '}
|
||||
{f.properties.source}
|
||||
{publicReference(f.properties.source)}
|
||||
</title>
|
||||
{rings(f.geometry.coordinates).map((ring, i) =>
|
||||
ring.length === 1 ? (
|
||||
@@ -113,7 +114,7 @@ export default function ZoneMap({ id }: { id: string }) {
|
||||
{features.map((f) => (
|
||||
<li key={f.id}>
|
||||
{f.properties.purpose} · Fonte:{' '}
|
||||
{f.properties.source} · Data:{' '}
|
||||
{publicReference(f.properties.source)} · Data:{' '}
|
||||
{f.properties.observed_at}
|
||||
</li>
|
||||
))}
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
import PublicSourceList from '@/components/public-source-list';
|
||||
import PublicReference from '@/components/public-reference';
|
||||
import { publicReference } from '@/lib/public-presentation';
|
||||
import ParkDetailsEditor, {
|
||||
ParkDetailsPublic,
|
||||
emptyParkDetails,
|
||||
@@ -585,7 +588,7 @@ function Editor({
|
||||
)}
|
||||
{!management && <PartnershipSourceLinks type="zone" id={z.id} />}
|
||||
<p>
|
||||
{z.code} ·{' '}
|
||||
{management && <>{z.code} · </>}
|
||||
{z.category === 'industrial_park'
|
||||
? 'Parque industrial'
|
||||
: z.category.toUpperCase()}{' '}
|
||||
@@ -1792,8 +1795,15 @@ function Editor({
|
||||
{area.value ?? 'Não informado'}{' '}
|
||||
{area.value == null ? '' : area.unit} ·{' '}
|
||||
{label(area.status)} · Fonte:{' '}
|
||||
{area.source_reference ||
|
||||
'Não informada'}{' '}
|
||||
{publicReference(
|
||||
area.source_reference,
|
||||
) ? (
|
||||
<PublicReference
|
||||
value={area.source_reference}
|
||||
/>
|
||||
) : (
|
||||
'Referência pública não disponível'
|
||||
)}{' '}
|
||||
·{' '}
|
||||
{area.source_date ??
|
||||
'Data não informada'}
|
||||
@@ -1802,37 +1812,8 @@ function Editor({
|
||||
</ul>
|
||||
</section>
|
||||
)}
|
||||
{zoneExtensionsAvailable && !!z.source_evidence?.length && (
|
||||
<section className={card}>
|
||||
<h2 className="font-bold">
|
||||
Fontes e o que comprovam
|
||||
</h2>
|
||||
<ul>
|
||||
{z.source_evidence.map((evidence) => (
|
||||
<li key={evidence.url}>
|
||||
<a
|
||||
className="underline"
|
||||
href={evidence.url}
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
>
|
||||
{evidence.title}
|
||||
</a>
|
||||
{evidence.source_date
|
||||
? ` · ${evidence.source_date}`
|
||||
: ' · data não indicada'}{' '}
|
||||
· {evidence.source_type} ·{' '}
|
||||
{evidence.supports}
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
<p>
|
||||
Esta informação descreve o que a fonte declara;
|
||||
não confirma vigência legal, benefícios, estado
|
||||
operacional ou disponibilidade para
|
||||
investimento.
|
||||
</p>
|
||||
</section>
|
||||
{zoneExtensionsAvailable && (
|
||||
<PublicSourceList sources={z.source_evidence} />
|
||||
)}
|
||||
{z.historical_territory?.name && (
|
||||
<p>
|
||||
@@ -1868,16 +1849,26 @@ function Editor({
|
||||
{label(activity.focus)} ·{' '}
|
||||
{activity.source_date ??
|
||||
'Data não informada'}
|
||||
{activity.source_reference
|
||||
? ` · ${activity.source_reference}`
|
||||
: ''}
|
||||
{publicReference(
|
||||
activity.source_reference,
|
||||
) && (
|
||||
<>
|
||||
{' '}
|
||||
·{' '}
|
||||
<PublicReference
|
||||
value={
|
||||
activity.source_reference
|
||||
}
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</section>
|
||||
) : null}
|
||||
{!z.activities?.length && (
|
||||
<p>Atividades: não informadas.</p>
|
||||
<p>Actividades: não informadas.</p>
|
||||
)}
|
||||
{!z.resources?.length && (
|
||||
<p>
|
||||
@@ -1908,9 +1899,19 @@ function Editor({
|
||||
·{' '}
|
||||
{resource.source_date ??
|
||||
'Data não informada'}
|
||||
{resource.source_reference
|
||||
? ` · ${resource.source_reference}`
|
||||
: ''}
|
||||
{publicReference(
|
||||
resource.source_reference,
|
||||
) && (
|
||||
<>
|
||||
{' '}
|
||||
·{' '}
|
||||
<PublicReference
|
||||
value={
|
||||
resource.source_reference
|
||||
}
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
</p>
|
||||
))}
|
||||
</section>
|
||||
@@ -2217,7 +2218,7 @@ function DetailFields({
|
||||
)}
|
||||
{kind === 'activities' && (
|
||||
<label className="grid gap-1">
|
||||
Atividade económica documentada
|
||||
Actividade económica documentada
|
||||
<select
|
||||
className={input}
|
||||
value={detail.economic_activity_id ?? ''}
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import PublicSourceList from '@/components/public-source-list';
|
||||
import { publicLocation } from '@/lib/public-presentation';
|
||||
import InvestmentZoneInstallation, {
|
||||
type ParkInstallationPlan,
|
||||
} from '@/components/investment-zone-installation';
|
||||
@@ -68,6 +70,7 @@ export default function Zones({
|
||||
detailsInstallation,
|
||||
records,
|
||||
filters,
|
||||
groupAvailability = {},
|
||||
management,
|
||||
zoneExtensionsAvailable = false,
|
||||
territorySelection = [],
|
||||
@@ -94,6 +97,9 @@ export default function Zones({
|
||||
activity?: string;
|
||||
};
|
||||
management: boolean;
|
||||
groupAvailability?: Partial<
|
||||
Record<'zee' | 'zfi' | 'industrial_park', number>
|
||||
>;
|
||||
zoneExtensionsAvailable?: boolean;
|
||||
territorySelection?: TerritoryOption[];
|
||||
}) {
|
||||
@@ -282,6 +288,14 @@ export default function Zones({
|
||||
maxLength={120}
|
||||
/>
|
||||
</Field>
|
||||
{!records.total && (
|
||||
<p role="status" className="md:col-span-3">
|
||||
Não há resultados publicados para este grupo e os
|
||||
filtros seleccionados. Pode alterar o grupo ou remover
|
||||
filtros; isto não demonstra ausência de actividade no
|
||||
território.
|
||||
</p>
|
||||
)}
|
||||
<Field label="Grupo">
|
||||
<select
|
||||
className={input}
|
||||
@@ -289,10 +303,20 @@ export default function Zones({
|
||||
defaultValue={filters.category ?? ''}
|
||||
>
|
||||
<option value="">Todas</option>
|
||||
<option value="zee">ZEE</option>
|
||||
<option value="zfi">ZFI</option>
|
||||
<option value="zee">
|
||||
ZEE
|
||||
{groupAvailability.zee != null &&
|
||||
` — ${groupAvailability.zee} registos`}
|
||||
</option>
|
||||
<option value="zfi">
|
||||
ZFI
|
||||
{groupAvailability.zfi != null &&
|
||||
` — ${groupAvailability.zfi} registos`}
|
||||
</option>
|
||||
<option value="industrial_park">
|
||||
Parque industrial
|
||||
{groupAvailability.industrial_park != null &&
|
||||
` — ${groupAvailability.industrial_park} registos`}
|
||||
</option>
|
||||
</select>
|
||||
</Field>
|
||||
@@ -460,36 +484,42 @@ export default function Zones({
|
||||
{zone.name}
|
||||
</Link>
|
||||
</h2>
|
||||
<Link
|
||||
className="underline"
|
||||
href={catalogueDetailHref(
|
||||
`${management ? '/management/investment/zones' : '/zonas'}/${zone.id}`,
|
||||
exportParams.toString(),
|
||||
pageUrl,
|
||||
)}
|
||||
<nav
|
||||
aria-label={`Acções de ${zone.name}`}
|
||||
className="flex flex-wrap items-center gap-3"
|
||||
>
|
||||
Consultar ficha
|
||||
</Link>
|
||||
{!management && (
|
||||
<Link
|
||||
className="ml-4 underline"
|
||||
href={searchTerritoryHref(
|
||||
`/oportunidades?${new URLSearchParams({ [zone.category === 'zee' ? 'zee_id' : zone.category === 'zfi' ? 'zfi_id' : 'park_id']: zone.id })}`,
|
||||
className="underline"
|
||||
href={catalogueDetailHref(
|
||||
`${management ? '/management/investment/zones' : '/zonas'}/${zone.id}`,
|
||||
exportParams.toString(),
|
||||
pageUrl,
|
||||
)}
|
||||
>
|
||||
Ver oportunidades associadas
|
||||
Consultar ficha
|
||||
</Link>
|
||||
)}
|
||||
{!management && (
|
||||
<Link
|
||||
className="underline"
|
||||
href={searchTerritoryHref(
|
||||
`/oportunidades?${new URLSearchParams({ [zone.category === 'zee' ? 'zee_id' : zone.category === 'zfi' ? 'zfi_id' : 'park_id']: zone.id })}`,
|
||||
pageUrl,
|
||||
)}
|
||||
>
|
||||
Ver oportunidades associadas
|
||||
</Link>
|
||||
)}
|
||||
</nav>
|
||||
<p>
|
||||
{zone.code} ·{' '}
|
||||
{management && <>{zone.code} · </>}
|
||||
{zone.category === 'industrial_park'
|
||||
? 'Parque industrial'
|
||||
: zone.category.toUpperCase()}{' '}
|
||||
·{' '}
|
||||
{[zone.district, zone.province]
|
||||
.filter(Boolean)
|
||||
.join(', ') || 'Localização por confirmar'}
|
||||
{publicLocation(zone.territory_path, [
|
||||
zone.province,
|
||||
zone.district,
|
||||
])}
|
||||
</p>
|
||||
{zone.legal_regime && (
|
||||
<p>
|
||||
@@ -540,35 +570,14 @@ export default function Zones({
|
||||
.join(' · ')}
|
||||
</p>
|
||||
) : null}
|
||||
{!!zone.source_evidence?.length && (
|
||||
<p>
|
||||
Fonte:{' '}
|
||||
{zone.source_evidence.map((source, index) => (
|
||||
<span key={source.url}>
|
||||
{index > 0 ? ' · ' : ''}
|
||||
<a
|
||||
className="underline"
|
||||
href={source.url}
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
>
|
||||
{source.title}
|
||||
</a>
|
||||
{source.source_date
|
||||
? ` (${source.source_date})`
|
||||
: ' (data da fonte não informada)'}{' '}
|
||||
— {source.supports}
|
||||
</span>
|
||||
))}
|
||||
</p>
|
||||
)}
|
||||
<PublicSourceList sources={zone.source_evidence} />
|
||||
{zone.category === 'industrial_park' && (
|
||||
<p>
|
||||
{zone.resources?.length
|
||||
? `${zone.resources.length} recursos descritos; consulte o âmbito e a fonte na ficha.`
|
||||
: 'Infraestruturas, serviços, acessos e capacidades: não informados.'}{' '}
|
||||
{!zone.activities?.length &&
|
||||
'Atividades: não informadas.'}
|
||||
'Actividades: não informadas.'}
|
||||
</p>
|
||||
)}
|
||||
<p>{zone.description}</p>
|
||||
|
||||
Reference in New Issue
Block a user