feat(editorial): review demographic batches before explicit publication
This commit is contained in:
@@ -17,6 +17,11 @@ type Edition = {
|
||||
description?: string;
|
||||
editorial_content?: string | null;
|
||||
source?: string;
|
||||
publication_version?: string;
|
||||
observations?: number;
|
||||
sha256?: string;
|
||||
dataset_hash?: string;
|
||||
report?: { issue_counts?: Record<string, number> };
|
||||
content?: Record<string, string | null>;
|
||||
_structure?: {
|
||||
fields: Record<string, string | number | null>;
|
||||
@@ -51,7 +56,7 @@ export default function EditorialEdition({
|
||||
independentRequired,
|
||||
subject = 'resource',
|
||||
}: {
|
||||
subject?: 'resource' | 'portfolio';
|
||||
subject?: 'resource' | 'portfolio' | 'demography';
|
||||
resource: {
|
||||
id: number | string;
|
||||
title: string;
|
||||
@@ -74,7 +79,7 @@ export default function EditorialEdition({
|
||||
canApprove: boolean;
|
||||
independentRequired: boolean;
|
||||
}) {
|
||||
const editionBase = `/management/editorial/${subject === 'portfolio' ? 'portfolio' : 'resources'}/${resource.id}`;
|
||||
const editionBase = `/management/editorial/${subject === 'resource' ? 'resources' : subject}/${resource.id}`;
|
||||
const form = useForm({
|
||||
version: edition?.version ?? 1,
|
||||
action: '',
|
||||
@@ -107,7 +112,14 @@ export default function EditorialEdition({
|
||||
<Link className="underline" href="/management/editorial">
|
||||
Fila e notificações
|
||||
</Link>
|
||||
{subject === 'portfolio' ? (
|
||||
{subject === 'demography' ? (
|
||||
<Link
|
||||
className="underline"
|
||||
href={`/management/demography?batch=${resource.id}`}
|
||||
>
|
||||
Conferir lote, correspondências e advertências
|
||||
</Link>
|
||||
) : subject === 'portfolio' ? (
|
||||
<Link
|
||||
className="underline"
|
||||
href={`/management/portfolio/${resource.id}`}
|
||||
@@ -166,6 +178,53 @@ export default function EditorialEdition({
|
||||
<p className="whitespace-pre-wrap">
|
||||
{edition.payload.resource.description}
|
||||
</p>
|
||||
{subject === 'demography' && (
|
||||
<section className="space-y-2 rounded border p-3">
|
||||
<p>Fonte: {edition.payload.resource.source}</p>
|
||||
<p>
|
||||
Exemplar/versão fornecida:{' '}
|
||||
{edition.payload.resource.publication_version}
|
||||
</p>
|
||||
<p>
|
||||
{edition.payload.resource.observations}{' '}
|
||||
observações conferidas, sem alteração dos
|
||||
valores originais.
|
||||
</p>
|
||||
<a
|
||||
className="underline"
|
||||
href={`${editionBase}/original`}
|
||||
>
|
||||
Consultar original fornecido
|
||||
</a>
|
||||
<p className="text-sm break-all">
|
||||
SHA256 do original:{' '}
|
||||
{edition.payload.resource.sha256}
|
||||
</p>
|
||||
<p className="text-sm break-all">
|
||||
Integridade das observações:{' '}
|
||||
{edition.payload.resource.dataset_hash}
|
||||
</p>
|
||||
<ul>
|
||||
{Object.entries(
|
||||
edition.payload.resource.report
|
||||
?.issue_counts ?? {},
|
||||
).map(([code, count]) => (
|
||||
<li key={code}>
|
||||
{code}: {count} advertências conservadas
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
<p>
|
||||
Aprovar esta edição não disponibiliza a série.
|
||||
Confirme publicar numa operação separada.
|
||||
</p>
|
||||
{edition.payload.links?.map((link) => (
|
||||
<p key={link.target_key}>
|
||||
Território: {link.context?.name}
|
||||
</p>
|
||||
))}
|
||||
</section>
|
||||
)}
|
||||
{subject === 'portfolio' && (
|
||||
<>
|
||||
<p>Fonte: {edition.payload.resource.source}</p>
|
||||
@@ -426,8 +485,9 @@ export default function EditorialEdition({
|
||||
</>
|
||||
) : (
|
||||
<p>
|
||||
Prepare uma edição no editor existente para iniciar a
|
||||
revisão.
|
||||
{subject === 'demography' && resource.published
|
||||
? 'Este lote já estava disponibilizado e permanece preservado. Uma nova fonte deve entrar como um lote próprio.'
|
||||
: 'Prepare uma edição no editor existente para iniciar a revisão.'}
|
||||
</p>
|
||||
)}
|
||||
<h2 className="font-semibold">Versões conservadas</h2>
|
||||
|
||||
Reference in New Issue
Block a user