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>
|
||||
|
||||
@@ -1,7 +1,15 @@
|
||||
import { Head, Link, router } from '@inertiajs/react';
|
||||
import { useEffect, useState } from 'react';
|
||||
import { PortalMenu } from '@/components/portal-menu';
|
||||
import { fiscalForms, fiscalFormFields, fiscalPreparationIssues, newFiscalPreparation, readFiscalPreparation, type FiscalFormKind, type FiscalPreparation } from '@/lib/fiscal-form-preparation';
|
||||
import {
|
||||
fiscalForms,
|
||||
fiscalFormFields,
|
||||
fiscalPreparationIssues,
|
||||
newFiscalPreparation,
|
||||
readFiscalPreparation,
|
||||
type FiscalFormKind,
|
||||
type FiscalPreparation,
|
||||
} from '@/lib/fiscal-form-preparation';
|
||||
|
||||
const input =
|
||||
'mt-1 block w-full rounded border border-slate-400 bg-white p-3 text-slate-900';
|
||||
@@ -112,7 +120,6 @@ export default function FiscalForms({
|
||||
</select>
|
||||
</label>
|
||||
<h2 className="text-xl font-bold">{source.title}</h2>
|
||||
<p>{source.coverage}</p>
|
||||
<nav
|
||||
aria-label="Etapas de preenchimento"
|
||||
className="flex flex-wrap gap-2 print:hidden"
|
||||
@@ -426,20 +433,6 @@ export default function FiscalForms({
|
||||
{notice}
|
||||
</p>
|
||||
)}
|
||||
<details className="rounded border p-4">
|
||||
<summary className="cursor-pointer font-semibold">
|
||||
Exemplar e cobertura
|
||||
</summary>
|
||||
<p>{source.source}</p>
|
||||
<p className="text-sm break-all">SHA256: {source.hash}</p>
|
||||
<p>{source.coverage}</p>
|
||||
<p>
|
||||
Os cálculos e correspondências já disponíveis no
|
||||
simulador permanecem separados desta introdução manual.
|
||||
Não se executam fórmulas nem se transportam valores
|
||||
entre edições automaticamente.
|
||||
</p>
|
||||
</details>
|
||||
<div className="flex flex-wrap gap-4 print:hidden">
|
||||
<Link href="/simulador-fiscal" className="underline">
|
||||
Consultar cálculos e preparação M20/M22 no simulador
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { Link, useForm, usePage } from '@inertiajs/react';
|
||||
import { publicPortfolioText } from '@/lib/public-presentation';
|
||||
import { searchTerritoryHref } from '@/lib/search-territory';
|
||||
import { catalogueDetailHref } from '@/lib/catalogue-context';
|
||||
import { Management } from '../management/shared';
|
||||
@@ -12,6 +13,7 @@ import {
|
||||
export default function Index({
|
||||
records,
|
||||
management,
|
||||
publicReferenceNames = {},
|
||||
filters,
|
||||
territorySelection = [],
|
||||
sectors = [],
|
||||
@@ -19,6 +21,7 @@ export default function Index({
|
||||
}: {
|
||||
records: Paginated<Dossier>;
|
||||
management: boolean;
|
||||
publicReferenceNames?: Record<string, string>;
|
||||
sectors?: string[];
|
||||
publishedOpportunities?: Paginated<{
|
||||
id: number;
|
||||
@@ -121,10 +124,11 @@ export default function Index({
|
||||
{records.data.map((r) => (
|
||||
<article
|
||||
key={r.id}
|
||||
className="space-y-3 rounded-xl border p-5"
|
||||
className="flex min-w-0 flex-col gap-3 rounded-xl border p-5 [overflow-wrap:anywhere]"
|
||||
>
|
||||
<p className="text-sm">
|
||||
{kind(r)} · {r.content.code}
|
||||
{kind(r)}
|
||||
{management && ` · ${r.content.code}`}
|
||||
{management &&
|
||||
` · ${r.publication_status === 'published' ? 'Publicado' : 'Rascunho'}`}
|
||||
</p>
|
||||
@@ -145,9 +149,13 @@ export default function Index({
|
||||
</Link>
|
||||
</h2>
|
||||
<p>
|
||||
{r.content.description ??
|
||||
r.content.focus ??
|
||||
r.content.anchors}
|
||||
{publicPortfolioText(
|
||||
r.content.description ??
|
||||
r.content.focus ??
|
||||
r.content.anchors ??
|
||||
'',
|
||||
publicReferenceNames,
|
||||
)}
|
||||
</p>
|
||||
{(r.content.location || r.content.region) && (
|
||||
<p>
|
||||
@@ -163,37 +171,47 @@ export default function Index({
|
||||
</span>
|
||||
</p>
|
||||
)}
|
||||
<Link
|
||||
className="underline"
|
||||
href={catalogueDetailHref(
|
||||
`${base}/${r.id}`,
|
||||
new URLSearchParams(
|
||||
Object.entries(filters).filter(
|
||||
([, value]) => Boolean(value),
|
||||
) as [string, string][],
|
||||
).toString(),
|
||||
url,
|
||||
)}
|
||||
<nav
|
||||
aria-label={`Acções de ${r.title}`}
|
||||
className="mt-auto flex flex-wrap items-center gap-3"
|
||||
>
|
||||
Consultar ficha
|
||||
</Link>
|
||||
{!management &&
|
||||
(r.corridor_id || r.cluster_id || r.project_id) && (
|
||||
<Link
|
||||
className="ml-4 underline"
|
||||
href={searchTerritoryHref(
|
||||
`/oportunidades?${new URLSearchParams(r.corridor_id ? { corridor_id: r.corridor_id } : r.cluster_id ? { cluster_id: r.cluster_id } : { project_id: r.project_id! })}`,
|
||||
url,
|
||||
)}
|
||||
>
|
||||
Ver oportunidades associadas
|
||||
</Link>
|
||||
)}
|
||||
<Link
|
||||
className="underline"
|
||||
href={catalogueDetailHref(
|
||||
`${base}/${r.id}`,
|
||||
new URLSearchParams(
|
||||
Object.entries(filters).filter(
|
||||
([, value]) => Boolean(value),
|
||||
) as [string, string][],
|
||||
).toString(),
|
||||
url,
|
||||
)}
|
||||
>
|
||||
Consultar ficha
|
||||
</Link>
|
||||
{!management &&
|
||||
(r.corridor_id ||
|
||||
r.cluster_id ||
|
||||
r.project_id) && (
|
||||
<Link
|
||||
className="underline"
|
||||
href={searchTerritoryHref(
|
||||
`/oportunidades?${new URLSearchParams(r.corridor_id ? { corridor_id: r.corridor_id } : r.cluster_id ? { cluster_id: r.cluster_id } : { project_id: r.project_id! })}`,
|
||||
url,
|
||||
)}
|
||||
>
|
||||
Ver oportunidades associadas
|
||||
</Link>
|
||||
)}
|
||||
</nav>
|
||||
</article>
|
||||
))}
|
||||
</div>
|
||||
{!records.data.length && (
|
||||
<div className="space-y-3 rounded-xl border p-5" role="status">
|
||||
<div
|
||||
className="flex min-w-0 flex-col gap-3 rounded-xl border p-5 [overflow-wrap:anywhere]"
|
||||
role="status"
|
||||
>
|
||||
<p>
|
||||
Ainda não existem fichas publicadas para esta pesquisa.
|
||||
Os filtros activos foram mantidos.
|
||||
@@ -253,7 +271,7 @@ export default function Index({
|
||||
{publishedOpportunities.data.map((opportunity) => (
|
||||
<article
|
||||
key={opportunity.id}
|
||||
className="space-y-3 rounded-xl border p-5"
|
||||
className="flex min-w-0 flex-col gap-3 rounded-xl border p-5 [overflow-wrap:anywhere]"
|
||||
>
|
||||
<h3 className="text-xl font-semibold">
|
||||
<Link
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
import PublicReference from '@/components/public-reference';
|
||||
import {
|
||||
publicReference,
|
||||
publicPortfolioText,
|
||||
} from '@/lib/public-presentation';
|
||||
import { Link, useForm, router, usePage } from '@inertiajs/react';
|
||||
import { useState } from 'react';
|
||||
import { catalogueReturnHref } from '@/lib/catalogue-context';
|
||||
@@ -30,6 +35,7 @@ export default function Show(props: Props) {
|
||||
}
|
||||
|
||||
type Props = {
|
||||
publicReferenceNames?: Record<string, string>;
|
||||
editorialEnabled?: boolean;
|
||||
competitiveness?: ApprovedCompetitiveness | null;
|
||||
complements?: ComplementOption[];
|
||||
@@ -65,6 +71,7 @@ type Props = {
|
||||
};
|
||||
|
||||
function Editor({
|
||||
publicReferenceNames = {},
|
||||
editorialEnabled = false,
|
||||
competitiveness,
|
||||
complements = [],
|
||||
@@ -104,9 +111,19 @@ function Editor({
|
||||
Voltar à pesquisa
|
||||
</Link>
|
||||
<p>
|
||||
{kind(record)} · {record.content.code}
|
||||
{kind(record)}
|
||||
{management && ` · ${record.content.code}`}
|
||||
</p>
|
||||
<p className="text-sm">Fonte: {record.source}</p>
|
||||
{(management || publicReference(record.source)) && (
|
||||
<p className="text-sm">
|
||||
Fonte:{' '}
|
||||
{management ? (
|
||||
record.source
|
||||
) : (
|
||||
<PublicReference value={record.source} />
|
||||
)}
|
||||
</p>
|
||||
)}
|
||||
{competitiveness && (
|
||||
<ClusterCompetitivenessPublic analysis={competitiveness} />
|
||||
)}
|
||||
@@ -150,7 +167,8 @@ function Editor({
|
||||
Referência de projecto âncora
|
||||
</h2>
|
||||
<p>
|
||||
{anchorProject.code} · {anchorProject.name}
|
||||
{management && `${anchorProject.code} · `}
|
||||
{anchorProject.name}
|
||||
</p>
|
||||
<p>
|
||||
Estado registado:{' '}
|
||||
@@ -234,7 +252,16 @@ function Editor({
|
||||
>
|
||||
{z.name}
|
||||
</Link>{' '}
|
||||
· {z.association_type} · Fonte: {z.source_reference}
|
||||
· {z.association_type}
|
||||
{publicReference(z.source_reference) && (
|
||||
<>
|
||||
{' '}
|
||||
· Fonte:{' '}
|
||||
<PublicReference
|
||||
value={z.source_reference}
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
</p>
|
||||
))}
|
||||
</section>
|
||||
@@ -491,7 +518,10 @@ function Editor({
|
||||
{labels[key] ?? key}
|
||||
</dt>
|
||||
<dd className="mt-1 whitespace-pre-line">
|
||||
{value}
|
||||
{publicPortfolioText(
|
||||
value,
|
||||
publicReferenceNames,
|
||||
)}
|
||||
</dd>
|
||||
</div>
|
||||
))}
|
||||
|
||||
Reference in New Issue
Block a user