This commit is contained in:
@@ -26,6 +26,7 @@ type DocumentResource = {
|
||||
links: {
|
||||
target_type: string;
|
||||
target_key: string;
|
||||
target_label?: string | null;
|
||||
relationship: string;
|
||||
applicability: string;
|
||||
condition_text: string | null;
|
||||
@@ -83,6 +84,7 @@ export default function DocumentPage({
|
||||
<div><dt className="font-semibold">Situação documental</dt><dd>{legalStatusLabels[resource.legal_status] ?? resource.legal_status}</dd></div>
|
||||
<div><dt className="font-semibold">Fonte</dt><dd>{resource.source_confirmation === 'official_confirmed' ? 'Fonte oficial confirmada' : resource.source_confirmation === 'identified' ? 'Origem identificada' : 'Por confirmar'}</dd></div>
|
||||
</dl>
|
||||
{resource.source_confirmation === 'identified' && <p className="rounded border border-amber-300 bg-amber-50 p-3" role="note">A origem está identificada, mas a autenticidade desta cópia não foi confirmada independentemente. Consulte a fonte indicada.</p>}
|
||||
<p className="break-words text-sm">Referência: {resource.source_reference}</p>
|
||||
{resource.links.length > 0 && <section className="space-y-2">
|
||||
<h2 className="text-xl font-semibold">Base legal e documentos relacionados no portal</h2>
|
||||
@@ -90,7 +92,7 @@ export default function DocumentPage({
|
||||
{resource.links.map((link, index) => {
|
||||
const destination = link.target_type === 'module' ? modulePaths[link.target_key] : undefined;
|
||||
return <li key={`${link.target_type}-${link.target_key}-${index}`}>
|
||||
{destination ? <Link className="underline" href={destination.href}>{destination.label}</Link> : <span>{link.target_type === 'requirement' ? `Requisito documental: ${link.target_key}` : `${link.target_type}: ${link.target_key}`}</span>}
|
||||
{destination ? <Link className="underline" href={destination.href}>{destination.label}</Link> : <span>{link.target_type === 'requirement' ? `Requisito documental: ${link.target_label ?? link.target_key}` : `${link.target_type}: ${link.target_key}`}</span>}
|
||||
{' · '}{link.applicability === 'evidence' ? 'evidência documental' : link.applicability}
|
||||
{link.condition_text && <span> · Condição: {link.condition_text}</span>}
|
||||
{link.basis_reference && <span> · Referência documental (não é regra fiscal): {link.basis_reference}</span>}
|
||||
|
||||
@@ -80,6 +80,7 @@ type ResourceForm = Omit<
|
||||
| 'applicability'
|
||||
| 'condition_text'
|
||||
| 'basis_reference'
|
||||
| 'review_status'
|
||||
> & {
|
||||
document_id: string;
|
||||
title: string;
|
||||
@@ -158,10 +159,18 @@ export default function Manage({
|
||||
malwareHealth,
|
||||
malwareCounts,
|
||||
requirementCatalogue,
|
||||
requirementAssociationsEnabled,
|
||||
disclosureAuthorization,
|
||||
}: {
|
||||
documents: DocumentFile[];
|
||||
resources: Resource[];
|
||||
requirementCatalogue: { key: string; label: string; tax: string }[];
|
||||
requirementAssociationsEnabled: boolean;
|
||||
disclosureAuthorization: {
|
||||
external_id: string;
|
||||
occurred_at: string;
|
||||
resources: { id: number; title: string; published: boolean; rights_status: string }[];
|
||||
} | null;
|
||||
territories: { id: string; name: string; location_type: string }[];
|
||||
incompleteCount: number;
|
||||
possibleDuplicates: number;
|
||||
@@ -691,6 +700,7 @@ export default function Manage({
|
||||
Relacionar o mesmo documento a vários módulos não cria
|
||||
cópias.
|
||||
</p>
|
||||
{!requirementAssociationsEnabled && <p role="status" className="text-sm">As associações documentais a requisitos serão activadas após a migração de compatibilidade do catálogo.</p>}
|
||||
{form.data.associations.map((association, index) => (
|
||||
<div
|
||||
className="grid gap-2 rounded border p-3 sm:grid-cols-2"
|
||||
@@ -721,7 +731,7 @@ export default function Manage({
|
||||
'investment_type',
|
||||
'legal_source',
|
||||
'requirement',
|
||||
].map((v) => (
|
||||
].filter((v) => v !== 'requirement' || requirementAssociationsEnabled).map((v) => (
|
||||
<option key={v}>{v}</option>
|
||||
))}
|
||||
</select>
|
||||
@@ -891,6 +901,20 @@ export default function Manage({
|
||||
</div>
|
||||
</form>
|
||||
|
||||
{disclosureAuthorization && (
|
||||
<section className="space-y-3 rounded border border-emerald-700 bg-emerald-50 p-5" aria-labelledby="disclosure-authorization-title">
|
||||
<h2 id="disclosure-authorization-title" className="text-xl font-bold">Autorização expressa de disponibilização documental</h2>
|
||||
<p>Registada em {new Date(disclosureAuthorization.occurred_at).toLocaleString()}; origem: instrução do utilizador, sem atribuição a gestor. Abrange consulta e download dos documentos listados e não certifica autenticidade ou vigência, nem activa cálculos fiscais.</p>
|
||||
<ul className="list-disc pl-6">
|
||||
{disclosureAuthorization.resources.map((resource) => <li key={resource.id}>#{resource.id} · {resource.title} · {resource.published ? 'já publicado' : `rascunho (${resource.rights_status})`}</li>)}
|
||||
</ul>
|
||||
<p className="text-sm">A acção mantém a autenticação de gestão e só publica ficheiros activos cujo hash corresponda ao resultado antimalware e que tenham fonte identificada. As situações de fonte e vigência são preservadas e apresentadas ao público. Registos que falhem estes controlos ficam pendentes individualmente.</p>
|
||||
<button type="button" className={button} disabled={disclosureAuthorization.resources.every((resource) => resource.published)} onClick={() => router.post('/management/portal-services/disclosure-authorization/apply', {}, { preserveScroll: true })}>
|
||||
Aplicar autorização e disponibilizar documentos elegíveis
|
||||
</button>
|
||||
</section>
|
||||
)}
|
||||
|
||||
<h2 className="text-xl font-bold">
|
||||
Registos, pendências e duplicados por rever
|
||||
</h2>
|
||||
|
||||
@@ -58,6 +58,7 @@ type Resource = {
|
||||
links: {
|
||||
target_type: string;
|
||||
target_key: string;
|
||||
target_label?: string | null;
|
||||
relationship: string;
|
||||
applicability: string;
|
||||
condition_text: string | null;
|
||||
@@ -1081,6 +1082,11 @@ export default function Services(p: Props) {
|
||||
: 'Fonte por confirmar'}
|
||||
</dd>
|
||||
</div>
|
||||
{r.source_confirmation === 'identified' && (
|
||||
<div className="sm:col-span-2 rounded border border-amber-300 bg-amber-50 p-3" role="note">
|
||||
A origem está identificada, mas a autenticidade desta cópia não foi confirmada independentemente. Consulte a fonte indicada.
|
||||
</div>
|
||||
)}
|
||||
<div>
|
||||
<dt className="font-semibold">
|
||||
Vigência
|
||||
@@ -1139,7 +1145,7 @@ export default function Services(p: Props) {
|
||||
</Link>
|
||||
) : (
|
||||
<>
|
||||
{link.target_type}: {link.target_key}
|
||||
{link.target_type === 'requirement' ? `Requisito documental: ${link.target_label ?? link.target_key}` : `${link.target_type}: ${link.target_key}`}
|
||||
</>
|
||||
)}{' '}
|
||||
· {link.relationship} ·{' '}
|
||||
|
||||
Reference in New Issue
Block a user