fix: correct V13 and public presentation patterns in isolated QA

This commit is contained in:
2026-11-21 12:36:28 +02:00
parent 1950bb69ec
commit e239a31a76
66 changed files with 3977 additions and 278 deletions
+35 -5
View File
@@ -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>
))}